Examples of replaceQueuedClasses()


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

    @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");
        Assert.assertTrue(field.isAnnotationPresent(StringA.class));
View Full Code Here

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

    @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");
        Assert.assertTrue(field.isAnnotationPresent(IntA.class));
View Full Code Here

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

    @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");
        Assert.assertTrue(field.isAnnotationPresent(ClassA.class));
View Full Code Here

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

    @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");
        Assert.assertTrue(field.isAnnotationPresent(AnnotationA.class));
View Full Code Here

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

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

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

    @BeforeClass
    public static void setup() {
        ClassReplacer r = new ClassReplacer();
        r.queueClassForReplacement(StaticMethodVisibilityCallingClass.class, StaticMethodVisibilityCallingClass1.class);
        r.queueClassForReplacement(StaticMethodVisibilityClass.class, StaticMethodVisibilityClass1.class);
        r.replaceQueuedClasses();
    }

    @Test
    public void testExistingMethod() {
        Assert.assertEquals("helo world", StaticMethodVisibilityClass.callingMethod());
View Full Code Here

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

    public static void setup() {
        ClassReplacer rep = new ClassReplacer();
        rep.queueClassForReplacement(InterfaceCallingClass.class, InterfaceCallingClass1.class);
        rep.queueClassForReplacement(SomeInterface.class, SomeInterface1.class);
        rep.queueClassForReplacement(ImplementingClass.class, ImplementingClass1.class);
        rep.replaceQueuedClasses();
    }

    @Test
    public void testAddingInterfaceMethod() {
        SomeInterface iface = new ImplementingClass();
View Full Code Here

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

    @BeforeClass
    public static void setup() {
        ClassReplacer c = new ClassReplacer();
        c.queueClassForReplacement(InstanceFieldReflection.class, InstanceFieldReflection1.class);
        c.replaceQueuedClasses();
    }

    @Test
    public void testSettingInstanceFieldByReflection() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
        InstanceFieldReflection r = new InstanceFieldReflection();
View Full Code Here

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

public class InstanceToStaticTest {
    @BeforeClass
    public static void setup() {
        ClassReplacer r = new ClassReplacer();
        r.queueClassForReplacement(InstanceToStatic.class, InstanceToStatic1.class);
        r.replaceQueuedClasses();
    }

    @Test
    public void testInstanceToStatic() {
        InstanceToStatic f1 = new InstanceToStatic();
View Full Code Here

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

    @BeforeClass
    public static void setup() {
        ClassReplacer r = new ClassReplacer();
        r.queueClassForReplacement(AddedInheritedSuperClass.class, AddedInheritedSuperClass1.class);
        r.queueClassForReplacement(RemovedInheritedSuperClass.class, RemovedInheritedSuperClass1.class);
        r.replaceQueuedClasses();
    }

    /**
     * test the annotation inheritence works the way it is supposed to
     */
 
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.