Package a.org.fakereplace.test.util

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


    @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


        InstTestRep re = new InstTestRep();
        int val0 = re.value();
        Assert.assertEquals( "Test setup wrong", 0, val0);
        ClassReplacer cr = new ClassReplacer();
        cr.queueClassForReplacement(InstTestRep.class, InstTestRep1.class);
        cr.replaceQueuedClasses();
        re = new InstTestRep();
        val0 = re.value();
        Assert.assertEquals("InstTestRep was not replaced", 1,  val0 );

    }
View Full Code Here

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

    @Test
    public void testIntPrimitiveReturnType() throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
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.