]> source.dussan.org Git - aspectj.git/commitdiff
Test LTW dump for JSPs
authormwebster <mwebster>
Mon, 22 Jan 2007 16:44:10 +0000 (16:44 +0000)
committermwebster <mwebster>
Mon, 22 Jan 2007 16:44:10 +0000 (16:44 +0000)
tests/java5/ataspectj/ataspectj/aop-dumpjsp.xml [new file with mode: 0644]
tests/java5/ataspectj/com/ibm/_jsp/_abc123_xyz890.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java
tests/src/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml

diff --git a/tests/java5/ataspectj/ataspectj/aop-dumpjsp.xml b/tests/java5/ataspectj/ataspectj/aop-dumpjsp.xml
new file mode 100644 (file)
index 0000000..43a6cf5
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<aspectj>
+       <aspects>
+               <aspect name="ataspectj.EmptyAspect"/>
+       </aspects>
+    <weaver options="-verbose -debug">
+        <dump within="com.ibm._jsp..*" beforeandafter="true"/> 
+    </weaver>
+</aspectj>
diff --git a/tests/java5/ataspectj/com/ibm/_jsp/_abc123_xyz890.java b/tests/java5/ataspectj/com/ibm/_jsp/_abc123_xyz890.java
new file mode 100644 (file)
index 0000000..4d0bac8
--- /dev/null
@@ -0,0 +1,8 @@
+package com.ibm._jsp;
+
+public class _abc123_xyz890 {
+       
+       public static void main (String[] args) {
+               System.out.println("? _abc123_xyz890.main()");
+       }
+}
\ No newline at end of file
index 6e7e7d546d0dc89104bfa2bd1fea6e5274d8bad1..22c817823eae3ab1b5d37c530e7b26d14a81c6aa 100644 (file)
@@ -147,6 +147,25 @@ public class AtAjLTWTests extends XMLBasedAjcTestCase {
         f.delete();
     }
 
+    public void testLTWDumpJSP () {
+        runTest("LTW DumpTest JSP");
+
+        // The working directory is different because this test must be forked
+        File f = new File("_ajdump/_before/com/ibm/_jsp");
+        CountingFilenameFilter cff = new CountingFilenameFilter(".class");
+        f.listFiles(cff);
+        assertEquals("Expected dump file in " + f.getAbsolutePath(),1,cff.getCount());
+        f = new File("_ajdump/com/ibm/_jsp");
+        cff = new CountingFilenameFilter(".class");
+        f.listFiles(cff);
+        assertEquals(1,cff.getCount());
+        
+        // tidy up...
+        f = new File("_ajdump");
+        FileUtil.deleteContents(f);
+        f.delete();
+    }
+    
     public void testAjcAspect1LTWAspect2_Xreweavable() {
         runTest("Ajc Aspect1 LTW Aspect2 -Xreweavable");
     }
index 2fb728485dce7fe158344977aab782eddcacb1ac..a72fa4ebfc765d5e67631e035bd16a9fed8edd41 100644 (file)
         <ant file="ajc-ant.xml" target="ltw.DumpProxyTest" verbose="true"/>
     </ajc-test>
 
+    <ajc-test dir="java5/ataspectj" title="LTW DumpTest JSP">
+        <compile
+                files="ataspectj/EmptyAspect.aj"
+                options="-1.5 -Xlint:ignore"/>
+        <compile
+                files="com/ibm/_jsp/_abc123_xyz890.java"
+                options="-1.5"/>
+        <run class="com.ibm._jsp._abc123_xyz890" ltw="ataspectj/aop-dumpjsp.xml"/>
+    </ajc-test>
+
     <ajc-test dir="java5/ataspectj" title="Ajc Aspect1 LTW Aspect2 -Xreweavable">
         <compile
                 files="ataspectj/ltwreweavable/Main.java,ataspectj/ltwreweavable/Aspect1.java,ataspectj/ltwreweavable/Advisable.java"