Browse Source

harness support for dirchanges delay (milliseconds) attribute

tags/for_ajdt1_1_12
wisberg 20 years ago
parent
commit
2489444ba5

+ 13
- 1
testing/src/org/aspectj/testing/harness/bridge/DirChanges.java View File

@@ -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
*/

+ 1
- 1
tests/ajcHarnessTests.xml View File

@@ -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(..),

+ 1
- 0
tests/ajcTestSuite.dtd View File

@@ -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 >

Loading…
Cancel
Save