Package a.org.fakereplace.test.util

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


public class InstanceFieldTest {
    @BeforeClass
    public static void setup() {
        ClassReplacer rep = new ClassReplacer();
        rep.queueClassForReplacement(InstanceFieldClass.class, InstanceFieldClass1.class);
        rep.replaceQueuedClasses();
    }

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


    }

    @Test
    public void testChangingInstanceFieldType() throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
        ClassReplacer rep = new ClassReplacer();
        rep.queueClassForReplacement(ChangeFieldType.class, ChangeFieldType1.class);
        rep.replaceQueuedClasses();
        ChangeFieldType type = new ChangeFieldType();
        Assert.assertEquals(20, type.getValue());
    }
View Full Code Here

public class FinalMethodReplacementTest {

    @BeforeClass
    public static void setup() {
        ClassReplacer cr = new ClassReplacer();
        cr.queueClassForReplacement(FinalMethodClass.class, FinalMethodClass1.class);
        cr.replaceQueuedClasses();
    }

    @Ignore
    @Test
View Full Code Here

public class AnnotatedMethodParametersTest {

    @BeforeClass
    public static void setup() {
        ClassReplacer r = new ClassReplacer();
        r.queueClassForReplacement(MethodParameterAnnotated.class, MethodParameterAnnotated1.class);
        r.replaceQueuedClasses();

    }

    @Test
View Full Code Here

public class AnnotatedMethodTest {

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

    @Test
    public void testMethodAnnotationGetAnnotation() throws SecurityException, NoSuchMethodException {
View Full Code Here

public class PrivateMethodTest {
    @BeforeClass
    public static void setup() {
        ClassReplacer rep = new ClassReplacer();
        rep.queueClassForReplacement(PrivateMethodClass.class, PrivateMethodClass1.class);
        rep.replaceQueuedClasses();
    }

    @Test
    public void testAddingPrivateMethod() {
View Full Code Here

public class StaticFieldReplacementTest {

    @BeforeClass
    public static void setup() {
        ClassReplacer r = new ClassReplacer();
        r.queueClassForReplacement(StaticFieldClass.class, StaticFieldClass1.class);
        r.replaceQueuedClasses(true);
    }

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

    @Test
    @InSequence(1)
    public void firstReplacementTest() throws SecurityException, NoSuchFieldException, NoSuchMethodException {
        ClassReplacer r = new ClassReplacer();
        r.queueClassForReplacement(Replace.class, Replace1.class);
        r.replaceQueuedClasses();

        Replace.class.getDeclaredField("field1");
        Replace.class.getDeclaredField("sfield1");
        Replace.class.getDeclaredMethod("method1");
View Full Code Here

public class ExceptionTableUpdateTest {
    @Test
    public void testExceptionTableCorrect() throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
        ClassReplacer cr = new ClassReplacer();
        cr.queueClassForReplacement(VirtualMethodExceptionClass.class, VirtualMethodExceptionClass1.class);
        cr.replaceQueuedClasses();

        VirtualMethodExceptionClass i = new VirtualMethodExceptionClass();
        Method m = i.getClass().getMethod("doStuff1", int.class, int.class);
        m.invoke(i, 0, 0);
View Full Code Here

    @Test
    @InSequence(2)
    public void secondReplacementTest() throws SecurityException, NoSuchFieldException, NoSuchMethodException {
        ClassReplacer r = new ClassReplacer();
        r.queueClassForReplacement(Replace.class, Replace2.class);
        r.replaceQueuedClasses();

        Replace.class.getDeclaredField("field2");
        Replace.class.getDeclaredField("sfield2");
        Replace.class.getDeclaredMethod("method2");
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.