Examples of CheckWithCheckPayment


Examples of org.apache.webbeans.test.component.CheckWithCheckPayment

        ContextFactory.initRequestContext(null);

        Assert.assertEquals(2, comps.size());

        CheckWithCheckPayment object =(CheckWithCheckPayment) getManager().getInstance(comps.get(0));
        Object object2 = getManager().getInstance(comps.get(1));

        Assert.assertTrue(object instanceof CheckWithCheckPayment);
        Assert.assertTrue(object2 instanceof PostConstructComponent);

        PostConstructComponent pcc = (PostConstructComponent) object2;

        CheckWithCheckPayment chk = (CheckWithCheckPayment) pcc.getP();

        ManagedBean<PostConstructComponent> s = (ManagedBean<PostConstructComponent>) comps.get(1);
        List<InterceptorData> stack = s.getInterceptorStack();

        Assert.assertEquals(1, stack.size());

        Assert.assertNotNull(pcc.getP());
        Assert.assertSame(object.getValue(), chk.getValue());

        ContextFactory.destroyRequestContext(null);
    }
View Full Code Here

Examples of org.apache.webbeans.test.component.CheckWithCheckPayment

        ContextFactory.initRequestContext(null);

        Assert.assertEquals(2, comps.size());

        CheckWithCheckPayment object = (CheckWithCheckPayment)getManager().getInstance(comps.get(0));
        PreDestroyComponent object2 = (PreDestroyComponent)getManager().getInstance(comps.get(1));
       
        object2.getP();

        Assert.assertTrue(object instanceof CheckWithCheckPayment);
        Assert.assertTrue(object2 instanceof PreDestroyComponent);

        PreDestroyComponent pcc = (PreDestroyComponent) object2;
        CheckWithCheckPayment payment = (CheckWithCheckPayment) pcc.getP();
        payment.setValue(true);

        ManagedBean<PreDestroyComponent> s = (ManagedBean<PreDestroyComponent>) comps.get(1);
        List<InterceptorData> stack = s.getInterceptorStack();

        Assert.assertEquals(2, stack.size());

        Assert.assertNotNull(pcc.getP());
        Assert.assertSame(object.getValue(), payment.getValue());

        Assert.assertFalse(PreDestroyComponent.isDestroyed());

        ContextFactory.destroyRequestContext(null);
View Full Code Here

Examples of org.apache.webbeans.test.component.CheckWithCheckPayment

        ContextFactory.initRequestContext(null);

        Assert.assertEquals(2, comps.size());

        CheckWithCheckPayment object =(CheckWithCheckPayment) getManager().getInstance(comps.get(0));
        Object object2 = getManager().getInstance(comps.get(1));

        Assert.assertTrue(object instanceof CheckWithCheckPayment);
        Assert.assertTrue(object2 instanceof PostConstructComponent);

        PostConstructComponent pcc = (PostConstructComponent) object2;

        CheckWithCheckPayment chk = (CheckWithCheckPayment) pcc.getP();

        ManagedBean<PostConstructComponent> s = (ManagedBean<PostConstructComponent>) comps.get(1);
        List<InterceptorData> stack = s.getInterceptorStack();

        Assert.assertEquals(1, stack.size());

        Assert.assertNotNull(pcc.getP());
        Assert.assertSame(object.getValue(), chk.getValue());

        ContextFactory.destroyRequestContext(null);
    }
View Full Code Here

Examples of org.apache.webbeans.test.component.CheckWithCheckPayment

        ContextFactory.initRequestContext(null);

        Assert.assertEquals(2, comps.size());

        CheckWithCheckPayment object = (CheckWithCheckPayment)getManager().getInstance(comps.get(0));
        PreDestroyComponent object2 = (PreDestroyComponent)getManager().getInstance(comps.get(1));
       
        object2.getP();

        Assert.assertTrue(object instanceof CheckWithCheckPayment);
        Assert.assertTrue(object2 instanceof PreDestroyComponent);

        PreDestroyComponent pcc = (PreDestroyComponent) object2;
        CheckWithCheckPayment payment = (CheckWithCheckPayment) pcc.getP();
        payment.setValue(true);

        ManagedBean<PreDestroyComponent> s = (ManagedBean<PreDestroyComponent>) comps.get(1);
        List<InterceptorData> stack = s.getInterceptorStack();

        Assert.assertEquals(2, stack.size());

        Assert.assertNotNull(pcc.getP());
        Assert.assertSame(object.getValue(), payment.getValue());

    }
View Full Code Here

Examples of org.apache.webbeans.test.component.CheckWithCheckPayment

        ContextFactory.initRequestContext(null);

        Assert.assertEquals(2, comps.size());

        CheckWithCheckPayment object = (CheckWithCheckPayment)getManager().getInstance(comps.get(0));
        PreDestroyComponent object2 = (PreDestroyComponent)getManager().getInstance(comps.get(1));
       
        object2.getP();

        Assert.assertTrue(object instanceof CheckWithCheckPayment);
        Assert.assertTrue(object2 instanceof PreDestroyComponent);

        PreDestroyComponent pcc = (PreDestroyComponent) object2;
        CheckWithCheckPayment payment = (CheckWithCheckPayment) pcc.getP();
        payment.setValue(true);

        ManagedBean<PreDestroyComponent> s = (ManagedBean<PreDestroyComponent>) comps.get(1);
        List<InterceptorData> stack = s.getInterceptorStack();

        Assert.assertEquals(2, stack.size());

        Assert.assertNotNull(pcc.getP());
        Assert.assertSame(object.getValue(), payment.getValue());

    }
View Full Code Here

Examples of org.apache.webbeans.test.component.CheckWithCheckPayment

    @Test
    public void testTypedComponent() throws Throwable
    {
        startContainer(CheckWithCheckPayment.class, PostConstructComponent.class);

        CheckWithCheckPayment object = getInstance("checkWithCheckPayment");
        PostConstructComponent pcc = getInstance(PostConstructComponent.class);

        CheckWithCheckPayment chk = (CheckWithCheckPayment) pcc.getP();

        Assert.assertNotNull(pcc.getP());
        Assert.assertSame(object.getValue(), chk.getValue());
    }
View Full Code Here

Examples of org.apache.webbeans.test.component.CheckWithCheckPayment

        beanClasses.add(CheckWithCheckPayment.class);
        beanClasses.add(PreDestroyComponent.class);

        startContainer(beanClasses, null);

        CheckWithCheckPayment object = getInstance(CheckWithCheckPayment.class, new AnyLiteral());
        PreDestroyComponent object2 = getInstance(PreDestroyComponent.class);
       
        object2.getP();

        Assert.assertTrue(object instanceof CheckWithCheckPayment);
        Assert.assertTrue(object2 instanceof PreDestroyComponent);

        PreDestroyComponent pcc = object2;
        CheckWithCheckPayment payment = (CheckWithCheckPayment) pcc.getP();
        payment.setValue(true);


        Assert.assertNotNull(pcc.getP());
        Assert.assertSame(object.getValue(), payment.getValue());

        Assert.assertFalse(PreDestroyComponent.isDestroyed());

        getLifecycle().getContextService().endContext(RequestScoped.class, null);
View Full Code Here

Examples of org.apache.webbeans.test.component.CheckWithCheckPayment

        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
        contextFactory.initRequestContext(null);

        Assert.assertEquals(2, comps.size());

        CheckWithCheckPayment object =(CheckWithCheckPayment) getManager().getInstance(comps.get(0));
        Object object2 = getManager().getInstance(comps.get(1));

        Assert.assertTrue(object instanceof CheckWithCheckPayment);
        Assert.assertTrue(object2 instanceof PostConstructComponent);

        PostConstructComponent pcc = (PostConstructComponent) object2;

        CheckWithCheckPayment chk = (CheckWithCheckPayment) pcc.getP();

        ManagedBean<PostConstructComponent> s = (ManagedBean<PostConstructComponent>) comps.get(1);
        List<InterceptorData> stack = s.getInterceptorStack();

        Assert.assertEquals(1, stack.size());

        Assert.assertNotNull(pcc.getP());
        Assert.assertSame(object.getValue(), chk.getValue());

        contextFactory.destroyRequestContext(null);
    }
View Full Code Here

Examples of org.apache.webbeans.test.component.CheckWithCheckPayment

        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
        contextFactory.initRequestContext(null);

        Assert.assertEquals(2, comps.size());

        CheckWithCheckPayment object = (CheckWithCheckPayment)getManager().getInstance(comps.get(0));
        PreDestroyComponent object2 = (PreDestroyComponent)getManager().getInstance(comps.get(1));
       
        object2.getP();

        Assert.assertTrue(object instanceof CheckWithCheckPayment);
        Assert.assertTrue(object2 instanceof PreDestroyComponent);

        PreDestroyComponent pcc = object2;
        CheckWithCheckPayment payment = (CheckWithCheckPayment) pcc.getP();
        payment.setValue(true);

        ManagedBean<PreDestroyComponent> s = (ManagedBean<PreDestroyComponent>) comps.get(1);
        List<InterceptorData> stack = s.getInterceptorStack();

        Assert.assertEquals(2, stack.size());

        Assert.assertNotNull(pcc.getP());
        Assert.assertSame(object.getValue(), payment.getValue());

        Assert.assertFalse(PreDestroyComponent.isDestroyed());

        contextFactory.destroyRequestContext(null);
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.