diff --git a/src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java b/src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java index 3586cf913..cf1c48c7d 100644 --- a/src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java +++ b/src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java @@ -170,9 +170,9 @@ public class AntClassLoaderTest { } /** - * @see - * bug 47593, request to log the name of corrupt zip files from which - * classes cannot be loaded + * @see bug 47593 + * request to log the name of corrupt zip files from which + * classes cannot be loaded */ @Test public void testInvalidZipException() { @@ -204,8 +204,7 @@ public class AntClassLoaderTest { * Asserts that getResources won't return resources that cannot be * seen by AntClassLoader but by ClassLoader.this.parent. * - * @see - * https://issues.apache.org/bugzilla/show_bug.cgi?id=46752 + * @see bug 46752 */ @SuppressWarnings("resource") @Test diff --git a/src/tests/junit/org/apache/tools/ant/IncludeTest.java b/src/tests/junit/org/apache/tools/ant/IncludeTest.java index 444008dd9..17141db37 100644 --- a/src/tests/junit/org/apache/tools/ant/IncludeTest.java +++ b/src/tests/junit/org/apache/tools/ant/IncludeTest.java @@ -86,6 +86,7 @@ public class IncludeTest { @Test public void testTaskErrorInIncluding() { + // TODO the test breaks in IDE thrown.expect(BuildException.class); thrown.expect(hasProperty("location", both(hasProperty("fileName", containsString("build.xml"))) @@ -104,6 +105,7 @@ public class IncludeTest { @Test public void testTaskErrorInIncluded() { + // TODO the test breaks in IDE thrown.expect(BuildException.class); thrown.expect(hasProperty("location", both(hasProperty("fileName", containsString("included_file.xml"))) diff --git a/src/tests/junit/org/apache/tools/ant/ProjectTest.java b/src/tests/junit/org/apache/tools/ant/ProjectTest.java index b98cf732f..c1b3f72d3 100644 --- a/src/tests/junit/org/apache/tools/ant/ProjectTest.java +++ b/src/tests/junit/org/apache/tools/ant/ProjectTest.java @@ -309,8 +309,7 @@ public class ProjectTest { } /** - * @see - * https://issues.apache.org/bugzilla/show_bug.cgi?id=47623 + * @see bug 47623 */ @Test public void testNullThrowableMessageLog() { diff --git a/src/tests/junit/org/apache/tools/ant/TaskContainerTest.java b/src/tests/junit/org/apache/tools/ant/TaskContainerTest.java index 888bbeb6f..69c51c238 100644 --- a/src/tests/junit/org/apache/tools/ant/TaskContainerTest.java +++ b/src/tests/junit/org/apache/tools/ant/TaskContainerTest.java @@ -48,20 +48,18 @@ public class TaskContainerTest { public void testTaskdef() { buildRule.executeTarget("testTaskdef"); assertThat("attribute worked", buildRule.getLog(), - containsString(("As attribute: it worked"))); - assertThat("nested text worked", buildRule.getLog(), - containsString(("As nested text: it worked"))); + containsString("As attribute: it worked")); assertThat("nested text worked", buildRule.getLog(), - containsString(("As nested task: it worked"))); + containsString("As nested text: it worked")); } @Test public void testCaseInsensitive() { buildRule.executeTarget("testCaseInsensitive"); assertThat("works outside of container", buildRule.getLog(), - containsString(("hello "))); + containsString("hello ")); assertThat("works inside of container", buildRule.getLog(), - containsString(("world"))); + containsString("world")); } } diff --git a/src/tests/junit/org/apache/tools/ant/UnknownElementTest.java b/src/tests/junit/org/apache/tools/ant/UnknownElementTest.java index d60f22fef..f40151ff7 100644 --- a/src/tests/junit/org/apache/tools/ant/UnknownElementTest.java +++ b/src/tests/junit/org/apache/tools/ant/UnknownElementTest.java @@ -49,8 +49,7 @@ public class UnknownElementTest { /** * Not really a UnknownElement test but rather one of "what * information is available in taskFinished". - * @see - * https://issues.apache.org/bugzilla/show_bug.cgi?id=26197 + * @see bug 26197 */ @Test @Ignore("Previously disabled through naming convention") diff --git a/src/tests/junit/org/apache/tools/ant/XmlLoggerTest.java b/src/tests/junit/org/apache/tools/ant/XmlLoggerTest.java index 58fc0a834..16b3e4b19 100644 --- a/src/tests/junit/org/apache/tools/ant/XmlLoggerTest.java +++ b/src/tests/junit/org/apache/tools/ant/XmlLoggerTest.java @@ -23,9 +23,12 @@ import org.junit.Test; public class XmlLoggerTest { + /** + * "NPE in XmlLogger.buildFinished" + * + * @see bug 56850 + */ @Test - // see https://issues.apache.org/bugzilla/show_bug.cgi?id=56850 - // "NPE in XmlLogger.buildFinished" public void test() { final XmlLogger logger = new XmlLogger(); final Cvs task = new Cvs(); diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/AntlibTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/AntlibTest.java index c056a0813..9fc99f346 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/AntlibTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/AntlibTest.java @@ -58,7 +58,7 @@ public class AntlibTest { /** * Confirms that all matching resources will be used, so that you * can collect several antlibs in one Definer call. - * @see "http://issues.apache.org/bugzilla/show_bug.cgi?id=24024" + * @see bug 24024 */ @Test public void testAntlibResource() { diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/ParallelTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/ParallelTest.java index 545e5a429..603cf5789 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/ParallelTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/ParallelTest.java @@ -164,7 +164,7 @@ public class ParallelTest { } /** - * @see "https://issues.apache.org/bugzilla/show_bug.cgi?id=55539" + * @see bug 55539 */ @Test public void testSingleExit() { @@ -177,7 +177,7 @@ public class ParallelTest { } /** - * @see "https://issues.apache.org/bugzilla/show_bug.cgi?id=55539" + * @see bug 55539 */ @Test public void testExitAndOtherException() { diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/SubAntTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/SubAntTest.java index fa2ee2c0f..4c31f78fc 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/SubAntTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/SubAntTest.java @@ -144,7 +144,7 @@ public class SubAntTest { } public void targetStarted(BuildEvent event) { - if (event.getTarget().getName().equals("")) { + if (event.getTarget().getName().isEmpty()) { return; } if (error == null) { diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/vss/MSVSSTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/vss/MSVSSTest.java index 5d27f5730..62fbea14b 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/vss/MSVSSTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/vss/MSVSSTest.java @@ -36,6 +36,7 @@ import org.junit.Rule; import org.junit.Test; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.fail; /** @@ -445,7 +446,7 @@ public class MSVSSTest implements MSVSSConstants { while (testIndex < testLength) { try { - if (sGeneratedCmdLine[genIndex].equals("")) { + if (sGeneratedCmdLine[genIndex].isEmpty()) { genIndex++; continue; } @@ -462,13 +463,11 @@ public class MSVSSTest implements MSVSSConstants { // Count the number of empty strings int cnt = 0; for (String argument : sGeneratedCmdLine) { - if (argument.equals("")) { + if (argument.isEmpty()) { cnt++; } } - if (genLength - cnt > sTestCmdLine.length) { - // We have extra elements - fail("extra args"); - } + // We have extra elements + assertFalse("extra args", genLength - cnt > sTestCmdLine.length); } } diff --git a/src/tests/junit/org/apache/tools/ant/util/DateUtilsTest.java b/src/tests/junit/org/apache/tools/ant/util/DateUtilsTest.java index ca223d9cf..08e3a88c9 100644 --- a/src/tests/junit/org/apache/tools/ant/util/DateUtilsTest.java +++ b/src/tests/junit/org/apache/tools/ant/util/DateUtilsTest.java @@ -43,7 +43,9 @@ public class DateUtilsTest { assertEquals("2 minutes 1 second", text); } - // https://issues.apache.org/bugzilla/show_bug.cgi?id=44659 + /** + * @see bug 44659 + */ @Test public void testLongElapsedTime() { assertEquals("2926 minutes 13 seconds", diff --git a/src/tests/junit/org/apache/tools/zip/ZipEntryTest.java b/src/tests/junit/org/apache/tools/zip/ZipEntryTest.java index 290694ffc..7e1e3c761 100644 --- a/src/tests/junit/org/apache/tools/zip/ZipEntryTest.java +++ b/src/tests/junit/org/apache/tools/zip/ZipEntryTest.java @@ -32,7 +32,6 @@ import static org.junit.Assert.fail; */ public class ZipEntryTest { - /** * test handling of extra fields */ @@ -203,8 +202,7 @@ public class ZipEntryTest { /** * Test case for - * COMPRESS-94. + * COMPRESS-94 */ @Test public void testNotEquals() {