]> source.dussan.org Git - aspectj.git/commitdiff
Bug 155033 "Use ajcore for LTW problems" (rename HelloWorld HelloWorldWithException)
authormwebster <mwebster>
Mon, 6 Nov 2006 13:51:05 +0000 (13:51 +0000)
committermwebster <mwebster>
Mon, 6 Nov 2006 13:51:05 +0000 (13:51 +0000)
tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java
tests/src/org/aspectj/systemtest/ajc153/ajc153.xml

index 3d586958fc2fc54e052045f564b727263c229168..6e7e7d546d0dc89104bfa2bd1fea6e5274d8bad1 100644 (file)
@@ -12,7 +12,6 @@
 package org.aspectj.systemtest.ajc150.ataspectj;
 
 import java.io.File;
-import java.io.FilenameFilter;
 
 import junit.framework.Test;
 
@@ -100,13 +99,13 @@ public class AtAjLTWTests extends XMLBasedAjcTestCase {
         
         // before
         File f = new File("_ajdump/_before/com/foo/bar");
-        CountingFilenameFilter cff = new CountingFilenameFilter();
+        CountingFilenameFilter cff = new CountingFilenameFilter(".class");
         f.listFiles(cff);
         assertEquals("Expected dump file in " + f.getAbsolutePath(),1,cff.getCount());
 
         // after
         f = new File("_ajdump/com/foo/bar");
-        cff = new CountingFilenameFilter();
+        cff = new CountingFilenameFilter(".class");
         f.listFiles(cff);
         assertEquals("Expected dump file in " + f.getAbsolutePath(),1,cff.getCount());
         
@@ -134,11 +133,11 @@ public class AtAjLTWTests extends XMLBasedAjcTestCase {
         // The working directory is different because this test must be forked
         File dir = new File("../tests/java5/ataspectj");
         File f = new File(dir,"_ajdump/_before");
-        CountingFilenameFilter cff = new CountingFilenameFilter();
+        CountingFilenameFilter cff = new CountingFilenameFilter(".class");
         f.listFiles(cff);
         assertEquals("Expected dump file in " + f.getAbsolutePath(),1,cff.getCount());
         f = new File(dir,"_ajdump");
-        cff = new CountingFilenameFilter();
+        cff = new CountingFilenameFilter(".class");
         f.listFiles(cff);
         assertEquals(1,cff.getCount());
         
@@ -215,18 +214,4 @@ public class AtAjLTWTests extends XMLBasedAjcTestCase {
     public void testCflowBelowStack() {
         runTest("CflowBelowStack");
     }
-
-    private static class CountingFilenameFilter implements FilenameFilter {
-       
-       private int count;
-       
-       public boolean accept(File dir, String name) {
-               if (name.endsWith(".class")) count++;
-               return false;
-       }
-
-               public int getCount() {
-                       return count;
-               }
-    }
 }
index 85219fc093a7b3bd8514b7ffc5bfdb6c4d850978..10bb31e0122ff50434874ec62df1e9338ef4a115 100644 (file)
     </ajc-test>
     
     <ajc-test dir="ltw" title="reweavableAspectNotRegistered error">
-      <compile files="HelloWorld.java, ExceptionHandler.aj" options="-showWeaveInfo">
-        <message kind="weave" text="Join point 'method-execution(void HelloWorld.main(java.lang.String[]))' in Type 'HelloWorld' (HelloWorld.java:3) advised by around advice from 'ExceptionHandler' (ExceptionHandler.aj:2)"/>
+      <compile files="HelloWorldWithException.java, ExceptionHandler.aj" options="-showWeaveInfo">
+        <message kind="weave" text="Join point 'method-execution(void HelloWorldWithException.main(java.lang.String[]))' in Type 'HelloWorldWithException' (HelloWorldWithException.java:3) advised by around advice from 'ExceptionHandler' (ExceptionHandler.aj:2)"/>
       </compile>
       <compile files="EmptyAspect.aj">
       </compile>
-      <run class="HelloWorld" ltw="aop-missingaspect.xml">
+      <run class="HelloWorldWithException" ltw="aop-missingaspect.xml">
         <stdout>
           <line text="Hello World!"/>
         </stdout>
         <stderr>
-               <line text="error aspect 'ExceptionHandler' woven into 'HelloWorld' must be defined to the weaver (placed on the aspectpath, or defined in an aop.xml file if using LTW)."/>
+               <line text="error aspect 'ExceptionHandler' woven into 'HelloWorldWithException' must be defined to the weaver (placed on the aspectpath, or defined in an aop.xml file if using LTW)."/>
         </stderr>
       </run>
     </ajc-test>
 
        <ajc-test dir="ltw" title="NPE with custom agent" keywords="ltw">
         <compile files="java/net/URLClassLoader.java"/>
-        <compile files="HelloWorld.java" options="-outjar hello.jar"/>
+        <compile files="HelloWorldWithException.java" options="-outjar hello.jar"/>
         <compile files="ExceptionHandler.aj" options="-outxml -outjar handler.jar"/>
         <compile files="NullSecurityManager.java" options="-outjar security.jar"/>
                <ant file="ant.xml" target="NPE with custom agent" verbose="true">