• R/O
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision255 (tree)
Time2016-05-03 14:28:54
Authort_nakayama1971

Log Message

(empty log message)

Change Summary

Incremental Difference

--- branches/apache/commons-chain2/src/test/java/org/apache/commons/chain2/base/CopyCommandTestCase.java (revision 254)
+++ branches/apache/commons-chain2/src/test/java/org/apache/commons/chain2/base/CopyCommandTestCase.java (revision 255)
@@ -17,11 +17,6 @@
1717
1818 package org.apache.commons.chain2.base;
1919
20-import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
21-import static org.hamcrest.collection.IsMapContaining.hasEntry;
22-import static org.junit.Assert.assertEquals;
23-import static org.junit.Assert.assertThat;
24-
2520 import java.util.Collections;
2621 import java.util.HashMap;
2722 import java.util.Map;
@@ -28,6 +23,7 @@
2823
2924 import org.apache.commons.chain2.Processing;
3025 import org.junit.After;
26+import org.junit.Assert;
3127 import org.junit.Before;
3228 import org.junit.Test;
3329
@@ -81,7 +77,7 @@
8177 command.setFromKey("one");
8278 execute();
8379
84- assertEquals(originalContext, context);
80+ Assert.assertEquals(originalContext, context);
8581 }
8682
8783 /**
@@ -92,7 +88,7 @@
9288 command.setToKey("one");
9389 execute();
9490
95- assertEquals(originalContext, context);
91+ Assert.assertEquals(originalContext, context);
9692 }
9793
9894 /**
@@ -105,15 +101,15 @@
105101
106102 execute();
107103
108- assertThat(context, hasEntry("one", (Object) "one"));
109- assertThat(context, hasEntry("two", (Object) "one"));
110- assertThat(context, hasEntry("three", (Object) "three"));
111- assertThat(context.keySet(), hasSize(3));
104+ Assert.assertEquals("one", context.get("one"));
105+ Assert.assertEquals("two", context.get("two"));
106+ Assert.assertEquals("three", context.get("three"));
107+ Assert.assertEquals(3, context.size());
112108 }
113109
114110 private void execute() {
115111 // make sure execute always returns continue
116- assertEquals(Processing.CONTINUE, command.execute(context));
112+ Assert.assertEquals(Processing.CONTINUE, command.execute(context));
117113 }
118114
119115 }
--- branches/apache/commons-chain2/src/test/java/org/apache/commons/chain2/base/RemoveCommandTestCase.java (revision 254)
+++ branches/apache/commons-chain2/src/test/java/org/apache/commons/chain2/base/RemoveCommandTestCase.java (revision 255)
@@ -17,17 +17,14 @@
1717
1818 package org.apache.commons.chain2.base;
1919
20-import static org.hamcrest.collection.IsMapContaining.hasKey;
21-import static org.hamcrest.core.IsNot.not;
22-import static org.junit.Assert.assertThat;
23-
2420 import org.apache.commons.chain2.Context;
2521 import org.apache.commons.chain2.impl.TestContext;
22+import org.junit.Assert;
2623 import org.junit.Before;
2724 import org.junit.Test;
2825
2926 /**
30- * @version $Id�
27+ * @version $Id$
3128 */
3229 public class RemoveCommandTestCase {
3330
@@ -55,8 +52,8 @@
5552 command.setFromKey("yet another Key");
5653 command.execute(context);
5754
58- assertThat(context, hasKey("Key"));
59- assertThat(context, hasKey("another Key"));
55+ Assert.assertTrue(context.containsKey("Key"));
56+ Assert.assertTrue(context.containsKey("another Key"));
6057 }
6158
6259 /**
@@ -67,8 +64,8 @@
6764 command.setFromKey("Key");
6865 command.execute(context);
6966
70- assertThat(context, not(hasKey("Key")));
71- assertThat(context, hasKey("another Key"));
67+ Assert.assertFalse(context.containsKey("Key"));
68+ Assert.assertTrue(context.containsKey("another Key"));
7269 }
7370
7471 }
--- branches/apache/commons-chain2/src/test/java/org/apache/commons/chain2/base/OverrideCommandTestCase.java (revision 254)
+++ branches/apache/commons-chain2/src/test/java/org/apache/commons/chain2/base/OverrideCommandTestCase.java (revision 255)
@@ -17,13 +17,10 @@
1717
1818 package org.apache.commons.chain2.base;
1919
20-import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
21-import static org.hamcrest.collection.IsMapContaining.hasEntry;
22-import static org.junit.Assert.assertThat;
23-
2420 import java.util.HashMap;
2521 import java.util.Map;
2622
23+import org.junit.Assert;
2724 import org.junit.Before;
2825 import org.junit.Test;
2926
@@ -57,8 +54,8 @@
5754
5855 command.execute(context);
5956
60- assertThat(context, hasEntry("Key", (Object) "Value"));
61- assertThat(context.keySet(), hasSize(1));
57+ Assert.assertEquals("Value", context.get("Key"));
58+ Assert.assertEquals(1, context.size());
6259 }
6360
6461 /**
@@ -71,7 +68,7 @@
7168
7269 command.execute(context);
7370
74- assertThat(context, hasEntry("Key", (Object) "new Value"));
75- assertThat(context.keySet(), hasSize(1));
71+ Assert.assertEquals("new Value", context.get("Key"));
72+ Assert.assertEquals(1, context.size());
7673 }
7774 }
--- branches/apache/commons-chain2/src/test/java/org/apache/commons/chain2/web/servlet/MockHttpServletResponse.java (revision 254)
+++ branches/apache/commons-chain2/src/test/java/org/apache/commons/chain2/web/servlet/MockHttpServletResponse.java (revision 255)
@@ -29,7 +29,7 @@
2929
3030
3131 /**
32- * Mock Object for HttpServletResponse (Version 2.3)
32+ * Mock Object for HttpServletResponse
3333 */
3434 public class MockHttpServletResponse implements HttpServletResponse {
3535
@@ -308,4 +308,12 @@
308308 return 0;
309309 }
310310
311+ /**
312+ * @see javax.servlet.ServletResponse#setContentLengthLong(long)
313+ */
314+ @Override
315+ public void setContentLengthLong(long arg0) {
316+ return;
317+ }
318+
311319 }
--- branches/apache/commons-chain2/src/test/java/org/apache/commons/chain2/web/servlet/MockServletContext.java (revision 254)
+++ branches/apache/commons-chain2/src/test/java/org/apache/commons/chain2/web/servlet/MockServletContext.java (revision 255)
@@ -470,4 +470,12 @@
470470 return;
471471 }
472472
473+ /**
474+ * @see javax.servlet.ServletContext#getVirtualServerName()
475+ */
476+ @Override
477+ public String getVirtualServerName() {
478+ return null;
479+ }
480+
473481 }
--- branches/apache/commons-chain2/src/test/java/org/apache/commons/chain2/web/servlet/MockHttpServletRequest.java (revision 254)
+++ branches/apache/commons-chain2/src/test/java/org/apache/commons/chain2/web/servlet/MockHttpServletRequest.java (revision 255)
@@ -39,6 +39,7 @@
3939 import javax.servlet.http.HttpServletRequest;
4040 import javax.servlet.http.HttpServletResponse;
4141 import javax.servlet.http.HttpSession;
42+import javax.servlet.http.HttpUpgradeHandler;
4243 import javax.servlet.http.Part;
4344
4445 import org.apache.commons.chain2.web.MockEnumeration;
@@ -46,7 +47,7 @@
4647
4748
4849 /**
49- * Mock Object for HttpServletRequest (Version 2.3)
50+ * Mock Object for HttpServletRequest
5051 */
5152 public class MockHttpServletRequest implements HttpServletRequest {
5253
@@ -724,4 +725,28 @@
724725 return;
725726 }
726727
728+ /**
729+ * @see javax.servlet.ServletRequest#getContentLengthLong()
730+ */
731+ @Override
732+ public long getContentLengthLong() {
733+ return 0;
734+ }
735+
736+ /**
737+ * @see javax.servlet.http.HttpServletRequest#changeSessionId()
738+ */
739+ @Override
740+ public String changeSessionId() {
741+ return null;
742+ }
743+
744+ /**
745+ * @see javax.servlet.http.HttpServletRequest#upgrade(java.lang.Class)
746+ */
747+ @Override
748+ public <T extends HttpUpgradeHandler> T upgrade(Class<T> arg0) throws IOException, ServletException {
749+ return null;
750+ }
751+
727752 }
--- branches/apache/commons-chain2/src/test/java/org/apache/commons/chain2/testutils/NonDelegatingCommandTestCase.java (revision 254)
+++ branches/apache/commons-chain2/src/test/java/org/apache/commons/chain2/testutils/NonDelegatingCommandTestCase.java (revision 255)
@@ -18,15 +18,12 @@
1818 package org.apache.commons.chain2.testutils;
1919
2020 import static org.apache.commons.chain2.testutils.HasLog.hasLog;
21-import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
22-import static org.hamcrest.collection.IsMapContaining.hasKey;
23-import static org.junit.Assert.assertThat;
24-import static org.junit.Assert.assertEquals;
2521
2622 import java.util.UUID;
2723
2824 import org.apache.commons.chain2.Context;
2925 import org.apache.commons.chain2.Processing;
26+import org.junit.Assert;
3027 import org.junit.Before;
3128 import org.junit.Test;
3229
@@ -64,9 +61,9 @@
6461 public void createsLogInEmptyContext() {
6562 execute();
6663
67- assertThat(context.keySet(), hasSize(1));
68- assertThat(context, hasKey("log"));
69- assertThat(context, hasLog(ID));
64+ Assert.assertEquals(1, context.size());
65+ Assert.assertTrue(context.containsKey("log"));
66+ Assert.assertThat(context, hasLog(ID));
7067 }
7168
7269 /**
@@ -77,10 +74,10 @@
7774 context.put("log", new StringBuilder("some content"));
7875 execute();
7976
80- assertThat(context, hasLog("some content/" + ID));
77+ Assert.assertThat(context, hasLog("some content/" + ID));
8178 }
8279
8380 private void execute() {
84- assertEquals(Processing.FINISHED, command.execute(context));
81+ Assert.assertEquals(Processing.FINISHED, command.execute(context));
8582 }
8683 }