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 },
}
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.*(..)"),
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 },
}
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 },
}
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(..)"),
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;
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);
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);