Search in sources :

Example 1 with EnhancedAnnotatedMethod

use of org.jboss.weld.annotated.enhanced.EnhancedAnnotatedMethod in project core by weld.

the class SimpleWeldClassTest method testWeldClassForCovariantReturnType.

/*
    * description = "WELD-568"
    */
@Category(Broken.class)
@Test
public void testWeldClassForCovariantReturnType() {
    TypeStore typeStore = new TypeStore();
    EnhancedAnnotatedType<Attacker> weldClass = new ClassTransformer(typeStore, new SharedObjectCache(), ReflectionCacheFactory.newInstance(typeStore), RegistrySingletonProvider.STATIC_INSTANCE).getEnhancedAnnotatedType(Attacker.class, AnnotatedTypeIdentifier.NULL_BDA_ID);
    Collection<EnhancedAnnotatedMethod<?, ? super Attacker>> methods = weldClass.getEnhancedMethods();
    Assert.assertEquals(4, methods.size());
    List<EnhancedAnnotatedMethod<?, ?>> interceptableMethods = Beans.getInterceptableMethods(weldClass);
    Assert.assertEquals(4, interceptableMethods.size());
}
Also used : SharedObjectCache(org.jboss.weld.resources.SharedObjectCache) TypeStore(org.jboss.weld.metadata.TypeStore) ClassTransformer(org.jboss.weld.resources.ClassTransformer) EnhancedAnnotatedMethod(org.jboss.weld.annotated.enhanced.EnhancedAnnotatedMethod) Category(org.junit.experimental.categories.Category) Test(org.junit.Test)

Example 2 with EnhancedAnnotatedMethod

use of org.jboss.weld.annotated.enhanced.EnhancedAnnotatedMethod in project core by weld.

the class SimpleWeldClassTest method testWeldClassForGenericSuperclass.

/*
    * description = "WELD-568"
    */
@Test
public void testWeldClassForGenericSuperclass() {
    TypeStore ts = new TypeStore();
    EnhancedAnnotatedType<StringProcessor> weldClass = new ClassTransformer(ts, new SharedObjectCache(), ReflectionCacheFactory.newInstance(ts), RegistrySingletonProvider.STATIC_INSTANCE).getEnhancedAnnotatedType(StringProcessor.class, AnnotatedTypeIdentifier.NULL_BDA_ID);
    Collection<EnhancedAnnotatedMethod<?, ? super StringProcessor>> methods = weldClass.getEnhancedMethods();
    // assert methods.size() == 2;
    List<EnhancedAnnotatedMethod<?, ?>> interceptableMethods = Beans.getInterceptableMethods(weldClass);
    Assert.assertEquals(3, interceptableMethods.size());
}
Also used : SharedObjectCache(org.jboss.weld.resources.SharedObjectCache) TypeStore(org.jboss.weld.metadata.TypeStore) ClassTransformer(org.jboss.weld.resources.ClassTransformer) EnhancedAnnotatedMethod(org.jboss.weld.annotated.enhanced.EnhancedAnnotatedMethod) Test(org.junit.Test)

Aggregations

EnhancedAnnotatedMethod (org.jboss.weld.annotated.enhanced.EnhancedAnnotatedMethod)2 TypeStore (org.jboss.weld.metadata.TypeStore)2 ClassTransformer (org.jboss.weld.resources.ClassTransformer)2 SharedObjectCache (org.jboss.weld.resources.SharedObjectCache)2 Test (org.junit.Test)2 Category (org.junit.experimental.categories.Category)1