Examples of AppScopedBean


Examples of org.apache.webbeans.newtests.contexts.session.common.AppScopedBean

        classes.add(CircularDependentScopedBean.class);
        classes.add(CircularApplicationScopedBean.class);

        startContainer(classes);
       
        AppScopedBean appBeanInstance = getInstance(AppScopedBean.class);
        Assert.assertNotNull(appBeanInstance);
        PersonalDataBean pdb1 = appBeanInstance.getPdb().getInstance();
        Assert.assertNotNull(pdb1);
       
        // now we reset the session Context so we should get a new contextual instance.
        getLifecycle().getContextService().endContext(SessionScoped.class, null);
        getLifecycle().getContextService().startContext(SessionScoped.class, null);
       
        PersonalDataBean pdb2 = appBeanInstance.getPdb().getInstance();
        Assert.assertNotNull(pdb2);
       
        // pdb1 and pdb2 are in different sessions, so they must not be the same instance!
        Assert.assertTrue(pdb1 != pdb2);
    }
View Full Code Here

Examples of org.apache.webbeans.newtests.contexts.session.common.AppScopedBean

        classes.add(CircularDependentScopedBean.class);
        classes.add(CircularApplicationScopedBean.class);

        startContainer(classes);
       
        AppScopedBean appBeanInstance = getInstance(AppScopedBean.class);
        Assert.assertNotNull(appBeanInstance);
        PersonalDataBean pdb1 = appBeanInstance.getPdb().getInstance();
        Assert.assertNotNull(pdb1);
       
        // now we reset the session Context so we should get a new contextual instance.
        getWebBeansContext().getContextsService().endContext(SessionScoped.class, null);
        getWebBeansContext().getContextsService().startContext(SessionScoped.class, null);
       
        PersonalDataBean pdb2 = appBeanInstance.getPdb().getInstance();
        Assert.assertNotNull(pdb2);
       
        // pdb1 and pdb2 are in different sessions, so they must not be the same instance!
        Assert.assertTrue(pdb1 != pdb2);
    }
View Full Code Here

Examples of org.apache.webbeans.newtests.contexts.session.common.AppScopedBean

        classes.add(CircularDependentScopedBean.class);
        classes.add(CircularApplicationScopedBean.class);

        startContainer(classes);
       
        AppScopedBean appBeanInstance = getInstance(AppScopedBean.class);
        Assert.assertNotNull(appBeanInstance);
        PersonalDataBean pdb1 = appBeanInstance.getPdb().getInstance();
        Assert.assertNotNull(pdb1);
       
        // now we reset the session Context so we should get a new contextual instance.
        getWebBeansContext().getContextsService().endContext(SessionScoped.class, null);
        getWebBeansContext().getContextsService().startContext(SessionScoped.class, null);
       
        PersonalDataBean pdb2 = appBeanInstance.getPdb().getInstance();
        Assert.assertNotNull(pdb2);
       
        // pdb1 and pdb2 are in different sessions, so they must not be the same instance!
        Assert.assertTrue(pdb1 != pdb2);
    }
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.