Package a.org.fakereplace.test.util

Examples of a.org.fakereplace.test.util.ClassReplacer


    }

    @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


    }

    @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

    }

    @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

    }

    @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

import org.junit.Test;

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

import org.junit.Test;

public class InterfaceMethodTest {
    @BeforeClass
    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();
    }
View Full Code Here

public class InstanceFieldReflectionTest {

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

* @author stuart
*/
public class InstanceToStaticTest {
    @BeforeClass
    public static void setup() {
        ClassReplacer r = new ClassReplacer();
        r.queueClassForReplacement(InstanceToStatic.class, InstanceToStatic1.class);
        r.replaceQueuedClasses();
    }
View Full Code Here

public class InheritedAnnotationTest {

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

public class AnnotatedFieldTest {

    @Test
    public void testFieldAnnotations() throws SecurityException, NoSuchFieldException {
        ClassReplacer r = new ClassReplacer();
        r.queueClassForReplacement(FieldAnnotated.class, FieldAnnotated1.class);
        r.replaceQueuedClasses();

        Field m1 = FieldAnnotated.class.getField("field1");
        Field m2 = FieldAnnotated.class.getField("field2");
        Field m3 = FieldAnnotated.class.getField("field3");
        Assert.assertEquals("1", m1.getAnnotation(FieldAnnotation.class).value());
View Full Code Here

TOP

Related Classes of a.org.fakereplace.test.util.ClassReplacer

Copyright © 2018 www.massapicom. 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.