diff options
-rw-r--r-- | testing/src/org/aspectj/testing/harness/bridge/DirChanges.java | 14 | ||||
-rw-r--r-- | tests/ajcHarnessTests.xml | 2 | ||||
-rw-r--r-- | tests/ajcTestSuite.dtd | 1 |
3 files changed, 15 insertions, 2 deletions
diff --git a/testing/src/org/aspectj/testing/harness/bridge/DirChanges.java b/testing/src/org/aspectj/testing/harness/bridge/DirChanges.java index c138d4559..fc55cfde4 100644 --- a/testing/src/org/aspectj/testing/harness/bridge/DirChanges.java +++ b/testing/src/org/aspectj/testing/harness/bridge/DirChanges.java @@ -139,7 +139,7 @@ public class DirChanges { if (0l == startTime) { throw new IllegalStateException("called before start"); } - final long targetTime = startTime + DELAY; + final long targetTime = startTime + spec.delayInMilliseconds; do { long curTime = System.currentTimeMillis(); if (curTime >= targetTime) { @@ -463,6 +463,8 @@ public class DirChanges { /** relative path of dir with expected files for comparison */ String expDir; + long delayInMilliseconds = DELAY; + /** if true, fail on first mis-match */ boolean fastFail; @@ -504,6 +506,16 @@ public class DirChanges { expDir = expectedDirRelativePath; } + public void setDelay(String delay) { + if (null != delay) { + // let NumberFormatException propogate up + delayInMilliseconds = Long.parseLong(delay); + if (delayInMilliseconds < 0l) { + delayInMilliseconds = 0l; + } + } + } + /** * @param clipSuffix the String suffix, if any, to clip automatically */ diff --git a/tests/ajcHarnessTests.xml b/tests/ajcHarnessTests.xml index 304552eff..d3534b01d 100644 --- a/tests/ajcHarnessTests.xml +++ b/tests/ajcHarnessTests.xml @@ -243,7 +243,7 @@ options="in packageOne.Main.main(..), before main packageOne.Main"/> <inc-compile tag="20"> - <dir-changes updated="packageOne.Main"/> + <dir-changes delay="2000" updated="packageOne.Main"/> </inc-compile> <run class="packageOne.Main" options="in longer packageOne.Main.main(..), diff --git a/tests/ajcTestSuite.dtd b/tests/ajcTestSuite.dtd index f6626208f..45c00f0c0 100644 --- a/tests/ajcTestSuite.dtd +++ b/tests/ajcTestSuite.dtd @@ -62,4 +62,5 @@ <!ATTLIST dir-changes unchanged CDATA #IMPLIED >
<!ATTLIST dir-changes expDir CDATA #IMPLIED >
<!ATTLIST dir-changes fastFail CDATA #IMPLIED >
+ <!ATTLIST dir-changes delay CDATA #IMPLIED >
|