git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277240 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -112,7 +112,7 @@ public class FixCrLfTest extends BuildFileTest { | |||||
| * granularity (should be > 2s to account for Windows FAT). | * granularity (should be > 2s to account for Windows FAT). | ||||
| */ | */ | ||||
| try { | try { | ||||
| Thread.currentThread().sleep(5000); | |||||
| Thread.sleep(5000); | |||||
| } catch (InterruptedException ie) { | } catch (InterruptedException ie) { | ||||
| fail(ie.getMessage()); | fail(ie.getMessage()); | ||||
| } // end of try-catch | } // end of try-catch | ||||
| @@ -96,7 +96,7 @@ public class JarTest extends BuildFileTest { | |||||
| File jarFile = new File(getProjectDir(), tempJar); | File jarFile = new File(getProjectDir(), tempJar); | ||||
| long jarModifiedDate = jarFile.lastModified(); | long jarModifiedDate = jarFile.lastModified(); | ||||
| try { | try { | ||||
| Thread.currentThread().sleep(2500); | |||||
| Thread.sleep(2500); | |||||
| } catch (InterruptedException e) { | } catch (InterruptedException e) { | ||||
| } // end of try-catch | } // end of try-catch | ||||
| executeTarget(secondTarget); | executeTarget(secondTarget); | ||||
| @@ -127,7 +127,7 @@ public class JarTest extends BuildFileTest { | |||||
| long sleeptime = 3000 | long sleeptime = 3000 | ||||
| + FileUtils.newFileUtils().getFileTimestampGranularity(); | + FileUtils.newFileUtils().getFileTimestampGranularity(); | ||||
| try { | try { | ||||
| Thread.currentThread().sleep(sleeptime); | |||||
| Thread.sleep(sleeptime); | |||||
| } catch (InterruptedException e) { | } catch (InterruptedException e) { | ||||
| } // end of try-catch | } // end of try-catch | ||||
| File jarFile = new File(getProjectDir(), tempJar); | File jarFile = new File(getProjectDir(), tempJar); | ||||
| @@ -122,7 +122,7 @@ public class ZipTest extends BuildFileTest { | |||||
| throws InterruptedException { | throws InterruptedException { | ||||
| executeTarget("testFilesOnlyDoesntCauseRecreateSetup"); | executeTarget("testFilesOnlyDoesntCauseRecreateSetup"); | ||||
| long l = getProject().resolveFile("test3.zip").lastModified(); | long l = getProject().resolveFile("test3.zip").lastModified(); | ||||
| Thread.currentThread().sleep(3000); | |||||
| Thread.sleep(3000); | |||||
| executeTarget("testFilesOnlyDoesntCauseRecreate"); | executeTarget("testFilesOnlyDoesntCauseRecreate"); | ||||
| assertEquals(l, getProject().resolveFile("test3.zip").lastModified()); | assertEquals(l, getProject().resolveFile("test3.zip").lastModified()); | ||||
| } | } | ||||
| @@ -29,7 +29,7 @@ public class Sleeper extends TestCase { | |||||
| public void testSleep() { | public void testSleep() { | ||||
| try { | try { | ||||
| Thread.currentThread().sleep(5 * 1000); | |||||
| Thread.sleep(5 * 1000); | |||||
| } catch (InterruptedException e) { | } catch (InterruptedException e) { | ||||
| } // end of try-catch | } // end of try-catch | ||||
| } | } | ||||
| @@ -36,14 +36,14 @@ public class P4ChangeTest extends TestCase { | |||||
| public void testBackslash(){ | public void testBackslash(){ | ||||
| String input = "comment with a / inside"; | String input = "comment with a / inside"; | ||||
| String output = p4change.backslash(input); | |||||
| String output = P4Change.backslash(input); | |||||
| assertEquals("comment with a \\/ inside", output); | assertEquals("comment with a \\/ inside", output); | ||||
| } | } | ||||
| public void testSubstitute(){ | public void testSubstitute(){ | ||||
| Perl5Util util = new Perl5Util(); | Perl5Util util = new Perl5Util(); | ||||
| String tosubstitute = "xx<here>xx"; | String tosubstitute = "xx<here>xx"; | ||||
| String input = p4change.backslash("/a/b/c/"); | |||||
| String input = P4Change.backslash("/a/b/c/"); | |||||
| String output = util.substitute("s/<here>/" + input + "/", tosubstitute); | String output = util.substitute("s/<here>/" + input + "/", tosubstitute); | ||||
| assertEquals("xx/a/b/c/xx", output); | assertEquals("xx/a/b/c/xx", output); | ||||
| } | } | ||||
| @@ -42,9 +42,9 @@ public class ScriptDefTest extends BuildFileTest { | |||||
| public void testSimple() { | public void testSimple() { | ||||
| executeTarget("simple"); | executeTarget("simple"); | ||||
| // get the fileset and its basedir | // get the fileset and its basedir | ||||
| Project project = getProject(); | |||||
| FileSet fileset = (FileSet) project.getReference("testfileset"); | |||||
| File baseDir = fileset.getDir(project); | |||||
| Project p = getProject(); | |||||
| FileSet fileset = (FileSet) p.getReference("testfileset"); | |||||
| File baseDir = fileset.getDir(p); | |||||
| String log = getLog(); | String log = getLog(); | ||||
| assertTrue("Expecting attribute value printed", | assertTrue("Expecting attribute value printed", | ||||
| log.indexOf("Attribute attr1 = test") != -1); | log.indexOf("Attribute attr1 = test") != -1); | ||||
| @@ -68,9 +68,9 @@ public class ScriptDefTest extends BuildFileTest { | |||||
| public void testNestedByClassName() { | public void testNestedByClassName() { | ||||
| executeTarget("nestedbyclassname"); | executeTarget("nestedbyclassname"); | ||||
| // get the fileset and its basedir | // get the fileset and its basedir | ||||
| Project project = getProject(); | |||||
| FileSet fileset = (FileSet) project.getReference("testfileset"); | |||||
| File baseDir = fileset.getDir(project); | |||||
| Project p = getProject(); | |||||
| FileSet fileset = (FileSet) p.getReference("testfileset"); | |||||
| File baseDir = fileset.getDir(p); | |||||
| String log = getLog(); | String log = getLog(); | ||||
| assertTrue("Expecting attribute value to be printed", | assertTrue("Expecting attribute value to be printed", | ||||
| log.indexOf("Attribute attr1 = test") != -1); | log.indexOf("Attribute attr1 = test") != -1); | ||||
| @@ -107,7 +107,6 @@ public class ScriptDefTest extends BuildFileTest { | |||||
| public void testProperty() { | public void testProperty() { | ||||
| executeTarget("property"); | executeTarget("property"); | ||||
| // get the fileset and its basedir | // get the fileset and its basedir | ||||
| Project project = getProject(); | |||||
| String log = getLog(); | String log = getLog(); | ||||
| assertTrue("Expecting property in attribute value replaced", | assertTrue("Expecting property in attribute value replaced", | ||||
| log.indexOf("Attribute value = test") != -1); | log.indexOf("Attribute value = test") != -1); | ||||
| @@ -53,10 +53,10 @@ public class ClassFileSetTest extends BuildFileTest { | |||||
| * Test basic clasfileset | * Test basic clasfileset | ||||
| */ | */ | ||||
| public void testBasicSet() { | public void testBasicSet() { | ||||
| Project project = getProject(); | |||||
| Project p = getProject(); | |||||
| executeTarget("testbasicset"); | executeTarget("testbasicset"); | ||||
| FileSet resultFileSet = (FileSet)project.getReference(RESULT_FILESET); | |||||
| DirectoryScanner scanner = resultFileSet.getDirectoryScanner(project); | |||||
| FileSet resultFileSet = (FileSet)p.getReference(RESULT_FILESET); | |||||
| DirectoryScanner scanner = resultFileSet.getDirectoryScanner(p); | |||||
| String[] scannedFiles = scanner.getIncludedFiles(); | String[] scannedFiles = scanner.getIncludedFiles(); | ||||
| Hashtable files = new Hashtable(); | Hashtable files = new Hashtable(); | ||||
| for (int i = 0; i < scannedFiles.length; ++i) { | for (int i = 0; i < scannedFiles.length; ++i) { | ||||
| @@ -78,10 +78,10 @@ public class ClassFileSetTest extends BuildFileTest { | |||||
| * Test small classfileset | * Test small classfileset | ||||
| */ | */ | ||||
| public void testSmallSet() { | public void testSmallSet() { | ||||
| Project project = getProject(); | |||||
| Project p = getProject(); | |||||
| executeTarget("testsmallset"); | executeTarget("testsmallset"); | ||||
| FileSet resultFileSet = (FileSet)project.getReference(RESULT_FILESET); | |||||
| DirectoryScanner scanner = resultFileSet.getDirectoryScanner(project); | |||||
| FileSet resultFileSet = (FileSet)p.getReference(RESULT_FILESET); | |||||
| DirectoryScanner scanner = resultFileSet.getDirectoryScanner(p); | |||||
| String[] scannedFiles = scanner.getIncludedFiles(); | String[] scannedFiles = scanner.getIncludedFiles(); | ||||
| Hashtable files = new Hashtable(); | Hashtable files = new Hashtable(); | ||||
| for (int i = 0; i < scannedFiles.length; ++i) { | for (int i = 0; i < scannedFiles.length; ++i) { | ||||
| @@ -99,10 +99,10 @@ public class ClassFileSetTest extends BuildFileTest { | |||||
| * Test conbo classfileset | * Test conbo classfileset | ||||
| */ | */ | ||||
| public void testComboSet() { | public void testComboSet() { | ||||
| Project project = getProject(); | |||||
| Project p = getProject(); | |||||
| executeTarget("testcomboset"); | executeTarget("testcomboset"); | ||||
| FileSet resultFileSet = (FileSet)project.getReference(RESULT_FILESET); | |||||
| DirectoryScanner scanner = resultFileSet.getDirectoryScanner(project); | |||||
| FileSet resultFileSet = (FileSet)p.getReference(RESULT_FILESET); | |||||
| DirectoryScanner scanner = resultFileSet.getDirectoryScanner(p); | |||||
| String[] scannedFiles = scanner.getIncludedFiles(); | String[] scannedFiles = scanner.getIncludedFiles(); | ||||
| Hashtable files = new Hashtable(); | Hashtable files = new Hashtable(); | ||||
| for (int i = 0; i < scannedFiles.length; ++i) { | for (int i = 0; i < scannedFiles.length; ++i) { | ||||
| @@ -125,10 +125,10 @@ public class ClassFileSetTest extends BuildFileTest { | |||||
| * Test that classes included in a method "System.out.println(MyClass.class)" are included. | * Test that classes included in a method "System.out.println(MyClass.class)" are included. | ||||
| */ | */ | ||||
| public void testMethodParam() { | public void testMethodParam() { | ||||
| Project project = getProject(); | |||||
| Project p = getProject(); | |||||
| executeTarget("testmethodparam"); | executeTarget("testmethodparam"); | ||||
| FileSet resultFileSet = (FileSet)project.getReference(RESULT_FILESET); | |||||
| DirectoryScanner scanner = resultFileSet.getDirectoryScanner(project); | |||||
| FileSet resultFileSet = (FileSet)p.getReference(RESULT_FILESET); | |||||
| DirectoryScanner scanner = resultFileSet.getDirectoryScanner(p); | |||||
| String[] scannedFiles = scanner.getIncludedFiles(); | String[] scannedFiles = scanner.getIncludedFiles(); | ||||
| Hashtable files = new Hashtable(); | Hashtable files = new Hashtable(); | ||||
| for (int i = 0; i < scannedFiles.length; ++i) { | for (int i = 0; i < scannedFiles.length; ++i) { | ||||
| @@ -152,10 +152,10 @@ public class ClassFileSetTest extends BuildFileTest { | |||||
| * Test that classes included in a method "System.out.println(Outer.Inner.class)" are included. | * Test that classes included in a method "System.out.println(Outer.Inner.class)" are included. | ||||
| */ | */ | ||||
| public void testMethodParamInner() { | public void testMethodParamInner() { | ||||
| Project project = getProject(); | |||||
| Project p = getProject(); | |||||
| executeTarget("testmethodparaminner"); | executeTarget("testmethodparaminner"); | ||||
| FileSet resultFileSet = (FileSet)project.getReference(RESULT_FILESET); | |||||
| DirectoryScanner scanner = resultFileSet.getDirectoryScanner(project); | |||||
| FileSet resultFileSet = (FileSet)p.getReference(RESULT_FILESET); | |||||
| DirectoryScanner scanner = resultFileSet.getDirectoryScanner(p); | |||||
| String[] scannedFiles = scanner.getIncludedFiles(); | String[] scannedFiles = scanner.getIncludedFiles(); | ||||
| Hashtable files = new Hashtable(); | Hashtable files = new Hashtable(); | ||||
| for (int i = 0; i < scannedFiles.length; ++i) { | for (int i = 0; i < scannedFiles.length; ++i) { | ||||