| @@ -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) { | |||
| @@ -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 | |||
| @@ -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; | |||
| /** | |||
| @@ -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); | |||
| @@ -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"); | |||
| } | |||
| @@ -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"); | |||
| @@ -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" */ | |||
| @@ -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(); | |||
| } | |||
| @@ -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 | |||
| @@ -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, | |||
| @@ -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/**"}); | |||
| @@ -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"); | |||
| @@ -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"); | |||
| @@ -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; | |||
| @@ -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); | |||
| @@ -49,7 +49,7 @@ public class LineContainsTest { | |||
| } | |||
| @Test | |||
| public void testNegateLineContains() throws IOException { | |||
| public void testNegateLineContains() { | |||
| buildRule.executeTarget("testNegateLineContains"); | |||
| } | |||
| @@ -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"); | |||
| } | |||
| @@ -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()); | |||
| } | |||
| @@ -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%"); | |||
| } | |||
| @@ -42,7 +42,7 @@ public class ChecksumTest { | |||
| } | |||
| @Test | |||
| public void testCreateMd5() throws IOException { | |||
| public void testCreateMd5() { | |||
| buildRule.executeTarget("createMd5"); | |||
| } | |||
| @@ -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"); | |||
| @@ -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)); | |||
| @@ -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); | |||
| @@ -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()); | |||
| @@ -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", | |||
| @@ -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"); | |||
| @@ -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); | |||
| } | |||
| @@ -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()); | |||
| @@ -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"); | |||
| @@ -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(); | |||
| @@ -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"); | |||
| } | |||
| @@ -44,7 +44,7 @@ public class IsReachableTest { | |||
| @Test | |||
| public void testLocalhost() throws Exception { | |||
| public void testLocalhost() { | |||
| buildRule.executeTarget("testLocalhost"); | |||
| } | |||
| @@ -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"); | |||
| @@ -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"); | |||
| @@ -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"); | |||
| } | |||
| @@ -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")); | |||
| @@ -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() | |||
| @@ -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(); | |||
| } | |||
| @@ -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"); | |||
| } | |||
| } | |||
| @@ -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"); | |||
| } | |||
| @@ -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"); | |||
| @@ -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); | |||
| @@ -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()); | |||
| @@ -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"); | |||
| @@ -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 { | |||
| @@ -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"); | |||
| @@ -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); | |||
| } | |||
| @@ -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); | |||
| @@ -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")); | |||
| @@ -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"); | |||
| } | |||
| @@ -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 | |||
| @@ -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()); | |||
| } | |||
| @@ -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); | |||
| } | |||
| } | |||
| @@ -14,7 +14,7 @@ public class JUnit4SampleTest { | |||
| } | |||
| @Test | |||
| public void testBar() throws Exception { | |||
| public void testBar() { | |||
| Assert.assertTrue(true); | |||
| } | |||