]> source.dussan.org Git - aspectj.git/commitdiff
annotation value matching: testcode
authoraclement <aclement>
Fri, 22 Feb 2008 22:34:08 +0000 (22:34 +0000)
committeraclement <aclement>
Fri, 22 Feb 2008 22:34:08 +0000 (22:34 +0000)
20 files changed:
tests/features160/annotationValueMatching/Broken1.java [new file with mode: 0644]
tests/features160/annotationValueMatching/Color.java [new file with mode: 0644]
tests/features160/annotationValueMatching/EnumTest1.java [new file with mode: 0644]
tests/features160/annotationValueMatching/EnumTest2.java [new file with mode: 0644]
tests/features160/annotationValueMatching/EnumTest3.java [new file with mode: 0644]
tests/features160/annotationValueMatching/Fruit.java [new file with mode: 0644]
tests/features160/annotationValueMatching/Fruity.java [new file with mode: 0644]
tests/features160/annotationValueMatching/Parsing.java [new file with mode: 0644]
tests/features160/annotationValueMatching/Simple.java [new file with mode: 0644]
tests/features160/annotationValueMatching/TrafficLight.java [new file with mode: 0644]
tests/features160/parameterValueMatching/Broken1.java [deleted file]
tests/features160/parameterValueMatching/Color.java [deleted file]
tests/features160/parameterValueMatching/EnumTest1.java [deleted file]
tests/features160/parameterValueMatching/EnumTest2.java [deleted file]
tests/features160/parameterValueMatching/EnumTest3.java [deleted file]
tests/features160/parameterValueMatching/Fruit.java [deleted file]
tests/features160/parameterValueMatching/Fruity.java [deleted file]
tests/features160/parameterValueMatching/Parsing.java [deleted file]
tests/features160/parameterValueMatching/Simple.java [deleted file]
tests/features160/parameterValueMatching/TrafficLight.java [deleted file]

diff --git a/tests/features160/annotationValueMatching/Broken1.java b/tests/features160/annotationValueMatching/Broken1.java
new file mode 100644 (file)
index 0000000..ab0877c
--- /dev/null
@@ -0,0 +1,29 @@
+enum Color { RED, GREEN, AMBER }
+
+@interface TrafficLight {
+       Color value() default Color.RED;
+}
+
+public class Broken1 {
+       public static void main(String[] args) {
+               
+       }
+}
+
+class Marked {
+
+  public void a() {}
+
+  @TrafficLight
+  public void b() {}
+
+  @TrafficLight(Color.RED)
+  public void c() {}
+
+  @TrafficLight(Color.GREEN)
+  public void d() {}
+}
+
+aspect X {     
+  pointcut p1(): execution(@TrafficLight(a) * *(..)); // value of just 'a' doesn't mean anything - only enums supported right now, let's say 'invalid annotation value'
+}
diff --git a/tests/features160/annotationValueMatching/Color.java b/tests/features160/annotationValueMatching/Color.java
new file mode 100644 (file)
index 0000000..086ba29
--- /dev/null
@@ -0,0 +1,3 @@
+package p;
+
+public enum Color { RED, GREEN, AMBER }
diff --git a/tests/features160/annotationValueMatching/EnumTest1.java b/tests/features160/annotationValueMatching/EnumTest1.java
new file mode 100644 (file)
index 0000000..47966ec
--- /dev/null
@@ -0,0 +1,14 @@
+package a;
+
+import p.*;
+
+public aspect EnumTest1 {
+       public static void main(String[] argv) {
+               
+       }
+       @TrafficLight(Color.RED) public void m() {}
+       @TrafficLight(Color.GREEN) public void n() {}
+       @TrafficLight public void o() {}
+       
+       before(): execution(@TrafficLight(Color.RED) * *(..)) {} // referencing Color via import of p.*
+}
\ No newline at end of file
diff --git a/tests/features160/annotationValueMatching/EnumTest2.java b/tests/features160/annotationValueMatching/EnumTest2.java
new file mode 100644 (file)
index 0000000..b195939
--- /dev/null
@@ -0,0 +1,14 @@
+package a;
+
+import p.*;
+
+public aspect EnumTest2 {
+       public static void main(String[] argv) {
+               
+       }
+       @TrafficLight(Color.RED) public void m() {}
+       @TrafficLight(Color.GREEN) public void n() {}
+       @TrafficLight public void o() {}
+       
+       before(): execution(@TrafficLight(p.Color.RED) * *(..)) {}; // referencing Color directly in package p
+}
\ No newline at end of file
diff --git a/tests/features160/annotationValueMatching/EnumTest3.java b/tests/features160/annotationValueMatching/EnumTest3.java
new file mode 100644 (file)
index 0000000..f6f3f16
--- /dev/null
@@ -0,0 +1,14 @@
+package a;
+
+import p.*;
+
+public aspect EnumTest3 {
+       public static void main(String[] argv) {
+               
+       }
+       @q.r.Fruity(q.r.Fruit.APPLE) public void m() {}
+       @q.r.Fruity(q.r.Fruit.BANANA) public void n() {}
+       @q.r.Fruity public void o() {}
+       
+       before(): execution(@q.r.Fruity(q.r.Fruit.APPLE) * *(..)) {}; // static import of fruits
+}
\ No newline at end of file
diff --git a/tests/features160/annotationValueMatching/Fruit.java b/tests/features160/annotationValueMatching/Fruit.java
new file mode 100644 (file)
index 0000000..1ea6500
--- /dev/null
@@ -0,0 +1,3 @@
+package q.r;
+
+public enum Fruit { APPLE, ORANGE, BANANA }
diff --git a/tests/features160/annotationValueMatching/Fruity.java b/tests/features160/annotationValueMatching/Fruity.java
new file mode 100644 (file)
index 0000000..5635bf5
--- /dev/null
@@ -0,0 +1,5 @@
+package q.r;
+
+public @interface Fruity {
+       Fruit value() default Fruit.BANANA;
+}
\ No newline at end of file
diff --git a/tests/features160/annotationValueMatching/Parsing.java b/tests/features160/annotationValueMatching/Parsing.java
new file mode 100644 (file)
index 0000000..f541a86
--- /dev/null
@@ -0,0 +1,32 @@
+enum Color { RED, GREEN, AMBER }
+
+@interface TrafficLight {
+       Color value() default Color.RED;
+}
+
+public class Parsing {
+       public static void main(String[] args) {
+               
+       }
+}
+
+class Marked {
+
+  public void a() {}
+
+  @TrafficLight
+  public void b() {}
+
+  @TrafficLight(Color.RED)
+  public void c() {}
+
+  @TrafficLight(Color.GREEN)
+  public void d() {}
+}
+
+aspect X {     
+  pointcut p1(): execution(@TrafficLight(Color.GREEN) * *(..));
+  pointcut p2(): execution(@TrafficLight(a=Color.GREEN) * *(..));
+  pointcut p3(): execution(@TrafficLight(a=Color.RED,c=Color.RED) * *(..));
+  pointcut p4(): execution(@TrafficLight(a=Color.RED,c=Color.RED,e=Color.RED) * *(..));
+}
\ No newline at end of file
diff --git a/tests/features160/annotationValueMatching/Simple.java b/tests/features160/annotationValueMatching/Simple.java
new file mode 100644 (file)
index 0000000..d70e2a8
--- /dev/null
@@ -0,0 +1,29 @@
+enum Color { RED, GREEN, AMBER }
+
+@interface TrafficLight {
+       Color value() default Color.RED;
+}
+
+public class Simple {
+       public static void main(String[] args) {
+               
+       }
+}
+
+class Marked {
+
+  public void a() {}
+
+  @TrafficLight
+  public void b() {}
+
+  @TrafficLight(Color.RED)
+  public void c() {}
+
+  @TrafficLight(Color.GREEN)
+  public void d() {}
+}
+
+aspect X {
+  before(): execution(@TrafficLight(Color.RED) * *(..)) {}
+}
\ No newline at end of file
diff --git a/tests/features160/annotationValueMatching/TrafficLight.java b/tests/features160/annotationValueMatching/TrafficLight.java
new file mode 100644 (file)
index 0000000..3d1fbc8
--- /dev/null
@@ -0,0 +1,5 @@
+package p;
+
+public @interface TrafficLight {
+       Color value() default Color.RED;
+}
\ No newline at end of file
diff --git a/tests/features160/parameterValueMatching/Broken1.java b/tests/features160/parameterValueMatching/Broken1.java
deleted file mode 100644 (file)
index ab0877c..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-enum Color { RED, GREEN, AMBER }
-
-@interface TrafficLight {
-       Color value() default Color.RED;
-}
-
-public class Broken1 {
-       public static void main(String[] args) {
-               
-       }
-}
-
-class Marked {
-
-  public void a() {}
-
-  @TrafficLight
-  public void b() {}
-
-  @TrafficLight(Color.RED)
-  public void c() {}
-
-  @TrafficLight(Color.GREEN)
-  public void d() {}
-}
-
-aspect X {     
-  pointcut p1(): execution(@TrafficLight(a) * *(..)); // value of just 'a' doesn't mean anything - only enums supported right now, let's say 'invalid annotation value'
-}
diff --git a/tests/features160/parameterValueMatching/Color.java b/tests/features160/parameterValueMatching/Color.java
deleted file mode 100644 (file)
index 086ba29..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-package p;
-
-public enum Color { RED, GREEN, AMBER }
diff --git a/tests/features160/parameterValueMatching/EnumTest1.java b/tests/features160/parameterValueMatching/EnumTest1.java
deleted file mode 100644 (file)
index 47966ec..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-package a;
-
-import p.*;
-
-public aspect EnumTest1 {
-       public static void main(String[] argv) {
-               
-       }
-       @TrafficLight(Color.RED) public void m() {}
-       @TrafficLight(Color.GREEN) public void n() {}
-       @TrafficLight public void o() {}
-       
-       before(): execution(@TrafficLight(Color.RED) * *(..)) {} // referencing Color via import of p.*
-}
\ No newline at end of file
diff --git a/tests/features160/parameterValueMatching/EnumTest2.java b/tests/features160/parameterValueMatching/EnumTest2.java
deleted file mode 100644 (file)
index b195939..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-package a;
-
-import p.*;
-
-public aspect EnumTest2 {
-       public static void main(String[] argv) {
-               
-       }
-       @TrafficLight(Color.RED) public void m() {}
-       @TrafficLight(Color.GREEN) public void n() {}
-       @TrafficLight public void o() {}
-       
-       before(): execution(@TrafficLight(p.Color.RED) * *(..)) {}; // referencing Color directly in package p
-}
\ No newline at end of file
diff --git a/tests/features160/parameterValueMatching/EnumTest3.java b/tests/features160/parameterValueMatching/EnumTest3.java
deleted file mode 100644 (file)
index f6f3f16..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-package a;
-
-import p.*;
-
-public aspect EnumTest3 {
-       public static void main(String[] argv) {
-               
-       }
-       @q.r.Fruity(q.r.Fruit.APPLE) public void m() {}
-       @q.r.Fruity(q.r.Fruit.BANANA) public void n() {}
-       @q.r.Fruity public void o() {}
-       
-       before(): execution(@q.r.Fruity(q.r.Fruit.APPLE) * *(..)) {}; // static import of fruits
-}
\ No newline at end of file
diff --git a/tests/features160/parameterValueMatching/Fruit.java b/tests/features160/parameterValueMatching/Fruit.java
deleted file mode 100644 (file)
index 1ea6500..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-package q.r;
-
-public enum Fruit { APPLE, ORANGE, BANANA }
diff --git a/tests/features160/parameterValueMatching/Fruity.java b/tests/features160/parameterValueMatching/Fruity.java
deleted file mode 100644 (file)
index 5635bf5..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-package q.r;
-
-public @interface Fruity {
-       Fruit value() default Fruit.BANANA;
-}
\ No newline at end of file
diff --git a/tests/features160/parameterValueMatching/Parsing.java b/tests/features160/parameterValueMatching/Parsing.java
deleted file mode 100644 (file)
index f541a86..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-enum Color { RED, GREEN, AMBER }
-
-@interface TrafficLight {
-       Color value() default Color.RED;
-}
-
-public class Parsing {
-       public static void main(String[] args) {
-               
-       }
-}
-
-class Marked {
-
-  public void a() {}
-
-  @TrafficLight
-  public void b() {}
-
-  @TrafficLight(Color.RED)
-  public void c() {}
-
-  @TrafficLight(Color.GREEN)
-  public void d() {}
-}
-
-aspect X {     
-  pointcut p1(): execution(@TrafficLight(Color.GREEN) * *(..));
-  pointcut p2(): execution(@TrafficLight(a=Color.GREEN) * *(..));
-  pointcut p3(): execution(@TrafficLight(a=Color.RED,c=Color.RED) * *(..));
-  pointcut p4(): execution(@TrafficLight(a=Color.RED,c=Color.RED,e=Color.RED) * *(..));
-}
\ No newline at end of file
diff --git a/tests/features160/parameterValueMatching/Simple.java b/tests/features160/parameterValueMatching/Simple.java
deleted file mode 100644 (file)
index d70e2a8..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-enum Color { RED, GREEN, AMBER }
-
-@interface TrafficLight {
-       Color value() default Color.RED;
-}
-
-public class Simple {
-       public static void main(String[] args) {
-               
-       }
-}
-
-class Marked {
-
-  public void a() {}
-
-  @TrafficLight
-  public void b() {}
-
-  @TrafficLight(Color.RED)
-  public void c() {}
-
-  @TrafficLight(Color.GREEN)
-  public void d() {}
-}
-
-aspect X {
-  before(): execution(@TrafficLight(Color.RED) * *(..)) {}
-}
\ No newline at end of file
diff --git a/tests/features160/parameterValueMatching/TrafficLight.java b/tests/features160/parameterValueMatching/TrafficLight.java
deleted file mode 100644 (file)
index 3d1fbc8..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-package p;
-
-public @interface TrafficLight {
-       Color value() default Color.RED;
-}
\ No newline at end of file