Browse Source

sleep a little longer during tests

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@731937 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 17 years ago
parent
commit
77cc5846cb
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      src/tests/junit/org/apache/tools/ant/taskdefs/ReplaceTest.java
  2. +2
    -2
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/ReplaceRegExpTest.java

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

@@ -79,7 +79,7 @@ public class ReplaceTest extends BuildFileTest {
executeTarget("lastModifiedSetup"); executeTarget("lastModifiedSetup");
String tmpdir = project.getProperty("tmp.dir"); String tmpdir = project.getProperty("tmp.dir");
long ts1 = new File(tmpdir, "test.txt").lastModified(); long ts1 = new File(tmpdir, "test.txt").lastModified();
Thread.sleep(2);
Thread.sleep(3000);
executeTarget("testNoPreserve"); executeTarget("testNoPreserve");
assertTrue(ts1 < new File(tmpdir, "test.txt").lastModified()); assertTrue(ts1 < new File(tmpdir, "test.txt").lastModified());
} }
@@ -88,7 +88,7 @@ public class ReplaceTest extends BuildFileTest {
executeTarget("lastModifiedSetup"); executeTarget("lastModifiedSetup");
String tmpdir = project.getProperty("tmp.dir"); String tmpdir = project.getProperty("tmp.dir");
long ts1 = new File(tmpdir, "test.txt").lastModified(); long ts1 = new File(tmpdir, "test.txt").lastModified();
Thread.sleep(2);
Thread.sleep(3000);
executeTarget("testPreserve"); executeTarget("testPreserve");
assertTrue(ts1 == new File(tmpdir, "test.txt").lastModified()); assertTrue(ts1 == new File(tmpdir, "test.txt").lastModified());
} }


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

@@ -106,7 +106,7 @@ public class ReplaceRegExpTest extends BuildFileTest {
executeTarget("lastModifiedSetup"); executeTarget("lastModifiedSetup");
String tmpdir = project.getProperty("tmpregexp"); String tmpdir = project.getProperty("tmpregexp");
long ts1 = new File(tmpdir, "test.txt").lastModified(); long ts1 = new File(tmpdir, "test.txt").lastModified();
Thread.sleep(2);
Thread.sleep(3000);
executeTarget("testNoPreserve"); executeTarget("testNoPreserve");
assertTrue(ts1 < new File(tmpdir, "test.txt").lastModified()); assertTrue(ts1 < new File(tmpdir, "test.txt").lastModified());
} }
@@ -115,7 +115,7 @@ public class ReplaceRegExpTest extends BuildFileTest {
executeTarget("lastModifiedSetup"); executeTarget("lastModifiedSetup");
String tmpdir = project.getProperty("tmpregexp"); String tmpdir = project.getProperty("tmpregexp");
long ts1 = new File(tmpdir, "test.txt").lastModified(); long ts1 = new File(tmpdir, "test.txt").lastModified();
Thread.sleep(2);
Thread.sleep(3000);
executeTarget("testPreserve"); executeTarget("testPreserve");
assertTrue(ts1 == new File(tmpdir, "test.txt").lastModified()); assertTrue(ts1 == new File(tmpdir, "test.txt").lastModified());
} }


Loading…
Cancel
Save