Package org.jboss.weld.environment.se

Examples of org.jboss.weld.environment.se.WeldContainer.instance()


    @Test
    public void testContainerIsolation() {

        Weld weld1 = new Weld("1");
        WeldContainer weldContainer1 = weld1.initialize();
        Foo foo1 = weldContainer1.instance().select(Foo.class).get();

        Weld weld2 = new Weld("2");
        WeldContainer weldContainer2 = weld2.initialize();
        Foo foo2 = weldContainer2.instance().select(Foo.class).get();
View Full Code Here


        WeldContainer weldContainer1 = weld1.initialize();
        Foo foo1 = weldContainer1.instance().select(Foo.class).get();

        Weld weld2 = new Weld("2");
        WeldContainer weldContainer2 = weld2.initialize();
        Foo foo2 = weldContainer2.instance().select(Foo.class).get();

        foo1.setValue(1);
        foo2.setValue(2);

        Assert.assertEquals(1, foo1.getValue());
View Full Code Here

    @Test
    public void testSelect() throws Exception {
        Weld weld = new Weld();
        try {
            WeldContainer wc = weld.initialize();
            Assert.assertNotNull(wc.instance().select(KPT.class).select(new KPQLiteral()).get());
            Assert.assertNotNull(wc.instance().select(KPT.class, new KPQLiteral()).get());
        } finally {
            weld.shutdown();
        }
    }
View Full Code Here

    public void testSelect() throws Exception {
        Weld weld = new Weld();
        try {
            WeldContainer wc = weld.initialize();
            Assert.assertNotNull(wc.instance().select(KPT.class).select(new KPQLiteral()).get());
            Assert.assertNotNull(wc.instance().select(KPT.class, new KPQLiteral()).get());
        } finally {
            weld.shutdown();
        }
    }
}
View Full Code Here

    Weld weld = new Weld();
    try {

      Plant.postConstructCalled = false;
      WeldContainer weldContainer = weld.initialize();
      weldContainer.instance().select(Tree.class).get();
      assertTrue(Plant.postConstructCalled);

    } finally {
      weld.shutdown();
    }
View Full Code Here

     */
    @Test
    public void testMainEmptyArgs() {
        WeldContainer container = startMain.go();

        MainTestBean mainTestBean = container.instance().select(MainTestBean.class).get();
        assertNotNull(mainTestBean);

        ParametersTestBean paramsBean = mainTestBean.getParametersTestBean();
        assertNotNull(paramsBean);
        assertNotNull(paramsBean.getParameters());
View Full Code Here

     */
    @Test
    public void testMain() {
        WeldContainer container = startMain.go();

        MainTestBean mainTestBean = container.instance().select(MainTestBean.class).get();
        assertNotNull(mainTestBean);

        ParametersTestBean paramsBean = mainTestBean.getParametersTestBean();
        assertNotNull(paramsBean);
        assertNotNull(paramsBean.getParameters());
View Full Code Here

    public void testInitialize() {

        Weld weld = new Weld();
        WeldContainer container = weld.initialize();

        MainTestBean mainTestBean = container.instance().select(MainTestBean.class).get();
        assertNotNull(mainTestBean);

        ParametersTestBean paramsBean = mainTestBean.getParametersTestBean();
        assertNotNull(paramsBean);
        assertNotNull(paramsBean.getParameters());
View Full Code Here

    public void testCDI() {
        // DROOLS-34
        Weld w = new Weld();
        WeldContainer wc = w.initialize();

        CDIBean bean = wc.instance().select(CDIBean.class).get();
        bean.test(env);

        w.shutdown();
    }
View Full Code Here

    public static void main(String[] args) {
        Weld w = new Weld();

        WeldContainer wc = w.initialize();
        CDIInstanceExample bean = wc.instance().select(CDIInstanceExample.class).get();
        bean.go(System.out);

        w.shutdown();
    }
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.