Examples of PreDestroyComponent


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

        ContextFactory.initRequestContext(null);

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

        Object object = 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;

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

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

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

    }
View Full Code Here

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

        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.PreDestroyComponent

        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.PreDestroyComponent

        ContextFactory.initRequestContext(null);

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

        Object object = 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;

        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, pcc.getP());

    }
View Full Code Here

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

        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.PreDestroyComponent

        Object object2 = getContext(RequestScoped.class).get(comps.get(1), new CreationalContextImpl());

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

        PreDestroyComponent pcc = (PreDestroyComponent) object2;

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

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

        Assert.assertNotNull(pcc.getP());
        Assert.assertEquals(object, pcc.getP());

        ContextFactory.destroyRequestContext(null);

        Assert.assertNotNull(pcc.getP2());
        Assert.assertEquals(pcc.getP(), pcc.getP2());

    }
View Full Code Here

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

        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.PreDestroyComponent

        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.