Skip to content

Commit

Permalink
RunSpec: allow '<stdout ordered="no">'
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
kriegaex committed Mar 23, 2022
1 parent 3c80a36 commit af0e70f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion testing/src/test/java/org/aspectj/testing/RunSpec.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -78,7 +79,7 @@ public void execute(AjcTestCase inTestCase) {
stdErrSpec.matchAgainst(rr.getStdErr(), orderedStderr);
}
if (stdOutSpec != null) {
stdOutSpec.matchAgainst(rr.getStdOut());
stdOutSpec.matchAgainst(rr.getStdOut(), orderedStdout);
}
} finally {
restoreProperties();
Expand Down Expand Up @@ -171,6 +172,10 @@ public void setOrderedStderr(String orderedStderr) {
this.orderedStderr = orderedStderr;
}

public void setOrderedStdout(String orderedStdout) {
this.orderedStdout = orderedStdout;
}

public String getClassToRun() {
return classToRun;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ protected Digester getDigester() {
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);
Expand Down

0 comments on commit af0e70f

Please sign in to comment.