diff options
author | aclement <aclement> | 2005-12-06 13:02:38 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-12-06 13:02:38 +0000 |
commit | 1e1bbb3f2e7aab4757d715d76730cb68cceb3b87 (patch) | |
tree | abba06b491b9f90fb43ddb64028ef3d556bab334 /testing | |
parent | f40d02927635b6171083229fe6d48f326da06cc7 (diff) | |
download | aspectj-1e1bbb3f2e7aab4757d715d76730cb68cceb3b87.tar.gz aspectj-1e1bbb3f2e7aab4757d715d76730cb68cceb3b87.zip |
fixes for 118715 from Matthew.
Diffstat (limited to 'testing')
-rw-r--r-- | testing/newsrc/org/aspectj/testing/OutputSpec.java | 3 | ||||
-rw-r--r-- | testing/newsrc/org/aspectj/testing/RunSpec.java | 23 | ||||
-rw-r--r-- | testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java | 1 |
3 files changed, 26 insertions, 1 deletions
diff --git a/testing/newsrc/org/aspectj/testing/OutputSpec.java b/testing/newsrc/org/aspectj/testing/OutputSpec.java index be869bfbb..45a7a02d6 100644 --- a/testing/newsrc/org/aspectj/testing/OutputSpec.java +++ b/testing/newsrc/org/aspectj/testing/OutputSpec.java @@ -35,7 +35,8 @@ public class OutputSpec { String line = (String) iter.next(); lineNo++; String outputLine = strTok.nextToken().trim(); - if (!line.equals(outputLine)) { + /* Avoid trying to match on ajSandbox source names that appear in messages */ + if (outputLine.indexOf(line) == -1) { matches = false; break; } diff --git a/testing/newsrc/org/aspectj/testing/RunSpec.java b/testing/newsrc/org/aspectj/testing/RunSpec.java index 166c2d89e..b879c95a2 100644 --- a/testing/newsrc/org/aspectj/testing/RunSpec.java +++ b/testing/newsrc/org/aspectj/testing/RunSpec.java @@ -37,6 +37,7 @@ public class RunSpec implements ITestStep { private OutputSpec stdErrSpec; private OutputSpec stdOutSpec; private String ltwFile; + private String xlintFile; public RunSpec() { } @@ -51,6 +52,7 @@ public class RunSpec implements ITestStep { String[] args = buildArgs(); // System.err.println("? execute() inTestCase='" + inTestCase + "', ltwFile=" + ltwFile); boolean useLtw = copyLtwFile(inTestCase.getSandboxDirectory()); + copyXlintFile(inTestCase.getSandboxDirectory()); AjcTestCase.RunResult rr = inTestCase.run(getClassToRun(),args,getClasspath(),useLtw); if (stdErrSpec != null) { stdErrSpec.matchAgainst(rr.getStdErr()); @@ -147,4 +149,25 @@ public class RunSpec implements ITestStep { return useLtw; } + + public String getXlintFile() { + return xlintFile; + } + + public void setXlintFile(String xlintFile) { + this.xlintFile = xlintFile; + } + + private void copyXlintFile (File sandboxDirectory) { + if (xlintFile != null) { + File from = new File(baseDir,xlintFile); + File to = new File(sandboxDirectory, File.separator + xlintFile); + try { + FileUtil.copyFile(from,to); + } + catch (IOException ex) { + AjcTestCase.fail(ex.toString()); + } + } + } } diff --git a/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java b/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java index 58a5f0d33..fbefbccb2 100644 --- a/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java +++ b/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java @@ -167,6 +167,7 @@ public abstract class XMLBasedAjcTestCase extends AjcTestCase { digester.addObjectCreate("suite/ajc-test/run",RunSpec.class); digester.addSetProperties("suite/ajc-test/run","class","classToRun"); digester.addSetProperties("suite/ajc-test/run","ltw","ltwFile"); + digester.addSetProperties("suite/ajc-test/run","xlintfile","xlintFile"); digester.addSetNext("suite/ajc-test/run","addTestStep","org.aspectj.testing.ITestStep"); digester.addObjectCreate("*/message",ExpectedMessageSpec.class); digester.addSetProperties("*/message"); |