Package org.jboss.cdi.tck.literals

Examples of org.jboss.cdi.tck.literals.NewLiteral


    private <T> void checkNewQualifiedBean(Bean<T> bean, Type... requiredTypes) {
        assertTrue(typeSetMatches(bean.getTypes(), requiredTypes));
        // Has scope @Dependent,
        assertEquals(bean.getScope(), Dependent.class);
        // Has exactly one qualifier...
        assertTrue(annotationSetMatches(bean.getQualifiers(), new NewLiteral(bean.getBeanClass())));
        // Has no bean EL name
        assertNull(bean.getName());
        // Has no stereotypes
        assertTrue(bean.getStereotypes() == null || bean.getStereotypes().isEmpty());
        // Is not an alternative
View Full Code Here


    // {
    // return strings;
    // }

    public Instance<IllegalArgumentException> getIae() {
        return iae.select(new NewLiteral(IllegalArgumentException.class));
    }
View Full Code Here

    }

    @Test(groups = { INTEGRATION, NEW })
    @SpecAssertion(section = "3.14", id = "l")
    public void testNewBeanHasSameConstructor() {
        ExplicitConstructor newBean = getInstanceByType(ExplicitConstructor.class, new NewLiteral(
                ExplicitConstructorSessionBean.class));
        assert newBean.getConstructorCalls() == 1;
        assert newBean.getInjectedSimpleBean() != null;
    }
View Full Code Here

    @Test(groups = { INTEGRATION, NEW })
    @SpecAssertion(section = "3.14", id = "m")
    public void testNewBeanHasSameInitializers() {
        InitializerSimpleBeanLocal bean = getInstanceByType(InitializerSimpleBeanLocal.class);
        InitializerSimpleBeanLocal newBean = getInstanceByType(InitializerSimpleBeanLocal.class, new NewLiteral(
                InitializerSimpleBean.class));
        assert bean != newBean;
        assert bean.getInitializerCalls() == 2;
    }
View Full Code Here

     */
    @Test(groups = { INTEGRATION, NEW })
    @SpecAssertion(section = "3.14", id = "v")
    public void testNewBeanHasNoProducerMethods() throws Exception {
        FoxLocal fox = getInstanceByType(FoxLocal.class);
        FoxLocal newFox = getInstanceByType(FoxLocal.class, new NewLiteral(Fox.class));
        fox.setNextLitterSize(3);
        newFox.setNextLitterSize(5);
        Litter theOnlyLitter = getInstanceByType(Litter.class, new AnnotationLiteral<Tame>() {
        });
        assert theOnlyLitter.getQuantity() == fox.getNextLitterSize();
View Full Code Here

    @Test(groups = { INTEGRATION, NEW, DISPOSAL })
    @SpecAssertion(section = "3.14", id = "x")
    public void testNewBeanHasNoDisposalMethods() throws Exception {
        FoxLocal fox = getInstanceByType(FoxLocal.class);
        FoxLocal newFox = getInstanceByType(FoxLocal.class, new NewLiteral(Fox.class));
        Set<Bean<Litter>> beans = getBeans(Litter.class, new AnnotationLiteral<Tame>() {
        });
        assert beans.size() == 1;
        Bean<Litter> litterBean = beans.iterator().next();
        CreationalContext<Litter> creationalContext = getCurrentManager().createCreationalContext(litterBean);
View Full Code Here

    }

    @Test(groups = { INTEGRATION, NEW })
    @SpecAssertion(section = "3.14", id = "p")
    public void testNewBeanIsDependentScoped() {
        Set<Bean<WrappedEnterpriseBeanLocal>> beans = getBeans(WrappedEnterpriseBeanLocal.class, new NewLiteral(
                WrappedEnterpriseBean.class));
        assert beans.size() == 1;
        Bean<WrappedEnterpriseBeanLocal> newEnterpriseBean = beans.iterator().next();
        assert Dependent.class.equals(newEnterpriseBean.getScope());
    }
View Full Code Here

    }

    @Test(groups = { INTEGRATION, NEW })
    @SpecAssertion(section = "3.14", id = "r")
    public void testNewBeanIsHasOnlyNewBinding() {
        Set<Bean<WrappedEnterpriseBeanLocal>> beans = getBeans(WrappedEnterpriseBeanLocal.class, new NewLiteral(
                WrappedEnterpriseBean.class));
        assert beans.size() == 1;
        Bean<WrappedEnterpriseBeanLocal> newEnterpriseBean = beans.iterator().next();
        assert newEnterpriseBean.getQualifiers().size() == 1;
        assert newEnterpriseBean.getQualifiers().iterator().next().annotationType().equals(New.class);
View Full Code Here

    }

    @Test(groups = { INTEGRATION, NEW })
    @SpecAssertion(section = "3.14", id = "s")
    public void testNewBeanHasNoBeanELName() {
        Set<Bean<WrappedEnterpriseBeanLocal>> beans = getBeans(WrappedEnterpriseBeanLocal.class, new NewLiteral(
                WrappedEnterpriseBean.class));
        assert beans.size() == 1;
        Bean<WrappedEnterpriseBeanLocal> newEnterpriseBean = beans.iterator().next();
        assert newEnterpriseBean.getName() == null;
    }
View Full Code Here

    @Test(groups = { INTEGRATION, NEW })
    @SpecAssertion(section = "3.14", id = "t")
    public void testNewBeanHasNoStereotypes() {
        Bean<MonkeyLocal> monkeyBean = getBeans(MonkeyLocal.class).iterator().next();
        Bean<MonkeyLocal> newMonkeyBean = getBeans(MonkeyLocal.class, new NewLiteral(Monkey.class)).iterator().next();
        assert monkeyBean.getScope().equals(RequestScoped.class);
        assert newMonkeyBean.getScope().equals(Dependent.class);
        assert monkeyBean.getName().equals("monkey");
        assert newMonkeyBean.getName() == null;
    }
View Full Code Here

TOP

Related Classes of org.jboss.cdi.tck.literals.NewLiteral

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.