tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1150933 - /tomcat/trunk/test/org/apache/tomcat/util/http/
Date Mon, 25 Jul 2011 22:09:39 GMT
Author: kkolinko
Date: Mon Jul 25 22:09:37 2011
New Revision: 1150933

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

Modified:
    tomcat/trunk/test/org/apache/tomcat/util/http/CookiesBaseTest.java
    tomcat/trunk/test/org/apache/tomcat/util/http/TestBug49158.java
    tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowEquals.java
    tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowHttpSeps.java
    tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowNameOnly.java
    tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDefaultSysProps.java
    tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDisallowEquals.java
    tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoFwdStrictSysProps.java
    tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoStrictNamingSysProps.java
    tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesStrictSysProps.java

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/CookiesBaseTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/CookiesBaseTest.java?rev=1150933&r1=1150932&r2=1150933&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/CookiesBaseTest.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/CookiesBaseTest.java Mon Jul 25 22:09:37
2011
@@ -26,7 +26,7 @@ import javax.servlet.http.HttpServletRes
 
 import org.apache.catalina.Context;
 import org.apache.catalina.startup.Tomcat;
-import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.catalina.startup.TomcatBaseTestJUnit4;
 
 /**
  * Base Test case for {@link Cookies}. <b>Note</b> because of the use of
@@ -34,7 +34,7 @@ import org.apache.catalina.startup.Tomca
  * must be executed in a new JVM instance. The tests have been place in separate
  * classes to facilitate this when running the unit tests via Ant.
  */
-public abstract class CookiesBaseTest extends TomcatBaseTest {
+public abstract class CookiesBaseTest extends TomcatBaseTestJUnit4 {
 
     /**
      * Servlet for cookie naming test.
@@ -89,7 +89,7 @@ public abstract class CookiesBaseTest ex
         ctx.addServletMapping("/switch", "switch");
 
     }
-    
+
     public abstract void testCookiesInstance() throws Exception;
     
 }

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestBug49158.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestBug49158.java?rev=1150933&r1=1150932&r2=1150933&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestBug49158.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestBug49158.java Mon Jul 25 22:09:37 2011
@@ -28,6 +28,10 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
 import org.apache.catalina.Context;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.tomcat.util.buf.ByteChunk;
@@ -42,6 +46,7 @@ public class TestBug49158 extends Cookie
     public static final String path = "49158";
     
     @Override
+    @Test
     public void testCookiesInstance() throws Exception {
         Tomcat tomcat = getTomcatInstance();
         addServlets(tomcat);

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowEquals.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowEquals.java?rev=1150933&r1=1150932&r2=1150933&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowEquals.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowEquals.java Mon Jul 25 22:09:37
2011
@@ -24,17 +24,22 @@ 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.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 TestCookiesAllowEquals extends TomcatBaseTest{
+public class TestCookiesAllowEquals extends TomcatBaseTestJUnit4 {
 
     private static final String COOKIE_WITH_EQUALS_1 = "name=equals=middle";
     private static final String COOKIE_WITH_EQUALS_2 = "name==equalsstart";
     private static final String COOKIE_WITH_EQUALS_3 = "name=equalsend=";
-    
+
+    @Test
     public void testWithEquals() throws Exception {
         System.setProperty(
                 "org.apache.tomcat.util.http.ServerCookie.ALLOW_EQUALS_IN_VALUE",

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowHttpSeps.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowHttpSeps.java?rev=1150933&r1=1150932&r2=1150933&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowHttpSeps.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowHttpSeps.java Mon Jul 25
22:09:37 2011
@@ -24,15 +24,20 @@ 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.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 TestCookiesAllowHttpSeps extends TomcatBaseTest{
+public class TestCookiesAllowHttpSeps extends TomcatBaseTestJUnit4 {
 
     private static final String COOKIE_WITH_SEPS = "name=val(ue";
-    
+
+    @Test
     public void testWithHttpSep() throws Exception {
         System.setProperty(
                 "org.apache.tomcat.util.http.ServerCookie.ALLOW_HTTP_SEPARATORS_IN_V0",

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowNameOnly.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowNameOnly.java?rev=1150933&r1=1150932&r2=1150933&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowNameOnly.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesAllowNameOnly.java Mon Jul 25
22:09:37 2011
@@ -24,16 +24,21 @@ 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.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 TestCookiesAllowNameOnly extends TomcatBaseTest{
+public class TestCookiesAllowNameOnly extends TomcatBaseTestJUnit4 {
 
     private static final String COOKIE_WITH_NAME_ONLY_1 = "bob";
     private static final String COOKIE_WITH_NAME_ONLY_2 = "bob=";
-    
+
+    @Test
     public void testWithEquals() throws Exception {
         System.setProperty(
                 "org.apache.tomcat.util.http.ServerCookie.ALLOW_NAME_ONLY",

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDefaultSysProps.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDefaultSysProps.java?rev=1150933&r1=1150932&r2=1150933&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDefaultSysProps.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDefaultSysProps.java Mon Jul
25 22:09:37 2011
@@ -21,6 +21,10 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
 import org.apache.catalina.startup.Tomcat;
 import org.apache.tomcat.util.buf.ByteChunk;
 
@@ -33,6 +37,7 @@ import org.apache.tomcat.util.buf.ByteCh
 public class TestCookiesDefaultSysProps extends CookiesBaseTest {
 
     @Override
+    @Test
     public void testCookiesInstance() throws Exception {
 
         Tomcat tomcat = getTomcatInstance();

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDisallowEquals.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDisallowEquals.java?rev=1150933&r1=1150932&r2=1150933&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDisallowEquals.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesDisallowEquals.java Mon Jul 25
22:09:37 2011
@@ -24,16 +24,21 @@ 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.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 TestCookiesDisallowEquals extends TomcatBaseTest{
+public class TestCookiesDisallowEquals extends TomcatBaseTestJUnit4 {
 
     private static final String COOKIE_WITH_EQUALS = "name=value=withequals";
     private static final String COOKIE_TRUNCATED = "name=value";
-    
+
+    @Test
     public void testWithEquals() throws Exception {
         TestCookieEqualsClient client = new TestCookieEqualsClient();
         client.doRequest();

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoFwdStrictSysProps.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoFwdStrictSysProps.java?rev=1150933&r1=1150932&r2=1150933&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoFwdStrictSysProps.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoFwdStrictSysProps.java Mon
Jul 25 22:09:37 2011
@@ -17,6 +17,10 @@
 
 package org.apache.tomcat.util.http;
 
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
 import org.apache.catalina.startup.Tomcat;
 import org.apache.tomcat.util.buf.ByteChunk;
 
@@ -29,6 +33,7 @@ import org.apache.tomcat.util.buf.ByteCh
 public class TestCookiesNoFwdStrictSysProps extends CookiesBaseTest {
     
     @Override
+    @Test
     public void testCookiesInstance() throws Exception {
 
         System.setProperty("org.apache.catalina.STRICT_SERVLET_COMPLIANCE",

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoStrictNamingSysProps.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoStrictNamingSysProps.java?rev=1150933&r1=1150932&r2=1150933&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoStrictNamingSysProps.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesNoStrictNamingSysProps.java Mon
Jul 25 22:09:37 2011
@@ -17,6 +17,10 @@
 
 package org.apache.tomcat.util.http;
 
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
 import org.apache.catalina.startup.Tomcat;
 import org.apache.tomcat.util.buf.ByteChunk;
 
@@ -29,6 +33,7 @@ import org.apache.tomcat.util.buf.ByteCh
 public class TestCookiesNoStrictNamingSysProps extends CookiesBaseTest {
 
     @Override
+    @Test
     public void testCookiesInstance() throws Exception {
     
         System.setProperty("org.apache.catalina.STRICT_SERVLET_COMPLIANCE",

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesStrictSysProps.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesStrictSysProps.java?rev=1150933&r1=1150932&r2=1150933&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesStrictSysProps.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookiesStrictSysProps.java Mon Jul 25
22:09:37 2011
@@ -21,6 +21,10 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
 import org.apache.catalina.startup.Tomcat;
 import org.apache.tomcat.util.buf.ByteChunk;
 
@@ -33,6 +37,7 @@ import org.apache.tomcat.util.buf.ByteCh
 public class TestCookiesStrictSysProps extends CookiesBaseTest {
 
     @Override
+    @Test
     public void testCookiesInstance() throws Exception {
 
         System.setProperty("org.apache.catalina.STRICT_SERVLET_COMPLIANCE",



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


Mime
View raw message