Examples of replaceQueuedClasses()


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

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

        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

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

    @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

Examples of a.org.fakereplace.testsuite.shared.ClassReplacer.replaceQueuedClasses()

    public void testClientProxyReplacement() throws InterruptedException {
        dependentBean.setValue("Hello CDI");
        final ClassReplacer replacer = new ClassReplacer();
        replacer.queueClassForReplacement(AppScopedBean.class, AppScopedBean1.class);
        replacer.queueClassForReplacement(DependentBean.class, DependentBean1.class);
        replacer.replaceQueuedClasses();
        Assert.assertEquals("Hello CDI", dependentBean.getValue());

    }
}
View Full Code Here

Examples of a.org.fakereplace.testsuite.shared.RemoteClassReplacer.replaceQueuedClasses()

        String result = performCall("hellopath/helloworld");
        Assert.assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><jaxbModel><first>John</first></jaxbModel>", result);
        RemoteClassReplacer r = new RemoteClassReplacer();
        r.queueClassForReplacement(HelloWorldResource.class, HelloWorldResource1.class);
        r.queueClassForReplacement(JaxbModel.class, JaxbModel1.class);
        r.replaceQueuedClasses(DEPLOYMENT_NAME);
        result = performCall("hellopath/helloworld");
        Assert.assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><jaxbModel><first>John</first><last>Citizen</last></jaxbModel>", result);
    }
}
View Full Code Here

Examples of a.org.fakereplace.testsuite.shared.RemoteClassReplacer.replaceQueuedClasses()

        remote.setValue("Hello CDI");
        final RemoteClassReplacer replacer = new RemoteClassReplacer();
        replacer.queueClassForReplacement(AppScopedBean.class, AppScopedBean1.class);
        replacer.queueClassForReplacement(RemoteEjb.class, RemoteEjb1.class);
        replacer.replaceQueuedClasses("test.jar");
        Assert.assertEquals("Hello CDI", remote.getValue());

    }
}
View Full Code Here

Examples of a.org.fakereplace.testsuite.shared.RemoteClassReplacer.replaceQueuedClasses()

        Assert.assertEquals("1-name", ejb.getEntityDesc(1));
        final RemoteClassReplacer replacer = new RemoteClassReplacer();
        replacer.queueClassForReplacement(Employee.class, Employee1.class);
        replacer.queueClassForReplacement(EmployeeEjb.class, EmployeeEjb1.class);
        replacer.addNewClass(AddedEntity.class);
        replacer.replaceQueuedClasses(DEPLOYMENT_NAME);
        ejb.saveEntity(2);
        Assert.assertEquals("2-name-address", ejb.getEntityDesc(2));
    }

}
View Full Code Here

Examples of a.org.fakereplace.testsuite.shared.RemoteClassReplacer.replaceQueuedClasses()

        String result = performCall("hellopath/helloworld");
        assertEquals("Hello World!", result);
        RemoteClassReplacer r = new RemoteClassReplacer();
        r.queueClassForReplacement(HelloWorldResource.class, HelloWorldResource1.class);
        r.addNewClass(JaxbModel.class);
        r.replaceQueuedClasses(DEPLOYMENT_NAME);
        result = performCall("hellopath/helloworld");
        Assert.assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><jaxbModel><first>John</first><last>Citizen</last></jaxbModel>", result);
    }
}
View Full Code Here

Examples of a.org.fakereplace.testsuite.shared.RemoteClassReplacer.replaceQueuedClasses()

        Assert.assertTrue(content, content.contains("FIRST: a"));
        Assert.assertFalse(content, content.contains("SECOND: b"));
        final RemoteClassReplacer replacer = new RemoteClassReplacer();
        replacer.queueClassForReplacement(AppScopedBean.class, AppScopedBean1.class);
        replacer.queueResourceForReplacement(getClass(), "index.xhtml", "index1.xhtml");
        replacer.replaceQueuedClasses("test.war");
        result = client.execute(new HttpGet(url.toExternalForm() + "index.jsf"));
        content = HttpUtils.getContent(result);

        Assert.assertTrue(content, content.contains("FIRST: a"));
        Assert.assertTrue(content, content.contains("SECOND: b"));
View Full Code Here

Examples of a.org.fakereplace.testsuite.shared.RemoteClassReplacer.replaceQueuedClasses()

        Assert.assertTrue(content, content.contains("FIRST: a"));
        Assert.assertFalse(content, content.contains("SECOND: b"));
        final RemoteClassReplacer replacer = new RemoteClassReplacer();
        replacer.queueClassForReplacement(AppScopedBean.class, AppScopedBean1.class);
        replacer.queueResourceForReplacement(getClass(), "index.xhtml", "index1.xhtml");
        replacer.replaceQueuedClasses("test.war");
        result = client.execute(new HttpGet(url.toExternalForm() + "index.jsf"));
        content = HttpUtils.getContent(result);

        Assert.assertTrue(content, content.contains("FIRST: a"));
        Assert.assertTrue(content, content.contains("SECOND: b"));
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.