diff options
author | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
commit | 144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch) | |
tree | b12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/harness/ajctest | |
parent | fafae443719b26159ab2d7dac1c9b46b5e00b671 (diff) | |
download | aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip |
initial version
Diffstat (limited to 'tests/harness/ajctest')
-rw-r--r-- | tests/harness/ajctest/Aspect.java | 11 | ||||
-rw-r--r-- | tests/harness/ajctest/CompilerError.java | 2 | ||||
-rw-r--r-- | tests/harness/ajctest/Driver.java | 21 |
3 files changed, 34 insertions, 0 deletions
diff --git a/tests/harness/ajctest/Aspect.java b/tests/harness/ajctest/Aspect.java new file mode 100644 index 000000000..dddacf69a --- /dev/null +++ b/tests/harness/ajctest/Aspect.java @@ -0,0 +1,11 @@ + +import org.aspectj.lang.*; +import org.aspectj.lang.reflect.*; + +aspect Aspect { + before() : execution(public * (!java..*).*(..)) { + SourceLocation sl = thisJoinPointStaticPart.getSourceLocation(); + String s = thisJoinPoint + "@" + sl.getFileName() + ":" + sl.getLine(); + System.err.println(s); + } +} diff --git a/tests/harness/ajctest/CompilerError.java b/tests/harness/ajctest/CompilerError.java new file mode 100644 index 000000000..94c7ad210 --- /dev/null +++ b/tests/harness/ajctest/CompilerError.java @@ -0,0 +1,2 @@ + +compiler error diff --git a/tests/harness/ajctest/Driver.java b/tests/harness/ajctest/Driver.java new file mode 100644 index 000000000..dca23a717 --- /dev/null +++ b/tests/harness/ajctest/Driver.java @@ -0,0 +1,21 @@ + + +/** Drive normal, system.exit, error or exception result from main */ +public class Driver { + + /** + * @param args {[-exit <number>|[-error|-exception] <string>]} + */ + public static void main (String[] args) throws Exception { + for (int i = 0; i < args.length; i++) { + String arg = args[i]; + if ("-exit".equals(arg)) { + System.exit(Integer.valueOf(args[i+1]).intValue()); + } else if ("-error".equals(arg)) { + throw new Error(args[i+1]); + } else if ("-exception".equals(arg)) { + throw new RuntimeException(args[i+1]); + } + } + } +} |