Convert simple tests in the following packages to JUnit 4:
org.apache.catalina.filters.*
org.apache.catalina.ha.session.*
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@
1150690 13f79535-47bb-0310-9956-
ffa450edef68
</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"/>
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;
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;