You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by gi...@apache.org on 2018/04/01 21:11:33 UTC
[4/4] ant git commit: Remove more extraneous exceptions
Remove more extraneous exceptions
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/b247c2e6
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/b247c2e6
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/b247c2e6
Branch: refs/heads/master
Commit: b247c2e6dbca4dd1634bbfc54c26b09679268922
Parents: cac9c2f
Author: Gintas Grigelionis <gi...@apache.org>
Authored: Sun Apr 1 23:11:04 2018 +0200
Committer: Gintas Grigelionis <gi...@apache.org>
Committed: Sun Apr 1 23:11:04 2018 +0200
----------------------------------------------------------------------
.../apache/tools/ant/taskdefs/ChecksumTest.java | 8 +++-----
.../tools/ant/taskdefs/ExecuteJavaTest.java | 8 ++++----
.../org/apache/tools/ant/taskdefs/MoveTest.java | 4 ++--
.../ant/taskdefs/condition/IsReachableTest.java | 19 +++++++++----------
.../ant/taskdefs/cvslib/ChangeLogParserTest.java | 2 +-
.../taskdefs/optional/EchoPropertiesTest.java | 4 ++--
.../taskdefs/optional/junit/JUnitTaskTest.java | 4 ++--
.../apache/tools/ant/types/XMLCatalogTest.java | 2 +-
8 files changed, 24 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/b247c2e6/src/tests/junit/org/apache/tools/ant/taskdefs/ChecksumTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/ChecksumTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/ChecksumTest.java
index e103f98..695a5cd 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/ChecksumTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/ChecksumTest.java
@@ -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");
}
http://git-wip-us.apache.org/repos/asf/ant/blob/b247c2e6/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java
index b6d3e5a..c00d1b7 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java
@@ -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();
http://git-wip-us.apache.org/repos/asf/ant/blob/b247c2e6/src/tests/junit/org/apache/tools/ant/taskdefs/MoveTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/MoveTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/MoveTest.java
index 3799003..c09b6ba 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/MoveTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/MoveTest.java
@@ -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");
}
http://git-wip-us.apache.org/repos/asf/ant/blob/b247c2e6/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsReachableTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsReachableTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsReachableTest.java
index bef7ab1..6ddf26f 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsReachableTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsReachableTest.java
@@ -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");
http://git-wip-us.apache.org/repos/asf/ant/blob/b247c2e6/src/tests/junit/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParserTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParserTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParserTest.java
index 4496bf0..e10a0dd 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParserTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParserTest.java
@@ -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");
http://git-wip-us.apache.org/repos/asf/ant/blob/b247c2e6/src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java
index 0536c9a..1c2d445 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java
@@ -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");
http://git-wip-us.apache.org/repos/asf/ant/blob/b247c2e6/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
index cac0f5b..8ef6c70 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
@@ -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",
http://git-wip-us.apache.org/repos/asf/ant/blob/b247c2e6/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java b/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java
index 30b62b4..7297264 100644
--- a/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java
+++ b/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java
@@ -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/";