bodewig 01/10/23 03:35:15
Modified: . WHATSNEW
src/testcases/org/apache/tools/ant DirectoryScannerTest.java
IntrospectionHelperTest.java ProjectTest.java
src/testcases/org/apache/tools/ant/taskdefs
AvailableTest.java CVSPassTest.java
ExecuteWatchdogTest.java JarTest.java
SleepTest.java
src/testcases/org/apache/tools/ant/taskdefs/optional
ANTLRTest.java
src/testcases/org/apache/tools/ant/types
CommandlineJavaTest.java
EnumeratedAttributeTest.java MapperTest.java
PathTest.java
src/testcases/org/apache/tools/ant/util
DOMElementWriterTest.java
src/testcases/org/apache/tools/ant/util/regexp
RegexpMatcherTest.java
src/testcases/org/apache/tools/zip AsiExtraFieldTest.java
ExtraFieldUtilsTest.java ZipLongTest.java
ZipShortTest.java
Log:
assert -> assertTrue in all testcases.
Revision Changes Path
1.156 +3 -0 jakarta-ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
retrieving revision 1.155
retrieving revision 1.156
diff -u -r1.155 -r1.156
--- WHATSNEW 2001/10/18 08:25:16 1.155
+++ WHATSNEW 2001/10/23 10:35:14 1.156
@@ -17,6 +17,9 @@
* Added a new condition <isset> that test for the existence of a
property to the condition task.
+* Ant's testcases require JUnit 3.7 or above as they now use the new
+ assertTrue method instead of assert.
+
Fixed bugs:
-----------
1.3 +4 -4
jakarta-ant/src/testcases/org/apache/tools/ant/DirectoryScannerTest.java
Index: DirectoryScannerTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/DirectoryScannerTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DirectoryScannerTest.java 2001/07/16 06:36:44 1.2
+++ DirectoryScannerTest.java 2001/10/23 10:35:14 1.3
@@ -87,8 +87,8 @@
haveTaskdefsPackage = true;
}
}
- assert("(1) zip package included", haveZipPackage);
- assert("(1) taskdefs package not included", !haveTaskdefsPackage);
+ assertTrue("(1) zip package included", haveZipPackage);
+ assertTrue("(1) taskdefs package not included",
!haveTaskdefsPackage);
ds = new DirectoryScanner();
ds.setBasedir(dir);
@@ -103,8 +103,8 @@
haveTaskdefsPackage = true;
}
}
- assert("(2) zip package included", haveZipPackage);
- assert("(2) taskdefs package included", haveTaskdefsPackage);
+ assertTrue("(2) zip package included", haveZipPackage);
+ assertTrue("(2) taskdefs package included", haveTaskdefsPackage);
}
1.9 +20 -20
jakarta-ant/src/testcases/org/apache/tools/ant/IntrospectionHelperTest.java
Index: IntrospectionHelperTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/IntrospectionHelperTest.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- IntrospectionHelperTest.java 2001/10/18 08:25:16 1.8
+++ IntrospectionHelperTest.java 2001/10/23 10:35:14 1.9
@@ -94,15 +94,15 @@
ih.addText(p, this, "test2");
fail("test2 shouldn\'t be equal to test");
} catch (BuildException be) {
- assert(be.getException() instanceof AssertionFailedError);
+ assertTrue(be.getException() instanceof AssertionFailedError);
}
}
public void testSupportsCharacters() {
IntrospectionHelper ih =
IntrospectionHelper.getHelper(java.lang.String.class);
- assert("String doesn\'t support addText", !ih.supportsCharacters());
+ assertTrue("String doesn\'t support addText",
!ih.supportsCharacters());
ih = IntrospectionHelper.getHelper(getClass());
- assert("IntrospectionHelperTest supports addText",
+ assertTrue("IntrospectionHelperTest supports addText",
ih.supportsCharacters());
}
@@ -177,14 +177,14 @@
ih.createElement(p, this, "fourteen");
fail("fourteen throws NullPointerException");
} catch (BuildException be) {
- assert(be.getException() instanceof NullPointerException);
+ assertTrue(be.getException() instanceof NullPointerException);
}
try {
ih.createElement(p, this, "fourteen");
fail("fifteen throws NullPointerException");
} catch (BuildException be) {
- assert(be.getException() instanceof NullPointerException);
+ assertTrue(be.getException() instanceof NullPointerException);
}
}
@@ -204,7 +204,7 @@
assertEquals("Return type of "+name, expect,
ih.getElementType(name));
h.remove(name);
}
- assert("Found all", h.isEmpty());
+ assertTrue("Found all", h.isEmpty());
}
public Object createTwo(String s) {
@@ -288,76 +288,76 @@
ih.setAttribute(p, this, "seven", "3");
fail("2 shouldn't be equals to three");
} catch (BuildException be) {
- assert(be.getException() instanceof AssertionFailedError);
+ assertTrue(be.getException() instanceof AssertionFailedError);
}
ih.setAttribute(p, this, "eight", "2");
try {
ih.setAttribute(p, this, "eight", "3");
fail("2 shouldn't be equals to three - as int");
} catch (BuildException be) {
- assert(be.getException() instanceof AssertionFailedError);
+ assertTrue(be.getException() instanceof AssertionFailedError);
}
ih.setAttribute(p, this, "nine", "2");
try {
ih.setAttribute(p, this, "nine", "3");
fail("2 shouldn't be equals to three - as Integer");
} catch (BuildException be) {
- assert(be.getException() instanceof AssertionFailedError);
+ assertTrue(be.getException() instanceof AssertionFailedError);
}
ih.setAttribute(p, this, "ten", "2");
try {
ih.setAttribute(p, this, "ten", "3");
fail("/tmp/2 shouldn't be equals to /tmp/3");
} catch (BuildException be) {
- assert(be.getException() instanceof AssertionFailedError);
+ assertTrue(be.getException() instanceof AssertionFailedError);
}
ih.setAttribute(p, this, "eleven", "2");
try {
ih.setAttribute(p, this, "eleven", "on");
fail("on shouldn't be false");
} catch (BuildException be) {
- assert(be.getException() instanceof AssertionFailedError);
+ assertTrue(be.getException() instanceof AssertionFailedError);
}
ih.setAttribute(p, this, "twelve", "2");
try {
ih.setAttribute(p, this, "twelve", "on");
fail("on shouldn't be false");
} catch (BuildException be) {
- assert(be.getException() instanceof AssertionFailedError);
+ assertTrue(be.getException() instanceof AssertionFailedError);
}
ih.setAttribute(p, this, "thirteen", "org.apache.tools.ant.Project");
try {
ih.setAttribute(p, this, "thirteen",
"org.apache.tools.ant.ProjectHelper");
fail("org.apache.tools.ant.Project shouldn't be equal to
org.apache.tools.ant.ProjectHelper");
} catch (BuildException be) {
- assert(be.getException() instanceof AssertionFailedError);
+ assertTrue(be.getException() instanceof AssertionFailedError);
}
try {
ih.setAttribute(p, this, "thirteen",
"org.apache.tools.ant.Project2");
fail("org.apache.tools.ant.Project2 doesn't exist");
} catch (BuildException be) {
- assert(be.getException() instanceof ClassNotFoundException);
+ assertTrue(be.getException() instanceof ClassNotFoundException);
}
ih.setAttribute(p, this, "fourteen", "2");
try {
ih.setAttribute(p, this, "fourteen", "on");
fail("2 shouldn't be equals to three - as StringBuffer");
} catch (BuildException be) {
- assert(be.getException() instanceof AssertionFailedError);
+ assertTrue(be.getException() instanceof AssertionFailedError);
}
ih.setAttribute(p, this, "fifteen", "abcd");
try {
ih.setAttribute(p, this, "fifteen", "on");
fail("o shouldn't be equal to a");
} catch (BuildException be) {
- assert(be.getException() instanceof AssertionFailedError);
+ assertTrue(be.getException() instanceof AssertionFailedError);
}
ih.setAttribute(p, this, "sixteen", "abcd");
try {
ih.setAttribute(p, this, "sixteen", "on");
fail("o shouldn't be equal to a");
} catch (BuildException be) {
- assert(be.getException() instanceof AssertionFailedError);
+ assertTrue(be.getException() instanceof AssertionFailedError);
}
}
@@ -394,7 +394,7 @@
h.remove(name);
}
h.remove("name");
- assert("Found all", h.isEmpty());
+ assertTrue("Found all", h.isEmpty());
}
public int setTwo(String s) {
@@ -432,11 +432,11 @@
}
public void setEleven(boolean b) {
- assert(!b);
+ assertTrue(!b);
}
public void setTwelve(Boolean b) {
- assert(!b.booleanValue());
+ assertTrue(!b.booleanValue());
}
public void setThirteen(Class c) {
1.7 +3 -3
jakarta-ant/src/testcases/org/apache/tools/ant/ProjectTest.java
Index: ProjectTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/ProjectTest.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ProjectTest.java 2001/08/08 16:13:08 1.6
+++ ProjectTest.java 2001/10/23 10:35:14 1.7
@@ -87,10 +87,10 @@
p.createDataType("dummy"));
Object o = p.createDataType("fileset");
assertNotNull("fileset is a known type", o);
- assert("fileset creates FileSet", o instanceof FileSet);
- assert("PatternSet",
+ assertTrue("fileset creates FileSet", o instanceof FileSet);
+ assertTrue("PatternSet",
p.createDataType("patternset") instanceof PatternSet);
- assert("Path", p.createDataType("path") instanceof Path);
+ assertTrue("Path", p.createDataType("path") instanceof Path);
}
/**
1.5 +3 -3
jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/AvailableTest.java
Index: AvailableTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/AvailableTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AvailableTest.java 2001/05/03 11:16:53 1.4
+++ AvailableTest.java 2001/10/23 10:35:14 1.5
@@ -85,7 +85,7 @@
// file doesn't exist -> property 'test' == null
public void test4() {
executeTarget("test4");
- assert(project.getProperty("test") == null);
+ assertTrue(project.getProperty("test") == null);
}
// file does exist -> property 'test' == 'true'
@@ -97,7 +97,7 @@
// resource doesn't exist -> property 'test' == null
public void test6() {
executeTarget("test6");
- assert(project.getProperty("test") == null);
+ assertTrue(project.getProperty("test") == null);
}
// resource does exist -> property 'test' == 'true'
@@ -109,7 +109,7 @@
// class doesn't exist -> property 'test' == null
public void test8() {
executeTarget("test8");
- assert(project.getProperty("test") == null);
+ assertTrue(project.getProperty("test") == null);
}
// class does exist -> property 'test' == 'true'
1.3 +3 -3
jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/CVSPassTest.java
Index: CVSPassTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/CVSPassTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CVSPassTest.java 2001/05/01 11:37:56 1.2
+++ CVSPassTest.java 2001/10/23 10:35:14 1.3
@@ -106,7 +106,7 @@
executeTarget("test3");
File f = new File(getProjectDir(), "testpassfile.tmp");
- assert( "Passfile "+f+" not created", f.exists());
+ assertTrue( "Passfile "+f+" not created", f.exists());
assertEquals(JAKARTA_URL+EOL, readFile(f));
@@ -116,7 +116,7 @@
executeTarget("test4");
File f = new File(getProjectDir(), "testpassfile.tmp");
- assert( "Passfile "+f+" not created", f.exists());
+ assertTrue( "Passfile "+f+" not created", f.exists());
assertEquals(
JAKARTA_URL+ EOL+
@@ -128,7 +128,7 @@
executeTarget("test5");
File f = new File(getProjectDir(), "testpassfile.tmp");
- assert( "Passfile "+f+" not created", f.exists());
+ assertTrue( "Passfile "+f+" not created", f.exists());
assertEquals(
JAKARTA_URL+ EOL+
1.5 +8 -8
jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java
Index: ExecuteWatchdogTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ExecuteWatchdogTest.java 2001/04/24 08:42:01 1.4
+++ ExecuteWatchdogTest.java 2001/10/23 10:35:14 1.5
@@ -138,7 +138,7 @@
Process process = getProcess(TIME_OUT/2);
watchdog.start(process);
int retCode = waitForEnd(process);
- assert("process should not have been killed",
!watchdog.killedProcess());
+ assertTrue("process should not have been killed",
!watchdog.killedProcess());
assertEquals(0, retCode);
}
@@ -149,10 +149,10 @@
watchdog.start(process);
int retCode = process.waitFor();
long elapsed = System.currentTimeMillis() - now;
- assert("process should have been killed",
watchdog.killedProcess());
- // assert("return code is invalid: " + retCode,
retCode!=0);
- assert("elapse time is less than timeout value", elapsed >
TIME_OUT);
- assert("elapse time is greater than run value", elapsed <
TIME_OUT*2);
+ assertTrue("process should have been killed",
watchdog.killedProcess());
+ // assertTrue("return code is invalid: " +
retCode, retCode!=0);
+ assertTrue("elapse time is less than timeout value", elapsed >
TIME_OUT);
+ assertTrue("elapse time is greater than run value", elapsed <
TIME_OUT*2);
}
// test a process that runs and failed
@@ -160,8 +160,8 @@
Process process = getProcess(-1); // process should abort
watchdog.start(process);
int retCode = process.waitFor();
- assert("process should not have been killed",
!watchdog.killedProcess());
- assert("return code is invalid: " + retCode, retCode!=0);
+ assertTrue("process should not have been killed",
!watchdog.killedProcess());
+ assertTrue("return code is invalid: " + retCode, retCode!=0);
}
public void testManualStop() throws Exception {
@@ -192,7 +192,7 @@
// process should be dead and well finished
assertEquals(0, process.exitValue());
- assert("process should not have been killed",
!watchdog.killedProcess());
+ assertTrue("process should not have been killed",
!watchdog.killedProcess());
}
public static class TimeProcess {
1.4 +1 -1
jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/JarTest.java
Index: JarTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/JarTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JarTest.java 2001/03/08 15:17:25 1.3
+++ JarTest.java 2001/10/23 10:35:14 1.4
@@ -88,7 +88,7 @@
public void test4() {
executeTarget("test4");
File jarFile = new File(getProjectDir(), tempJar);
- assert(jarFile.exists());
+ assertTrue(jarFile.exists());
jarModifiedDate = jarFile.lastModified();
}
1.3 +5 -5
jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/SleepTest.java
Index: SleepTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/SleepTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SleepTest.java 2001/10/18 23:53:03 1.2
+++ SleepTest.java 2001/10/23 10:35:14 1.3
@@ -78,7 +78,7 @@
executeTarget("test1");
timer.stop();
if(TRACE) System.out.println(" test1 elapsed time="+timer.time());
- assert(timer.time()>=0);
+ assertTrue(timer.time()>=0);
}
public void test2() {
@@ -86,7 +86,7 @@
executeTarget("test2");
timer.stop();
if(TRACE) System.out.println(" test2 elapsed time="+timer.time());
- assert(timer.time()>=0);
+ assertTrue(timer.time()>=0);
}
public void test3() {
@@ -94,7 +94,7 @@
executeTarget("test3");
timer.stop();
if(TRACE) System.out.println(" test3 elapsed time="+timer.time());
- assert(timer.time()>=(2000-ERROR_RANGE));
+ assertTrue(timer.time()>=(2000-ERROR_RANGE));
}
public void test4() {
@@ -102,7 +102,7 @@
executeTarget("test3");
timer.stop();
if(TRACE) System.out.println(" test4 elapsed time="+timer.time());
- assert(timer.time()>=(2000-ERROR_RANGE) && timer.time()<60000);
+ assertTrue(timer.time()>=(2000-ERROR_RANGE) && timer.time()<60000);
}
public void test5() {
@@ -115,7 +115,7 @@
executeTarget("test6");
timer.stop();
if(TRACE) System.out.println(" test6 elapsed time="+timer.time());
- assert(timer.time()<2000);
+ assertTrue(timer.time()<2000);
}
1.4 +1 -1
jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/ANTLRTest.java
Index: ANTLRTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/ANTLRTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ANTLRTest.java 2001/02/18 13:44:44 1.3
+++ ANTLRTest.java 2001/10/23 10:35:14 1.4
@@ -83,7 +83,7 @@
executeTarget("test3");
File outputDirectory = new File(TASKDEFS_DIR + "antlr.tmp");
String[] calcFiles = outputDirectory.list(new CalcFileFilter());
- assert(5 == calcFiles.length);
+ assertEquals(5, calcFiles.length);
}
public void test4() {
1.8 +3 -3
jakarta-ant/src/testcases/org/apache/tools/ant/types/CommandlineJavaTest.java
Index: CommandlineJavaTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/types/CommandlineJavaTest.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- CommandlineJavaTest.java 2001/07/18 11:31:16 1.7
+++ CommandlineJavaTest.java 2001/10/23 10:35:14 1.8
@@ -93,7 +93,7 @@
* here without using the same logic as applied in the class
* itself.
*
- * assert("no classpath", "java", s[0]);
+ * assertTrue("no classpath", "java", s[0]);
*/
assertEquals("no classpath", "-Djava.compiler=NONE", s[1]);
assertEquals("no classpath", "junit.textui.TestRunner", s[2]);
@@ -112,9 +112,9 @@
// assertEquals("with classpath", "java", s[0]);
assertEquals("with classpath", "-Djava.compiler=NONE", s[1]);
assertEquals("with classpath", "-classpath", s[2]);
- assert("junit.jar contained",
+ assertTrue("junit.jar contained",
s[3].indexOf("junit.jar"+java.io.File.pathSeparator) >= 0);
- assert("ant.jar contained", s[3].endsWith("ant.jar"));
+ assertTrue("ant.jar contained", s[3].endsWith("ant.jar"));
assertEquals("with classpath", "junit.textui.TestRunner", s[4]);
assertEquals("with classpath",
"org.apache.tools.ant.CommandlineJavaTest", s[5]);
1.4 +4 -4
jakarta-ant/src/testcases/org/apache/tools/ant/types/EnumeratedAttributeTest.java
Index: EnumeratedAttributeTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/types/EnumeratedAttributeTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- EnumeratedAttributeTest.java 2001/05/23 16:58:34 1.3
+++ EnumeratedAttributeTest.java 2001/10/23 10:35:14 1.4
@@ -76,14 +76,14 @@
public void testContains() {
EnumeratedAttribute t1 = new TestNormal();
for (int i=0; i<expected.length; i++) {
- assert(expected[i]+" is in TestNormal",
+ assertTrue(expected[i]+" is in TestNormal",
t1.containsValue(expected[i]));
- assert(expected[i].toUpperCase()+" is in TestNormal",
+ assertTrue(expected[i].toUpperCase()+" is in TestNormal",
!t1.containsValue(expected[i].toUpperCase()));
}
- assert("TestNormal doesn\'t have \"d\" attribute",
+ assertTrue("TestNormal doesn\'t have \"d\" attribute",
!t1.containsValue("d"));
- assert("TestNull doesn\'t have \"d\" attribute and doesn\'t die",
+ assertTrue("TestNull doesn\'t have \"d\" attribute and doesn\'t die",
!(new TestNull()).containsValue("d"));
}
1.4 +1 -1
jakarta-ant/src/testcases/org/apache/tools/ant/types/MapperTest.java
Index: MapperTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/types/MapperTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MapperTest.java 2001/03/02 16:01:13 1.3
+++ MapperTest.java 2001/10/23 10:35:14 1.4
@@ -170,7 +170,7 @@
m3.setFrom("*.java");
m3.setTo("*.class");
FileNameMapper fmm = m1.getImplementation();
- assert("should be glob", fmm instanceof GlobPatternMapper);
+ assertTrue("should be glob", fmm instanceof GlobPatternMapper);
String[] result = fmm.mapFileName("a.java");
assertEquals("a.java should match", 1, result.length);
assertEquals("a.class", result[0]);
1.10 +2 -2
jakarta-ant/src/testcases/org/apache/tools/ant/types/PathTest.java
Index: PathTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/types/PathTest.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- PathTest.java 2001/10/13 02:00:17 1.9
+++ PathTest.java 2001/10/23 10:35:14 1.10
@@ -135,7 +135,7 @@
l = p.list();
if (isUnixStyle) {
assertEquals("no drives on Unix", 2, l.length);
- assert("c resolved relative to project\'s basedir",
+ assertTrue("c resolved relative to project\'s basedir",
l[0].endsWith("/c"));
assertEquals("/test", l[1]);
} else if (isNetWare) {
@@ -150,7 +150,7 @@
l = p.list();
if (isUnixStyle) {
assertEquals("no drives on Unix", 2, l.length);
- assert("c resolved relative to project\'s basedir",
+ assertTrue("c resolved relative to project\'s basedir",
l[0].endsWith("/c"));
assertEquals("/test", l[1]);
} else if (isNetWare) {
1.3 +11 -11
jakarta-ant/src/testcases/org/apache/tools/ant/util/DOMElementWriterTest.java
Index: DOMElementWriterTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/util/DOMElementWriterTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DOMElementWriterTest.java 2001/01/03 14:18:51 1.2
+++ DOMElementWriterTest.java 2001/10/23 10:35:14 1.3
@@ -72,17 +72,17 @@
}
public void testIsReference() {
- assert("", w.isReference(""));
- assert(" ", w.isReference(" "));
- assert(" ", w.isReference(" "));
- assert("&#A0;", !w.isReference("&#A0;"));
- assert("20;", !w.isReference("20;"));
- assert("", !w.isReference(""));
- assert(""", w.isReference("""));
- assert("'", w.isReference("'"));
- assert(">", w.isReference(">"));
- assert("<", w.isReference("<"));
- assert("&", w.isReference("&"));
+ assertTrue("", w.isReference(""));
+ assertTrue(" ", w.isReference(" "));
+ assertTrue(" ", w.isReference(" "));
+ assertTrue("&#A0;", !w.isReference("&#A0;"));
+ assertTrue("20;", !w.isReference("20;"));
+ assertTrue("", !w.isReference(""));
+ assertTrue(""", w.isReference("""));
+ assertTrue("'", w.isReference("'"));
+ assertTrue(">", w.isReference(">"));
+ assertTrue("<", w.isReference("<"));
+ assertTrue("&", w.isReference("&"));
}
public void testEncode() {
1.3 +17 -17
jakarta-ant/src/testcases/org/apache/tools/ant/util/regexp/RegexpMatcherTest.java
Index: RegexpMatcherTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/util/regexp/RegexpMatcherTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- RegexpMatcherTest.java 2001/01/03 14:18:52 1.2
+++ RegexpMatcherTest.java 2001/10/23 10:35:14 1.3
@@ -76,28 +76,28 @@
public void testMatches() {
RegexpMatcher reg = getImplementation();
reg.setPattern("aaaa");
- assert("aaaa should match itself", reg.matches("aaaa"));
- assert("aaaa should match xaaaa", reg.matches("xaaaa"));
- assert("aaaa shouldn\'t match xaaa", !reg.matches("xaaa"));
+ assertTrue("aaaa should match itself", reg.matches("aaaa"));
+ assertTrue("aaaa should match xaaaa", reg.matches("xaaaa"));
+ assertTrue("aaaa shouldn\'t match xaaa", !reg.matches("xaaa"));
reg.setPattern("^aaaa");
- assert("^aaaa shouldn\'t match xaaaa", !reg.matches("xaaaa"));
- assert("^aaaa should match aaaax", reg.matches("aaaax"));
+ assertTrue("^aaaa shouldn\'t match xaaaa", !reg.matches("xaaaa"));
+ assertTrue("^aaaa should match aaaax", reg.matches("aaaax"));
reg.setPattern("aaaa$");
- assert("aaaa$ shouldn\'t match aaaax", !reg.matches("aaaax"));
- assert("aaaa$ should match xaaaa", reg.matches("xaaaa"));
+ assertTrue("aaaa$ shouldn\'t match aaaax", !reg.matches("aaaax"));
+ assertTrue("aaaa$ should match xaaaa", reg.matches("xaaaa"));
reg.setPattern("[0-9]+");
- assert("[0-9]+ should match 123", reg.matches("123"));
- assert("[0-9]+ should match 1", reg.matches("1"));
- assert("[0-9]+ shouldn\'t match \'\'", !reg.matches(""));
- assert("[0-9]+ shouldn\'t match a", !reg.matches("a"));
+ assertTrue("[0-9]+ should match 123", reg.matches("123"));
+ assertTrue("[0-9]+ should match 1", reg.matches("1"));
+ assertTrue("[0-9]+ shouldn\'t match \'\'", !reg.matches(""));
+ assertTrue("[0-9]+ shouldn\'t match a", !reg.matches("a"));
reg.setPattern("[0-9]*");
- assert("[0-9]* should match 123", reg.matches("123"));
- assert("[0-9]* should match 1", reg.matches("1"));
- assert("[0-9]* should match \'\'", reg.matches(""));
- assert("[0-9]* should match a", reg.matches("a"));
+ assertTrue("[0-9]* should match 123", reg.matches("123"));
+ assertTrue("[0-9]* should match 1", reg.matches("1"));
+ assertTrue("[0-9]* should match \'\'", reg.matches(""));
+ assertTrue("[0-9]* should match a", reg.matches("a"));
reg.setPattern("([0-9]+)=\\1");
- assert("([0-9]+)=\\1 should match 1=1", reg.matches("1=1"));
- assert("([0-9]+)=\\1 shouldn\'t match 1=2", !reg.matches("1=2"));
+ assertTrue("([0-9]+)=\\1 should match 1=1", reg.matches("1=1"));
+ assertTrue("([0-9]+)=\\1 shouldn\'t match 1=2", !reg.matches("1=2"));
}
public void testGroups() {
1.2 +6 -6
jakarta-ant/src/testcases/org/apache/tools/zip/AsiExtraFieldTest.java
Index: AsiExtraFieldTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/zip/AsiExtraFieldTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AsiExtraFieldTest.java 2001/04/23 16:12:25 1.1
+++ AsiExtraFieldTest.java 2001/10/23 10:35:14 1.2
@@ -126,8 +126,8 @@
a.parseFromLocalFileData(data, 0, data.length);
assertEquals("length plain file", data.length,
a.getLocalFileDataLength().getValue());
- assert("plain file, no link", !a.isLink());
- assert("plain file, no dir", !a.isDirectory());
+ assertTrue("plain file, no link", !a.isLink());
+ assertTrue("plain file, no dir", !a.isDirectory());
assertEquals("mode plain file", FILE_FLAG | 0123, a.getMode());
assertEquals("uid plain file", 5, a.getUserId());
assertEquals("gid plain file", 6, a.getGroupId());
@@ -141,8 +141,8 @@
a.parseFromLocalFileData(data, 0, data.length);
assertEquals("length link", data.length,
a.getLocalFileDataLength().getValue());
- assert("link, is link", a.isLink());
- assert("link, no dir", !a.isDirectory());
+ assertTrue("link, is link", a.isLink());
+ assertTrue("link, no dir", !a.isDirectory());
assertEquals("mode link", LINK_FLAG | 0123, a.getMode());
assertEquals("uid link", 5, a.getUserId());
assertEquals("gid link", 6, a.getGroupId());
@@ -156,8 +156,8 @@
a.parseFromLocalFileData(data, 0, data.length);
assertEquals("length dir", data.length,
a.getLocalFileDataLength().getValue());
- assert("dir, no link", !a.isLink());
- assert("dir, is dir", a.isDirectory());
+ assertTrue("dir, no link", !a.isLink());
+ assertTrue("dir, is dir", a.isDirectory());
assertEquals("mode dir", DIR_FLAG | 0123, a.getMode());
assertEquals("uid dir", 5, a.getUserId());
assertEquals("gid dir", 6, a.getGroupId());
1.2 +2 -2
jakarta-ant/src/testcases/org/apache/tools/zip/ExtraFieldUtilsTest.java
Index: ExtraFieldUtilsTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/zip/ExtraFieldUtilsTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ExtraFieldUtilsTest.java 2001/04/23 16:12:25 1.1
+++ ExtraFieldUtilsTest.java 2001/10/23 10:35:14 1.2
@@ -101,10 +101,10 @@
public void testParse() throws Exception {
ZipExtraField[] ze = ExtraFieldUtils.parse(data);
assertEquals("number of fields", 2, ze.length);
- assert("type field 1", ze[0] instanceof AsiExtraField);
+ assertTrue("type field 1", ze[0] instanceof AsiExtraField);
assertEquals("mode field 1", 040755,
((AsiExtraField) ze[0]).getMode());
- assert("type field 2", ze[1] instanceof UnrecognizedExtraField);
+ assertTrue("type field 2", ze[1] instanceof UnrecognizedExtraField);
assertEquals("data length field 2", 0,
ze[1].getLocalFileDataLength().getValue());
1.2 +6 -6
jakarta-ant/src/testcases/org/apache/tools/zip/ZipLongTest.java
Index: ZipLongTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/zip/ZipLongTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ZipLongTest.java 2001/04/23 16:12:25 1.1
+++ ZipLongTest.java 2001/10/23 10:35:14 1.2
@@ -97,15 +97,15 @@
ZipLong zl2 = new ZipLong(0x12345678);
ZipLong zl3 = new ZipLong(0x87654321);
- assert("reflexive", zl.equals(zl));
+ assertTrue("reflexive", zl.equals(zl));
- assert("works", zl.equals(zl2));
- assert("works, part two", !zl.equals(zl3));
+ assertTrue("works", zl.equals(zl2));
+ assertTrue("works, part two", !zl.equals(zl3));
- assert("symmetric", zl2.equals(zl));
+ assertTrue("symmetric", zl2.equals(zl));
- assert("null handling", !zl.equals(null));
- assert("non ZipLong handling", !zl.equals(new Integer(0x1234)));
+ assertTrue("null handling", !zl.equals(null));
+ assertTrue("non ZipLong handling", !zl.equals(new Integer(0x1234)));
}
/**
1.2 +6 -6
jakarta-ant/src/testcases/org/apache/tools/zip/ZipShortTest.java
Index: ZipShortTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/zip/ZipShortTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ZipShortTest.java 2001/04/23 16:12:25 1.1
+++ ZipShortTest.java 2001/10/23 10:35:14 1.2
@@ -95,15 +95,15 @@
ZipShort zs2 = new ZipShort(0x1234);
ZipShort zs3 = new ZipShort(0x5678);
- assert("reflexive", zs.equals(zs));
+ assertTrue("reflexive", zs.equals(zs));
- assert("works", zs.equals(zs2));
- assert("works, part two", !zs.equals(zs3));
+ assertTrue("works", zs.equals(zs2));
+ assertTrue("works, part two", !zs.equals(zs3));
- assert("symmetric", zs2.equals(zs));
+ assertTrue("symmetric", zs2.equals(zs));
- assert("null handling", !zs.equals(null));
- assert("non ZipShort handling", !zs.equals(new Integer(0x1234)));
+ assertTrue("null handling", !zs.equals(null));
+ assertTrue("non ZipShort handling", !zs.equals(new Integer(0x1234)));
}
/**