diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2023-01-29 14:57:58 +0100 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2024-04-13 13:03:06 +0200 |
commit | a1a700fc6eb8793d7bfa08a31a4529eb2e49b84c (patch) | |
tree | 44ab93d62981e1310327bdf351281a9e5d834173 /testing/src/test | |
parent | 287ec8f5ef52510b36b05331e69b7dd579c01ecf (diff) | |
download | aspectj-a1a700fc6eb8793d7bfa08a31a4529eb2e49b84c.tar.gz aspectj-a1a700fc6eb8793d7bfa08a31a4529eb2e49b84c.zip |
Implement source location matching for weave messages in XML tests
WIP (work in progress).
Closes #218.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'testing/src/test')
-rw-r--r-- | testing/src/test/java/org/aspectj/testing/CompileSpec.java | 2 | ||||
-rw-r--r-- | testing/src/test/java/org/aspectj/testing/ExpectedMessageSpec.java | 32 |
2 files changed, 32 insertions, 2 deletions
diff --git a/testing/src/test/java/org/aspectj/testing/CompileSpec.java b/testing/src/test/java/org/aspectj/testing/CompileSpec.java index 889183303..b018102d9 100644 --- a/testing/src/test/java/org/aspectj/testing/CompileSpec.java +++ b/testing/src/test/java/org/aspectj/testing/CompileSpec.java @@ -329,7 +329,7 @@ public class CompileSpec implements ITestStep { } else if (kind.equals("abort")) { fails.add(exMsg.toMessage()); } else if (kind.equals("weave")) { - weaveInfos.add(exMsg.toMessage()); + weaveInfos.add(exMsg.toWeaveMessage()); } else if (kind.equals("usage")) { weaveInfos.add(exMsg.toMessage()); } diff --git a/testing/src/test/java/org/aspectj/testing/ExpectedMessageSpec.java b/testing/src/test/java/org/aspectj/testing/ExpectedMessageSpec.java index 23903beb7..5d438a677 100644 --- a/testing/src/test/java/org/aspectj/testing/ExpectedMessageSpec.java +++ b/testing/src/test/java/org/aspectj/testing/ExpectedMessageSpec.java @@ -23,12 +23,18 @@ public class ExpectedMessageSpec { private String kind = "error"; private int line = -1; + private int aspectLine = -1; private String text; private String file; + private String aspectFile; private String details; public AjcTestCase.Message toMessage() { - return new AjcTestCase.Message(line,file,text,null); + return new AjcTestCase.Message(line, file, text, null); + } + + public AjcTestCase.Message toWeaveMessage() { + return new AjcTestCase.Message(line, file, aspectLine, aspectFile, text, null); } /** @@ -56,6 +62,18 @@ public class ExpectedMessageSpec { this.file = file; } /** + * @return Returns the aspect file. + */ + public String getAspectFile() { + return aspectFile; + } + /** + * @param aspectFile The aspect file to set. + */ + public void setAspectFile(String aspectFile) { + this.aspectFile = aspectFile; + } + /** * @return Returns the kind. */ public String getKind() { @@ -80,6 +98,18 @@ public class ExpectedMessageSpec { this.line = line; } /** + * @return Returns the asperct line. + */ + public int getAspectLine() { + return aspectLine; + } + /** + * @param aspectLine The aspect line to set. + */ + public void setAspectLine(int aspectLine) { + this.aspectLine = aspectLine; + } + /** * @return Returns the text. */ public String getText() { |