Examples of queueClassForReplacement()


Examples of a.org.fakereplace.test.util.ClassReplacer.queueClassForReplacement()

public class VirtualMethodTest {
    @BeforeClass
    public static void setup() {
        ClassReplacer rep = new ClassReplacer();
        rep.queueClassForReplacement(VirtualClass.class, VirtualClass1.class);
        rep.queueClassForReplacement(VirtualCaller.class, VirtualCaller1.class);
        rep.queueClassForReplacement(NoSupChild.class, NoSupChild1.class);
        rep.replaceQueuedClasses();
    }
View Full Code Here

Examples of a.org.fakereplace.test.util.ClassReplacer.queueClassForReplacement()

public class VirtualMethodTest {
    @BeforeClass
    public static void setup() {
        ClassReplacer rep = new ClassReplacer();
        rep.queueClassForReplacement(VirtualClass.class, VirtualClass1.class);
        rep.queueClassForReplacement(VirtualCaller.class, VirtualCaller1.class);
        rep.queueClassForReplacement(NoSupChild.class, NoSupChild1.class);
        rep.replaceQueuedClasses();
    }

    @Test
View Full Code Here

Examples of a.org.fakereplace.test.util.ClassReplacer.queueClassForReplacement()

    @BeforeClass
    public static void setup() {
        ClassReplacer rep = new ClassReplacer();
        rep.queueClassForReplacement(VirtualClass.class, VirtualClass1.class);
        rep.queueClassForReplacement(VirtualCaller.class, VirtualCaller1.class);
        rep.queueClassForReplacement(NoSupChild.class, NoSupChild1.class);
        rep.replaceQueuedClasses();
    }

    @Test
    public void testVirtualMethodByReflection() throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
View Full Code Here

Examples of a.org.fakereplace.test.util.ClassReplacer.queueClassForReplacement()

public class StaticMethodTest {
    @BeforeClass
    public static void setup() {
        ClassReplacer rep = new ClassReplacer();
        rep.queueClassForReplacement(StaticClass.class, StaticClass1.class);
        rep.replaceQueuedClasses();
    }

    @Test
    public void testStaticMethodByReflection() throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
View Full Code Here

Examples of a.org.fakereplace.test.util.ClassReplacer.queueClassForReplacement()

public class StaticFieldRepeatReplacementTest {
    @Test
    @InSequence(1)
    public void firstReplacement() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
        ClassReplacer r = new ClassReplacer();
        r.queueClassForReplacement(StaticFieldRepeatClass.class, StaticFieldRepeatClass1.class);
        r.replaceQueuedClasses();

        Field someField = StaticFieldRepeatClass.class.getDeclaredField("someField");
        someField.setAccessible(true);
        someField.set(null, 10);
View Full Code Here

Examples of a.org.fakereplace.test.util.ClassReplacer.queueClassForReplacement()

    }

    @InSequence(2)
    public void secondReplacement() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
        ClassReplacer r = new ClassReplacer();
        r.queueClassForReplacement(StaticFieldRepeatClass.class, StaticFieldRepeatClass2.class);
        r.replaceQueuedClasses();

        Field someField = StaticFieldRepeatClass.class.getDeclaredField("someField");
        someField.setAccessible(true);
        Assert.assertEquals(10, someField.get(null));
View Full Code Here

Examples of a.org.fakereplace.test.util.ClassReplacer.queueClassForReplacement()

public class AnnotatedClassTest {

    @Test
    public void testStringA() throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException, NoSuchFieldException {
        ClassReplacer rep = new ClassReplacer();
        rep.queueClassForReplacement(StringC.class, StringC1.class);
        rep.replaceQueuedClasses();
        StringC ns = new StringC();
        Class c = StringC.class;
        Assert.assertFalse(ns.getClass().isAnnotationPresent(StringA.class));
        Field field = c.getDeclaredField("field");
View Full Code Here

Examples of a.org.fakereplace.test.util.ClassReplacer.queueClassForReplacement()

    }

    @Test
    public void testIntA() throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException, NoSuchFieldException {
        ClassReplacer rep = new ClassReplacer();
        rep.queueClassForReplacement(IntC.class, IntC1.class);
        rep.replaceQueuedClasses();
        IntC ns = new IntC();
        Class c = IntC.class;
        Assert.assertFalse(ns.getClass().isAnnotationPresent(IntA.class));
        Field field = c.getDeclaredField("field");
View Full Code Here

Examples of a.org.fakereplace.test.util.ClassReplacer.queueClassForReplacement()

    }

    @Test
    public void testClassA() throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException, NoSuchFieldException {
        ClassReplacer rep = new ClassReplacer();
        rep.queueClassForReplacement(ClassC.class, ClassC1.class);
        rep.replaceQueuedClasses();
        ClassC ns = new ClassC();
        Class c = ClassC.class;
        Assert.assertFalse(ns.getClass().isAnnotationPresent(ClassA.class));
        Field field = c.getDeclaredField("field");
View Full Code Here

Examples of a.org.fakereplace.test.util.ClassReplacer.queueClassForReplacement()

    }

    @Test
    public void testAnnotationA() throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException, NoSuchFieldException {
        ClassReplacer rep = new ClassReplacer();
        rep.queueClassForReplacement(AnnotationC.class, AnnotationC1.class);
        rep.replaceQueuedClasses();
        AnnotationC ns = new AnnotationC();
        Class c = AnnotationC.class;
        Assert.assertFalse(ns.getClass().isAnnotationPresent(AnnotationA.class));
        Field field = c.getDeclaredField("field");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.