You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2015/11/07 03:04:00 UTC
svn commit: r1713068 - in /tomcat/tc6.0.x/trunk/test/org/apache:
juli/TestClassLoaderLogManager.java tomcat/util/res/TestStringManager.java
Author: kkolinko
Date: Sat Nov 7 02:04:00 2015
New Revision: 1713068
URL: http://svn.apache.org/viewvc?rev=1713068&view=rev
Log:
Update test classes, aligning them with Tomcat 7.
Modified:
tomcat/tc6.0.x/trunk/test/org/apache/juli/TestClassLoaderLogManager.java
tomcat/tc6.0.x/trunk/test/org/apache/tomcat/util/res/TestStringManager.java
Modified: tomcat/tc6.0.x/trunk/test/org/apache/juli/TestClassLoaderLogManager.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/test/org/apache/juli/TestClassLoaderLogManager.java?rev=1713068&r1=1713067&r2=1713068&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/test/org/apache/juli/TestClassLoaderLogManager.java (original)
+++ tomcat/tc6.0.x/trunk/test/org/apache/juli/TestClassLoaderLogManager.java Sat Nov 7 02:04:00 2015
@@ -16,51 +16,44 @@
*/
package org.apache.juli;
-import junit.framework.TestCase;
-
+import java.io.File;
import java.util.Collections;
import java.util.Random;
import java.util.logging.LogManager;
import java.util.logging.Logger;
import org.junit.Assert;
+import org.junit.Test;
/**
* Test cases for {@link ClassLoaderLogManager}.
*/
-public class TestClassLoaderLogManager extends TestCase {
+public class TestClassLoaderLogManager {
+ @Test
public void testReplace() {
ClassLoaderLogManager logManager = new ClassLoaderLogManager();
Assert.assertEquals("", logManager.replace(""));
Assert.assertEquals("${", logManager.replace("${"));
- Assert.assertEquals("${undefinedproperty}",
- logManager.replace("${undefinedproperty}"));
+ Assert.assertEquals("${undefinedproperty}", logManager.replace("${undefinedproperty}"));
Assert.assertEquals(
- System.getProperty("line.separator")
- + System.getProperty("path.separator")
- + System.getProperty("file.separator"),
- logManager
- .replace("${line.separator}${path.separator}${file.separator}"));
+ System.getProperty("line.separator") + File.pathSeparator + File.separator,
+ logManager.replace("${line.separator}${path.separator}${file.separator}"));
Assert.assertEquals(
- "foo" + System.getProperty("file.separator") + "bar"
- + System.getProperty("line.separator")
- + System.getProperty("path.separator") + "baz",
- logManager
- .replace("foo${file.separator}bar${line.separator}${path.separator}baz"));
+ "foo" + File.separator + "bar" + System.getProperty("line.separator")
+ + File.pathSeparator + "baz",
+ logManager.replace("foo${file.separator}bar${line.separator}${path.separator}baz"));
// BZ 51249
Assert.assertEquals(
- "%{file.separator}" + System.getProperty("file.separator"),
+ "%{file.separator}" + File.separator,
logManager.replace("%{file.separator}${file.separator}"));
Assert.assertEquals(
- System.getProperty("file.separator") + "${undefinedproperty}"
- + System.getProperty("file.separator"),
- logManager
- .replace("${file.separator}${undefinedproperty}${file.separator}"));
- Assert.assertEquals("${}" + System.getProperty("path.separator"),
- logManager.replace("${}${path.separator}"));
+ File.separator + "${undefinedproperty}" + File.separator,
+ logManager.replace("${file.separator}${undefinedproperty}${file.separator}"));
+ Assert.assertEquals("${}" + File.pathSeparator, logManager.replace("${}${path.separator}"));
}
+ @Test
public void testBug56082() {
ClassLoaderLogManager logManager = new ClassLoaderLogManager();
@@ -75,14 +68,10 @@ public class TestClassLoaderLogManager e
listThread.setName("LoggerList");
listThread.start();
- int count = 0;
- while (count < 4 && listThread.isAlive()) {
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- // Ignore
- }
- count++;
+ try {
+ listThread.join(2000);
+ } catch (InterruptedException e) {
+ // Ignore
}
for (int i = 0; i < createThreads.length; i ++) {
Modified: tomcat/tc6.0.x/trunk/test/org/apache/tomcat/util/res/TestStringManager.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/test/org/apache/tomcat/util/res/TestStringManager.java?rev=1713068&r1=1713067&r2=1713068&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/test/org/apache/tomcat/util/res/TestStringManager.java (original)
+++ tomcat/tc6.0.x/trunk/test/org/apache/tomcat/util/res/TestStringManager.java Sat Nov 7 02:04:00 2015
@@ -17,24 +17,28 @@
package org.apache.tomcat.util.res;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertTrue;
-public class TestStringManager extends TestCase {
+import org.junit.Test;
+
+public class TestStringManager {
private static final StringManager sm =
StringManager.getManager("org.apache.naming");
+ @Test
public void testNullKey() {
boolean iaeThrown = false;
-
+
try {
sm.getString(null);
} catch (IllegalArgumentException iae) {
iaeThrown = true;
}
- assertEquals("IAE not thrown on null key", true, iaeThrown);
+ assertTrue("IAE not thrown on null key", iaeThrown);
}
-
+
+ @Test
public void testBug46933() {
// Check null args are OK
sm.getString("namingContext.nameNotBound");
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org