Package org.apache.webbeans.context.creational

Examples of org.apache.webbeans.context.creational.CreationalContextImpl


        List<AbstractComponent<?>> comps = getComponents();

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

        NewComponent comp = (NewComponent) getContext(RequestScoped.class).get(comps.get(2), new CreationalContextImpl());

        DependentOwnerComponent own = comp.owner();

        Assert.assertNotNull(own);
View Full Code Here


        ContextFactory.initRequestContext(null);
        ContextFactory.initSessionContext(session);

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

        UserComponent userComponent = (UserComponent) ManagerImpl.getManager().getContext(SessionScoped.class).get(comps.get(0), new CreationalContextImpl());
        userComponent.setName("Gurkan");
        userComponent.setSurname("Erdogdu");

        Assert.assertNotNull(userComponent);

        Object object = ManagerImpl.getManager().getContext(SessionScoped.class).get(comps.get(1), new CreationalContextImpl());
        Assert.assertNotNull(object);
        Assert.assertTrue(object instanceof ContainUserComponent);

        ContainUserComponent uc = (ContainUserComponent) object;
View Full Code Here

        ContextFactory.initSessionContext(session);

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

        getContext(SessionScoped.class).get(comps.get(0), new CreationalContextImpl());

        Object object = getContext(SessionScoped.class).get(comps.get(1), new CreationalContextImpl());

        Assert.assertTrue(object instanceof TypedInjection);

        TypedInjection i = (TypedInjection) object;
View Full Code Here

        ContextFactory.initSessionContext(session);

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

        getContext(SessionScoped.class).get(comps.get(0), new CreationalContextImpl());
        Object object = getContext(SessionScoped.class).get(comps.get(1), new CreationalContextImpl());

        Assert.assertTrue(object instanceof TypedInjectionWithoutArguments);

        TypedInjectionWithoutArguments i = (TypedInjectionWithoutArguments) object;
View Full Code Here

        ContextFactory.initRequestContext(null);
        ContextFactory.initApplicationContext(null);

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

        Object producerResult = getContext(ApplicationScoped.class).get(getManager().resolveByName("service").iterator().next(), new CreationalContextImpl());
       
        IService producverService = (IService)producerResult;
       
        Object disposalComp = getContext(RequestScoped.class).get(comps.get(1));
        Object object = getContext(ApplicationScoped.class).get(comps.get(0), new CreationalContextImpl());

        Assert.assertTrue(object instanceof ServiceImpl1);
        Assert.assertTrue(disposalComp instanceof DisposalMethodComponent);

        DisposalMethodComponent mc = (DisposalMethodComponent) disposalComp;
View Full Code Here

        List<AbstractComponent<?>> comps = getComponents();

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

        DependentOwnerComponent comp = (DependentOwnerComponent) getContext(RequestScoped.class).get(comps.get(1), new CreationalContextImpl());

        DependentComponent dc = comp.getDependent();

        Assert.assertNotNull(dc);
View Full Code Here

        ContextFactory.initRequestContext(null);
        ContextFactory.initApplicationContext(null);

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

        Object object = ManagerImpl.getManager().getContext(ApplicationScoped.class).get(comps.get(0), new CreationalContextImpl());

        Assert.assertTrue(object instanceof InjectedComponent);

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

        ContextFactory.initRequestContext(null);
        ContextFactory.initApplicationContext(null);

        Assert.assertEquals(4, getDeployedComponents());

        Object obj = getContext(ApplicationScoped.class).get(comps.get(0), new CreationalContextImpl());

        getInstanceByName("service");

        getContext(ApplicationScoped.class).get(comps.get(1), new CreationalContextImpl());

        Object object = getContext(ApplicationScoped.class).get(comps.get(2), new CreationalContextImpl());

        Assert.assertTrue(object instanceof Producer1ConsumerComponent);

        Producer1ConsumerComponent single = (Producer1ConsumerComponent) object;
View Full Code Here

        ContextFactory.initRequestContext(null);

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

        TypeLiteralComponent userComponent = (TypeLiteralComponent) ManagerImpl.getManager().getContext(RequestScoped.class).get(comps.get(0), new CreationalContextImpl());
        InjectedTypeLiteralComponent tc = (InjectedTypeLiteralComponent) ManagerImpl.getManager().getContext(RequestScoped.class).get(comps.get(1), new CreationalContextImpl());

        Assert.assertNotNull(tc.getComponent());
        Assert.assertNotNull(userComponent);

        Assert.assertTrue(tc.getComponent() instanceof TypeLiteralComponent);
View Full Code Here

TOP

Related Classes of org.apache.webbeans.context.creational.CreationalContextImpl

Copyright © 2018 www.massapicom. 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.