malaysf commented on a change in pull request #332:
URL: https://github.com/apache/tomcat/pull/332#discussion_r466179556



##########
File path: test/org/apache/catalina/core/TestStandardContextValve.java
##########
@@ -182,4 +184,66 @@ public void requestDestroyed(ServletRequestEvent sre) {
         }
 
     }
+
+    @Test
+    public void test100ContinueDefaultPolicy() throws Exception {
+        // the default policy is IMMEDIATELY
+        // This test verifies that we get proper 100 Continue responses
+        // when the continueHandlingResponsePolicy property is not set
+        final Tomcat tomcat = getTomcatInstance();
+
+        final Connector connector = tomcat.getConnector();
+        connector.setProperty("continueHandlingResponsePolicy", "IMMEDIATELY");
+
+        test100Continue();
+    }
+
+    @Test
+    public void test100ContinueSentImmediately() throws Exception {
+        final Tomcat tomcat = getTomcatInstance();
+
+        final Connector connector = tomcat.getConnector();
+        connector.setProperty("continueHandlingResponsePolicy", "IMMEDIATELY");
+
+        test100Continue();
+    }
+
+    @Test
+    public void test100ContinueSentOnRequestContentRead() throws Exception {
+        final Tomcat tomcat = getTomcatInstance();
+
+        final Connector connector = tomcat.getConnector();
+        connector.setProperty("continueHandlingResponsePolicy", 
"ON_REQUEST_CONTENT_READ");
+
+        test100Continue();
+    }
+
+    public void test100Continue() throws Exception {

Review comment:
       I struggled a bit with writing the tests, in both cases a 100 continue 
response is expected. I'll give testing some more thought.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to