tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1150764 - in /tomcat/trunk/test: javax/el/TestCompositeELResolver.java javax/servlet/jsp/TestPageContext.java org/apache/catalina/startup/TomcatBaseTestJUnit4.java
Date Mon, 25 Jul 2011 16:10:51 GMT
Author: kkolinko
Date: Mon Jul 25 16:10:50 2011
New Revision: 1150764

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

TomcatBaseTestJUnit4 is a copy of TomcatBaseTest converted to JUnit 4,
to be used until conversion is completed.

Added:
    tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTestJUnit4.java
      - copied, changed from r1150602, tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
Modified:
    tomcat/trunk/test/javax/el/TestCompositeELResolver.java
    tomcat/trunk/test/javax/servlet/jsp/TestPageContext.java

Modified: tomcat/trunk/test/javax/el/TestCompositeELResolver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/javax/el/TestCompositeELResolver.java?rev=1150764&r1=1150763&r2=1150764&view=diff
==============================================================================
--- tomcat/trunk/test/javax/el/TestCompositeELResolver.java (original)
+++ tomcat/trunk/test/javax/el/TestCompositeELResolver.java Mon Jul 25 16:10:50 2011
@@ -20,13 +20,18 @@ import java.io.File;
 
 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.startup.Tomcat;
-import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.catalina.startup.TomcatBaseTestJUnit4;
 import org.apache.tomcat.util.buf.ByteChunk;
 
-public class TestCompositeELResolver extends TomcatBaseTest {
+public class TestCompositeELResolver extends TomcatBaseTestJUnit4 {
 
+    @Test
     public void testBug50408() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 

Modified: tomcat/trunk/test/javax/servlet/jsp/TestPageContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/javax/servlet/jsp/TestPageContext.java?rev=1150764&r1=1150763&r2=1150764&view=diff
==============================================================================
--- tomcat/trunk/test/javax/servlet/jsp/TestPageContext.java (original)
+++ tomcat/trunk/test/javax/servlet/jsp/TestPageContext.java Mon Jul 25 16:10:50 2011
@@ -19,12 +19,17 @@ package javax.servlet.jsp;
 
 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 TestPageContext extends TomcatBaseTest {
+public class TestPageContext extends TomcatBaseTestJUnit4 {
 
+    @Test
     public void testBug49196() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 

Copied: tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTestJUnit4.java (from r1150602,
tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java)
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTestJUnit4.java?p2=tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTestJUnit4.java&p1=tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java&r1=1150602&r2=1150764&rev=1150764&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java (original)
+++ tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTestJUnit4.java Mon Jul 25 16:10:50
2011
@@ -32,7 +32,10 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.fail;
+
+import org.junit.After;
+import org.junit.Before;
 
 import org.apache.catalina.LifecycleState;
 import org.apache.catalina.connector.Connector;
@@ -45,7 +48,7 @@ import org.apache.tomcat.util.buf.ByteCh
  * Base test case that provides a Tomcat instance for each test - mainly so we
  * don't have to keep writing the cleanup code.
  */
-public abstract class TomcatBaseTest extends TestCase {
+public abstract class TomcatBaseTestJUnit4 {
     private Tomcat tomcat;
     private File tempDir;
     private boolean accessLogEnabled = false;
@@ -101,7 +104,7 @@ public abstract class TomcatBaseTest ext
         return accessLogEnabled;
     }
 
-    @Override
+    @Before
     public void setUp() throws Exception {
         // Need to use JULI so log messages from the tests are visible
         System.setProperty("java.util.logging.manager",
@@ -169,7 +172,7 @@ public abstract class TomcatBaseTest ext
         return protocol;
     }
 
-    @Override
+    @After
     public void tearDown() throws Exception {
         // Some tests may call tomcat.destroy(), some tests may just call
         // tomcat.stop(), some not call either method. Make sure that stop() &



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


Mime
View raw message