Author: kkolinko Date: Mon Jul 25 13:18:20 2011 New Revision: 1150690 URL: http://svn.apache.org/viewvc?rev=1150690&view=rev Log: Update checkstyle rules to treat imports of "org.junit" as a separate group vs. "org".
Convert simple tests in the following packages to JUnit 4: org.apache.catalina.filters.* org.apache.catalina.ha.session.* Modified: tomcat/trunk/res/checkstyle/checkstyle.xml tomcat/trunk/test/org/apache/catalina/filters/TestCsrfPreventionFilter2.java tomcat/trunk/test/org/apache/catalina/ha/session/TestSerializablePrincipal.java Modified: tomcat/trunk/res/checkstyle/checkstyle.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/res/checkstyle/checkstyle.xml?rev=1150690&r1=1150689&r2=1150690&view=diff ============================================================================== --- tomcat/trunk/res/checkstyle/checkstyle.xml (original) +++ tomcat/trunk/res/checkstyle/checkstyle.xml Mon Jul 25 13:18:20 2011 @@ -55,7 +55,7 @@ </module> <module name="IllegalImport"/> <module name="ImportOrder"> - <property name="groups" value="java,javax,async,jsp2,junit,org,util"/> + <property name="groups" value="java,javax,async,jsp2,junit,org.junit,org,util"/> <property name="ordered" value="true"/> <property name="separated" value="true"/> <property name="option" value="above"/> Modified: tomcat/trunk/test/org/apache/catalina/filters/TestCsrfPreventionFilter2.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/filters/TestCsrfPreventionFilter2.java?rev=1150690&r1=1150689&r2=1150690&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/catalina/filters/TestCsrfPreventionFilter2.java (original) +++ tomcat/trunk/test/org/apache/catalina/filters/TestCsrfPreventionFilter2.java Mon Jul 25 13:18:20 2011 @@ -17,16 +17,19 @@ package org.apache.catalina.filters; -import junit.framework.TestCase; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; import org.apache.catalina.filters.CsrfPreventionFilter.LruCache; -public class TestCsrfPreventionFilter2 extends TestCase { +public class TestCsrfPreventionFilter2 { /** * When this test fails, it tends to enter a long running loop but it will * eventually finish (after ~70s on a 8-core Windows box). */ + @Test public void testLruCacheConcurrency() throws Exception { int threadCount = 2; long iterationCount = 100000L; Modified: tomcat/trunk/test/org/apache/catalina/ha/session/TestSerializablePrincipal.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/ha/session/TestSerializablePrincipal.java?rev=1150690&r1=1150689&r2=1150690&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/catalina/ha/session/TestSerializablePrincipal.java (original) +++ tomcat/trunk/test/org/apache/catalina/ha/session/TestSerializablePrincipal.java Mon Jul 25 13:18:20 2011 @@ -27,16 +27,22 @@ import java.io.ObjectOutputStream; import java.util.ArrayList; import java.util.List; -import junit.framework.TestCase; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.fail; + +import org.junit.Test; import org.apache.catalina.realm.GenericPrincipal; -public class TestSerializablePrincipal extends TestCase { + +public class TestSerializablePrincipal { /** * Simple serialization / de-serialization test for bug 43840. */ @SuppressWarnings("null") + @Test public void testWriteReadPrincipal() { // Get a temporary file to use for the serialization test File file = null; --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org