tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1150890 - in /tomcat/trunk/test/org/apache/jasper/compiler: TestCompiler.java TestGenerator.java TestJspConfig.java TestJspDocumentParser.java TestParser.java TestParserNoStrictWhitespace.java TestScriptingVariabler.java TestValidator.java
Date Mon, 25 Jul 2011 20:31:01 GMT
Author: kkolinko
Date: Mon Jul 25 20:30:58 2011
New Revision: 1150890

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

Modified:
    tomcat/trunk/test/org/apache/jasper/compiler/TestCompiler.java
    tomcat/trunk/test/org/apache/jasper/compiler/TestGenerator.java
    tomcat/trunk/test/org/apache/jasper/compiler/TestJspConfig.java
    tomcat/trunk/test/org/apache/jasper/compiler/TestJspDocumentParser.java
    tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java
    tomcat/trunk/test/org/apache/jasper/compiler/TestParserNoStrictWhitespace.java
    tomcat/trunk/test/org/apache/jasper/compiler/TestScriptingVariabler.java
    tomcat/trunk/test/org/apache/jasper/compiler/TestValidator.java

Modified: tomcat/trunk/test/org/apache/jasper/compiler/TestCompiler.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/jasper/compiler/TestCompiler.java?rev=1150890&r1=1150889&r2=1150890&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/jasper/compiler/TestCompiler.java (original)
+++ tomcat/trunk/test/org/apache/jasper/compiler/TestCompiler.java Mon Jul 25 20:30:58 2011
@@ -22,12 +22,17 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+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;
 
-public class TestCompiler extends TomcatBaseTest {
-    
+public class TestCompiler extends TomcatBaseTestJUnit4 {
+
+    @Test
     public void testBug49726a() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -49,6 +54,7 @@ public class TestCompiler extends Tomcat
         assertTrue(headers.get("Content-Type").get(0).startsWith("text/html"));
     }
 
+    @Test
     public void testBug49726b() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 

Modified: tomcat/trunk/test/org/apache/jasper/compiler/TestGenerator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/jasper/compiler/TestGenerator.java?rev=1150890&r1=1150889&r2=1150890&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/jasper/compiler/TestGenerator.java (original)
+++ tomcat/trunk/test/org/apache/jasper/compiler/TestGenerator.java Mon Jul 25 20:30:58 2011
@@ -30,13 +30,19 @@ import javax.servlet.jsp.tagext.TagExtra
 import javax.servlet.jsp.tagext.TagSupport;
 import javax.servlet.jsp.tagext.VariableInfo;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+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;
 import org.apache.tomcat.util.buf.ByteChunk;
 
-public class TestGenerator extends TomcatBaseTest {
-    
+public class TestGenerator extends TomcatBaseTestJUnit4 {
+
+    @Test
     public void testBug45015a() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -65,6 +71,7 @@ public class TestGenerator extends Tomca
         assertEcho(result, "09-hello world\"");
     }
 
+    @Test
     public void testBug45015b() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -81,6 +88,7 @@ public class TestGenerator extends Tomca
         assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, rc);
     }
 
+    @Test
     public void testBug45015c() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -97,6 +105,7 @@ public class TestGenerator extends Tomca
         assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, rc);
     }
 
+    @Test
     public void testBug48701Fail() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -118,18 +127,22 @@ public class TestGenerator extends Tomca
         assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, rc);
     }
 
+    @Test
     public void testBug48701UseBean() throws Exception {
         testBug48701("bug48nnn/bug48701-UseBean.jsp");
     }
-    
+
+    @Test
     public void testBug48701VariableInfo() throws Exception {
         testBug48701("bug48nnn/bug48701-VI.jsp");
     }
-    
+
+    @Test
     public void testBug48701TagVariableInfoNameGiven() throws Exception {
         testBug48701("bug48nnn/bug48701-TVI-NG.jsp");
     }
-    
+
+    @Test
     public void testBug48701TagVariableInfoNameFromAttribute() throws Exception {
         testBug48701("bug48nnn/bug48701-TVI-NFA.jsp");
     }
@@ -200,6 +213,7 @@ public class TestGenerator extends Tomca
         }
     }
 
+    @Test
     public void testBug49799() throws Exception {
 
         String[] expected = { "<p style=\"color:red\">00-Red</p>",

Modified: tomcat/trunk/test/org/apache/jasper/compiler/TestJspConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/jasper/compiler/TestJspConfig.java?rev=1150890&r1=1150889&r2=1150890&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/jasper/compiler/TestJspConfig.java (original)
+++ tomcat/trunk/test/org/apache/jasper/compiler/TestJspConfig.java Mon Jul 25 20:30:58 2011
@@ -19,12 +19,17 @@ package org.apache.jasper.compiler;
 
 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;
 
-public class TestJspConfig extends TomcatBaseTest {
+public class TestJspConfig extends TomcatBaseTestJUnit4 {
 
+    @Test
     public void testServlet23NoEL() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -44,6 +49,7 @@ public class TestJspConfig extends Tomca
         assertTrue(result.indexOf("<p>01-#{'hello world'}</p>") > 0);
     }
 
+    @Test
     public void testServlet24NoEL() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -63,6 +69,7 @@ public class TestJspConfig extends Tomca
         assertTrue(result.indexOf("<p>01-#{'hello world'}</p>") > 0);
     }
 
+    @Test
     public void testServlet25NoEL() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -81,6 +88,7 @@ public class TestJspConfig extends Tomca
         assertTrue(result.indexOf("<p>00-hello world</p>") > 0);
     }
 
+    @Test
     public void testServlet30NoEL() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 

Modified: tomcat/trunk/test/org/apache/jasper/compiler/TestJspDocumentParser.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/jasper/compiler/TestJspDocumentParser.java?rev=1150890&r1=1150889&r2=1150890&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/jasper/compiler/TestJspDocumentParser.java (original)
+++ tomcat/trunk/test/org/apache/jasper/compiler/TestJspDocumentParser.java Mon Jul 25 20:30:58
2011
@@ -22,12 +22,18 @@ import java.io.IOException;
 
 import javax.servlet.http.HttpServletResponse;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+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;
 
-public class TestJspDocumentParser extends TomcatBaseTest {
-    
+public class TestJspDocumentParser extends TomcatBaseTestJUnit4 {
+
+    @Test
     public void testBug47977() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -43,7 +49,8 @@ public class TestJspDocumentParser exten
         
         assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, rc);
     }
-    
+
+    @Test
     public void testBug48827() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 

Modified: tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java?rev=1150890&r1=1150889&r2=1150890&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java (original)
+++ tomcat/trunk/test/org/apache/jasper/compiler/TestParser.java Mon Jul 25 20:30:58 2011
@@ -21,16 +21,22 @@ import java.io.File;
 import java.util.HashMap;
 import java.util.List;
 
+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;
 import org.apache.tomcat.util.buf.ByteChunk;
 
 /**
  * Tests are duplicated in {@link TestParserNoStrictWhitespace} with the strict
  * whitespace parsing disabled.
  */
-public class TestParser extends TomcatBaseTest {
-    
+public class TestParser extends TomcatBaseTestJUnit4 {
+
+    @Test
     public void testBug48627() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -51,6 +57,7 @@ public class TestParser extends TomcatBa
         assertEcho(result, "01-\\");
     }
 
+    @Test
     public void testBug48668a() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -96,6 +103,7 @@ public class TestParser extends TomcatBa
         assertEcho(result, "53-Hello #{'foo}");
     }
 
+    @Test
     public void testBug48668b() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -112,6 +120,7 @@ public class TestParser extends TomcatBa
         assertEcho(result, "01-Hello world</p>#{foo2");
     }
 
+    @Test
     public void testBug49297NoSpaceStrict() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -127,7 +136,8 @@ public class TestParser extends TomcatBa
 
         assertEquals(500, sc);
     }
-    
+
+    @Test
     public void testBug49297DuplicateAttr() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -143,7 +153,8 @@ public class TestParser extends TomcatBa
 
         assertEquals(500, sc);
     }
-    
+
+    @Test
     public void testBug49297MultipleImport1() throws Exception {
 
         Tomcat tomcat = getTomcatInstance();
@@ -163,6 +174,7 @@ public class TestParser extends TomcatBa
         assertEcho(res.toString(), "OK");
     }
 
+    @Test
     public void testBug49297MultipleImport2() throws Exception {
 
         Tomcat tomcat = getTomcatInstance();
@@ -182,6 +194,7 @@ public class TestParser extends TomcatBa
         assertEcho(res.toString(), "OK");
     }
 
+    @Test
     public void testBug49297MultiplePageEncoding1() throws Exception {
 
         Tomcat tomcat = getTomcatInstance();
@@ -200,6 +213,7 @@ public class TestParser extends TomcatBa
         assertEquals(500, sc);
     }
 
+    @Test
     public void testBug49297MultiplePageEncoding2() throws Exception {
 
         Tomcat tomcat = getTomcatInstance();
@@ -218,6 +232,7 @@ public class TestParser extends TomcatBa
         assertEquals(500, sc);
     }
 
+    @Test
     public void testBug49297MultiplePageEncoding3() throws Exception {
 
         Tomcat tomcat = getTomcatInstance();
@@ -236,6 +251,7 @@ public class TestParser extends TomcatBa
         assertEquals(500, sc);
     }
 
+    @Test
     public void testBug49297MultiplePageEncoding4() throws Exception {
 
         Tomcat tomcat = getTomcatInstance();
@@ -254,6 +270,7 @@ public class TestParser extends TomcatBa
         assertEquals(500, sc);
     }
 
+    @Test
     public void testBug49297Tag() throws Exception {
 
         Tomcat tomcat = getTomcatInstance();

Modified: tomcat/trunk/test/org/apache/jasper/compiler/TestParserNoStrictWhitespace.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/jasper/compiler/TestParserNoStrictWhitespace.java?rev=1150890&r1=1150889&r2=1150890&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/jasper/compiler/TestParserNoStrictWhitespace.java (original)
+++ tomcat/trunk/test/org/apache/jasper/compiler/TestParserNoStrictWhitespace.java Mon Jul
25 20:30:58 2011
@@ -21,15 +21,20 @@ import java.io.File;
 import java.util.HashMap;
 import java.util.List;
 
+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;
 import org.apache.tomcat.util.buf.ByteChunk;
 
 /**
  * Tests are duplicated in {@link TestParser} with the strict whitespace parsing
  * enabled by default.
  */
-public class TestParserNoStrictWhitespace extends TomcatBaseTest {
+public class TestParserNoStrictWhitespace extends TomcatBaseTestJUnit4 {
     
     @Override
     public void setUp() throws Exception {
@@ -39,6 +44,7 @@ public class TestParserNoStrictWhitespac
         super.setUp();
     }
 
+    @Test
     public void testBug48627() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -59,6 +65,7 @@ public class TestParserNoStrictWhitespac
         assertEcho(result, "01-\\");
     }
 
+    @Test
     public void testBug48668a() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -104,6 +111,7 @@ public class TestParserNoStrictWhitespac
         assertEcho(result, "53-Hello #{'foo}");
     }
 
+    @Test
     public void testBug48668b() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -120,6 +128,7 @@ public class TestParserNoStrictWhitespac
         assertEcho(result, "01-Hello world</p>#{foo2");
     }
 
+    @Test
     public void testBug49297NoSpaceNotStrict() throws Exception {
 
         Tomcat tomcat = getTomcatInstance();
@@ -140,6 +149,7 @@ public class TestParserNoStrictWhitespac
         assertEcho(res.toString(), "Hello World");
     }
 
+    @Test
     public void testBug49297DuplicateAttr() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 

Modified: tomcat/trunk/test/org/apache/jasper/compiler/TestScriptingVariabler.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/jasper/compiler/TestScriptingVariabler.java?rev=1150890&r1=1150889&r2=1150890&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/jasper/compiler/TestScriptingVariabler.java (original)
+++ tomcat/trunk/test/org/apache/jasper/compiler/TestScriptingVariabler.java Mon Jul 25 20:30:58
2011
@@ -25,11 +25,16 @@ import javax.servlet.jsp.tagext.TagExtra
 import javax.servlet.jsp.tagext.TagSupport;
 import javax.servlet.jsp.tagext.VariableInfo;
 
+import static org.junit.Assert.assertNull;
+
+import org.junit.Test;
+
 import org.apache.catalina.startup.Tomcat;
-import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.catalina.startup.TomcatBaseTestJUnit4;
 
-public class TestScriptingVariabler extends TomcatBaseTest {
-    
+public class TestScriptingVariabler extends TomcatBaseTestJUnit4 {
+
+    @Test
     public void testBug42390() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -71,7 +76,8 @@ public class TestScriptingVariabler exte
             };
         }
     }
-    
+
+    @Test
     public void testBug48616() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -93,6 +99,7 @@ public class TestScriptingVariabler exte
         assertNull(e);
     }
 
+    @Test
     public void testBug48616b() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 

Modified: tomcat/trunk/test/org/apache/jasper/compiler/TestValidator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/jasper/compiler/TestValidator.java?rev=1150890&r1=1150889&r2=1150890&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/jasper/compiler/TestValidator.java (original)
+++ tomcat/trunk/test/org/apache/jasper/compiler/TestValidator.java Mon Jul 25 20:30:58 2011
@@ -24,12 +24,18 @@ import javax.servlet.http.HttpServletRes
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.TagSupport;
 
+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;
 import org.apache.tomcat.util.buf.ByteChunk;
 
-public class TestValidator extends TomcatBaseTest {
-    
+public class TestValidator extends TomcatBaseTestJUnit4 {
+
+    @Test
     public void testBug47331() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -45,8 +51,8 @@ public class TestValidator extends Tomca
         
         assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, rc);
     }
-    
 
+    @Test
     public void testTldVersions23() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -71,7 +77,7 @@ public class TestValidator extends Tomca
         assertTrue(result.indexOf("<p>${'06-hello world'}</p>") > 0);
     }
 
-    
+    @Test
     public void testTldVersions24() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -96,7 +102,7 @@ public class TestValidator extends Tomca
         assertTrue(result.indexOf("<p>06-hello world</p>") > 0);
     }
 
-    
+    @Test
     public void testTldVersions25() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
@@ -121,7 +127,7 @@ public class TestValidator extends Tomca
         assertTrue(result.indexOf("<p>06-hello world</p>") > 0);
     }
 
-    
+    @Test
     public void testTldVersions30() 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