void execute() { event.getAnnotatedTypes(ContainerLifeCycleEventRuntimeInvocationTest.class); } }.run();
/** * Store the result, don't verify anything since it's more transparent to have assertions in the test class methods. * * The methods {@link BeanManager#getAnnotatedType(Class, String)} and {@link BeanManager#getAnnotatedTypes(Class)} will be * probably placed on the {@link AfterBeanDiscovery}. See also CDI-83. * * @param event * @param beanManager */ public void observeAfterBeanDiscovery(@Observes AfterBeanDiscovery event, BeanManager beanManager) { for (AnnotatedType<Human> annotatedType : event.getAnnotatedTypes(Human.class)) { allHumans.add(annotatedType); } for (AnnotatedType<Android> annotatedType : event.getAnnotatedTypes(Android.class)) { allAndroids.add(annotatedType); } android = event.getAnnotatedType(Android.class, null); }
/** * Store the result, don't verify anything since it's more transparent to have assertions in the test class methods. * * The methods {@link BeanManager#getAnnotatedType(Class, String)} and {@link BeanManager#getAnnotatedTypes(Class)} will be * probably placed on the {@link AfterBeanDiscovery}. See also CDI-83. * * @param event * @param beanManager */ public void observeAfterBeanDiscovery(@Observes AfterBeanDiscovery event, BeanManager beanManager) { for (AnnotatedType<Foo> annotatedType : event.getAnnotatedTypes(Foo.class)) { allFoo.add(annotatedType); } bravo = event.getAnnotatedType(Foo.class, buildId(BASE_ID_BRAVO, Foo.class)); charlie = event.getAnnotatedType(Foo.class, buildId(BASE_ID_CHARLIE, Foo.class)); aplha = event.getAnnotatedType(Foo.class, null); bar = event.getAnnotatedType(Bar.class, null); }