]> source.dussan.org Git - aspectj.git/commitdiff
tests for pr103097
authoracolyer <acolyer>
Tue, 22 Nov 2005 09:47:59 +0000 (09:47 +0000)
committeracolyer <acolyer>
Tue, 22 Nov 2005 09:47:59 +0000 (09:47 +0000)
tests/bugs150/Pr103097.aj [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/Pr103097.aj b/tests/bugs150/Pr103097.aj
new file mode 100644 (file)
index 0000000..e8e3cbb
--- /dev/null
@@ -0,0 +1,23 @@
+import java.io.IOException;
+
+public aspect Pr103097 {
+    declare soft: IOException: 
+               within(Pr103097) && 
+               !withincode(* *(..)) &&
+               !call(* *(..));
+
+    before() : execution(* main(..)) {
+        try {
+           doThrow();
+       } catch (IOException e) {
+         throw new RuntimeException("IOException not softened as expected");
+       } catch(org.aspectj.lang.SoftException ex) {}
+    }
+
+    public static void doThrow() throws IOException {
+        throw new IOException("test");
+    }
+
+    public static void main(String args[]) {
+    }
+}
\ No newline at end of file
index d5df0462cb33c121c6b2d526abce551d12b4f58e..14833bc63c1fc4bdaf56fe7a379a37d005cdacb8 100644 (file)
@@ -730,6 +730,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
          runTest("declare soft and adviceexecution");
   }
 
+  public void testDeclareSoftWithExclusions() {
+         runTest("declare soft and exclusions");
+  }
+  
   /*
    * Load-time weaving bugs
    */
index 120083cf7514890c509c7f8f9e9289b59b0fda60..7a19516b62d8590d737dd0d766bde84f0526a7f6 100644 (file)
        <ajc-test dir="bugs150" title="declare soft and adviceexecution" pr="103051">
                <compile files="Pr103051.aj" options="-Xdev:Pinpoint"/>
        </ajc-test>
-           
+
+       <ajc-test dir="bugs150" title="declare soft and exclusions" pr="103097">
+               <compile files="Pr103097.aj"/>
+               <run class="Pr103097"/>
+       </ajc-test>
+                   
     <ajc-test dir="bugs150/pr114436" title="ClassFormatError binary weaving perthis">
      <compile files="SimpleTrace.aj,ConcreteSimpleTracing.aj" outjar="aspects.jar"/>
      <compile files="TestClass.java" aspectpath="aspects.jar"/>