diff options
author | aclement <aclement> | 2005-12-08 15:32:36 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-12-08 15:32:36 +0000 |
commit | f5f36e2dd0f1318f44397f691c480967c57dbfb4 (patch) | |
tree | e9ae0715897d34186371c6659df672a705697907 /tests | |
parent | 94159f9e80233497e02899c91a126ea5a3b605cc (diff) | |
download | aspectj-f5f36e2dd0f1318f44397f691c480967c57dbfb4.tar.gz aspectj-f5f36e2dd0f1318f44397f691c480967c57dbfb4.zip |
testcode for 119210
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs150/pr119210/TestLib.java | 8 | ||||
-rw-r--r-- | tests/bugs150/pr119210/TestLib2.java | 8 | ||||
-rw-r--r-- | tests/bugs150/pr119210/ThreadAspectLib.java | 19 | ||||
-rw-r--r-- | tests/bugs150/pr119210/ThreadAspectLib2.java | 19 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java | 6 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 25 |
6 files changed, 83 insertions, 2 deletions
diff --git a/tests/bugs150/pr119210/TestLib.java b/tests/bugs150/pr119210/TestLib.java new file mode 100644 index 000000000..09f1770a5 --- /dev/null +++ b/tests/bugs150/pr119210/TestLib.java @@ -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 index 000000000..718eee2e8 --- /dev/null +++ b/tests/bugs150/pr119210/TestLib2.java @@ -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 index 000000000..b2c899499 --- /dev/null +++ b/tests/bugs150/pr119210/ThreadAspectLib.java @@ -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 index 000000000..1794c0a4d --- /dev/null +++ b/tests/bugs150/pr119210/ThreadAspectLib2.java @@ -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 diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index 4d40e12a9..af9e8d3cf 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -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");} diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index 1834c22f7..19ad305c9 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -68,6 +68,31 @@ <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"> |