svn commit: r1845897 - /tomcat/tc8.5.x/trunk/test/org/apache/catalina/core/TestSwallowAbortedUploads.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1845897 - /tomcat/tc8.5.x/trunk/test/org/apache/catalina/core/TestSwallowAbortedUploads.java

markt
Author: markt
Date: Tue Nov  6 11:41:13 2018
New Revision: 1845897

URL: http://svn.apache.org/viewvc?rev=1845897&view=rev
Log:
Make test more robust. It now passes when running on Java 8 and Java 11.

Modified:
    tomcat/tc8.5.x/trunk/test/org/apache/catalina/core/TestSwallowAbortedUploads.java

Modified: tomcat/tc8.5.x/trunk/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/test/org/apache/catalina/core/TestSwallowAbortedUploads.java?rev=1845897&r1=1845896&r2=1845897&view=diff
==============================================================================
--- tomcat/tc8.5.x/trunk/test/org/apache/catalina/core/TestSwallowAbortedUploads.java (original)
+++ tomcat/tc8.5.x/trunk/test/org/apache/catalina/core/TestSwallowAbortedUploads.java Tue Nov  6 11:41:13 2018
@@ -40,6 +40,7 @@ import org.junit.Test;
 
 import org.apache.catalina.Context;
 import org.apache.catalina.Wrapper;
+import org.apache.catalina.connector.Connector;
 import org.apache.catalina.startup.SimpleHttpClient;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
@@ -228,7 +229,7 @@ public class TestSwallowAbortedUploads e
         private static final String URI = "/uploadAborted";
         private static final String servletName = "uploadAborted";
         private static final int limitSize = 100;
-        private static final int hugeSize = 2000000;
+        private static final int hugeSize = 10000000;
 
         private Context context;
 
@@ -252,8 +253,12 @@ public class TestSwallowAbortedUploads e
             context.addServletMappingDecoded(URI, servletName);
             context.setSwallowAbortedUploads(swallow);
 
+            Connector c = tomcat.getConnector();
+            c.setMaxPostSize(2 * hugeSize);
+            c.setProperty("maxSwallowSize", Integer.toString(hugeSize));
+
             tomcat.start();
-            setPort(tomcat.getConnector().getLocalPort());
+            setPort(c.getLocalPort());
         }
 
         private Exception doRequest(boolean limited, boolean swallow) {
@@ -344,7 +349,7 @@ public class TestSwallowAbortedUploads e
 
         private static final String URI = "/uploadAborted";
         private static final String servletName = "uploadAborted";
-        private static final int hugeSize = 2000000;
+        private static final int hugeSize = 10000000;
 
         private Context context;
 
@@ -362,7 +367,11 @@ public class TestSwallowAbortedUploads e
 
             tomcat.start();
 
-            setPort(tomcat.getConnector().getLocalPort());
+            Connector c = tomcat.getConnector();
+            c.setMaxPostSize(2 * hugeSize);
+            c.setProperty("maxSwallowSize", Integer.toString(hugeSize));
+
+            setPort(c.getLocalPort());
         }
 
         private Exception doRequest(int status, boolean swallow) {



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]