]> source.dussan.org Git - aspectj.git/commitdiff
testcode for 119210
authoraclement <aclement>
Thu, 8 Dec 2005 15:32:36 +0000 (15:32 +0000)
committeraclement <aclement>
Thu, 8 Dec 2005 15:32:36 +0000 (15:32 +0000)
tests/bugs150/pr119210/TestLib.java [new file with mode: 0644]
tests/bugs150/pr119210/TestLib2.java [new file with mode: 0644]
tests/bugs150/pr119210/ThreadAspectLib.java [new file with mode: 0644]
tests/bugs150/pr119210/ThreadAspectLib2.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml

diff --git a/tests/bugs150/pr119210/TestLib.java b/tests/bugs150/pr119210/TestLib.java
new file mode 100644 (file)
index 0000000..09f1770
--- /dev/null
@@ -0,0 +1,8 @@
+public class TestLib {
+
+          public static void main(String[] args) {
+                System.err.println("obtaining five, got "+new TestLib().getFive());
+          }
+          
+          public int getFive() { return 5; }
+}
\ No newline at end of file
diff --git a/tests/bugs150/pr119210/TestLib2.java b/tests/bugs150/pr119210/TestLib2.java
new file mode 100644 (file)
index 0000000..718eee2
--- /dev/null
@@ -0,0 +1,8 @@
+public class TestLib2 {
+
+          public static void main(String[] args) {
+                System.err.println("obtaining five, got "+new TestLib2().getFive());
+          }
+          
+          public Integer getFive() { return new Integer(5); }
+}
\ No newline at end of file
diff --git a/tests/bugs150/pr119210/ThreadAspectLib.java b/tests/bugs150/pr119210/ThreadAspectLib.java
new file mode 100644 (file)
index 0000000..b2c8994
--- /dev/null
@@ -0,0 +1,19 @@
+public aspect ThreadAspectLib {
+//        pointcut setThreadLocalsField(): set(private int TestLib.myInt);
+//
+//        Integer around():setThreadLocalsField()
+//        {
+//                try{
+//                        return new Integer(2);
+//                }
+//                catch(Exception e)
+//                {
+//                        e.printStackTrace();
+//                        return null;
+//                }
+//        }
+        
+        Integer around(): call(* getFive()) {
+               return new Integer(3);
+        }
+}
\ No newline at end of file
diff --git a/tests/bugs150/pr119210/ThreadAspectLib2.java b/tests/bugs150/pr119210/ThreadAspectLib2.java
new file mode 100644 (file)
index 0000000..1794c0a
--- /dev/null
@@ -0,0 +1,19 @@
+public aspect ThreadAspectLib2 {
+//        pointcut setThreadLocalsField(): set(private int TestLib.myInt);
+//
+//        Integer around():setThreadLocalsField()
+//        {
+//                try{
+//                        return new Integer(2);
+//                }
+//                catch(Exception e)
+//                {
+//                        e.printStackTrace();
+//                        return null;
+//                }
+//        }
+        
+        int around(): call(* getFive()) {
+               return 3;
+        }
+}
\ No newline at end of file
index 4d40e12a9ba14bdca4e10b994841143e53a09ec1..af9e8d3cfad79b6fc7c73c7bd2363dcbe4938907 100644 (file)
@@ -42,7 +42,7 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
     return new File("../tests/src/org/aspectj/systemtest/ajc150/ajc150.xml");
   }
 
// public void testGenericPTW_pr119539_1() { runTest("generic pertypewithin aspect - 1");}
 //public void testGenericPTW_pr119539_1() { runTest("generic pertypewithin aspect - 1");}
   //public void testGenericPTW_pr119539_2() { runTest("generic pertypewithin aspect - 2");}
   //public void testGenericPTW_pr119539_3() { runTest("generic pertypewithin aspect - 3");}
   /*
@@ -79,7 +79,9 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
   public void testFieldGet_pr114343_2()       { runTest("field-get, generics and around advice - 2");}
   public void testFieldGet_pr114343_3()       { runTest("field-get, generics and around advice - 3");}
   public void testCaptureBinding_pr114744()   { runTest("capturebinding wildcard problem");}
-  
+  public void testAutoboxingAroundAdvice_pr119210_1()   { runTest("autoboxing around advice - 1");}
+  public void testAutoboxingAroundAdvice_pr119210_2()   { runTest("autoboxing around advice - 2");}
+  public void testAutoboxingAroundAdvice_pr119210_3()   { runTest("autoboxing around advice - 3");}
   public void testBadDecp_pr110788_1() { runTest("bad generic decp - 1");}
   public void testBadDecp_pr110788_2() { runTest("bad generic decp - 2");}
   public void testBadDecp_pr110788_3() { runTest("bad generic decp - 3");}
index 1834c22f7440b0e2299f6d9e27e9c7e9136ab4a4..19ad305c9f7a48e375eb75a585a9adef246dd33b 100644 (file)
      <compile files="Pr114054.aj" options=""/>
      <run class="Pr114054"/>
     </ajc-test>  
+
+    <ajc-test dir="bugs150/pr119210" pr="119210" title="autoboxing around advice - 1">
+     <compile files="TestLib.java,ThreadAspectLib.java" options="-1.5"/>
+     <run class="TestLib">
+       <stderr>
+          <line text="obtaining five, got 3"/>
+       </stderr>
+     </run>
+    </ajc-test> 
+    <ajc-test dir="bugs150/pr119210" pr="119210" title="autoboxing around advice - 2">
+     <compile files="TestLib2.java,ThreadAspectLib2.java" options="-1.5"/>
+     <run class="TestLib2">
+       <stderr>
+          <line text="obtaining five, got 3"/>
+       </stderr>
+     </run>
+    </ajc-test> 
+   
+    <ajc-test dir="bugs150/pr119210" pr="119210" title="autoboxing around advice - 3">
+     <compile files="TestLib2.java,ThreadAspectLib2.java">
+       <message kind="error" line="16" text="incompatible return type applying to method-call(java.lang.Integer TestLib2.getFive())"/>
+       <message kind="error" line="4" text="incompatible return type applying to method-call(java.lang.Integer TestLib2.getFive())"/>
+     </compile>
+    </ajc-test> 
     
     <ajc-test dir="bugs150/pr119539" pr="119539" title="generic pertypewithin aspect - 1">
      <compile files="GenericPerTypeWithin.java" options="-1.5 -showWeaveInfo">