Browse Source

Remove extraneous exceptions and “extends Object”

master
Gintas Grigelionis 7 years ago
parent
commit
763de36308
54 changed files with 183 additions and 200 deletions
  1. +1
    -1
      src/main/org/apache/tools/ant/filters/SortFilter.java
  2. +2
    -7
      src/main/org/apache/tools/ant/taskdefs/Deltree.java
  3. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/jlink/ClassNameReader.java
  4. +2
    -1
      src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java
  5. +2
    -2
      src/main/org/apache/tools/ant/util/UUEncoder.java
  6. +2
    -2
      src/main/org/apache/tools/bzip2/CBZip2InputStream.java
  7. +1
    -1
      src/main/org/apache/tools/bzip2/CBZip2OutputStream.java
  8. +2
    -1
      src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java
  9. +1
    -1
      src/tests/junit/org/apache/tools/ant/BuildFileTest.java
  10. +1
    -1
      src/tests/junit/org/apache/tools/ant/DefaultLoggerTest.java
  11. +1
    -1
      src/tests/junit/org/apache/tools/ant/DirectoryScannerTest.java
  12. +3
    -3
      src/tests/junit/org/apache/tools/ant/ExtendedTaskdefTest.java
  13. +3
    -3
      src/tests/junit/org/apache/tools/ant/ProjectHelperRepositoryTest.java
  14. +0
    -1
      src/tests/junit/org/apache/tools/ant/UnknownElementTest.java
  15. +1
    -1
      src/tests/junit/org/apache/tools/ant/XmlLoggerTest.java
  16. +1
    -1
      src/tests/junit/org/apache/tools/ant/filters/LineContainsTest.java
  17. +1
    -3
      src/tests/junit/org/apache/tools/ant/filters/NoNewLineTest.java
  18. +5
    -5
      src/tests/junit/org/apache/tools/ant/filters/TokenFilterTest.java
  19. +10
    -10
      src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java
  20. +1
    -1
      src/tests/junit/org/apache/tools/ant/taskdefs/ChecksumTest.java
  21. +1
    -1
      src/tests/junit/org/apache/tools/ant/taskdefs/ExecStreamRedirectorTest.java
  22. +1
    -1
      src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java
  23. +21
    -21
      src/tests/junit/org/apache/tools/ant/taskdefs/FixCrLfTest.java
  24. +4
    -4
      src/tests/junit/org/apache/tools/ant/taskdefs/MoveTest.java
  25. +2
    -2
      src/tests/junit/org/apache/tools/ant/taskdefs/ReplaceTest.java
  26. +48
    -48
      src/tests/junit/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java
  27. +2
    -2
      src/tests/junit/org/apache/tools/ant/taskdefs/SQLExecTest.java
  28. +4
    -4
      src/tests/junit/org/apache/tools/ant/taskdefs/StyleTest.java
  29. +5
    -5
      src/tests/junit/org/apache/tools/ant/taskdefs/TStampTest.java
  30. +2
    -4
      src/tests/junit/org/apache/tools/ant/taskdefs/ZipTest.java
  31. +1
    -1
      src/tests/junit/org/apache/tools/ant/taskdefs/condition/AntVersionTest.java
  32. +1
    -1
      src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsReachableTest.java
  33. +1
    -1
      src/tests/junit/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParserTest.java
  34. +1
    -1
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java
  35. +7
    -7
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/JspcTest.java
  36. +1
    -1
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/PropertyFileTest.java
  37. +2
    -2
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/ReplaceRegExpTest.java
  38. +2
    -2
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/RpmTest.java
  39. +9
    -9
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/SchemaValidateTest.java
  40. +2
    -2
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/XmlValidateTest.java
  41. +4
    -4
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/XsltTest.java
  42. +1
    -1
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/image/ImageTest.java
  43. +3
    -3
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java
  44. +1
    -1
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
  45. +1
    -2
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/ssh/ScpTest.java
  46. +1
    -1
      src/tests/junit/org/apache/tools/ant/types/CommandlineJavaTest.java
  47. +1
    -1
      src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java
  48. +2
    -2
      src/tests/junit/org/apache/tools/ant/types/resources/LazyResourceCollectionTest.java
  49. +3
    -3
      src/tests/junit/org/apache/tools/ant/types/resources/ResourceListTest.java
  50. +2
    -2
      src/tests/junit/org/apache/tools/ant/types/resources/TarResourceTest.java
  51. +2
    -10
      src/tests/junit/org/apache/tools/bzip2/CBZip2StreamTest.java
  52. +2
    -2
      src/tests/junit/org/apache/tools/zip/ZipOutputStreamTest.java
  53. +1
    -1
      src/tests/junit/org/example/junitlauncher/vintage/AlwaysFailingJUnit4Test.java
  54. +1
    -1
      src/tests/junit/org/example/junitlauncher/vintage/JUnit4SampleTest.java

+ 1
- 1
src/main/org/apache/tools/ant/filters/SortFilter.java View File

@@ -310,7 +310,7 @@ public final class SortFilter extends BaseParamFilterReader
/**
* Scans the parameters list
*/
private void initialize() throws IOException {
private void initialize() {
// get parameters
Parameter[] params = getParameters();
if (params != null) {


+ 2
- 7
src/main/org/apache/tools/ant/taskdefs/Deltree.java View File

@@ -72,16 +72,11 @@ public class Deltree extends Task {

log("Deleting: " + dir.getAbsolutePath());

try {
removeDir(dir);
} catch (IOException ioe) {
String msg = "Unable to delete " + dir.getAbsolutePath();
throw new BuildException(msg, getLocation());
}
removeDir(dir);
}
}

private void removeDir(File dir) throws IOException {
private void removeDir(File dir) {

// check to make sure that the given dir isn't a symlink
// the comparison of absolute path and canonical path


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/jlink/ClassNameReader.java View File

@@ -104,7 +104,7 @@ class ConstantPool {
* given just an InputStream. Reads in just enough to perform this
* minimal task only.
*/
public class ClassNameReader extends Object {
public class ClassNameReader {
private static final int CLASS_MAGIC_NUMBER = 0xCAFEBABE;

/**


+ 2
- 1
src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java View File

@@ -525,7 +525,8 @@ public final class SelectorUtils {
/**
* Same as {@link #tokenizePath tokenizePath} but hopefully faster.
*/
/*package*/ static String[] tokenizePathAsArray(String path) {
/* package */
static String[] tokenizePathAsArray(String path) {
String root = null;
if (FileUtils.isAbsolutePath(path)) {
String[] s = FILE_UTILS.dissect(path);


+ 2
- 2
src/main/org/apache/tools/ant/util/UUEncoder.java View File

@@ -87,11 +87,11 @@ public class UUEncoder {
writer.flush();
}

private void encodeBegin() throws IOException {
private void encodeBegin() {
encodeString("begin " + DEFAULT_MODE + " " + name + "\n");
}

private void encodeEnd() throws IOException {
private void encodeEnd() {
encodeString(" \nend\n");
}



+ 2
- 2
src/main/org/apache/tools/bzip2/CBZip2InputStream.java View File

@@ -983,7 +983,7 @@ public class CBZip2InputStream extends InputStream implements BZip2Constants {
}
}

private static final class Data extends Object {
private static final class Data {

// (with blockSize 900k)
final boolean[] inUse = new boolean[256]; // 256 byte
@@ -1046,7 +1046,7 @@ public class CBZip2InputStream extends InputStream implements BZip2Constants {

}

private static void reportCRCError() throws IOException {
private static void reportCRCError() {
// The clean way would be to throw an exception.
//throw new IOException("crc error");



+ 1
- 1
src/main/org/apache/tools/bzip2/CBZip2OutputStream.java View File

@@ -1513,7 +1513,7 @@ public class CBZip2OutputStream extends OutputStream
this.nMTF = wr + 1;
}

static final class Data extends Object {
static final class Data {

// with blockSize 900k
/* maps unsigned byte => "does it occur in block" */


+ 2
- 1
src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java View File

@@ -175,7 +175,7 @@ public class AntClassLoaderTest {
* classes cannot be loaded</a>
*/
@Test
public void testInvalidZipException() throws Exception {
public void testInvalidZipException() {
buildRule.executeTarget("createNonJar");
File jar = new File(buildRule.getProject().getProperty("tmp.dir")
+ "/foo.jar");
@@ -234,6 +234,7 @@ public class AntClassLoaderTest {
public URL getResource(String n) {
return null;
}
@SuppressWarnings("unchecked")
public Enumeration getResources(String n) {
return new CollectionUtils.EmptyEnumeration();
}


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

@@ -72,7 +72,7 @@ public abstract class BuildFileTest extends TestCase {
* is automatically called, since it's trivial to have a
* test target depend on it.
*/
protected void tearDown() throws Exception {
protected void tearDown() {
if (project == null) {
/*
* Maybe the BuildFileTest was subclassed and there is


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

@@ -36,7 +36,7 @@ public class DefaultLoggerTest {

@SuppressWarnings("serial")
@Test
public void testThrowableMessage() throws Exception { // #43398
public void testThrowableMessage() { // #43398
BuildException be = new BuildException("oops", new Location("build.xml", 1, 0));
assertEquals(
"build.xml:1: oops" + StringUtils.LINE_SEP,


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

@@ -508,7 +508,7 @@ public class DirectoryScannerTest {
}

@Test
public void testRecursiveExcludes() throws Exception {
public void testRecursiveExcludes() {
DirectoryScanner ds = new DirectoryScanner();
ds.setBasedir(new File(buildRule.getProject().getProperty("output")));
ds.setExcludes(new String[] {"**/beta/**"});


+ 3
- 3
src/tests/junit/org/apache/tools/ant/ExtendedTaskdefTest.java View File

@@ -41,12 +41,12 @@ public class ExtendedTaskdefTest {
}

@After
public void tearDown() throws Exception {
public void tearDown() {
buildRule.executeTarget("teardown");
}

@Test
public void testRun() throws Exception {
public void testRun() {
try {
buildRule.executeTarget("testRun");
fail("BuildException should have been thrown");
@@ -56,7 +56,7 @@ public class ExtendedTaskdefTest {
}

@Test
public void testRun2() throws Exception {
public void testRun2() {
try {
buildRule.executeTarget("testRun2");
fail("BuildException should have been thrown");


+ 3
- 3
src/tests/junit/org/apache/tools/ant/ProjectHelperRepositoryTest.java View File

@@ -45,7 +45,7 @@ public class ProjectHelperRepositoryTest {
}

@Test
public void testFind() throws Exception {
public void testFind() {
ProjectHelperRepository repo = ProjectHelperRepository.getInstance();
repo.registerProjectHelper(SomeHelper.class);

@@ -75,7 +75,7 @@ public class ProjectHelperRepositoryTest {
}

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

class IncrrectHelper extends ProjectHelper {
// the default constructor is not visible to ant here
@@ -92,7 +92,7 @@ public class ProjectHelperRepositoryTest {
}

@Test
public void testUnkwnowHelper() throws Exception {
public void testUnkwnowHelper() {
ProjectHelperRepository repo = ProjectHelperRepository.getInstance();
try {
repo.registerProjectHelper("xxx.yyy.zzz.UnknownHelper");


+ 0
- 1
src/tests/junit/org/apache/tools/ant/UnknownElementTest.java View File

@@ -24,7 +24,6 @@ import org.junit.Rule;
import org.junit.Test;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import static org.junit.Assert.assertEquals;


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

@@ -26,7 +26,7 @@ public class XmlLoggerTest {
@Test
// see https://issues.apache.org/bugzilla/show_bug.cgi?id=56850
// "NPE in XmlLogger.buildFinished"
public void test() throws Throwable {
public void test() {
final XmlLogger logger = new XmlLogger();
final Cvs task = new Cvs();
final BuildEvent event = new BuildEvent(task);


+ 1
- 1
src/tests/junit/org/apache/tools/ant/filters/LineContainsTest.java View File

@@ -49,7 +49,7 @@ public class LineContainsTest {
}

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



+ 1
- 3
src/tests/junit/org/apache/tools/ant/filters/NoNewLineTest.java View File

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

package org.apache.tools.ant.filters;

import java.io.IOException;

import org.apache.tools.ant.BuildFileRule;
import org.junit.Before;
import org.junit.Rule;
@@ -41,7 +39,7 @@ public class NoNewLineTest {


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



+ 5
- 5
src/tests/junit/org/apache/tools/ant/filters/TokenFilterTest.java View File

@@ -51,18 +51,18 @@ public class TokenFilterTest {

/** make sure tokenfilter exists */
@Test
public void testTokenfilter() throws IOException {
public void testTokenfilter() {
buildRule.executeTarget("tokenfilter");
}

@Test
public void testTrimignore() throws IOException {
public void testTrimignore() {
buildRule.executeTarget("trimignore");
assertContains("Hello-World", buildRule.getLog());
}

@Test
public void testStringTokenizer() throws IOException {
public void testStringTokenizer() {
buildRule.executeTarget("stringtokenizer");
assertContains("#This#is#a#number#of#words#", buildRule.getLog());
}
@@ -98,7 +98,7 @@ public class TokenFilterTest {
}

@Test
public void testReplaceStrings() throws IOException {
public void testReplaceStrings() {
buildRule.executeTarget("replacestrings");
assertContains("bar bar bar", buildRule.getLog());
}
@@ -175,7 +175,7 @@ public class TokenFilterTest {
}

@Test
public void testFilterReplaceStrings() throws IOException {
public void testFilterReplaceStrings() {
buildRule.executeTarget("filterreplacestrings");
assertContains("bar bar bar", buildRule.getLog());
}


+ 10
- 10
src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java View File

@@ -38,7 +38,7 @@ public class LocatorTest {


@Before
public void setUp() throws Exception {
public void setUp() {
windows = Os.isFamily(Os.FAMILY_DOS);
unix = Os.isFamily(Os.FAMILY_UNIX);
}
@@ -88,7 +88,7 @@ public class LocatorTest {
* this isn't really a valid URI, except maybe in IE
* @throws Exception if something goes wrong
*/
public void testNetworkURI() throws Exception {
public void testNetworkURI() {
resolveTo("file:\\\\PC03\\jclasses\\lib\\ant-1.7.0.jar", ""
+ "\\\\PC03\\jclasses\\lib\\ant-1.7.0.jar",
"\\\\PC03\\jclasses\\lib\\ant-1.7.0.jar");
@@ -96,26 +96,26 @@ public class LocatorTest {

@Ignore("We don't appear to generate paths like this in the launcher")
@Test
public void testTripleForwardSlashNetworkURI() throws Exception {
public void testTripleForwardSlashNetworkURI() {
resolveTo("file:///PC03/jclasses/lib/ant-1.7.0.jar",
"///PC03/jclasses/lib/ant-1.7.0.jar",
"\\\\PC03\\jclasses\\lib\\ant-1.7.0.jar");
}

@Test
public void testUnixNetworkPath() throws Exception {
public void testUnixNetworkPath() {
resolveTo("file://cluster/home/ant/lib",
"//cluster/home/ant/lib",
"\\\\cluster\\home\\ant\\lib");
}

@Test
public void testUnixPath() throws Exception {
public void testUnixPath() {
resolveTo("file:/home/ant/lib", "/home/ant/lib", null);
}

@Test
public void testSpacedURI() throws Exception {
public void testSpacedURI() {
resolveTo("file:C:\\Program Files\\Ant\\lib",
"C:\\Program Files\\Ant\\lib",
"C:\\Program Files\\Ant\\lib");
@@ -126,7 +126,7 @@ public class LocatorTest {
* @throws Throwable if desired
*/
@Test
public void testAntOnRemoteShare() throws Throwable {
public void testAntOnRemoteShare() {
String resolved = Locator.fromJarURI(SHARED_JAR_URI);
assertResolved(SHARED_JAR_URI, LAUNCHER_JAR, resolved, unix);
assertResolved(SHARED_JAR_URI, LAUNCHER_JAR.replace('/', '\\'),
@@ -139,7 +139,7 @@ public class LocatorTest {
* @throws Throwable if desired
*/
@Test
public void testFileFromRemoteShare() throws Throwable {
public void testFileFromRemoteShare() {
String resolved = Locator.fromJarURI(SHARED_JAR_URI);
File f = new File(resolved);
String path = f.getAbsolutePath();
@@ -149,7 +149,7 @@ public class LocatorTest {
}

@Test
public void testHttpURI() throws Exception {
public void testHttpURI() {
String url = "http://ant.apache.org";
try {
Locator.fromURI(url);
@@ -174,7 +174,7 @@ public class LocatorTest {
}

@Test
public void testOddLowAsciiURI() throws Exception {
public void testOddLowAsciiURI() {
assertResolves("hash# and percent%");
}



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

@@ -42,7 +42,7 @@ public class ChecksumTest {
}

@Test
public void testCreateMd5() throws IOException {
public void testCreateMd5() {
buildRule.executeTarget("createMd5");
}



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

@@ -23,7 +23,7 @@ public class ExecStreamRedirectorTest {
private Project project;

@Before
public void setUp() throws Exception {
public void setUp() {
project = new Project();
project.init();
final File antFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/exec/exec-with-redirector.xml");


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

@@ -54,7 +54,7 @@ public class ExecuteJavaTest {
ej.setClasspath(cp);
}

private Commandline getCommandline(int timetorun) throws Exception {
private Commandline getCommandline(int timetorun) {
Commandline cmd = new Commandline();
cmd.setExecutable(TimeProcess.class.getName());
cmd.createArgument().setValue(String.valueOf(timetorun));


+ 21
- 21
src/tests/junit/org/apache/tools/ant/taskdefs/FixCrLfTest.java View File

@@ -49,107 +49,107 @@ public class FixCrLfTest {
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@Test
public void testCrCrLfSequenceUnix() throws IOException {
public void testCrCrLfSequenceUnix() {
buildRule.executeTarget("testCrCrLfSequence-unix");
}

@Test
public void testCrCrLfSequenceDos() throws IOException {
public void testCrCrLfSequenceDos() {
buildRule.executeTarget("testCrCrLfSequence-dos");
}

@Test
public void testCrCrLfSequenceMac() throws IOException {
public void testCrCrLfSequenceMac() {
buildRule.executeTarget("testCrCrLfSequence-mac");
}

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

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

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

@Test
public void testFixFileExclusive() throws Exception {
public void testFixFileExclusive() {
try {
buildRule.executeTarget("testFixFileExclusive");
fail(FixCRLF.ERROR_FILE_AND_SRCDIR);


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

@@ -65,7 +65,7 @@ public class MoveTest {

/** Bugzilla Report 11732 */
@Test
public void testDirectoryRemoval() throws IOException {
public void testDirectoryRemoval() {

buildRule.executeTarget("testDirectoryRemoval");
String output = buildRule.getProject().getProperty("output");
@@ -81,7 +81,7 @@ public class MoveTest {

/** Bugzilla Report 18886 */
@Test
public void testDirectoryRetaining() throws IOException {
public void testDirectoryRetaining() {
buildRule.executeTarget("testDirectoryRetaining");
String output = buildRule.getProject().getProperty("output");
assertTrue(new File(output,"E").exists());
@@ -100,7 +100,7 @@ public class MoveTest {
testCompleteDirectoryMove("testCompleteDirectoryMove2");
}

private void testCompleteDirectoryMove(String target) throws IOException {
private void testCompleteDirectoryMove(String target) {
buildRule.executeTarget(target);
String output = buildRule.getProject().getProperty("output");
assertTrue(new File(output,"E").exists());
@@ -111,7 +111,7 @@ public class MoveTest {
}

@Test
public void testPathElementMove() throws IOException {
public void testPathElementMove() {
buildRule.executeTarget("testPathElementMove");
String output = buildRule.getProject().getProperty("output");
assertTrue(new File(output,"E").exists());


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

@@ -130,7 +130,7 @@ public class ReplaceTest {
}

@Test
public void testNoPreserveLastModified() throws Exception {
public void testNoPreserveLastModified() {
buildRule.executeTarget("lastModifiedSetup");
File testFile = new File(buildRule.getOutputDir(), "test.txt");
assumeTrue("Could not change file modification time",
@@ -141,7 +141,7 @@ public class ReplaceTest {
}

@Test
public void testPreserveLastModified() throws Exception {
public void testPreserveLastModified() {
buildRule.executeTarget("lastModifiedSetup");
File testFile = new File(buildRule.getOutputDir(), "test.txt");
assumeTrue("Could not change file modification time",


+ 48
- 48
src/tests/junit/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java View File

@@ -52,7 +52,7 @@ public class RmicAdvancedTest {
* The JUnit setup method
*/
@Before
public void setUp() throws Exception {
public void setUp() {
buildRule.configureProject(TASKDEFS_DIR + "rmic.xml");
}

@@ -60,7 +60,7 @@ public class RmicAdvancedTest {
* verify that "default" binds us to the default compiler
*/
@Test
public void testDefault() throws Exception {
public void testDefault() {
buildRule.executeTarget("testDefault");
}

@@ -68,7 +68,7 @@ public class RmicAdvancedTest {
* verify that "default" binds us to the default compiler
*/
@Test
public void testDefaultDest() throws Exception {
public void testDefaultDest() {
buildRule.executeTarget("testDefaultDest");
}

@@ -76,7 +76,7 @@ public class RmicAdvancedTest {
* verify that "" binds us to the default compiler
*/
@Test
public void testEmpty() throws Exception {
public void testEmpty() {
buildRule.executeTarget("testEmpty");
}

@@ -84,7 +84,7 @@ public class RmicAdvancedTest {
* verify that "" binds us to the default compiler
*/
@Test
public void testEmptyDest() throws Exception {
public void testEmptyDest() {
buildRule.executeTarget("testEmptyDest");
}

@@ -92,7 +92,7 @@ public class RmicAdvancedTest {
* test sun's rmic compiler
*/
@Test
public void testRmic() throws Exception {
public void testRmic() {
buildRule.executeTarget("testRmic");
}

@@ -100,7 +100,7 @@ public class RmicAdvancedTest {
* test sun's rmic compiler
*/
@Test
public void testRmicDest() throws Exception {
public void testRmicDest() {
buildRule.executeTarget("testRmicDest");
}

@@ -109,7 +109,7 @@ public class RmicAdvancedTest {
* out -J arguments when not forking
*/
@Test
public void testRmicJArg() throws Exception {
public void testRmicJArg() {
buildRule.executeTarget("testRmicJArg");
}

@@ -118,7 +118,7 @@ public class RmicAdvancedTest {
* out -J arguments when not forking
*/
@Test
public void testRmicJArgDest() throws Exception {
public void testRmicJArgDest() {
buildRule.executeTarget("testRmicJArgDest");
}

@@ -126,7 +126,7 @@ public class RmicAdvancedTest {
* A unit test for JUnit
*/
@Test
public void testKaffe() throws Exception {
public void testKaffe() {
buildRule.executeTarget("testKaffe");
}

@@ -134,7 +134,7 @@ public class RmicAdvancedTest {
* A unit test for JUnit
*/
@Test
public void testKaffeDest() throws Exception {
public void testKaffeDest() {
buildRule.executeTarget("testKaffeDest");
}

@@ -144,7 +144,7 @@ public class RmicAdvancedTest {
*/
@Test
@Ignore("WLRmic tests don't work")
public void XtestWlrmic() throws Exception {
public void XtestWlrmic() {
buildRule.executeTarget("testWlrmic");
}

@@ -153,7 +153,7 @@ public class RmicAdvancedTest {
*/
@Test
@Ignore("WLRmic tests don't work")
public void XtestWlrmicJArg() throws Exception {
public void XtestWlrmicJArg() {
buildRule.executeTarget("testWlrmicJArg");
}

@@ -161,7 +161,7 @@ public class RmicAdvancedTest {
* test the forking compiler
*/
@Test
public void testForking() throws Exception {
public void testForking() {
buildRule.executeTarget("testForking");
}

@@ -169,7 +169,7 @@ public class RmicAdvancedTest {
* test the forking compiler
*/
@Test
public void testForkingAntClasspath() throws Exception {
public void testForkingAntClasspath() {
buildRule.executeTarget("testForkingAntClasspath");
}

@@ -177,7 +177,7 @@ public class RmicAdvancedTest {
* test the forking compiler
*/
@Test
public void testForkingAntClasspathDest() throws Exception {
public void testForkingAntClasspathDest() {
buildRule.executeTarget("testForkingAntClasspathDest");
}

@@ -185,7 +185,7 @@ public class RmicAdvancedTest {
* test the forking compiler
*/
@Test
public void testAntClasspath() throws Exception {
public void testAntClasspath() {
buildRule.executeTarget("testAntClasspath");
}

@@ -193,7 +193,7 @@ public class RmicAdvancedTest {
* test the forking compiler
*/
@Test
public void testAntClasspathDest() throws Exception {
public void testAntClasspathDest() {
buildRule.executeTarget("testAntClasspathDest");
}

@@ -201,7 +201,7 @@ public class RmicAdvancedTest {
* A unit test for JUnit
*/
@Test
public void testBadName() throws Exception {
public void testBadName() {
tried.expect(BuildException.class);
tried.expectMessage(RmicAdapterFactory.ERROR_UNKNOWN_COMPILER);
buildRule.executeTarget("testBadName");
@@ -211,7 +211,7 @@ public class RmicAdvancedTest {
* load an adapter by name
*/
@Test
public void testExplicitClass() throws Exception {
public void testExplicitClass() {
buildRule.executeTarget("testExplicitClass");
}

@@ -219,7 +219,7 @@ public class RmicAdvancedTest {
* A unit test for JUnit
*/
@Test
public void testWrongClass() throws Exception {
public void testWrongClass() {
tried.expect(BuildException.class);
tried.expectMessage(RmicAdapterFactory.ERROR_NOT_RMIC_ADAPTER);
buildRule.executeTarget("testWrongClass");
@@ -229,7 +229,7 @@ public class RmicAdvancedTest {
* A unit test for JUnit
*/
@Test
public void testDefaultBadClass() throws Exception {
public void testDefaultBadClass() {
tried.expect(BuildException.class);
tried.expectMessage(Rmic.ERROR_RMIC_FAILED);
try {
@@ -244,7 +244,7 @@ public class RmicAdvancedTest {
* A unit test for JUnit
*/
@Test
public void testMagicProperty() throws Exception {
public void testMagicProperty() {
tried.expect(BuildException.class);
tried.expectMessage(RmicAdapterFactory.ERROR_UNKNOWN_COMPILER);
buildRule.executeTarget("testMagicProperty");
@@ -254,20 +254,20 @@ public class RmicAdvancedTest {
* A unit test for JUnit
*/
@Test
public void testMagicPropertyOverridesEmptyString() throws Exception {
public void testMagicPropertyOverridesEmptyString() {
tried.expect(BuildException.class);
tried.expectMessage(RmicAdapterFactory.ERROR_UNKNOWN_COMPILER);
buildRule.executeTarget("testMagicPropertyOverridesEmptyString");
}

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

@Test
@Ignore("Previously named to prevent execution")
public void NotestFailingAdapter() throws Exception {
public void NotestFailingAdapter() {
tried.expect(BuildException.class);
tried.expectMessage(Rmic.ERROR_RMIC_FAILED);
buildRule.executeTarget("testFailingAdapter");
@@ -278,7 +278,7 @@ public class RmicAdvancedTest {
* @throws Exception if something goes wrong
*/
@Test
public void testVersion11() throws Exception {
public void testVersion11() {
buildRule.executeTarget("testVersion11");
}

@@ -287,7 +287,7 @@ public class RmicAdvancedTest {
* @throws Exception if something goes wrong
*/
@Test
public void testVersion11Dest() throws Exception {
public void testVersion11Dest() {
buildRule.executeTarget("testVersion11Dest");
}

@@ -297,7 +297,7 @@ public class RmicAdvancedTest {
* @throws Exception if something goes wrong
*/
@Test
public void testVersion12() throws Exception {
public void testVersion12() {
buildRule.executeTarget("testVersion12");
}

@@ -307,7 +307,7 @@ public class RmicAdvancedTest {
* @throws Exception if something goes wrong
*/
@Test
public void testVersion12Dest() throws Exception {
public void testVersion12Dest() {
buildRule.executeTarget("testVersion12Dest");
}

@@ -317,7 +317,7 @@ public class RmicAdvancedTest {
* @throws Exception if something goes wrong
*/
@Test
public void testVersionCompat() throws Exception {
public void testVersionCompat() {
buildRule.executeTarget("testVersionCompat");
}

@@ -327,7 +327,7 @@ public class RmicAdvancedTest {
* @throws Exception if something goes wrong
*/
@Test
public void testVersionCompatDest() throws Exception {
public void testVersionCompatDest() {
buildRule.executeTarget("testVersionCompatDest");
}

@@ -337,13 +337,13 @@ public class RmicAdvancedTest {
* @throws Exception if something goes wrong
*/
@Test
public void testXnewForked() throws Exception {
public void testXnewForked() {
assumeFalse("Current system is Java 9 or newer", JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_9));
buildRule.executeTarget("testXnewForked");
}

@Test
public void testXnewForkedJava9plus() throws Exception {
public void testXnewForkedJava9plus() {
assumeTrue("Current system is Java 8 or older", JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_9));
tried.expect(BuildException.class);
tried.expectMessage("JDK9 has removed support for -Xnew");
@@ -356,13 +356,13 @@ public class RmicAdvancedTest {
* @throws Exception if something goes wrong
*/
@Test
public void testXnewForkedDest() throws Exception {
public void testXnewForkedDest() {
assumeFalse("Current system is Java 9 or newer", JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_9));
buildRule.executeTarget("testXnewForkedDest");
}

@Test
public void testXnewForkedDestJava9plus() throws Exception {
public void testXnewForkedDestJava9plus() {
assumeTrue("Current system is Java 8 or older", JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_9));
tried.expect(BuildException.class);
tried.expectMessage("JDK9 has removed support for -Xnew");
@@ -375,13 +375,13 @@ public class RmicAdvancedTest {
* @throws Exception if something goes wrong
*/
@Test
public void testXnewCompiler() throws Exception {
public void testXnewCompiler() {
assumeFalse("Current system is Java 9 or newer", JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_9));
buildRule.executeTarget("testXnewCompiler");
}

@Test
public void testXnewCompilerJava9plus() throws Exception {
public void testXnewCompilerJava9plus() {
assumeTrue("Current system is Java 8 or older", JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_9));
tried.expect(BuildException.class);
tried.expectMessage("JDK9 has removed support for -Xnew");
@@ -394,13 +394,13 @@ public class RmicAdvancedTest {
* @throws Exception if something goes wrong
*/
@Test
public void testXnewCompilerDest() throws Exception {
public void testXnewCompilerDest() {
assumeFalse("Current system is Java 9 or newer", JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_9));
buildRule.executeTarget("testXnewCompilerDest");
}

@Test
public void testXnewCompilerDestJava9plus() throws Exception {
public void testXnewCompilerDestJava9plus() {
assumeTrue("Current system is Java 8 or older", JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_9));
tried.expect(BuildException.class);
tried.expectMessage("JDK9 has removed support for -Xnew");
@@ -413,13 +413,13 @@ public class RmicAdvancedTest {
* @throws Exception if something goes wrong
*/
@Test
public void testIDL() throws Exception {
public void testIDL() {
assumeFalse("Current system is Java 11 or newer", JavaEnvUtils.isAtLeastJavaVersion("11"));
buildRule.executeTarget("testIDL");
}

@Test
public void testIDLJava11plus() throws Exception {
public void testIDLJava11plus() {
assumeTrue("Current system is Java 10 or older", JavaEnvUtils.isAtLeastJavaVersion("11"));
tried.expect(BuildException.class);
tried.expectMessage("this rmic implementation doesn't support the -idl switch");
@@ -432,13 +432,13 @@ public class RmicAdvancedTest {
* @throws Exception if something goes wrong
*/
@Test
public void testIDLDest() throws Exception {
public void testIDLDest() {
assumeFalse("Current system is Java 11 or newer", JavaEnvUtils.isAtLeastJavaVersion("11"));
buildRule.executeTarget("testIDLDest");
}

@Test
public void testIDLDestJava11plus() throws Exception {
public void testIDLDestJava11plus() {
assumeTrue("Current system is Java 10 or older", JavaEnvUtils.isAtLeastJavaVersion("11"));
tried.expect(BuildException.class);
tried.expectMessage("this rmic implementation doesn't support the -idl switch");
@@ -451,13 +451,13 @@ public class RmicAdvancedTest {
* @throws Exception if something goes wrong
*/
@Test
public void testIIOP() throws Exception {
public void testIIOP() {
assumeFalse("Current system is Java 11 or newer", JavaEnvUtils.isAtLeastJavaVersion("11"));
buildRule.executeTarget("testIIOP");
}

@Test
public void testIIOPJava11plus() throws Exception {
public void testIIOPJava11plus() {
assumeTrue("Current system is Java 10 or older", JavaEnvUtils.isAtLeastJavaVersion("11"));
tried.expect(BuildException.class);
tried.expectMessage("this rmic implementation doesn't support the -iiop switch");
@@ -470,13 +470,13 @@ public class RmicAdvancedTest {
* @throws Exception if something goes wrong
*/
@Test
public void testIIOPDest() throws Exception {
public void testIIOPDest() {
assumeFalse("Current system is Java 11 or newer", JavaEnvUtils.isAtLeastJavaVersion("11"));
buildRule.executeTarget("testIIOPDest");
}

@Test
public void testIIOPDestJava11plus() throws Exception {
public void testIIOPDestJava11plus() {
assumeTrue("Current system is Java 10 or older", JavaEnvUtils.isAtLeastJavaVersion("11"));
tried.expect(BuildException.class);
tried.expectMessage("this rmic implementation doesn't support the -iiop switch");


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

@@ -63,7 +63,7 @@ public class SQLExecTest {
public static final String SQL = "sql";

@Before
public void setUp() throws Exception {
public void setUp() {
// make sure the cache is cleared.
JDBCTask.getLoaderMap().clear();
}
@@ -98,7 +98,7 @@ public class SQLExecTest {
}

@Test
public void testNull() throws Exception {
public void testNull() {
doMultipleCalls(1000, NULL, true, true);
}



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

@@ -44,12 +44,12 @@ public class StyleTest {
public final BuildFileRule buildRule = new BuildFileRule();

@Before
public void setUp() throws Exception {
public void setUp() {
buildRule.configureProject("src/etc/testcases/taskdefs/style/build.xml");
}

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

try {
buildRule.executeTarget("testStyleIsSet");
@@ -130,14 +130,14 @@ public class StyleTest {
}

@Test
public void testDirectoryHierarchyWithDirMatching() throws Exception {
public void testDirectoryHierarchyWithDirMatching() {
buildRule.executeTarget("testDirectoryHierarchyWithDirMatching");
assertTrue(new File(buildRule.getOutputDir().getAbsoluteFile(), "dest/level1/data.html")
.exists());
}

@Test
public void testDirsWithSpaces() throws Exception {
public void testDirsWithSpaces() {
buildRule.executeTarget("testDirsWithSpaces");
assertTrue(new File(buildRule.getOutputDir().getAbsoluteFile(), "d est/data.html")
.exists());


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

@@ -40,7 +40,7 @@ public class TStampTest {
protected Location location;

@Before
public void setUp() throws Exception {
public void setUp() {
location = new Location("test.xml");
project = new Project();
tstamp = new Tstamp();
@@ -49,7 +49,7 @@ public class TStampTest {
}

@Test
public void testTimeZone() throws Exception {
public void testTimeZone() {
Tstamp.CustomFormat format = tstamp.createFormat();
format.setProperty("today");
format.setPattern("HH:mm:ss z");
@@ -71,7 +71,7 @@ public class TStampTest {
* @throws Exception if something goes wrong
*/
@Test
public void testWriteOrder() throws Exception {
public void testWriteOrder() {
Tstamp.CustomFormat format = tstamp.createFormat();
format.setProperty("TODAY");
format.setPattern("HH:mm:ss z");
@@ -94,7 +94,7 @@ public class TStampTest {
* @throws Exception if something goes wrong
*/
@Test
public void testPrefix() throws Exception {
public void testPrefix() {
tstamp.setPrefix("prefix");
tstamp.execute();
String prop = project.getProperty("prefix.DSTAMP");
@@ -102,7 +102,7 @@ public class TStampTest {
}

@Test
public void testFormatPrefix() throws Exception {
public void testFormatPrefix() {
Tstamp.CustomFormat format = tstamp.createFormat();
format.setProperty("format");
format.setPattern("HH:mm:ss z");


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

@@ -21,7 +21,6 @@ package org.apache.tools.ant.taskdefs;
import java.io.File;
import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;

import org.apache.tools.ant.BuildException;
@@ -217,8 +216,7 @@ public class ZipTest {

// Bugzilla Report 33412
@Test
public void testDefaultExcludesAndUpdate()
throws ZipException, IOException {
public void testDefaultExcludesAndUpdate() throws IOException {
buildRule.executeTarget("testDefaultExcludesAndUpdate");
ZipFile f = null;
try {
@@ -303,7 +301,7 @@ public class ZipTest {
}

@Test
public void testRegexpMapper() throws IOException {
public void testRegexpMapper() {
buildRule.executeTarget("testRegexpMapper1");
File testFile = new File(buildRule.getOutputDir(), "regexp.zip");
long l = testFile.lastModified();


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

@@ -32,7 +32,7 @@ public class AntVersionTest {
public BuildFileRule buildRule = new BuildFileRule();

@Before
public void setUp() throws Exception {
public void setUp() {
buildRule.configureProject("src/etc/testcases/taskdefs/conditions/antversion.xml");
}



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

@@ -44,7 +44,7 @@ public class IsReachableTest {


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



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

@@ -34,7 +34,7 @@ public class ChangeLogParserTest {
protected ChangeLogParser parser = new ChangeLogParser();

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


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

@@ -182,7 +182,7 @@ public class EchoPropertiesTest {
}

@Test
public void testWithPrefixAndRegex() throws Exception {
public void testWithPrefixAndRegex() {
try {
buildRule.executeTarget("testWithPrefixAndRegex");
fail("BuildException should have been thrown on Prefix and RegEx being set");


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

@@ -60,12 +60,12 @@ public class JspcTest {
}

@Test
public void testUriroot() throws Exception {
public void testUriroot() {
executeJspCompile("testUriroot", "uriroot_jsp.java");
}

@Test
public void testXml() throws Exception {
public void testXml() {
executeJspCompile("testXml", "xml_jsp.java");
}

@@ -73,7 +73,7 @@ public class JspcTest {
* try a keyword in a file
*/
@Test
public void testKeyword() throws Exception {
public void testKeyword() {
executeJspCompile("testKeyword", "default_jsp.java");
}

@@ -81,13 +81,13 @@ public class JspcTest {
* what happens to 1nvalid-classname
*/
@Test
public void testInvalidClassname() throws Exception {
public void testInvalidClassname() {
executeJspCompile("testInvalidClassname",
"_1nvalid_0002dclassname_jsp.java");
}

@Test
public void testNoTld() throws Exception {
public void testNoTld() {
try {
buildRule.executeTarget("testNoTld");
fail("Not found");
@@ -97,7 +97,7 @@ public class JspcTest {
}

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

@@ -107,7 +107,7 @@ public class JspcTest {
*/
@Ignore("picks up on the missing_tld file, and incorrectly bails")
@Test
public void testWebapp() throws Exception {
public void testWebapp() {
buildRule.executeTarget("testWebapp");
}



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

@@ -115,7 +115,7 @@ public class PropertyFileTest {
}

@Test
public void testExerciseDefaultAndIncrement() throws Exception {
public void testExerciseDefaultAndIncrement() {
buildRule.executeTarget("exercise");
assertEquals("3", buildRule.getProject().getProperty("int.with.default"));
assertEquals("1", buildRule.getProject().getProperty("int.without.default"));


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

@@ -108,7 +108,7 @@ public class ReplaceRegExpTest {
}

@Test
public void testNoPreserveLastModified() throws Exception {
public void testNoPreserveLastModified() {
buildRule.executeTarget("lastModifiedSetup");
File testFile = new File(buildRule.getOutputDir(), "test.txt");
assumeTrue(testFile.setLastModified(testFile.lastModified()
@@ -119,7 +119,7 @@ public class ReplaceRegExpTest {
}

@Test
public void testPreserveLastModified() throws Exception {
public void testPreserveLastModified() {
buildRule.executeTarget("lastModifiedSetup");
File testFile = new File(buildRule.getOutputDir(), "test.txt");
assumeTrue(testFile.setLastModified(testFile.lastModified()


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

@@ -31,7 +31,7 @@ import static org.apache.tools.ant.AntAssert.assertContains;
public class RpmTest {

@Test
public void testShouldThrowExceptionWhenRpmFails() throws Exception {
public void testShouldThrowExceptionWhenRpmFails() {
Rpm rpm = new MyRpm();
rpm.setProject(new Project());
rpm.setFailOnError(true);
@@ -45,7 +45,7 @@ public class RpmTest {
}

@Test
public void testShouldNotThrowExceptionWhenRpmFails() throws Exception {
public void testShouldNotThrowExceptionWhenRpmFails() {
Rpm rpm = new MyRpm();
rpm.execute();
}


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

@@ -49,7 +49,7 @@ public class SchemaValidateTest {
* test with no namespace
*/
@Test
public void testNoNamespace() throws Exception {
public void testNoNamespace() {
buildRule.executeTarget("testNoNamespace");
}

@@ -57,12 +57,12 @@ public class SchemaValidateTest {
* add namespace awareness.
*/
@Test
public void testNSMapping() throws Exception {
public void testNSMapping() {
buildRule.executeTarget("testNSMapping");
}

@Test
public void testNoEmptySchemaNamespace() throws Exception {
public void testNoEmptySchemaNamespace() {
try {
buildRule.executeTarget("testNoEmptySchemaNamespace");
fail("Empty namespace URI");
@@ -72,7 +72,7 @@ public class SchemaValidateTest {
}

@Test
public void testNoEmptySchemaLocation() throws Exception {
public void testNoEmptySchemaLocation() {
try {
buildRule.executeTarget("testNoEmptySchemaLocation");
fail("Empty schema location");
@@ -83,7 +83,7 @@ public class SchemaValidateTest {
}

@Test
public void testNoFile() throws Exception {
public void testNoFile() {
try {
buildRule.executeTarget("testNoFile");
fail("No file at file attribute");
@@ -94,7 +94,7 @@ public class SchemaValidateTest {
}

@Test
public void testNoDoubleSchemaLocation() throws Exception {
public void testNoDoubleSchemaLocation() {
try {
buildRule.executeTarget("testNoDoubleSchemaLocation");
fail("Two locations for schemas");
@@ -105,7 +105,7 @@ public class SchemaValidateTest {
}

@Test
public void testNoDuplicateSchema() throws Exception {
public void testNoDuplicateSchema() {
try {
buildRule.executeTarget("testNoDuplicateSchema");
fail("duplicate schemas with different values");
@@ -116,12 +116,12 @@ public class SchemaValidateTest {
}

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

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

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

@@ -54,7 +54,7 @@ public class XmlValidateTest {
* Basic inline 'dtd' element test.
*/
@Test
public void testValidate() throws Exception {
public void testValidate() {
buildRule.executeTarget("testValidate");
}

@@ -62,7 +62,7 @@ public class XmlValidateTest {
* Test indirect validation.
*/
@Test
public void testDeepValidate() throws Exception {
public void testDeepValidate() {
buildRule.executeTarget("testDeepValidate");
}



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

@@ -56,17 +56,17 @@ public class XsltTest {
}

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

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

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

@@ -75,7 +75,7 @@ public class XsltTest {
* @throws Exception if something goes wrong.
*/
@Test
public void testStyleSheetWithInclude() throws Exception {
public void testStyleSheetWithInclude() {
buildRule.executeTarget("testStyleSheetWithInclude");
if (buildRule.getLog().contains("java.io.FileNotFoundException")) {
fail("xsl:include was not found");


+ 1
- 1
src/tests/junit/org/apache/tools/ant/taskdefs/optional/image/ImageTest.java View File

@@ -72,7 +72,7 @@ public class ImageTest {
}

@Test
public void testOverwriteTrue() throws InterruptedException {
public void testOverwriteTrue() {
buildRule.executeTarget("testSimpleScale");
AntAssert.assertContains("Processing File", buildRule.getLog());
File f = new File(buildRule.getOutputDir(), LARGEIMAGE);


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

@@ -97,21 +97,21 @@ public class JUnitReportTest {
}

@Test
public void testEmptyFile() throws Exception {
public void testEmptyFile() {
buildRule.executeTarget("testEmptyFile");
assertIndexCreated();
assertContains("Required text not found in log", XMLResultAggregator.WARNING_EMPTY_FILE, buildRule.getLog());
}

@Test
public void testIncompleteFile() throws Exception {
public void testIncompleteFile() {
buildRule.executeTarget("testIncompleteFile");
assertIndexCreated();
assertContains("Required text not found in log", XMLResultAggregator.WARNING_IS_POSSIBLY_CORRUPTED, buildRule.getLog());
}

@Test
public void testWrongElement() throws Exception {
public void testWrongElement() {
buildRule.executeTarget("testWrongElement");
assertIndexCreated();
assertContains("Required text not found in log", XMLResultAggregator.WARNING_INVALID_ROOT_ELEMENT, buildRule.getLog());


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

@@ -97,7 +97,7 @@ public class JUnitTaskTest {
}

@Test
public void testNonForkedCapture() throws IOException {
public void testNonForkedCapture() {
buildRule.executeTarget("capture");
assertNoPrint(buildRule.getLog(), "log");
assertNoPrint(buildRule.getFullLog(), "debug log");


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

@@ -22,7 +22,6 @@ import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.apache.tools.ant.BuildException;
@@ -174,7 +173,7 @@ public class ScpTest {
}

@Test
public void testRemoteToDir() throws IOException {
public void testRemoteToDir() {

// first try an invalid URI
try {


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

@@ -102,7 +102,7 @@ public class CommandlineJavaTest {
}

@Test
public void testJarOption() throws Exception {
public void testJarOption() {
CommandlineJava c = new CommandlineJava();
c.createArgument().setValue("arg1");
c.setJar("myfile.jar");


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

@@ -56,7 +56,7 @@ public class XMLCatalogTest {
return cat;
}

private static String toURLString(File file) throws MalformedURLException {
private static String toURLString(File file) {
return JAXPUtils.getSystemId(file);
}



+ 2
- 2
src/tests/junit/org/apache/tools/ant/types/resources/LazyResourceCollectionTest.java View File

@@ -77,7 +77,7 @@ public class LazyResourceCollectionTest {
}

@Test
public void testLazyLoading() throws Exception {
public void testLazyLoading() {
StringResourceCollection collectionTest = new StringResourceCollection();
LazyResourceCollectionWrapper lazyCollection = new LazyResourceCollectionWrapper();
lazyCollection.add(collectionTest);
@@ -118,7 +118,7 @@ public class LazyResourceCollectionTest {
}

@Test
public void testCaching() throws Exception {
public void testCaching() {
StringResourceCollection collectionTest = new StringResourceCollection();
LazyResourceCollectionWrapper lazyCollection = new LazyResourceCollectionWrapper();
lazyCollection.add(collectionTest);


+ 3
- 3
src/tests/junit/org/apache/tools/ant/types/resources/ResourceListTest.java View File

@@ -35,12 +35,12 @@ public class ResourceListTest {
public BuildFileRule buildRule = new BuildFileRule();

@Before
public void setUp() throws Exception {
public void setUp() {
buildRule.configureProject("src/etc/testcases/types/resources/resourcelist.xml");
}

@After
public void tearDown() throws Exception {
public void tearDown() {
buildRule.executeTarget("tearDown");
}

@@ -108,7 +108,7 @@ public class ResourceListTest {
}

@Test
public void testCircularReference() throws Exception {
public void testCircularReference() {
ResourceList rl1 = new ResourceList();
rl1.setProject(buildRule.getProject());
rl1.setRefid(new Reference(buildRule.getProject(), "foo"));


+ 2
- 2
src/tests/junit/org/apache/tools/ant/types/resources/TarResourceTest.java View File

@@ -36,13 +36,13 @@ public class TarResourceTest {
public BuildFileRule buildRule = new BuildFileRule();

@Before
public void setUp() throws Exception {
public void setUp() {
buildRule.configureProject("src/etc/testcases/types/resources/tarentry.xml");
}


@After
public void tearDown() throws Exception {
public void tearDown() {
buildRule.executeTarget("tearDown");
}



+ 2
- 10
src/tests/junit/org/apache/tools/bzip2/CBZip2StreamTest.java View File

@@ -23,20 +23,12 @@ import java.io.IOException;

import org.junit.Test;

import static org.junit.Assert.fail;

public class CBZip2StreamTest {

@SuppressWarnings("resource")
@Test
@Test(expected = IOException.class)
public void testNullPointer() throws IOException {
try {
new CBZip2InputStream(new ByteArrayInputStream(new byte[0]));
fail("expected an exception");
} catch (IOException e) {
// expected
//TODO assert exception values
}
new CBZip2InputStream(new ByteArrayInputStream(new byte[0]));
}

@Test


+ 2
- 2
src/tests/junit/org/apache/tools/zip/ZipOutputStreamTest.java View File

@@ -32,7 +32,7 @@ public class ZipOutputStreamTest {
private ZipLong zl;

@Before
public void setUp() throws Exception {
public void setUp() {
time = new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(time);
@@ -55,7 +55,7 @@ public class ZipOutputStreamTest {


@Test
public void testZipLong() throws Exception {
public void testZipLong() {
ZipLong test = ZipOutputStream.toDosTime(time);
assertEquals(test.getValue(), zl.getValue());
}


+ 1
- 1
src/tests/junit/org/example/junitlauncher/vintage/AlwaysFailingJUnit4Test.java View File

@@ -10,7 +10,7 @@ import static org.junit.Assert.assertEquals;
public class AlwaysFailingJUnit4Test {

@Test
public void testWillFail() throws Exception {
public void testWillFail() {
assertEquals("Values weren't equal", 3, 4);
}
}

+ 1
- 1
src/tests/junit/org/example/junitlauncher/vintage/JUnit4SampleTest.java View File

@@ -14,7 +14,7 @@ public class JUnit4SampleTest {
}

@Test
public void testBar() throws Exception {
public void testBar() {
Assert.assertTrue(true);
}



Loading…
Cancel
Save