From: aclement Date: Thu, 29 May 2008 04:50:16 +0000 (+0000) Subject: 231396: Use testutils rather than mainline code X-Git-Tag: V1_6_1rc1~215 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=318c4a62b60e8c2497d6226bd5b73d786d3a99d8;p=aspectj.git 231396: Use testutils rather than mainline code --- diff --git a/weaver/testsrc/org/aspectj/weaver/patterns/SignaturePatternTestCase.java b/weaver/testsrc/org/aspectj/weaver/patterns/SignaturePatternTestCase.java index 336d86f62..b355cdc2c 100644 --- a/weaver/testsrc/org/aspectj/weaver/patterns/SignaturePatternTestCase.java +++ b/weaver/testsrc/org/aspectj/weaver/patterns/SignaturePatternTestCase.java @@ -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.()"); - Member onDerived = MemberImpl.methodFromString("void fluffy.Derived.()"); - Member onBaseWithInt = MemberImpl.methodFromString("void fluffy.Base.(int)"); + Member onBase = TestUtils.methodFromString("void fluffy.Base.()"); + Member onDerived = TestUtils.methodFromString("void fluffy.Derived.()"); + Member onBaseWithInt = TestUtils.methodFromString("void fluffy.Base.(int)"); checkMatch(makeMethodPat("fluffy.Base.new(..)"), diff --git a/weaver/testsrc/org/aspectj/weaver/patterns/VisitorTestCase.java b/weaver/testsrc/org/aspectj/weaver/patterns/VisitorTestCase.java index 12218df8b..16ee14054 100644 --- a/weaver/testsrc/org/aspectj/weaver/patterns/VisitorTestCase.java +++ b/weaver/testsrc/org/aspectj/weaver/patterns/VisitorTestCase.java @@ -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()); } diff --git a/weaver/testsrc/org/aspectj/weaver/patterns/WithinTestCase.java b/weaver/testsrc/org/aspectj/weaver/patterns/WithinTestCase.java index d2063b73b..55f2a38c8 100644 --- a/weaver/testsrc/org/aspectj/weaver/patterns/WithinTestCase.java +++ b/weaver/testsrc/org/aspectj/weaver/patterns/WithinTestCase.java @@ -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);