| @@ -18,8 +18,6 @@ | |||||
| package org.apache.tools.ant.taskdefs; | package org.apache.tools.ant.taskdefs; | ||||
| import java.io.IOException; | |||||
| import org.apache.tools.ant.BuildFileRule; | import org.apache.tools.ant.BuildFileRule; | ||||
| import org.junit.After; | import org.junit.After; | ||||
| import org.junit.Before; | import org.junit.Before; | ||||
| @@ -47,17 +45,17 @@ public class ChecksumTest { | |||||
| } | } | ||||
| @Test | @Test | ||||
| public void testCreateMD5SUMformat() throws IOException { | |||||
| public void testCreateMD5SUMformat() { | |||||
| buildRule.executeTarget("createMD5SUMformat"); | buildRule.executeTarget("createMD5SUMformat"); | ||||
| } | } | ||||
| @Test | @Test | ||||
| public void testCreateSVFformat() throws IOException { | |||||
| public void testCreateSVFformat() { | |||||
| buildRule.executeTarget("createSVFformat"); | buildRule.executeTarget("createSVFformat"); | ||||
| } | } | ||||
| @Test | @Test | ||||
| public void testCreatePattern() throws IOException { | |||||
| public void testCreatePattern() { | |||||
| buildRule.executeTarget("createPattern"); | buildRule.executeTarget("createPattern"); | ||||
| } | } | ||||
| @@ -62,7 +62,7 @@ public class ExecuteJavaTest { | |||||
| } | } | ||||
| @Test | @Test | ||||
| public void testNoTimeOut() throws Exception { | |||||
| public void testNoTimeOut() { | |||||
| Commandline cmd = getCommandline(TIME_OUT / 2); | Commandline cmd = getCommandline(TIME_OUT / 2); | ||||
| ej.setJavaCommand(cmd); | ej.setJavaCommand(cmd); | ||||
| ej.execute(project); | ej.execute(project); | ||||
| @@ -71,7 +71,7 @@ public class ExecuteJavaTest { | |||||
| // test that the watchdog ends the process | // test that the watchdog ends the process | ||||
| @Test | @Test | ||||
| public void testTimeOut() throws Exception { | |||||
| public void testTimeOut() { | |||||
| Commandline cmd = getCommandline(TIME_OUT * 2); | Commandline cmd = getCommandline(TIME_OUT * 2); | ||||
| ej.setJavaCommand(cmd); | ej.setJavaCommand(cmd); | ||||
| long now = System.currentTimeMillis(); | long now = System.currentTimeMillis(); | ||||
| @@ -88,7 +88,7 @@ public class ExecuteJavaTest { | |||||
| } | } | ||||
| @Test | @Test | ||||
| public void testNoTimeOutForked() throws Exception { | |||||
| public void testNoTimeOutForked() { | |||||
| Commandline cmd = getCommandline(TIME_OUT / 2); | Commandline cmd = getCommandline(TIME_OUT / 2); | ||||
| ej.setJavaCommand(cmd); | ej.setJavaCommand(cmd); | ||||
| ej.fork(cp); | ej.fork(cp); | ||||
| @@ -97,7 +97,7 @@ public class ExecuteJavaTest { | |||||
| // test that the watchdog ends the process | // test that the watchdog ends the process | ||||
| @Test | @Test | ||||
| public void testTimeOutForked() throws Exception { | |||||
| public void testTimeOutForked() { | |||||
| Commandline cmd = getCommandline(TIME_OUT * 2); | Commandline cmd = getCommandline(TIME_OUT * 2); | ||||
| ej.setJavaCommand(cmd); | ej.setJavaCommand(cmd); | ||||
| long now = System.currentTimeMillis(); | long now = System.currentTimeMillis(); | ||||
| @@ -91,12 +91,12 @@ public class MoveTest { | |||||
| } | } | ||||
| @Test | @Test | ||||
| public void testCompleteDirectoryMove() throws IOException { | |||||
| public void testCompleteDirectoryMove() { | |||||
| testCompleteDirectoryMove("testCompleteDirectoryMove"); | testCompleteDirectoryMove("testCompleteDirectoryMove"); | ||||
| } | } | ||||
| @Test | @Test | ||||
| public void testCompleteDirectoryMove2() throws IOException { | |||||
| public void testCompleteDirectoryMove2() { | |||||
| testCompleteDirectoryMove("testCompleteDirectoryMove2"); | testCompleteDirectoryMove("testCompleteDirectoryMove2"); | ||||
| } | } | ||||
| @@ -42,39 +42,38 @@ public class IsReachableTest { | |||||
| "src/etc/testcases/taskdefs/conditions/isreachable.xml"); | "src/etc/testcases/taskdefs/conditions/isreachable.xml"); | ||||
| } | } | ||||
| @Test | @Test | ||||
| public void testLocalhost() { | public void testLocalhost() { | ||||
| buildRule.executeTarget("testLocalhost"); | buildRule.executeTarget("testLocalhost"); | ||||
| } | } | ||||
| @Test | @Test | ||||
| public void testLocalhostURL() throws Exception { | |||||
| public void testLocalhostURL() { | |||||
| buildRule.executeTarget("testLocalhostURL"); | buildRule.executeTarget("testLocalhostURL"); | ||||
| } | } | ||||
| @Test | @Test | ||||
| public void testIpv4localhost() throws Exception { | |||||
| public void testIpv4localhost() { | |||||
| buildRule.executeTarget("testIpv4localhost"); | buildRule.executeTarget("testIpv4localhost"); | ||||
| } | } | ||||
| @Test | @Test | ||||
| public void testFTPURL() throws Exception { | |||||
| public void testFTPURL() { | |||||
| buildRule.executeTarget("testFTPURL"); | buildRule.executeTarget("testFTPURL"); | ||||
| } | } | ||||
| @Test | @Test | ||||
| public void testBoth() throws Exception { | |||||
| public void testBoth() { | |||||
| try { | try { | ||||
| buildRule.executeTarget("testBoth"); | buildRule.executeTarget("testBoth"); | ||||
| fail("Build exception expected: error on two targets"); | |||||
| fail("Build exception expected: error on two targets"); | |||||
| } catch (BuildException ex) { | } catch (BuildException ex) { | ||||
| assertEquals(IsReachable.ERROR_BOTH_TARGETS, ex.getMessage()); | assertEquals(IsReachable.ERROR_BOTH_TARGETS, ex.getMessage()); | ||||
| } | } | ||||
| } | } | ||||
| @Test | @Test | ||||
| public void testNoTargets() throws Exception { | |||||
| public void testNoTargets() { | |||||
| try { | try { | ||||
| buildRule.executeTarget("testNoTargets"); | buildRule.executeTarget("testNoTargets"); | ||||
| fail("Build exception expected: no params"); | fail("Build exception expected: no params"); | ||||
| @@ -84,7 +83,7 @@ public class IsReachableTest { | |||||
| } | } | ||||
| @Test | @Test | ||||
| public void testBadTimeout() throws Exception { | |||||
| public void testBadTimeout() { | |||||
| try { | try { | ||||
| buildRule.executeTarget("testBadTimeout"); | buildRule.executeTarget("testBadTimeout"); | ||||
| fail("Build exception expected: error on -ve timeout"); | fail("Build exception expected: error on -ve timeout"); | ||||
| @@ -95,7 +94,7 @@ public class IsReachableTest { | |||||
| @Test | @Test | ||||
| @Ignore("Previously named in a way to prevent execution") | @Ignore("Previously named in a way to prevent execution") | ||||
| public void NotestFile() throws Exception { | |||||
| public void NotestFile() { | |||||
| try { | try { | ||||
| buildRule.executeTarget("testFile"); | buildRule.executeTarget("testFile"); | ||||
| fail("Build exception expected: error on file URL"); | fail("Build exception expected: error on file URL"); | ||||
| @@ -105,7 +104,7 @@ public class IsReachableTest { | |||||
| } | } | ||||
| @Test | @Test | ||||
| public void testBadURL() throws Exception { | |||||
| public void testBadURL() { | |||||
| try { | try { | ||||
| buildRule.executeTarget("testBadURL"); | buildRule.executeTarget("testBadURL"); | ||||
| fail("Build exception expected: error in URL"); | fail("Build exception expected: error in URL"); | ||||
| @@ -50,7 +50,7 @@ public class ChangeLogParserTest { | |||||
| } | } | ||||
| @Test | @Test | ||||
| public void testCvs112Format() throws Exception { | |||||
| public void testCvs112Format() { | |||||
| parser.stdout("Working file: build.xml"); | parser.stdout("Working file: build.xml"); | ||||
| parser.stdout("revision 1.475"); | parser.stdout("revision 1.475"); | ||||
| parser.stdout("date: 2004-06-05 16:10:32 +0000; author: somebody; state: Exp; lines: +2 -2"); | parser.stdout("date: 2004-06-05 16:10:32 +0000; author: somebody; state: Exp; lines: +2 -2"); | ||||
| @@ -193,13 +193,13 @@ public class EchoPropertiesTest { | |||||
| } | } | ||||
| @Test | @Test | ||||
| public void testWithEmptyPrefixAndRegex() throws Exception { | |||||
| public void testWithEmptyPrefixAndRegex() { | |||||
| buildRule.executeTarget("testEchoWithEmptyPrefixToLog"); | buildRule.executeTarget("testEchoWithEmptyPrefixToLog"); | ||||
| assertContains("test.property=" + TEST_VALUE, buildRule.getLog()); | assertContains("test.property=" + TEST_VALUE, buildRule.getLog()); | ||||
| } | } | ||||
| @Test | @Test | ||||
| public void testWithRegex() throws Exception { | |||||
| public void testWithRegex() { | |||||
| assumeTrue("Test skipped because no regexp matcher is present.", | assumeTrue("Test skipped because no regexp matcher is present.", | ||||
| RegexpMatcherFactory.regexpMatcherPresent(buildRule.getProject())); | RegexpMatcherFactory.regexpMatcherPresent(buildRule.getProject())); | ||||
| buildRule.executeTarget("testWithRegex"); | buildRule.executeTarget("testWithRegex"); | ||||
| @@ -385,12 +385,12 @@ public class JUnitTaskTest { | |||||
| } | } | ||||
| @Test | @Test | ||||
| public void testTestMethods() throws Exception { | |||||
| public void testTestMethods() { | |||||
| buildRule.executeTarget("testTestMethods"); | buildRule.executeTarget("testTestMethods"); | ||||
| } | } | ||||
| @Test | @Test | ||||
| public void testNonTestsSkipped() throws Exception { | |||||
| public void testNonTestsSkipped() { | |||||
| buildRule.executeTarget("testNonTests"); | buildRule.executeTarget("testNonTests"); | ||||
| assertFalse("Test result should not exist as test was skipped - TEST-org.example.junit.NonTestMissed.xml", | assertFalse("Test result should not exist as test was skipped - TEST-org.example.junit.NonTestMissed.xml", | ||||
| @@ -312,7 +312,7 @@ public class XMLCatalogTest { | |||||
| } | } | ||||
| @Test | @Test | ||||
| public void testResolverBase() throws MalformedURLException, TransformerException { | |||||
| public void testResolverBase() throws TransformerException { | |||||
| String uri = "http://foo.com/bar/blah.xml"; | String uri = "http://foo.com/bar/blah.xml"; | ||||
| String uriLoc = "etc/testcases/taskdefs/optional/xml/about.xml"; | String uriLoc = "etc/testcases/taskdefs/optional/xml/about.xml"; | ||||
| String base = toURLString(project.getBaseDir()) + "/src/"; | String base = toURLString(project.getBaseDir()) + "/src/"; | ||||