]> source.dussan.org Git - aspectj.git/commitdiff
RunSpec: allow '<stdout ordered="no">'
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Mon, 28 Feb 2022 02:23:44 +0000 (09:23 +0700)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Wed, 23 Mar 2022 08:39:14 +0000 (15:39 +0700)
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 <Alexander@Kriegisch.name>
testing/src/test/java/org/aspectj/testing/RunSpec.java
testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java

index d687ae86ba2de40441bfb5a9eeb4960eb03be115..9e07f8a442ccc1ba9e8f147b13c650f8c23a962e 100644 (file)
@@ -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;
        }
index 3954c7ecc2de5e4637fec98225c06b27e66dc0cd..6af8ced47633c048f7520ca5e9885c2266030357 100644 (file)
@@ -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);