From af0e70f1615f256a43e798ab7b7fc3d53089f588 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Mon, 28 Feb 2022 09:23:44 +0700 Subject: RunSpec: allow '' Previously 'ordered="no"' was only permitted for 'stderr'. We need this for tests with asynchronous log output on standard error. Signed-off-by: Alexander Kriegisch --- testing/src/test/java/org/aspectj/testing/RunSpec.java | 7 ++++++- testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'testing') diff --git a/testing/src/test/java/org/aspectj/testing/RunSpec.java b/testing/src/test/java/org/aspectj/testing/RunSpec.java index d687ae86b..9e07f8a44 100644 --- a/testing/src/test/java/org/aspectj/testing/RunSpec.java +++ b/testing/src/test/java/org/aspectj/testing/RunSpec.java @@ -36,6 +36,7 @@ public class RunSpec implements ITestStep { private String options; private String cpath; private String mpath; + private String orderedStdout; private String orderedStderr; private AjcTest myTest; private OutputSpec stdErrSpec; @@ -78,7 +79,7 @@ public class RunSpec implements ITestStep { stdErrSpec.matchAgainst(rr.getStdErr(), orderedStderr); } if (stdOutSpec != null) { - stdOutSpec.matchAgainst(rr.getStdOut()); + stdOutSpec.matchAgainst(rr.getStdOut(), orderedStdout); } } finally { restoreProperties(); @@ -171,6 +172,10 @@ public class RunSpec implements ITestStep { this.orderedStderr = orderedStderr; } + public void setOrderedStdout(String orderedStdout) { + this.orderedStdout = orderedStdout; + } + public String getClassToRun() { return classToRun; } diff --git a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java index 3954c7ecc..6af8ced47 100644 --- a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java +++ b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java @@ -251,6 +251,7 @@ public abstract class XMLBasedAjcTestCase extends AjcTestCase { digester.addSetProperties("suite/ajc-test/run", "module", "moduleToRun"); digester.addSetProperties("suite/ajc-test/run", "ltw", "ltwFile"); digester.addSetProperties("suite/ajc-test/run", "xlintfile", "xlintFile"); + digester.addSetProperties("suite/ajc-test/run/stdout", "ordered", "orderedStdout"); digester.addSetProperties("suite/ajc-test/run/stderr", "ordered", "orderedStderr"); digester.addSetNext("suite/ajc-test/run", "addTestStep", "org.aspectj.testing.ITestStep"); digester.addObjectCreate("*/message", ExpectedMessageSpec.class); -- cgit v1.2.3