Browse Source

Remove more extraneous exceptions

master
Gintas Grigelionis 7 years ago
parent
commit
b247c2e6db
8 changed files with 24 additions and 27 deletions
  1. +3
    -5
      src/tests/junit/org/apache/tools/ant/taskdefs/ChecksumTest.java
  2. +4
    -4
      src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java
  3. +2
    -2
      src/tests/junit/org/apache/tools/ant/taskdefs/MoveTest.java
  4. +9
    -10
      src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsReachableTest.java
  5. +1
    -1
      src/tests/junit/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParserTest.java
  6. +2
    -2
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java
  7. +2
    -2
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
  8. +1
    -1
      src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java

+ 3
- 5
src/tests/junit/org/apache/tools/ant/taskdefs/ChecksumTest.java View File

@@ -18,8 +18,6 @@

package org.apache.tools.ant.taskdefs;

import java.io.IOException;

import org.apache.tools.ant.BuildFileRule;
import org.junit.After;
import org.junit.Before;
@@ -47,17 +45,17 @@ public class ChecksumTest {
}

@Test
public void testCreateMD5SUMformat() throws IOException {
public void testCreateMD5SUMformat() {
buildRule.executeTarget("createMD5SUMformat");
}

@Test
public void testCreateSVFformat() throws IOException {
public void testCreateSVFformat() {
buildRule.executeTarget("createSVFformat");
}

@Test
public void testCreatePattern() throws IOException {
public void testCreatePattern() {
buildRule.executeTarget("createPattern");
}



+ 4
- 4
src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java View File

@@ -62,7 +62,7 @@ public class ExecuteJavaTest {
}

@Test
public void testNoTimeOut() throws Exception {
public void testNoTimeOut() {
Commandline cmd = getCommandline(TIME_OUT / 2);
ej.setJavaCommand(cmd);
ej.execute(project);
@@ -71,7 +71,7 @@ public class ExecuteJavaTest {

// test that the watchdog ends the process
@Test
public void testTimeOut() throws Exception {
public void testTimeOut() {
Commandline cmd = getCommandline(TIME_OUT * 2);
ej.setJavaCommand(cmd);
long now = System.currentTimeMillis();
@@ -88,7 +88,7 @@ public class ExecuteJavaTest {
}

@Test
public void testNoTimeOutForked() throws Exception {
public void testNoTimeOutForked() {
Commandline cmd = getCommandline(TIME_OUT / 2);
ej.setJavaCommand(cmd);
ej.fork(cp);
@@ -97,7 +97,7 @@ public class ExecuteJavaTest {

// test that the watchdog ends the process
@Test
public void testTimeOutForked() throws Exception {
public void testTimeOutForked() {
Commandline cmd = getCommandline(TIME_OUT * 2);
ej.setJavaCommand(cmd);
long now = System.currentTimeMillis();


+ 2
- 2
src/tests/junit/org/apache/tools/ant/taskdefs/MoveTest.java View File

@@ -91,12 +91,12 @@ public class MoveTest {
}

@Test
public void testCompleteDirectoryMove() throws IOException {
public void testCompleteDirectoryMove() {
testCompleteDirectoryMove("testCompleteDirectoryMove");
}

@Test
public void testCompleteDirectoryMove2() throws IOException {
public void testCompleteDirectoryMove2() {
testCompleteDirectoryMove("testCompleteDirectoryMove2");
}



+ 9
- 10
src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsReachableTest.java View File

@@ -42,39 +42,38 @@ public class IsReachableTest {
"src/etc/testcases/taskdefs/conditions/isreachable.xml");
}


@Test
public void testLocalhost() {
buildRule.executeTarget("testLocalhost");
}

@Test
public void testLocalhostURL() throws Exception {
public void testLocalhostURL() {
buildRule.executeTarget("testLocalhostURL");
}

@Test
public void testIpv4localhost() throws Exception {
public void testIpv4localhost() {
buildRule.executeTarget("testIpv4localhost");
}

@Test
public void testFTPURL() throws Exception {
public void testFTPURL() {
buildRule.executeTarget("testFTPURL");
}

@Test
public void testBoth() throws Exception {
public void testBoth() {
try {
buildRule.executeTarget("testBoth");
fail("Build exception expected: error on two targets");
fail("Build exception expected: error on two targets");
} catch (BuildException ex) {
assertEquals(IsReachable.ERROR_BOTH_TARGETS, ex.getMessage());
}
}

@Test
public void testNoTargets() throws Exception {
public void testNoTargets() {
try {
buildRule.executeTarget("testNoTargets");
fail("Build exception expected: no params");
@@ -84,7 +83,7 @@ public class IsReachableTest {
}

@Test
public void testBadTimeout() throws Exception {
public void testBadTimeout() {
try {
buildRule.executeTarget("testBadTimeout");
fail("Build exception expected: error on -ve timeout");
@@ -95,7 +94,7 @@ public class IsReachableTest {

@Test
@Ignore("Previously named in a way to prevent execution")
public void NotestFile() throws Exception {
public void NotestFile() {
try {
buildRule.executeTarget("testFile");
fail("Build exception expected: error on file URL");
@@ -105,7 +104,7 @@ public class IsReachableTest {
}

@Test
public void testBadURL() throws Exception {
public void testBadURL() {
try {
buildRule.executeTarget("testBadURL");
fail("Build exception expected: error in URL");


+ 1
- 1
src/tests/junit/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParserTest.java View File

@@ -50,7 +50,7 @@ public class ChangeLogParserTest {
}

@Test
public void testCvs112Format() throws Exception {
public void testCvs112Format() {
parser.stdout("Working file: build.xml");
parser.stdout("revision 1.475");
parser.stdout("date: 2004-06-05 16:10:32 +0000; author: somebody; state: Exp; lines: +2 -2");


+ 2
- 2
src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java View File

@@ -193,13 +193,13 @@ public class EchoPropertiesTest {
}

@Test
public void testWithEmptyPrefixAndRegex() throws Exception {
public void testWithEmptyPrefixAndRegex() {
buildRule.executeTarget("testEchoWithEmptyPrefixToLog");
assertContains("test.property=" + TEST_VALUE, buildRule.getLog());
}

@Test
public void testWithRegex() throws Exception {
public void testWithRegex() {
assumeTrue("Test skipped because no regexp matcher is present.",
RegexpMatcherFactory.regexpMatcherPresent(buildRule.getProject()));
buildRule.executeTarget("testWithRegex");


+ 2
- 2
src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java View File

@@ -385,12 +385,12 @@ public class JUnitTaskTest {
}

@Test
public void testTestMethods() throws Exception {
public void testTestMethods() {
buildRule.executeTarget("testTestMethods");
}

@Test
public void testNonTestsSkipped() throws Exception {
public void testNonTestsSkipped() {

buildRule.executeTarget("testNonTests");
assertFalse("Test result should not exist as test was skipped - TEST-org.example.junit.NonTestMissed.xml",


+ 1
- 1
src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java View File

@@ -312,7 +312,7 @@ public class XMLCatalogTest {
}

@Test
public void testResolverBase() throws MalformedURLException, TransformerException {
public void testResolverBase() throws TransformerException {
String uri = "http://foo.com/bar/blah.xml";
String uriLoc = "etc/testcases/taskdefs/optional/xml/about.xml";
String base = toURLString(project.getBaseDir()) + "/src/";


Loading…
Cancel
Save