]> source.dussan.org Git - aspectj.git/commitdiff
231396: Use testutils rather than mainline code
authoraclement <aclement>
Thu, 29 May 2008 04:50:16 +0000 (04:50 +0000)
committeraclement <aclement>
Thu, 29 May 2008 04:50:16 +0000 (04:50 +0000)
weaver/testsrc/org/aspectj/weaver/patterns/SignaturePatternTestCase.java
weaver/testsrc/org/aspectj/weaver/patterns/VisitorTestCase.java
weaver/testsrc/org/aspectj/weaver/patterns/WithinTestCase.java

index 336d86f6248a8f294ce808113ed6c60d8310e13a..b355cdc2cf1e1d28d2f9382521c0fcc6bd2ba644 100644 (file)
@@ -33,9 +33,9 @@ public class SignaturePatternTestCase extends TestCase {
        BcelWorld world = new BcelWorld();
 
        public void testThrowsMatch() throws IOException {
-               Member onlyDerivedOnDerived = MemberImpl.methodFromString("static void fluffy.Derived.onlyDerived()");
-               Member mOnBase = MemberImpl.methodFromString("void fluffy.Base.m()");
-               Member mOnDerived = MemberImpl.methodFromString("void fluffy.Derived.m()");
+               Member onlyDerivedOnDerived = TestUtils.methodFromString("static void fluffy.Derived.onlyDerived()");
+               Member mOnBase = TestUtils.methodFromString("void fluffy.Base.m()");
+               Member mOnDerived = TestUtils.methodFromString("void fluffy.Derived.m()");
                
                checkMatch(makeMethodPat("* fluffy.Base.*(..) throws java.lang.CloneNotSupportedException"),
                                        new Member[] { mOnBase },
@@ -66,9 +66,9 @@ public class SignaturePatternTestCase extends TestCase {
        }
 
        public void testInstanceMethodMatch() throws IOException {
-               Member objectToString = MemberImpl.methodFromString("java.lang.String java.lang.Object.toString()");
-               Member integerToString = MemberImpl.methodFromString("java.lang.String java.lang.Integer.toString()");
-               Member integerIntValue = MemberImpl.methodFromString("int java.lang.Integer.intValue()");
+               Member objectToString = TestUtils.methodFromString("java.lang.String java.lang.Object.toString()");
+               Member integerToString = TestUtils.methodFromString("java.lang.String java.lang.Integer.toString()");
+               Member integerIntValue = TestUtils.methodFromString("int java.lang.Integer.intValue()");
                //Member objectToString = Member.methodFromString("java.lang.String java.lang.Object.toString()");
                
                checkMatch(makeMethodPat("* java.lang.Object.*(..)"),
@@ -82,11 +82,11 @@ public class SignaturePatternTestCase extends TestCase {
 
        
        public void testStaticMethodMatch() throws IOException {
-               Member onlyBaseOnBase = MemberImpl.methodFromString("static void fluffy.Base.onlyBase()");
-               Member onlyBaseOnDerived = MemberImpl.methodFromString("static void fluffy.Derived.onlyBase()");
-               Member onlyDerivedOnDerived = MemberImpl.methodFromString("static void fluffy.Derived.onlyDerived()");
-               Member bothOnBase = MemberImpl.methodFromString("static void fluffy.Base.both()");
-               Member bothOnDerived = MemberImpl.methodFromString("static void fluffy.Derived.both()");
+               Member onlyBaseOnBase = TestUtils.methodFromString("static void fluffy.Base.onlyBase()");
+               Member onlyBaseOnDerived = TestUtils.methodFromString("static void fluffy.Derived.onlyBase()");
+               Member onlyDerivedOnDerived = TestUtils.methodFromString("static void fluffy.Derived.onlyDerived()");
+               Member bothOnBase = TestUtils.methodFromString("static void fluffy.Base.both()");
+               Member bothOnDerived = TestUtils.methodFromString("static void fluffy.Derived.both()");
                
                checkMatch(makeMethodPat("* fluffy.Base.*(..)"),
                                        new Member[] { onlyBaseOnBase, onlyBaseOnDerived, bothOnBase },
@@ -98,11 +98,11 @@ public class SignaturePatternTestCase extends TestCase {
        }
        
        public void testFieldMatch() throws IOException {
-               Member onlyBaseOnBase = MemberImpl.fieldFromString("int fluffy.Base.onlyBase");
-               Member onlyBaseOnDerived = MemberImpl.fieldFromString("int fluffy.Derived.onlyBase");
-               Member onlyDerivedOnDerived = MemberImpl.fieldFromString("int fluffy.Derived.onlyDerived");
-               Member bothOnBase = MemberImpl.fieldFromString("int fluffy.Base.both");
-               Member bothOnDerived = MemberImpl.fieldFromString("int fluffy.Derived.both");
+               Member onlyBaseOnBase = TestUtils.fieldFromString("int fluffy.Base.onlyBase");
+               Member onlyBaseOnDerived = TestUtils.fieldFromString("int fluffy.Derived.onlyBase");
+               Member onlyDerivedOnDerived = TestUtils.fieldFromString("int fluffy.Derived.onlyDerived");
+               Member bothOnBase = TestUtils.fieldFromString("int fluffy.Base.both");
+               Member bothOnDerived = TestUtils.fieldFromString("int fluffy.Derived.both");
                
                checkMatch(makeFieldPat("* fluffy.Base.*"),
                                        new Member[] { onlyBaseOnBase, onlyBaseOnDerived, bothOnBase },
@@ -114,9 +114,9 @@ public class SignaturePatternTestCase extends TestCase {
        }
        
        public void testConstructorMatch() throws IOException {
-               Member onBase = MemberImpl.methodFromString("void fluffy.Base.<init>()");
-               Member onDerived = MemberImpl.methodFromString("void fluffy.Derived.<init>()");
-               Member onBaseWithInt = MemberImpl.methodFromString("void fluffy.Base.<init>(int)");
+               Member onBase = TestUtils.methodFromString("void fluffy.Base.<init>()");
+               Member onDerived = TestUtils.methodFromString("void fluffy.Derived.<init>()");
+               Member onBaseWithInt = TestUtils.methodFromString("void fluffy.Base.<init>(int)");
 
                
                checkMatch(makeMethodPat("fluffy.Base.new(..)"),
index 12218df8b8237c3236715b759105e4173a739688..16ee14054d04300bea5c18a9fc741cd982670788 100644 (file)
@@ -50,7 +50,7 @@ public class VisitorTestCase extends TestCase {
         for (Iterator iterator = pointcuts.iterator(); iterator.hasNext();) {
             String pointcut = (String) iterator.next();
             try  {
-                PatternNodeVisitor.DumpPointcutVisitor.check(pointcut);
+                DumpPointcutVisitor.check(pointcut);
             } catch (Throwable t) {
                 t.printStackTrace();
                 fail("Failed on '"+pointcut+"': " +t.toString());
@@ -66,7 +66,7 @@ public class VisitorTestCase extends TestCase {
             String tp = (String) iterator.next();
             try  {
                 TypePattern p = new PatternParser(tp).parseTypePattern();
-                PatternNodeVisitor.DumpPointcutVisitor.check(p, true);
+                DumpPointcutVisitor.check(p, true);
             } catch (Throwable t) {
                 fail("Failed on '"+tp+"': " +t.toString());
             }
index d2063b73b3453ee00b8e77138e2bb885ba1ad275..55f2a38c88a687af6322dbc2fc43f4b95f572595 100644 (file)
@@ -23,6 +23,7 @@ import junit.framework.TestCase;
 import org.aspectj.util.FuzzyBoolean;
 import org.aspectj.weaver.IntMap;
 import org.aspectj.weaver.MemberImpl;
+import org.aspectj.weaver.TestUtils;
 import org.aspectj.weaver.Shadow;
 import org.aspectj.weaver.TestShadow;
 import org.aspectj.weaver.UnresolvedType;
@@ -41,7 +42,7 @@ public class WithinTestCase extends TestCase {
        public void testMatch() throws IOException {
                Shadow getOutFromArrayList = new TestShadow(
                        Shadow.FieldGet, 
-                       MemberImpl.fieldFromString("java.io.PrintStream java.lang.System.out"),
+                       TestUtils.fieldFromString("java.io.PrintStream java.lang.System.out"),
                        UnresolvedType.forName("java.util.ArrayList"),
                        world);
 
@@ -57,7 +58,7 @@ public class WithinTestCase extends TestCase {
                
                Shadow getOutFromEntry = new TestShadow(
                        Shadow.FieldGet, 
-                       MemberImpl.fieldFromString("java.io.PrintStream java.lang.System.out"),
+                       TestUtils.fieldFromString("java.io.PrintStream java.lang.System.out"),
                        UnresolvedType.forName("java.util.Map$Entry"),
                        world);