tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1150877 - in /tomcat/trunk/test/org/apache: coyote/ajp/ coyote/http11/ coyote/http11/filters/ el/ naming/resources/
Date Mon, 25 Jul 2011 20:11:43 GMT
Author: kkolinko
Date: Mon Jul 25 20:11:41 2011
New Revision: 1150877

URL: http://svn.apache.org/viewvc?rev=1150877&view=rev
Log:
Converted the tests to JUnit 4.

Modified:
    tomcat/trunk/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java
    tomcat/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java
    tomcat/trunk/test/org/apache/coyote/http11/TestInternalInputBuffer.java
    tomcat/trunk/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java
    tomcat/trunk/test/org/apache/el/TestELInJsp.java
    tomcat/trunk/test/org/apache/naming/resources/TestNamingContext.java
    tomcat/trunk/test/org/apache/naming/resources/TestProxyDirContext.java
    tomcat/trunk/test/org/apache/naming/resources/TestWarDirContext.java

Modified: tomcat/trunk/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java?rev=1150877&r1=1150876&r2=1150877&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java (original)
+++ tomcat/trunk/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java Mon Jul 25 20:11:41
2011
@@ -16,10 +16,15 @@
  */
 package org.apache.coyote.ajp;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
 import org.apache.catalina.startup.Tomcat;
-import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.catalina.startup.TomcatBaseTestJUnit4;
 
-public class TestAbstractAjpProcessor extends TomcatBaseTest {
+public class TestAbstractAjpProcessor extends TomcatBaseTestJUnit4 {
 
     @Override
     protected String getProtocol() {
@@ -43,7 +48,8 @@ public class TestAbstractAjpProcessor ex
         
         return protocol;
     }
-    
+
+    @Test
     public void testKeepAlive() throws Exception {
         Tomcat tomcat = getTomcatInstance();
         tomcat.getConnector().setProperty("connectionTimeout", "-1");
@@ -159,8 +165,8 @@ public class TestAbstractAjpProcessor ex
         if (message.readByte() > 0) {
             reuse = true;
         }
-        
-        assertEquals(expectedReuse, reuse);
+
+        assertEquals(Boolean.valueOf(expectedReuse), Boolean.valueOf(reuse));
     }
 
     private void validateCpong(TesterAjpMessage message) throws Exception {

Modified: tomcat/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java?rev=1150877&r1=1150876&r2=1150877&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java (original)
+++ tomcat/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java Mon Jul 25
20:11:41 2011
@@ -19,14 +19,21 @@ package org.apache.coyote.http11;
 import java.io.File;
 import java.io.IOException;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
 import org.apache.catalina.Context;
 import org.apache.catalina.startup.SimpleHttpClient;
 import org.apache.catalina.startup.TesterServlet;
 import org.apache.catalina.startup.Tomcat;
-import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.catalina.startup.TomcatBaseTestJUnit4;
 
-public class TestAbstractHttp11Processor extends TomcatBaseTest {
+public class TestAbstractHttp11Processor extends TomcatBaseTestJUnit4 {
 
+    @Test
     public void testWithTEVoid() throws Exception {
         Tomcat tomcat = getTomcatInstance();
         
@@ -55,6 +62,7 @@ public class TestAbstractHttp11Processor
         assertTrue(client.isResponse501());
     }
 
+    @Test
     public void testWithTEBuffered() throws Exception {
         Tomcat tomcat = getTomcatInstance();
         
@@ -84,6 +92,7 @@ public class TestAbstractHttp11Processor
     }
 
 
+    @Test
     public void testWithTEIdentity() throws Exception {
         Tomcat tomcat = getTomcatInstance();
         
@@ -115,6 +124,7 @@ public class TestAbstractHttp11Processor
     }
 
 
+    @Test
     public void testWithTESavedRequest() throws Exception {
         Tomcat tomcat = getTomcatInstance();
         
@@ -144,6 +154,7 @@ public class TestAbstractHttp11Processor
     }
 
 
+    @Test
     public void testWithTEUnsupported() throws Exception {
         Tomcat tomcat = getTomcatInstance();
         
@@ -173,6 +184,7 @@ public class TestAbstractHttp11Processor
     }
 
 
+    @Test
     public void testPipelining() throws Exception {
         Tomcat tomcat = getTomcatInstance();
         

Modified: tomcat/trunk/test/org/apache/coyote/http11/TestInternalInputBuffer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http11/TestInternalInputBuffer.java?rev=1150877&r1=1150876&r2=1150877&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/http11/TestInternalInputBuffer.java (original)
+++ tomcat/trunk/test/org/apache/coyote/http11/TestInternalInputBuffer.java Mon Jul 25 20:11:41
2011
@@ -26,18 +26,23 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
 import org.apache.catalina.Context;
 import org.apache.catalina.connector.Connector;
 import org.apache.catalina.startup.SimpleHttpClient;
 import org.apache.catalina.startup.Tomcat;
-import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.catalina.startup.TomcatBaseTestJUnit4;
 
-public class TestInternalInputBuffer extends TomcatBaseTest {
+public class TestInternalInputBuffer extends TomcatBaseTestJUnit4 {
     
     /**
      * Test case for https://issues.apache.org/bugzilla/show_bug.cgi?id=48839
      * with BIO
      */
+    @Test
     public void testBug48839BIO() {
         
         Bug48839Client client = new Bug48839Client();
@@ -54,6 +59,7 @@ public class TestInternalInputBuffer ext
      * Test case for https://issues.apache.org/bugzilla/show_bug.cgi?id=48839
      * with NIO
      */
+    @Test
     public void testBug48839NIO() {
         
         Bug48839Client client = new Bug48839Client();

Modified: tomcat/trunk/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java?rev=1150877&r1=1150876&r2=1150877&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java (original)
+++ tomcat/trunk/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java Mon Jul
25 20:11:41 2011
@@ -26,13 +26,19 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
 import org.apache.catalina.Context;
 import org.apache.catalina.startup.SimpleHttpClient;
 import org.apache.catalina.startup.Tomcat;
-import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.catalina.startup.TomcatBaseTestJUnit4;
 
-public class TestChunkedInputFilter extends TomcatBaseTest {
+public class TestChunkedInputFilter extends TomcatBaseTestJUnit4 {
 
+    @Test
     public void testTrailingHeaders() throws Exception {
         // Setup Tomcat instance
         Tomcat tomcat = getTomcatInstance();
@@ -71,6 +77,7 @@ public class TestChunkedInputFilter exte
         assertEquals("null7TestTestTest0123456789abcdefghijABCDEFGHIJopqrstuvwxyz", client.getResponseBody());
     }
 
+    @Test
     public void testTrailingHeadersSizeLimit() throws Exception {
         // Setup Tomcat instance
         Tomcat tomcat = getTomcatInstance();
@@ -113,6 +120,7 @@ public class TestChunkedInputFilter exte
         assertTrue(client.isResponse500());
     }
 
+    @Test
     public void testNoTrailingHeaders() throws Exception {
         // Setup Tomcat instance
         Tomcat tomcat = getTomcatInstance();

Modified: tomcat/trunk/test/org/apache/el/TestELInJsp.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/el/TestELInJsp.java?rev=1150877&r1=1150876&r2=1150877&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/el/TestELInJsp.java (original)
+++ tomcat/trunk/test/org/apache/el/TestELInJsp.java Mon Jul 25 20:11:41 2011
@@ -19,8 +19,12 @@ package org.apache.el;
 
 import java.io.File;
 
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
 import org.apache.catalina.startup.Tomcat;
-import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.catalina.startup.TomcatBaseTestJUnit4;
 import org.apache.tomcat.util.buf.ByteChunk;
 
 /**
@@ -28,8 +32,9 @@ import org.apache.tomcat.util.buf.ByteCh
  * tests may be found in {@link TestELEvaluation} and
  * {@link org.apache.jasper.compiler.TestAttributeParser}.
  */
-public class TestELInJsp extends TomcatBaseTest {
-    
+public class TestELInJsp extends TomcatBaseTestJUnit4 {
+
+    @Test
     public void testBug36923() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -46,6 +51,7 @@ public class TestELInJsp extends TomcatB
         assertEcho(result, "00-${hello world}");
     }
 
+    @Test
     public void testBug42565() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -77,6 +83,7 @@ public class TestELInJsp extends TomcatB
         assertEcho(result, "15-false");
     }
 
+    @Test
     public void testBug44994() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -96,6 +103,7 @@ public class TestELInJsp extends TomcatB
         assertEcho(result, "02-many");
     }
 
+    @Test
     public void testBug45427() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -131,6 +139,7 @@ public class TestELInJsp extends TomcatB
         assertEcho(result, "17-hello \"world");
     }
 
+    @Test
     public void testBug45451() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -231,6 +240,7 @@ public class TestELInJsp extends TomcatB
         assertEcho(result, "13-\\\\#{1+1}");
     }
 
+    @Test
     public void testBug45511() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -249,6 +259,7 @@ public class TestELInJsp extends TomcatB
         assertEcho(result, "01-false");
     }
 
+    @Test
     public void testBug46596() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -264,7 +275,8 @@ public class TestELInJsp extends TomcatB
         String result = res.toString();
         assertEcho(result, "{OK}");
     }
-    
+
+    @Test
     public void testBug47413() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -293,6 +305,7 @@ public class TestELInJsp extends TomcatB
         assertEcho(result, "11-0");
     }
 
+    @Test
     public void testBug48112() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -308,7 +321,8 @@ public class TestELInJsp extends TomcatB
         String result = res.toString();
         assertEcho(result, "{OK}");
     }
-    
+
+    @Test
     public void testBug49555() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -325,6 +339,7 @@ public class TestELInJsp extends TomcatB
         assertEcho(result, "00-" + TesterFunctions.Inner$Class.RETVAL);
     }
 
+    @Test
     public void testBug51544() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -341,6 +356,7 @@ public class TestELInJsp extends TomcatB
         assertEcho(result, "Empty list: true");
     }
 
+    @Test
     public void testELMisc() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -374,6 +390,7 @@ public class TestELInJsp extends TomcatB
         assertEcho(result, "17-foo\\bar\\baz");
     }
 
+    @Test
     public void testScriptingExpression() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -401,6 +418,7 @@ public class TestELInJsp extends TomcatB
         assertEcho(result, "11-hello %> world");
     }
 
+    @Test
     public void testELMethod() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 

Modified: tomcat/trunk/test/org/apache/naming/resources/TestNamingContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/naming/resources/TestNamingContext.java?rev=1150877&r1=1150876&r2=1150877&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/naming/resources/TestNamingContext.java (original)
+++ tomcat/trunk/test/org/apache/naming/resources/TestNamingContext.java Mon Jul 25 20:11:41
2011
@@ -29,18 +29,24 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
 import org.apache.catalina.core.StandardContext;
 import org.apache.catalina.deploy.ContextResource;
 import org.apache.catalina.startup.Tomcat;
-import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.catalina.startup.TomcatBaseTestJUnit4;
 import org.apache.tomcat.util.buf.ByteChunk;
 
-public class TestNamingContext extends TomcatBaseTest {
+public class TestNamingContext extends TomcatBaseTestJUnit4 {
 
+    @Test
     public void testLookupSingletonResource() throws Exception {
         doTestLookup(true);
     }
-    
+
+    @Test
     public void testLookupNonSingletonResource() throws Exception {
         doTestLookup(false);
     }
@@ -106,6 +112,7 @@ public class TestNamingContext extends T
         }
     }
 
+    @Test
     public void testListBindings() throws Exception {
         Tomcat tomcat = getTomcatInstance();
         tomcat.enableNaming();
@@ -156,7 +163,8 @@ public class TestNamingContext extends T
             }
         }
     }
-    
+
+    @Test
     public void testBeanFactory() throws Exception {
         Tomcat tomcat = getTomcatInstance();
         tomcat.enableNaming();

Modified: tomcat/trunk/test/org/apache/naming/resources/TestProxyDirContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/naming/resources/TestProxyDirContext.java?rev=1150877&r1=1150876&r2=1150877&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/naming/resources/TestProxyDirContext.java (original)
+++ tomcat/trunk/test/org/apache/naming/resources/TestProxyDirContext.java Mon Jul 25 20:11:41
2011
@@ -18,20 +18,25 @@ package org.apache.naming.resources;
 
 import javax.naming.NameNotFoundException;
 
+import static org.junit.Assert.fail;
+
+import org.junit.Test;
+
 import org.apache.catalina.core.StandardContext;
 import org.apache.catalina.startup.Tomcat;
-import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.catalina.startup.TomcatBaseTestJUnit4;
 
 /**
  * Unit test for the {@link ProxyDirContext}.
  * @author Marc Guillemot
  * @version $Revision: $
  */
-public class TestProxyDirContext extends TomcatBaseTest {
+public class TestProxyDirContext extends TomcatBaseTestJUnit4 {
 
     /**
      * lookup doesn't always throw the same exception.
      */
+    @Test
     public void testLookupException() throws Exception {
         Tomcat tomcat = getTomcatInstance();
         

Modified: tomcat/trunk/test/org/apache/naming/resources/TestWarDirContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/naming/resources/TestWarDirContext.java?rev=1150877&r1=1150876&r2=1150877&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/naming/resources/TestWarDirContext.java (original)
+++ tomcat/trunk/test/org/apache/naming/resources/TestWarDirContext.java Mon Jul 25 20:11:41
2011
@@ -18,13 +18,17 @@ package org.apache.naming.resources;
 
 import java.io.File;
 
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
 import org.apache.catalina.core.JreMemoryLeakPreventionListener;
 import org.apache.catalina.core.StandardContext;
 import org.apache.catalina.startup.Tomcat;
-import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.catalina.startup.TomcatBaseTestJUnit4;
 import org.apache.tomcat.util.buf.ByteChunk;
 
-public class TestWarDirContext extends TomcatBaseTest {
+public class TestWarDirContext extends TomcatBaseTestJUnit4 {
     
     @Override
     public void setUp() throws Exception {
@@ -43,6 +47,7 @@ public class TestWarDirContext extends T
     /**
      * Check https://jira.springsource.org/browse/SPR-7350 isn't really an issue
      */
+    @Test
     public void testLookupException() throws Exception {
         Tomcat tomcat = getTomcatInstance();
         
@@ -63,6 +68,7 @@ public class TestWarDirContext extends T
      * Additional test following on from SPR-7350 above to check files that
      * contain JNDI reserved characters can be served when caching is enabled.
      */
+    @Test
     public void testReservedJNDIFileNamesWithCache() throws Exception {
         Tomcat tomcat = getTomcatInstance();
         
@@ -92,6 +98,7 @@ public class TestWarDirContext extends T
      * Additional test following on from SPR-7350 above to check files that
      * contain JNDI reserved characters can be served when caching is disabled.
      */
+    @Test
     public void testReservedJNDIFileNamesNoCache() throws Exception {
         Tomcat tomcat = getTomcatInstance();
         



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


Mime
View raw message