]> source.dussan.org Git - aspectj.git/commitdiff
extra test resources for within(@Foo *) tests
authoracolyer <acolyer>
Wed, 5 Jan 2005 13:21:27 +0000 (13:21 +0000)
committeracolyer <acolyer>
Wed, 5 Jan 2005 13:21:27 +0000 (13:21 +0000)
tests/java5/annotations/within/PlainWithin.java [new file with mode: 0644]
tests/java5/annotations/within/PlainWithinTests.java [new file with mode: 0644]

diff --git a/tests/java5/annotations/within/PlainWithin.java b/tests/java5/annotations/within/PlainWithin.java
new file mode 100644 (file)
index 0000000..e19368c
--- /dev/null
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * 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:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+/**
+ * @author colyer
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+@MyClassRetententionAnnotation
+public class PlainWithin {
+
+    public void foo() {}
+}
+
+class NotAnnotated {
+    public void foo() {}
+}
+
+@interface MyAnnotation {}
+
diff --git a/tests/java5/annotations/within/PlainWithinTests.java b/tests/java5/annotations/within/PlainWithinTests.java
new file mode 100644 (file)
index 0000000..087356a
--- /dev/null
@@ -0,0 +1,12 @@
+public aspect PlainWithinTests {
+    
+    // CW L 21
+    declare warning : execution(* foo()) && within(@MyAnnotation *)
+       : "positive within match on annotation";
+    
+    // CW L25
+    declare warning : execution(* foo()) && !within(@MyAnnotation *)
+       : "negative within match on annotation";
+    
+    
+}
\ No newline at end of file