Examples of NewLiteral


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

    @SuppressWarnings("unchecked")
    @Test
    @SpecAssertions({ @SpecAssertion(section = "11.5.10", id = "aa"), @SpecAssertion(section = "11.5.10", id = "ad") })
    public void testManagedBeanAttributes() {

        assertEquals(getCurrentManager().getBeans(Alpha.class, new NewLiteral(Alpha.class)).size(), 1);
        // No event is fired for any @New qualified bean
        assertEquals(extension.getAlphaAttributesObserved(), 1);

        BeanAttributes<Alpha> attributes = extension.getAlphaAttributes();
        assertNotNull(attributes);
View Full Code Here

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

    public Instance<Map<String, String>> getMap() {
        return map;
    }

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

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

    }

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

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

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

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

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

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

    @Test
    @SpecAssertion(section = NEW, id = "x")
    public void testNewBeanHasNoDisposalMethods() throws Exception {
        FoxLocal fox = getContextualReference(FoxLocal.class);
        FoxLocal newFox = getContextualReference(FoxLocal.class, new NewLiteral(Fox.class));
        @SuppressWarnings("serial")
        Set<Bean<Litter>> beans = getBeans(Litter.class, new AnnotationLiteral<Tame>() {
        });
        assert beans.size() == 1;
        Bean<Litter> litterBean = beans.iterator().next();
View Full Code Here

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

    }

    @Test
    @SpecAssertion(section = NEW, 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

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

    }

    @Test
    @SpecAssertion(section = NEW, id = "r")
    public void testNewBeanHasOnlyOneQualifier() {
        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

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

    }

    @Test
    @SpecAssertion(section = NEW, 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

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

    @Test
    @SpecAssertion(section = NEW, 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
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.