summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2004-12-08 14:15:42 +0000
committeraclement <aclement>2004-12-08 14:15:42 +0000
commit6e6d34c79638763ab180578dd169147fda5011cc (patch)
treeb4a0def4960a386fe5d05c8209ba49419d402e79 /tests
parent4c20738fbb3560cccf1bc7e5bc0a21618c9559c7 (diff)
downloadaspectj-6e6d34c79638763ab180578dd169147fda5011cc.tar.gz
aspectj-6e6d34c79638763ab180578dd169147fda5011cc.zip
Annotation matching.
Diffstat (limited to 'tests')
-rw-r--r--tests/java5/annotations/AnnotatedType.java11
-rw-r--r--tests/java5/annotations/Annotation.classbin0 -> 297 bytes
-rw-r--r--tests/java5/annotations/AnnotationAspect02.aj5
-rw-r--r--tests/java5/annotations/build.xml1
-rw-r--r--tests/java5/annotations/testcode.jarbin1041 -> 1551 bytes
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/AnnotationPointcuts.java50
6 files changed, 67 insertions, 0 deletions
diff --git a/tests/java5/annotations/AnnotatedType.java b/tests/java5/annotations/AnnotatedType.java
new file mode 100644
index 000000000..d252f20fe
--- /dev/null
+++ b/tests/java5/annotations/AnnotatedType.java
@@ -0,0 +1,11 @@
+public class AnnotatedType {
+ public static void main(String[] argv) {
+ method1();
+ method2();
+ }
+
+ @SimpleAnnotation(id=1)
+ public static void method1() { }
+
+ public static void method2() { }
+}
diff --git a/tests/java5/annotations/Annotation.class b/tests/java5/annotations/Annotation.class
new file mode 100644
index 000000000..79c4831ca
--- /dev/null
+++ b/tests/java5/annotations/Annotation.class
Binary files differ
diff --git a/tests/java5/annotations/AnnotationAspect02.aj b/tests/java5/annotations/AnnotationAspect02.aj
new file mode 100644
index 000000000..ddc3cc48d
--- /dev/null
+++ b/tests/java5/annotations/AnnotationAspect02.aj
@@ -0,0 +1,5 @@
+public aspect AnnotationAspect02 {
+ before(): call(@SimpleAnnotation * *(..)) {}
+
+ before(): call( * *(..)) {}
+}
diff --git a/tests/java5/annotations/build.xml b/tests/java5/annotations/build.xml
index 86a30e6ab..8a7a20bcc 100644
--- a/tests/java5/annotations/build.xml
+++ b/tests/java5/annotations/build.xml
@@ -5,6 +5,7 @@
<mkdir dir="output"/>
<javac destdir="output" debug="on" srcdir="." includes="SimpleAnnotation.java"/>
<javac destdir="output" debug="on" srcdir="." includes="Annotation.java"/>
+ <javac destdir="output" debug="on" srcdir="." includes="AnnotatedType.java"/>
<zip file="testcode.jar" basedir="output" includes="**/*"/>
<delete dir="output"/>
</target>
diff --git a/tests/java5/annotations/testcode.jar b/tests/java5/annotations/testcode.jar
index 574b25142..5fd363171 100644
--- a/tests/java5/annotations/testcode.jar
+++ b/tests/java5/annotations/testcode.jar
Binary files differ
diff --git a/tests/src/org/aspectj/systemtest/ajc150/AnnotationPointcuts.java b/tests/src/org/aspectj/systemtest/ajc150/AnnotationPointcuts.java
new file mode 100644
index 000000000..dba69c367
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/ajc150/AnnotationPointcuts.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc150;
+
+import java.io.File;
+
+import org.aspectj.bridge.IMessage;
+import org.aspectj.tools.ajc.CompilationResult;
+
+
+/**
+ * Tests the use of Annotations in pointcuts
+ */
+public class AnnotationPointcuts extends TestUtils {
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ baseDir = new File("../tests/java5/annotations");
+ }
+
+ // before(): call(@SimpleAnnotation * *(..)) { }
+// public void test001_usingAnnotationsInPointcuts() {
+// CompilationResult cR = binaryWeave("testcode.jar","AnnotationAspect02.aj",0,0);
+// System.err.println(cR.getStandardError());
+// System.err.println(cR.getErrorMessages());
+// System.err.println(cR.getInfoMessages());
+// verifyWeavingMessagesOutput(cR,new String[]{});
+//// assertTrue("Expected three message about ITDs not allowed on Annotations but got: #"+
+//// cR.getErrorMessages().size()+": \n"+cR.getErrorMessages(),
+//// cR.getErrorMessages().size()==3);
+//// IMessage msg1_ctor = (IMessage)cR.getErrorMessages().get(0);
+//// IMessage msg2_method = (IMessage)cR.getErrorMessages().get(1);
+//// IMessage msg3_field = (IMessage)cR.getErrorMessages().get(2);
+//// assertTrue("Expected message about ITDCs on annotations not allowed, but got: \n"+msg1_ctor,
+//// msg1_ctor.toString().indexOf("can't make inter-type constructor declarations")!=-1);
+//// assertTrue("Expected message about ITDMs on annotations not allowed, but got: \n"+msg2_method,
+//// msg2_method.toString().indexOf("can't make inter-type method declarations")!=-1);
+//// assertTrue("Expected message about ITDFs on annotations not allowed, but got: \n"+msg3_field,
+//// msg3_field.toString().indexOf("can't make inter-type field declarations")!=-1);
+//// verifyWeavingMessagesOutput(cR,new String[]{});
+// }
+} \ No newline at end of file