Package javax.enterprise.inject.spi

Examples of javax.enterprise.inject.spi.Annotated


    }

    @Test
    @SpecAssertions({ @SpecAssertion(section = PBA, id = "bad") })
    public void testProducerFieldAnnotated() {
        Annotated charlieAnnotated = extension.getAnnotatedMap().get(Charlie.class);
        assertNotNull(charlieAnnotated);
        assertTrue(charlieAnnotated instanceof AnnotatedField);
        @SuppressWarnings("unchecked")
        AnnotatedField<Charlie> charlieAnnotatedField = (AnnotatedField<Charlie>) charlieAnnotated;
        assertEquals(charlieAnnotatedField.getJavaMember().getName(), "charlie");
View Full Code Here


    @SuppressWarnings("rawtypes")
    @Test
    @SpecAssertions({ @SpecAssertion(section = INJECTION_POINT, id = "daa"), @SpecAssertion(section = EVENT_METADATA, id = "b") })
    public void testGetAnnotatedType() {

        Annotated lastAnnotated = null;

        notifier.fireInfoEvent();
        lastAnnotated = infoObserver.getLastAnnotated();
        assertTrue(lastAnnotated instanceof AnnotatedField);
        assertEquals(((AnnotatedField) lastAnnotated).getJavaMember().getName(), "infoEvent");
        assertTrue(lastAnnotated.isAnnotationPresent(Inject.class));

        notifier.fireInitializerInfoEvent();
        lastAnnotated = infoObserver.getLastAnnotated();
        assertTrue(lastAnnotated instanceof AnnotatedParameter);
        assertEquals(((AnnotatedParameter) lastAnnotated).getPosition(), 0);

        notifier.fireConstructorInfoEvent();
        lastAnnotated = infoObserver.getLastAnnotated();
        assertTrue(lastAnnotated instanceof AnnotatedParameter);
        assertEquals(((AnnotatedParameter) lastAnnotated).getPosition(), 0);
        assertTrue(lastAnnotated.isAnnotationPresent(Nice.class));
    }
View Full Code Here

    @SuppressWarnings("rawtypes")
    @Test
    @SpecAssertion(section=INJECTION_POINT, id="dab")
    public void testInjectionPointGetAnnotated() {

        Annotated fooFieldAnnotated = bar.getFoo().getInjectionPoint().getAnnotated();
        assertTrue(fooFieldAnnotated instanceof AnnotatedField);
        assertEquals(((AnnotatedField) fooFieldAnnotated).getJavaMember().getName(), "fooInstance");
        assertTrue(fooFieldAnnotated.isAnnotationPresent(Any.class));

        Annotated fooInitializerAnnnotated = bar.getInitializerFoo().getInjectionPoint().getAnnotated();
        assertTrue(fooInitializerAnnnotated instanceof AnnotatedParameter);
        assertEquals(((AnnotatedParameter) fooInitializerAnnnotated).getPosition(), 0);

        Annotated fooConstructorAnnnotated = bar.getConstructorInjectionFoo().getInjectionPoint().getAnnotated();
        assertTrue(fooConstructorAnnnotated instanceof AnnotatedParameter);
        assertEquals(((AnnotatedParameter) fooConstructorAnnnotated).getPosition(), 0);
    }
View Full Code Here

    }

    @Test
    @SpecAssertions({ @SpecAssertion(section = PBA, id = "baa") })
    public void testManagedBeanAnnotated() {
        Annotated alphaAnnotated = extension.getAnnotatedMap().get(Alpha.class);
        assertNotNull(alphaAnnotated);
        assertTrue(alphaAnnotated instanceof AnnotatedType);
        @SuppressWarnings("unchecked")
        AnnotatedType<Alpha> alphaAnnotatedType = (AnnotatedType<Alpha>) alphaAnnotated;
        assertEquals(alphaAnnotatedType.getJavaClass(), Alpha.class);
View Full Code Here

    }

    @Test
    @SpecAssertions({ @SpecAssertion(section = PBA, id = "bab") })
    public void testSessionBeanAnnotated() {
        Annotated deltaAnnotated = extension.getAnnotatedMap().get(Delta.class);
        assertNotNull(deltaAnnotated);
        assertTrue(deltaAnnotated instanceof AnnotatedType);
        @SuppressWarnings("unchecked")
        AnnotatedType<Delta> deltaAnnotatedType = (AnnotatedType<Delta>) deltaAnnotated;
        assertEquals(deltaAnnotatedType.getJavaClass(), Delta.class);
View Full Code Here

    }

    @Test
    @SpecAssertions({ @SpecAssertion(section = PBA, id = "bac") })
    public void testProducerMethodAnnotated() {
        Annotated bravoAnnotated = extension.getAnnotatedMap().get(Bravo.class);
        assertNotNull(bravoAnnotated);
        assertTrue(bravoAnnotated instanceof AnnotatedMethod);
        @SuppressWarnings("unchecked")
        AnnotatedMethod<Bravo> bravoAnnotatedMethod = (AnnotatedMethod<Bravo>) bravoAnnotated;
        assertEquals(bravoAnnotatedMethod.getJavaMember().getName(), "createBravo");
View Full Code Here

    }

    @Test
    @SpecAssertions({ @SpecAssertion(section = PBA, id = "bad") })
    public void testProducerFieldAnnotated() {
        Annotated charlieAnnotated = extension.getAnnotatedMap().get(Charlie.class);
        assertNotNull(charlieAnnotated);
        assertTrue(charlieAnnotated instanceof AnnotatedField);
        @SuppressWarnings("unchecked")
        AnnotatedField<Charlie> charlieAnnotatedField = (AnnotatedField<Charlie>) charlieAnnotated;
        assertEquals(charlieAnnotatedField.getJavaMember().getName(), "charlie");
View Full Code Here

      return false;
    }

    @Override
    public Annotated getAnnotated() {
      return new Annotated() {

        @Override
        public Type getBaseType() {
          // TODO Auto-generated method stub
          return null;
View Full Code Here

    this.environment = environment;
  }
 
  @Produces @Property
  public String get(InjectionPoint ip) {
    Annotated annotated = ip.getAnnotated();
    Property property = annotated.getAnnotation(Property.class);
    String key = property.value();
    if (isNullOrEmpty(key)) {
      key = ip.getMember().getName();
    }
   
View Full Code Here

        {
            if(!injectionPoint.isTransient())
            {
                if(!webBeansContext.getWebBeansUtil().isPassivationCapableDependency(injectionPoint))
                {
                    Annotated annotated = injectionPoint.getAnnotated();
                    if(annotated.isAnnotationPresent(Disposes.class) || annotated.isAnnotationPresent(TransientReference.class))
                    {
                        continue;
                    }
                    throw new WebBeansConfigurationException(
                            "Passivation capable beans must satisfy passivation capable dependencies. " +
View Full Code Here

TOP

Related Classes of javax.enterprise.inject.spi.Annotated

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.