]> source.dussan.org Git - aspectj.git/commitdiff
bring refactoring up to date.
authoraclement <aclement>
Mon, 12 May 2008 19:29:16 +0000 (19:29 +0000)
committeraclement <aclement>
Mon, 12 May 2008 19:29:16 +0000 (19:29 +0000)
19 files changed:
tests/bugs161/pr227993/FieldJP.java [new file with mode: 0644]
tests/bugs161/pr231187/Cement.java [new file with mode: 0644]
tests/bugs161/pr231187/ConcreteClass.java [new file with mode: 0644]
tests/bugs161/pr231187/Main.java [new file with mode: 0644]
tests/bugs161/pr231187/SuperClass.java [new file with mode: 0644]
tests/bugs161/pr231187/SuperClassAspect.aj [new file with mode: 0644]
tests/bugs161/pr231187/WetCement.java [new file with mode: 0644]
tests/bugs161/pr231187x/Cement.java [new file with mode: 0644]
tests/bugs161/pr231187x/ConcreteClass.java [new file with mode: 0644]
tests/bugs161/pr231187x/Main.java [new file with mode: 0644]
tests/bugs161/pr231187x/SuperClass.java [new file with mode: 0644]
tests/bugs161/pr231187x/SuperClassAspect.aj [new file with mode: 0644]
tests/bugs161/pr231187x/WetCement.java [new file with mode: 0644]
tests/bugs161/pr231478/AbstractComponent.java [new file with mode: 0644]
tests/bugs161/pr231478/AbstractWindow.java [new file with mode: 0644]
tests/bugs161/pr231478/Base.java [new file with mode: 0644]
tests/bugs161/pr231478/Sub.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc161/ajc161.xml [new file with mode: 0644]

diff --git a/tests/bugs161/pr227993/FieldJP.java b/tests/bugs161/pr227993/FieldJP.java
new file mode 100644 (file)
index 0000000..e36de35
--- /dev/null
@@ -0,0 +1,41 @@
+
+import java.lang.annotation.*;
+
+enum Store {YES,NO;}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface SearchableProperty { Store store(); }
+
+public class FieldJP {
+    @SearchableProperty(store=Store.YES)
+    public static int fieldOne;
+    
+    @SearchableProperty(store=Store.NO)
+    public static int fieldTwo;
+    
+    public static int fieldThree;
+    
+    public static void main(String[] args) {
+        System.err.println("fone="+fieldOne);
+        System.err.println("ftwo="+fieldTwo);
+        System.err.println("fthr="+fieldThree);
+        fieldOne = 5;
+        fieldTwo = 6;
+        fieldThree = 7;
+    }
+}
+
+aspect X {
+    before(): get(@SearchableProperty(store=Store.YES) * *) {
+        System.err.println("get of YES field");
+    }
+    before(): get(@SearchableProperty(store=Store.NO) * *) {
+        System.err.println("get of NO field");
+    }
+    before(): set(@SearchableProperty(store=Store.YES) * *) {
+        System.err.println("set of YES field");
+    }
+    before(): set(@SearchableProperty(store=Store.NO) * *) {
+        System.err.println("set of NO field");
+    }
+}
\ No newline at end of file
diff --git a/tests/bugs161/pr231187/Cement.java b/tests/bugs161/pr231187/Cement.java
new file mode 100644 (file)
index 0000000..3fd69d0
--- /dev/null
@@ -0,0 +1,5 @@
+package concrete;
+
+public interface Cement {
+   public int getWeight();
+}
diff --git a/tests/bugs161/pr231187/ConcreteClass.java b/tests/bugs161/pr231187/ConcreteClass.java
new file mode 100644 (file)
index 0000000..c0eb8af
--- /dev/null
@@ -0,0 +1,19 @@
+package concrete;
+
+import java.util.Vector;
+
+public class ConcreteClass extends SuperClass<WetCement> {
+
+       @Override
+       public Vector<WetCement> getSomeTs() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public void addSomeTs(Vector<WetCement> newTs) {
+               // TODO Auto-generated method stub
+               someTs.addAll(newTs);
+       }
+
+}
diff --git a/tests/bugs161/pr231187/Main.java b/tests/bugs161/pr231187/Main.java
new file mode 100644 (file)
index 0000000..2f98e15
--- /dev/null
@@ -0,0 +1,14 @@
+package concrete;
+
+import java.util.*;
+
+public class Main {
+   public static void main(String[] args) {
+     ConcreteClass cc = new ConcreteClass();
+     WetCement wc = new WetCement();
+     Vector<WetCement> v = new Vector<WetCement>();
+     v.add(wc);
+     cc.addSomeTs(v);
+     System.out.println("ran!");
+   }
+}
\ No newline at end of file
diff --git a/tests/bugs161/pr231187/SuperClass.java b/tests/bugs161/pr231187/SuperClass.java
new file mode 100644 (file)
index 0000000..18c1fe6
--- /dev/null
@@ -0,0 +1,8 @@
+package concrete;
+import java.util.Vector;
+
+public abstract class SuperClass<T extends Cement> {
+   Vector<T> someTs = new Vector<T>();
+   public abstract Vector<T> getSomeTs();
+   public abstract void addSomeTs(Vector<T> newTs);  
+}
diff --git a/tests/bugs161/pr231187/SuperClassAspect.aj b/tests/bugs161/pr231187/SuperClassAspect.aj
new file mode 100644 (file)
index 0000000..c370744
--- /dev/null
@@ -0,0 +1,12 @@
+package concrete;
+
+import java.util.Vector;
+
+
+public aspect SuperClassAspect {
+   declare parents : WetCement implements Cement;
+
+   after(SuperClass sc, Vector cm) returning: execution(void SuperClass.addSomeTs(Vector)) && target(sc) && args(cm) {
+    //  System.out.println(cm);   
+   }
+}
diff --git a/tests/bugs161/pr231187/WetCement.java b/tests/bugs161/pr231187/WetCement.java
new file mode 100644 (file)
index 0000000..dfefde0
--- /dev/null
@@ -0,0 +1,6 @@
+package concrete;
+
+public class WetCement {
+   boolean wet = true;
+   public int getWeight() { return 5; }
+}
diff --git a/tests/bugs161/pr231187x/Cement.java b/tests/bugs161/pr231187x/Cement.java
new file mode 100644 (file)
index 0000000..3fd69d0
--- /dev/null
@@ -0,0 +1,5 @@
+package concrete;
+
+public interface Cement {
+   public int getWeight();
+}
diff --git a/tests/bugs161/pr231187x/ConcreteClass.java b/tests/bugs161/pr231187x/ConcreteClass.java
new file mode 100644 (file)
index 0000000..c0eb8af
--- /dev/null
@@ -0,0 +1,19 @@
+package concrete;
+
+import java.util.Vector;
+
+public class ConcreteClass extends SuperClass<WetCement> {
+
+       @Override
+       public Vector<WetCement> getSomeTs() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public void addSomeTs(Vector<WetCement> newTs) {
+               // TODO Auto-generated method stub
+               someTs.addAll(newTs);
+       }
+
+}
diff --git a/tests/bugs161/pr231187x/Main.java b/tests/bugs161/pr231187x/Main.java
new file mode 100644 (file)
index 0000000..2f98e15
--- /dev/null
@@ -0,0 +1,14 @@
+package concrete;
+
+import java.util.*;
+
+public class Main {
+   public static void main(String[] args) {
+     ConcreteClass cc = new ConcreteClass();
+     WetCement wc = new WetCement();
+     Vector<WetCement> v = new Vector<WetCement>();
+     v.add(wc);
+     cc.addSomeTs(v);
+     System.out.println("ran!");
+   }
+}
\ No newline at end of file
diff --git a/tests/bugs161/pr231187x/SuperClass.java b/tests/bugs161/pr231187x/SuperClass.java
new file mode 100644 (file)
index 0000000..18c1fe6
--- /dev/null
@@ -0,0 +1,8 @@
+package concrete;
+import java.util.Vector;
+
+public abstract class SuperClass<T extends Cement> {
+   Vector<T> someTs = new Vector<T>();
+   public abstract Vector<T> getSomeTs();
+   public abstract void addSomeTs(Vector<T> newTs);  
+}
diff --git a/tests/bugs161/pr231187x/SuperClassAspect.aj b/tests/bugs161/pr231187x/SuperClassAspect.aj
new file mode 100644 (file)
index 0000000..c370744
--- /dev/null
@@ -0,0 +1,12 @@
+package concrete;
+
+import java.util.Vector;
+
+
+public aspect SuperClassAspect {
+   declare parents : WetCement implements Cement;
+
+   after(SuperClass sc, Vector cm) returning: execution(void SuperClass.addSomeTs(Vector)) && target(sc) && args(cm) {
+    //  System.out.println(cm);   
+   }
+}
diff --git a/tests/bugs161/pr231187x/WetCement.java b/tests/bugs161/pr231187x/WetCement.java
new file mode 100644 (file)
index 0000000..dfefde0
--- /dev/null
@@ -0,0 +1,6 @@
+package concrete;
+
+public class WetCement {
+   boolean wet = true;
+   public int getWeight() { return 5; }
+}
diff --git a/tests/bugs161/pr231478/AbstractComponent.java b/tests/bugs161/pr231478/AbstractComponent.java
new file mode 100644 (file)
index 0000000..ccbdf5a
--- /dev/null
@@ -0,0 +1 @@
+abstract aspect AbstractComponent<C extends Base> {}
diff --git a/tests/bugs161/pr231478/AbstractWindow.java b/tests/bugs161/pr231478/AbstractWindow.java
new file mode 100644 (file)
index 0000000..ce16bbf
--- /dev/null
@@ -0,0 +1 @@
+abstract aspect AbstractWindow<W extends Sub> extends AbstractComponent<W> {}
diff --git a/tests/bugs161/pr231478/Base.java b/tests/bugs161/pr231478/Base.java
new file mode 100644 (file)
index 0000000..d77cf17
--- /dev/null
@@ -0,0 +1 @@
+class Base {}
diff --git a/tests/bugs161/pr231478/Sub.java b/tests/bugs161/pr231478/Sub.java
new file mode 100644 (file)
index 0000000..ed68d78
--- /dev/null
@@ -0,0 +1 @@
+class Sub extends Base {}
diff --git a/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java b/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java
new file mode 100644 (file)
index 0000000..a31dfb8
--- /dev/null
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Contributors 
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc161;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+       
+       // AspectJ1.6.1
+       public void testGenericAbstractAspects_pr231478() { runTest("generic abstract aspects"); }
+    public void testFieldJoinpointsAndAnnotationValues_pr227993() { runTest("field jp anno value"); }
+    public void testGenericsBoundsDecp_pr231187() { runTest("generics bounds decp"); }
+    public void testGenericsBoundsDecp_pr231187_2() { runTest("generics bounds decp - 2"); }
+       public void testLtwInheritedCflow_pr230134() { runTest("ltw inherited cflow"); }
+    public void testAroundAdviceOnFieldSet_pr229910() { runTest("around advice on field set"); }
+    public void testPipelineCompilationGenericReturnType_pr226567() { runTest("pipeline compilation and generic return type"); }
+
+    public static Test suite() {
+      return XMLBasedAjcTestCase.loadSuite(Ajc161Tests.class);
+    }
+
+    protected File getSpecFile() {
+      return new File("../tests/src/org/aspectj/systemtest/ajc161/ajc161.xml");
+    }
+  
+}
\ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml b/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml
new file mode 100644 (file)
index 0000000..a7768d2
--- /dev/null
@@ -0,0 +1,60 @@
+<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
+
+<!-- AspectJ v1.6.1 Tests -->
+<suite>
+
+    <ajc-test dir="bugs161/pr231478" title="generic abstract aspects">
+        <compile files="Base.java Sub.java AbstractComponent.java AbstractWindow.java" options="-1.5"/>
+    </ajc-test>
+
+    <ajc-test dir="bugs161/pr227993" title="field jp anno value">
+        <compile files="FieldJP.java" options="-1.5"/>
+        <run class="FieldJP">
+          <stderr>
+            <line text="get of YES field"/>
+            <line text="fone=0"/>
+            <line text="get of NO field"/>
+            <line text="ftwo=0"/>
+            <line text="fthr=0"/>
+            <line text="set of YES field"/>
+            <line text="set of NO field"/>
+          </stderr>
+        </run>
+    </ajc-test> 
+
+    <ajc-test dir="bugs161/pr231187x" title="generics bounds decp">
+        <compile files="Cement.java ConcreteClass.java SuperClass.java SuperClassAspect.aj WetCement.java Main.java" options="-1.5"/>
+        <run class="concrete.Main">
+          <stdout>
+            <line text="ran!"/>
+          </stdout>
+        </run>
+    </ajc-test> 
+    
+    <ajc-test dir="bugs161/pr231187x" title="generics bounds decp - 2">
+        <compile files="Cement.java ConcreteClass.java SuperClass.java WetCement.java" options="-1.5">
+          <message kind="error" text="The type WetCement is not a valid substitute for the bounded parameter"/>
+        </compile>
+    </ajc-test> 
+    
+    <ajc-test dir="bugs161/pr230134" title="ltw inherited cflow">
+      <compile files="HW.java"/>
+      <compile files="SimpleTracing.java Tracing.java HelloWorldTracing.java" outjar="foo.jar"/>
+      <run class="hello.HW" classpath="$sandbox/foo.jar" ltw="aop.xml">
+        <stdout>
+          <line text="Hello World"/>
+           </stdout>
+      </run>
+    </ajc-test>
+    
+    <ajc-test dir="bugs161/pr229910" title="around advice on field set">
+        <compile files="Test.java" options="-1.5"/>
+        <run class="Test"/>
+    </ajc-test> 
+    
+    <ajc-test dir="bugs161/pr226567" title="pipeline compilation and generic return type">
+        <compile files="BarAspect.aj Foo.java Bar.java" options="-1.5"/>
+        <compile files="BarAspect.aj Bar.java Foo.java" options="-1.5"/>
+    </ajc-test> 
+
+</suite>
\ No newline at end of file