Package org.jboss.cdi.tck.literals

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


        Bean<?> simpleExtensionBean = beans.iterator().next();
        // Bean scope is @ApplicationScoped
        assertEquals(simpleExtensionBean.getScope(), ApplicationScoped.class);
        // Bean has two qualifiers @Default and @Any
        assertEquals(simpleExtensionBean.getQualifiers().size(), 2);
        assertTrue(simpleExtensionBean.getQualifiers().contains(new DefaultLiteral()));
        assertTrue(simpleExtensionBean.getQualifiers().contains(AnyLiteral.INSTANCE));
        // Bean types include the class of the service provider and all superclases and interfaces
        Set<Type> types = simpleExtensionBean.getTypes();
        assertEquals(types.size(), 4);
        assertTrue(types.contains(SuperExtension.class));
View Full Code Here


    @Test(groups = PRODUCER_FIELD)
    @SpecAssertions({ @SpecAssertion(section = "2.3.1", id = "aa") })
    public void testDefaultBindingType() {
        Set<Bean<Tarantula>> tarantulaBeans = getBeans(Tarantula.class);
        assert tarantulaBeans.size() == 2;
        assert tarantulaBeans.iterator().next().getQualifiers().contains(new DefaultLiteral());
    }
View Full Code Here

    @Test
    @SpecAssertion(section = "11.3", id = "ac")
    public void testManagerBeanHasCurrentBinding() {
        Bean<BeanManager> beanManager = getBeans(BeanManager.class).iterator().next();
        assert beanManager.getQualifiers().contains(new DefaultLiteral());
    }
View Full Code Here

    @Test
    @SpecAssertions({ @SpecAssertion(section = "11.3.5", id = "c") })
    public void testNoBindingImpliesCurrent() {
        Set<Bean<?>> beans = getCurrentManager().getBeans(SimpleBean.class);
        assert beans.size() == 1;
        assert beans.iterator().next().getQualifiers().contains(new DefaultLiteral());
    }
View Full Code Here

    private final Bean<SimpleBean> bean;
    private final Set<Annotation> bindings = new HashSet<Annotation>();

    public UnsatisfiedInjectionPoint(Bean<SimpleBean> beanWithInjectionPoint) {
        this.bean = beanWithInjectionPoint;
        bindings.add(new DefaultLiteral());
        bindings.add(AnyLiteral.INSTANCE);
    }
View Full Code Here

        assert Method.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getMember().getClass());

        // Since the type and bindings must correspond to the parameter, check
        // them
        assert beanWithInjectionPoint.getInjectedMetadata().getType().equals(BeanWithInjectionPointMetadata.class);
        assert beanWithInjectionPoint.getInjectedMetadata().getQualifiers().contains(new DefaultLiteral());
    }
View Full Code Here

        assert Constructor.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getMember().getClass());

        // Since the type and bindings must correspond to the parameter, check
        // them
        assert beanWithInjectionPoint.getInjectedMetadata().getType().equals(BeanWithInjectionPointMetadata.class);
        assert beanWithInjectionPoint.getInjectedMetadata().getQualifiers().contains(new DefaultLiteral());
    }
View Full Code Here

    public void testCurrentBinding() {
        // Get an instance of the bean which has another bean injected into it
        FieldInjectionPointBean beanWithInjectedBean = getContextualReference(FieldInjectionPointBean.class);
        BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
        assert beanWithInjectionPoint.getInjectedMetadata() != null;
        assert beanWithInjectionPoint.getInjectedMetadata().getQualifiers().contains(new DefaultLiteral());
    }
View Full Code Here

    private final Bean<SimpleBean> bean;
    private final Set<Annotation> bindings = new HashSet<Annotation>();

    public AmbiguousInjectionPoint(Bean<SimpleBean> bean) {
        this.bean = bean;
        bindings.add(new DefaultLiteral());
        bindings.add(AnyLiteral.INSTANCE);
    }
View Full Code Here

    @Test
    @SpecAssertion(section = BEANMANAGER, id = "ac")
    public void testManagerBeanHasCurrentBinding() {
        Bean<BeanManager> beanManager = getBeans(BeanManager.class).iterator().next();
        assert beanManager.getQualifiers().contains(new DefaultLiteral());
    }
View Full Code Here

TOP

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

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.