Weld SVN: r4441 - in core/trunk/impl/src/main/java/org/jboss/weld: bootstrap/events and 2 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-10-30 08:27:32 -0400 (Fri, 30 Oct 2009)
New Revision: 4441
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AfterBeanDiscoveryImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessObserverMethodImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeObserverResolver.java
Log:
WELD-217, part 1
Modified: core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java 2009-10-30 12:24:20 UTC (rev 4440)
+++ core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java 2009-10-30 12:27:32 UTC (rev 4441)
@@ -65,8 +65,6 @@
import org.jboss.weld.bootstrap.events.AbstractProcessInjectionTarget;
import org.jboss.weld.context.CreationalContextImpl;
import org.jboss.weld.context.WeldCreationalContext;
-import org.jboss.weld.serialization.spi.ContextualStore;
-import org.jboss.weld.serialization.spi.helpers.SerializableContextual;
import org.jboss.weld.ejb.EjbDescriptors;
import org.jboss.weld.ejb.spi.EjbDescriptor;
import org.jboss.weld.el.Namespace;
@@ -88,6 +86,8 @@
import org.jboss.weld.resolution.TypeSafeObserverResolver;
import org.jboss.weld.resolution.TypeSafeResolver;
import org.jboss.weld.resources.ClassTransformer;
+import org.jboss.weld.serialization.spi.ContextualStore;
+import org.jboss.weld.serialization.spi.helpers.SerializableContextual;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.Observers;
import org.jboss.weld.util.Proxies;
@@ -216,7 +216,7 @@
private transient final TypeSafeBeanResolver<Bean<?>> beanResolver;
private transient final TypeSafeResolver<? extends Resolvable, DecoratorImpl<?>> decoratorResolver;
private transient final TypeSafeResolver<? extends Resolvable, InterceptorImpl<?>> interceptorResolver;
- private transient final TypeSafeResolver<? extends Resolvable, ObserverMethod<?,?>> observerResolver;
+ private transient final TypeSafeResolver<? extends Resolvable, ObserverMethod<?>> observerResolver;
private transient final NameBasedResolver nameBasedResolver;
private transient final ELResolver weldELResolver;
private transient Namespace rootNamespace;
@@ -234,7 +234,7 @@
private transient final List<DecoratorImpl<?>> decorators;
private transient final List<InterceptorImpl<?>> interceptors;
private transient final List<String> namespaces;
- private transient final List<ObserverMethod<?,?>> observers;
+ private transient final List<ObserverMethod<?>> observers;
/*
* These data structures represent the managers *accessible* from this bean
@@ -286,7 +286,7 @@
new CopyOnWriteArrayList<Bean<?>>(),
new CopyOnWriteArrayList<DecoratorImpl<?>>(),
new CopyOnWriteArrayList<InterceptorImpl<?>>(),
- new CopyOnWriteArrayList<ObserverMethod<?,?>>(),
+ new CopyOnWriteArrayList<ObserverMethod<?>>(),
new CopyOnWriteArrayList<String>(),
new ConcurrentHashMap<EjbDescriptor<?>, SessionBean<?>>(),
new ClientProxyProvider(),
@@ -314,7 +314,7 @@
new CopyOnWriteArrayList<Bean<?>>(),
new CopyOnWriteArrayList<DecoratorImpl<?>>(),
new CopyOnWriteArrayList<InterceptorImpl<?>>(),
- new CopyOnWriteArrayList<ObserverMethod<?,?>>(),
+ new CopyOnWriteArrayList<ObserverMethod<?>>(),
new CopyOnWriteArrayList<String>(),
rootManager.getEnterpriseBeans(),
rootManager.getClientProxyProvider(),
@@ -340,7 +340,7 @@
List<Bean<?>> beans = new CopyOnWriteArrayList<Bean<?>>();
beans.addAll(parentManager.getBeans());
- List<ObserverMethod<?,?>> registeredObservers = new CopyOnWriteArrayList<ObserverMethod<?,?>>();
+ List<ObserverMethod<?>> registeredObservers = new CopyOnWriteArrayList<ObserverMethod<?>>();
registeredObservers.addAll(parentManager.getObservers());
List<String> namespaces = new CopyOnWriteArrayList<String>();
namespaces.addAll(parentManager.getNamespaces());
@@ -376,7 +376,7 @@
List<Bean<?>> beans,
List<DecoratorImpl<?>> decorators,
List<InterceptorImpl<?>> interceptors,
- List<ObserverMethod<?,?>> observers,
+ List<ObserverMethod<?>> observers,
List<String> namespaces,
Map<EjbDescriptor<?>, SessionBean<?>> enterpriseBeans,
ClientProxyProvider clientProxyProvider,
@@ -511,10 +511,10 @@
};
- public static Transform<ObserverMethod<?,?>> EVENT_OBSERVER = new Transform<ObserverMethod<?,?>>()
+ public static Transform<ObserverMethod<?>> EVENT_OBSERVER = new Transform<ObserverMethod<?>>()
{
- public Iterable<ObserverMethod<?,?>> transform(BeanManagerImpl beanManager)
+ public Iterable<ObserverMethod<?>> transform(BeanManagerImpl beanManager)
{
return beanManager.getObservers();
}
@@ -578,7 +578,7 @@
decoratorResolver.clear();
}
- public <T> Set<ObserverMethod<?, T>> resolveObserverMethods(T event, Annotation... bindings)
+ public <T> Set<ObserverMethod<T>> resolveObserverMethods(T event, Annotation... bindings)
{
Observers.checkEventObjectType(event);
return resolveObserverMethods(event.getClass(), bindings);
@@ -593,7 +593,7 @@
@SuppressWarnings("unchecked")
- private <T> Set<ObserverMethod<?, T>> resolveObserverMethods(Type eventType, Annotation... bindings)
+ private <T> Set<ObserverMethod<T>> resolveObserverMethods(Type eventType, Annotation... bindings)
{
checkBindingTypes(Arrays.asList(bindings));
@@ -604,11 +604,11 @@
bindingAnnotations.add(new DefaultLiteral());
}
bindingAnnotations.add(new AnyLiteral());
- Set<ObserverMethod<?, T>> observers = new HashSet<ObserverMethod<?, T>>();
- Set<ObserverMethod<?,?>> eventObservers = observerResolver.resolve(ResolvableFactory.of(new Reflections.HierarchyDiscovery(eventType).getTypeClosureAsSet(), bindingAnnotations, null));
- for (ObserverMethod<?,?> observer : eventObservers)
+ Set<ObserverMethod<T>> observers = new HashSet<ObserverMethod<T>>();
+ Set<ObserverMethod<?>> eventObservers = observerResolver.resolve(ResolvableFactory.of(new Reflections.HierarchyDiscovery(eventType).getTypeClosureAsSet(), bindingAnnotations, null));
+ for (ObserverMethod<?> observer : eventObservers)
{
- observers.add((ObserverMethod<?, T>) observer);
+ observers.add((ObserverMethod<T>) observer);
}
return observers;
}
@@ -804,7 +804,7 @@
*
* @param observer
= */
- public void addObserver(ObserverMethod<?, ?> observer)
+ public void addObserver(ObserverMethod<?> observer)
{
//checkEventType(observer.getObservedType());
observers.add(observer);
@@ -834,9 +834,9 @@
notifyObservers(event, resolveObserverMethods(eventType, qualifiers));
}
- private <T> void notifyObservers(final T event, final Set<ObserverMethod<?, T>> observers)
+ private <T> void notifyObservers(final T event, final Set<ObserverMethod<T>> observers)
{
- for (ObserverMethod<?, T> observer : observers)
+ for (ObserverMethod<T> observer : observers)
{
observer.notify(event);
}
@@ -1229,7 +1229,7 @@
return childIds;
}
- public List<ObserverMethod<?,?>> getObservers()
+ public List<ObserverMethod<?>> getObservers()
{
return observers;
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AfterBeanDiscoveryImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AfterBeanDiscoveryImpl.java 2009-10-30 12:24:20 UTC (rev 4440)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AfterBeanDiscoveryImpl.java 2009-10-30 12:27:32 UTC (rev 4441)
@@ -66,7 +66,7 @@
getBeanManager().addContext(context);
}
- public void addObserverMethod(ObserverMethod<?, ?> observerMethod)
+ public void addObserverMethod(ObserverMethod<?> observerMethod)
{
getOrCreateBeanDeployment(observerMethod.getBeanClass()).getBeanManager().addObserver(observerMethod);
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessObserverMethodImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessObserverMethodImpl.java 2009-10-30 12:24:20 UTC (rev 4440)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessObserverMethodImpl.java 2009-10-30 12:27:32 UTC (rev 4441)
@@ -44,7 +44,7 @@
}
private final AnnotatedMethod<X> beanMethod;
- private final ObserverMethod<X, T> observerMethod;
+ private final ObserverMethod<T> observerMethod;
public ProcessObserverMethodImpl(BeanManagerImpl beanManager, AnnotatedMethod<X> beanMethod, ObserverMethodImpl<X, T> observerMethod)
{
@@ -63,7 +63,7 @@
return beanMethod;
}
- public ObserverMethod<X, T> getObserverMethod()
+ public ObserverMethod<T> getObserverMethod()
{
return observerMethod;
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java 2009-10-30 12:24:20 UTC (rev 4440)
+++ core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java 2009-10-30 12:27:32 UTC (rev 4441)
@@ -59,7 +59,7 @@
* @author David Allen
*
*/
-public class ObserverMethodImpl<X, T> implements ObserverMethod<X, T>
+public class ObserverMethodImpl<X, T> implements ObserverMethod<T>
{
private final Set<Annotation> bindings;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeObserverResolver.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeObserverResolver.java 2009-10-30 12:24:20 UTC (rev 4440)
+++ core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeObserverResolver.java 2009-10-30 12:27:32 UTC (rev 4441)
@@ -29,19 +29,19 @@
* @author pmuir
*
*/
-public class TypeSafeObserverResolver extends TypeSafeResolver<Resolvable, ObserverMethod<?,?>>
+public class TypeSafeObserverResolver extends TypeSafeResolver<Resolvable, ObserverMethod<?>>
{
private final BeanManagerImpl manager;
- public TypeSafeObserverResolver(BeanManagerImpl manager, Iterable<ObserverMethod<?,?>> observers)
+ public TypeSafeObserverResolver(BeanManagerImpl manager, Iterable<ObserverMethod<?>> observers)
{
super(observers);
this.manager = manager;
}
@Override
- protected boolean matches(Resolvable resolvable, ObserverMethod<?,?> observer)
+ protected boolean matches(Resolvable resolvable, ObserverMethod<?> observer)
{
return Reflections.isAssignableFrom(observer.getObservedType(), resolvable.getTypeClosure()) && Beans.containsAllBindings(observer.getObservedQualifiers(), resolvable.getQualifiers(), manager);
}
@@ -55,7 +55,7 @@
}
@Override
- protected Set<ObserverMethod<?,?>> filterResult(Set<ObserverMethod<?,?>> matched)
+ protected Set<ObserverMethod<?>> filterResult(Set<ObserverMethod<?>> matched)
{
return matched;
}
@@ -67,7 +67,7 @@
}
@Override
- protected Set<ObserverMethod<?,?>> sortResult(Set<ObserverMethod<?,?>> matched)
+ protected Set<ObserverMethod<?>> sortResult(Set<ObserverMethod<?>> matched)
{
return matched;
}
15 years, 2 months
Weld SVN: r4440 - in cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: event/observer and 4 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-10-30 08:24:20 -0400 (Fri, 30 Oct 2009)
New Revision: 4440
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/EnterpriseEventInheritenceTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/NonBindingTypesWhenResolvingTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/observer/ProcessObserverMethodObserver.java
Log:
WELD-217, part 1
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-10-30 12:24:08 UTC (rev 4439)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-10-30 12:24:20 UTC (rev 4440)
@@ -111,7 +111,7 @@
public void testNonStaticObserverMethodNotInherited()
{
Egg egg = new Egg();
- Set<ObserverMethod<?, Egg>> observers = getCurrentManager().resolveObserverMethods(egg);
+ Set<ObserverMethod<Egg>> observers = getCurrentManager().resolveObserverMethods(egg);
assert observers.size() == 1;
// Reception the observer so we can confirm that it
@@ -129,7 +129,7 @@
public void testNonStaticObserverMethodNotIndirectlyInherited()
{
StockPrice price = new StockPrice();
- Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(price);
+ Set<ObserverMethod<StockPrice>> observers = getCurrentManager().resolveObserverMethods(price);
assert observers.size() == 1;
// Reception the observer so we can confirm that it
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java 2009-10-30 12:24:08 UTC (rev 4439)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java 2009-10-30 12:24:20 UTC (rev 4440)
@@ -52,9 +52,9 @@
@SpecAssertion(section = "11.1.3", id = "b")
public void testGetBeanOnObserverMethod()
{
- Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
+ Set<ObserverMethod<StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
assert observers.size() == 1;
- ObserverMethod<?, StockPrice> observerMethod = observers.iterator().next();
+ ObserverMethod<StockPrice> observerMethod = observers.iterator().next();
assert observerMethod.getBeanClass().equals(StockWatcher.class);
}
@@ -62,9 +62,9 @@
@SpecAssertion(section = "11.1.3", id = "c")
public void testGetObservedTypeOnObserverMethod()
{
- Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
+ Set<ObserverMethod<StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
assert observers.size() == 1;
- ObserverMethod<?, ?> observerMethod = observers.iterator().next();
+ ObserverMethod<?> observerMethod = observers.iterator().next();
assert observerMethod.getObservedType().equals(StockPrice.class);
}
@@ -72,9 +72,9 @@
@SpecAssertion(section = "11.1.3", id = "c")
public void testGetObservedBindingsOnObserverMethod()
{
- Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
+ Set<ObserverMethod<StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
assert observers.size() == 1;
- ObserverMethod<?, ?> observerMethod = observers.iterator().next();
+ ObserverMethod<?> observerMethod = observers.iterator().next();
assert observerMethod.getObservedQualifiers().size() == 1;
assert observerMethod.getObservedQualifiers().contains(new DefaultLiteral());
}
@@ -83,11 +83,11 @@
@SpecAssertion(section = "11.1.3", id = "d")
public void testGetNotifyOnObserverMethod()
{
- Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
+ Set<ObserverMethod<StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
assert observers.size() == 1;
assert observers.iterator().next().getReception().equals(Reception.ALWAYS);
- Set<ObserverMethod<?, ConditionalEvent>> conditionalObservers = getCurrentManager().resolveObserverMethods(new ConditionalEvent());
+ Set<ObserverMethod<ConditionalEvent>> conditionalObservers = getCurrentManager().resolveObserverMethods(new ConditionalEvent());
assert !conditionalObservers.isEmpty();
assert conditionalObservers.iterator().next().getReception().equals(Reception.IF_EXISTS);
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/EnterpriseEventInheritenceTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/EnterpriseEventInheritenceTest.java 2009-10-30 12:24:08 UTC (rev 4439)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/EnterpriseEventInheritenceTest.java 2009-10-30 12:24:20 UTC (rev 4440)
@@ -29,7 +29,7 @@
public void testNonStaticObserverMethodNotInherited() throws Exception
{
Egg egg = new Egg();
- Set<ObserverMethod<?, Egg>> observers = getCurrentManager().resolveObserverMethods(egg);
+ Set<ObserverMethod<Egg>> observers = getCurrentManager().resolveObserverMethods(egg);
assert observers.size() == 1;
// Reception the observer so we can confirm that it
@@ -44,7 +44,7 @@
public void testNonStaticObserverMethodNotIndirectlyInherited() throws Exception
{
StockPrice stockPrice = new StockPrice();
- Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(stockPrice);
+ Set<ObserverMethod<StockPrice>> observers = getCurrentManager().resolveObserverMethods(stockPrice);
assert observers.size() == 1;
// Reception the observer so we can confirm that it
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java 2009-10-30 12:24:08 UTC (rev 4439)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java 2009-10-30 12:24:20 UTC (rev 4440)
@@ -40,9 +40,9 @@
@SpecAssertion(section = "10.4.2", id = "a")
public void testMethodWithParameterAnnotatedWithObservesRegistersObserverMethod() throws SecurityException, NoSuchMethodException
{
- Set<ObserverMethod<?, Temperature>> temperatureObservers = getCurrentManager().resolveObserverMethods(new Temperature(0d));
+ Set<ObserverMethod<Temperature>> temperatureObservers = getCurrentManager().resolveObserverMethods(new Temperature(0d));
assert temperatureObservers.size() == 1;
- ObserverMethod<?, Temperature> temperatureObserver = temperatureObservers.iterator().next();
+ ObserverMethod<Temperature> temperatureObserver = temperatureObservers.iterator().next();
assert temperatureObserver.getBeanClass().equals(AirConditioner.class);
assert temperatureObserver.getObservedType().equals(Temperature.class);
@@ -103,12 +103,12 @@
@SpecAssertion(section = "12.3", id = "o")
public void testObserverMethodNotAutomaticallyRegisteredForDisabledBeans()
{
- Set<ObserverMethod<?, Ghost>> ghostObservers = getCurrentManager().resolveObserverMethods(new Ghost());
+ Set<ObserverMethod<Ghost>> ghostObservers = getCurrentManager().resolveObserverMethods(new Ghost());
assert ghostObservers.size() == 0;
- Set<ObserverMethod<?, String>> stringObservers = getCurrentManager().resolveObserverMethods(new String(), new AnnotationLiteral<Secret>() {});
+ Set<ObserverMethod<String>> stringObservers = getCurrentManager().resolveObserverMethods(new String(), new AnnotationLiteral<Secret>() {});
assert stringObservers.size() == 1;
- for (ObserverMethod<?, String> observer : stringObservers)
+ for (ObserverMethod<String> observer : stringObservers)
{
// an assertion error will be raised if an inappropriate observer is called
observer.notify("fail if disabled observer invoked");
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/NonBindingTypesWhenResolvingTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/NonBindingTypesWhenResolvingTest.java 2009-10-30 12:24:08 UTC (rev 4439)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/NonBindingTypesWhenResolvingTest.java 2009-10-30 12:24:20 UTC (rev 4440)
@@ -33,6 +33,6 @@
@SpecAssertion(section = "11.3.11", id = "e")
public void testNonBindingTypeAnnotationWhenResolvingFails()
{
- Set<ObserverMethod<?, AnEventType>> resolvedObservers = getCurrentManager().resolveObserverMethods(new AnEventType(), new AnimalStereotypeAnnotationLiteral());
+ Set<ObserverMethod<AnEventType>> resolvedObservers = getCurrentManager().resolveObserverMethods(new AnEventType(), new AnimalStereotypeAnnotationLiteral());
}
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/observer/ProcessObserverMethodObserver.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/observer/ProcessObserverMethodObserver.java 2009-10-30 12:24:08 UTC (rev 4439)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/observer/ProcessObserverMethodObserver.java 2009-10-30 12:24:20 UTC (rev 4440)
@@ -13,7 +13,7 @@
{
private static final HashSet<Type> eventTypes = new HashSet<Type>();
private static AnnotatedMethod<?> annotatedMethod;
- private static ObserverMethod<?, ?> observerMethod;
+ private static ObserverMethod<?> observerMethod;
public void observeObserverMethodForEventA(@Observes ProcessObserverMethod<EventAObserver, EventA> event)
{
@@ -32,7 +32,7 @@
return annotatedMethod;
}
- public static ObserverMethod<?, ?> getObserverMethod()
+ public static ObserverMethod<?> getObserverMethod()
{
return observerMethod;
}
15 years, 2 months
Weld SVN: r4439 - api/trunk/cdi/src/main/java/javax/enterprise/inject/spi.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-10-30 08:24:08 -0400 (Fri, 30 Oct 2009)
New Revision: 4439
Modified:
api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/AfterBeanDiscovery.java
api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/BeanManager.java
api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java
api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java
Log:
WELD-217, part 1
Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/AfterBeanDiscovery.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/AfterBeanDiscovery.java 2009-10-30 12:07:59 UTC (rev 4438)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/AfterBeanDiscovery.java 2009-10-30 12:24:08 UTC (rev 4439)
@@ -79,7 +79,7 @@
*
* @param observerMethod The custom observer method to add to the deployment
*/
- public void addObserverMethod(ObserverMethod<?, ?> observerMethod);
+ public void addObserverMethod(ObserverMethod<?> observerMethod);
/**
* Registers a custom {@link javax.enterprise.context.spi.Context} object
Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/BeanManager.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/BeanManager.java 2009-10-30 12:07:59 UTC (rev 4438)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/BeanManager.java 2009-10-30 12:24:08 UTC (rev 4439)
@@ -191,7 +191,7 @@
* @throws IllegalArgumentException if two instances of the same binding type
* are passed
*/
- public <T> Set<ObserverMethod<?, T>> resolveObserverMethods(T event, Annotation... qualifiers);
+ public <T> Set<ObserverMethod<T>> resolveObserverMethods(T event, Annotation... qualifiers);
/**
* Obtains an ordered list of enabled decorators for a set of bean types and
Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java 2009-10-30 12:07:59 UTC (rev 4438)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java 2009-10-30 12:24:08 UTC (rev 4439)
@@ -13,17 +13,16 @@
*
* @author Gavin King
* @author David Allen
- * @param <X> the type of the bean with the observer method
* @param <T> the event type
*/
-public interface ObserverMethod<X, T>
+public interface ObserverMethod<T>
{
/**
* Obtains the {@linkplain Class class} of bean defining the observer method.
*
* @return the defining {@linkplain Class class}
*/
- public Class<X> getBeanClass();
+ public Class<?> getBeanClass();
/**
* Obtains the observed event {@linkplain Type type}.
Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java 2009-10-30 12:07:59 UTC (rev 4438)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java 2009-10-30 12:24:08 UTC (rev 4439)
@@ -52,7 +52,7 @@
* @return the {@link javax.enterprise.inject.spi.ObserverMethod} object that
* will be used by the container to call the observer method
*/
- public ObserverMethod<X, T> getObserverMethod();
+ public ObserverMethod<T> getObserverMethod();
/**
* Registers a definition error with the container, causing the container to
15 years, 2 months
Weld SVN: r4438 - core/trunk/impl.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-10-30 08:07:59 -0400 (Fri, 30 Oct 2009)
New Revision: 4438
Modified:
core/trunk/impl/pom.xml
Log:
WELD-203
Modified: core/trunk/impl/pom.xml
===================================================================
--- core/trunk/impl/pom.xml 2009-10-30 10:49:07 UTC (rev 4437)
+++ core/trunk/impl/pom.xml 2009-10-30 12:07:59 UTC (rev 4438)
@@ -55,7 +55,6 @@
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
- <optional>true</optional>
</dependency>
<dependency>
15 years, 2 months
Weld SVN: r4437 - in core/trunk: tests/src/test/java/org/jboss/weld/test/unit/extensions and 1 other directory.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-10-30 06:49:07 -0400 (Fri, 30 Oct 2009)
New Revision: 4437
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/ExtensionTest.java
Log:
WELD-234
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java 2009-10-30 09:24:23 UTC (rev 4436)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java 2009-10-30 10:49:07 UTC (rev 4437)
@@ -29,6 +29,7 @@
import javax.enterprise.event.Observes;
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.Extension;
import javax.inject.Inject;
import org.jboss.weld.BeanManagerImpl;
@@ -288,7 +289,8 @@
EJBApiAbstraction ejbApiAbstraction = manager.getServices().get(EJBApiAbstraction.class);
JsfApiAbstraction jsfApiAbstraction = manager.getServices().get(JsfApiAbstraction.class);
ServletApiAbstraction servletApiAbstraction = manager.getServices().get(ServletApiAbstraction.class);
- return !clazz.isNonStaticMemberClass() &&
+ return !Extension.class.isAssignableFrom(clazz.getJavaClass()) &&
+ !clazz.isNonStaticMemberClass() &&
!Reflections.isParamerterizedTypeWithWildcard(javaClass) &&
!servletApiAbstraction.SERVLET_CLASS.isAssignableFrom(javaClass) &&
!servletApiAbstraction.FILTER_CLASS.isAssignableFrom(javaClass) &&
Modified: core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/ExtensionTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/ExtensionTest.java 2009-10-30 09:24:23 UTC (rev 4436)
+++ core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/ExtensionTest.java 2009-10-30 10:49:07 UTC (rev 4437)
@@ -12,7 +12,7 @@
public class ExtensionTest extends AbstractWeldTest
{
- @Test(description="WELD-234", groups="broken")
+ @Test(description="WELD-234")
public void testExtensionInjectableAsBean()
{
assert SimpleExtension.getInstance() != null;
15 years, 2 months
Weld SVN: r4436 - in cdi-tck/trunk/impl/src/main: resources/org/jboss/jsr299/tck/tests/context and 1 other directory.
by weld-commits@lists.jboss.org
Author: jharting
Date: 2009-10-30 05:24:23 -0400 (Fri, 30 Oct 2009)
New Revision: 4436
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/AfterBeanDiscoveryObserver.java
Removed:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextExtensions.java
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextDestroysBeansTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/javax.enterprise.inject.spi.Extension
Log:
Fixed broken tests
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/AfterBeanDiscoveryObserver.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/AfterBeanDiscoveryObserver.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/AfterBeanDiscoveryObserver.java 2009-10-30 09:24:23 UTC (rev 4436)
@@ -0,0 +1,27 @@
+package org.jboss.jsr299.tck.tests.context;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.Extension;
+
+public class AfterBeanDiscoveryObserver implements Extension
+{
+ private static MyContextual bean = null;
+
+ public void addCustomBeanImplementation(@Observes AfterBeanDiscovery event, BeanManager manager) {
+ bean = new MyContextual(manager);
+ event.addBean(bean);
+ }
+
+ public void addNewContexts(@Observes AfterBeanDiscovery event)
+ {
+ event.addContext(new DummyContext());
+ event.addContext(new DummyContext());
+ }
+
+ public static MyContextual getBean()
+ {
+ return bean;
+ }
+}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextDestroysBeansTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextDestroysBeansTest.java 2009-10-30 03:11:01 UTC (rev 4435)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextDestroysBeansTest.java 2009-10-30 09:24:23 UTC (rev 4436)
@@ -9,6 +9,8 @@
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
import org.testng.annotations.Test;
/**
@@ -18,21 +20,21 @@
* @author David Allen
*/
@Artifact
+@IntegrationTest
@SpecVersion(spec="cdi", version="20091018")
+@Resource(source = "javax.enterprise.inject.spi.Extension", destination = "WEB-INF/classes/META-INF/services/javax.enterprise.inject.spi.Extension")
public class ContextDestroysBeansTest extends AbstractJSR299Test
{
- @Test(groups = { "contexts", "broken" })
+ @Test(groups = { "contexts" })
@SpecAssertions( {
@SpecAssertion(section = "6.2", id = "p"),
@SpecAssertion(section = "6.3", id = "d")
})
public void testContextDestroysBeansWhenDestroyed()
{
- MyContextual bean = new MyContextual(getCurrentManager());
+ MyContextual bean = AfterBeanDiscoveryObserver.getBean();
bean.setShouldReturnNullInstances(false);
- // TODO Remove use of this deprecated API
- //getCurrentManager().addBean(bean);
Context sessionContext = getCurrentManager().getContext(SessionScoped.class);
CreationalContext<MySessionBean> creationalContext = getCurrentManager().createCreationalContext(bean);
Deleted: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextExtensions.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextExtensions.java 2009-10-30 03:11:01 UTC (rev 4435)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextExtensions.java 2009-10-30 09:24:23 UTC (rev 4436)
@@ -1,14 +0,0 @@
-package org.jboss.jsr299.tck.tests.context;
-
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.spi.AfterBeanDiscovery;
-import javax.enterprise.inject.spi.Extension;
-
-public class ContextExtensions implements Extension
-{
- public void addNewContexts(@Observes AfterBeanDiscovery event)
- {
- event.addContext(new DummyContext());
- event.addContext(new DummyContext());
- }
-}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java 2009-10-30 03:11:01 UTC (rev 4435)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java 2009-10-30 09:24:23 UTC (rev 4436)
@@ -10,6 +10,8 @@
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
import org.testng.annotations.Test;
/**
@@ -20,6 +22,8 @@
*/
@Artifact
@SpecVersion(spec="cdi", version="20091018")
+@IntegrationTest
+@Resource(source = "javax.enterprise.inject.spi.Extension", destination = "WEB-INF/classes/META-INF/services/javax.enterprise.inject.spi.Extension")
public class NormalContextTest extends AbstractJSR299Test
{
@@ -43,16 +47,14 @@
assert fourth.getId() == 10;
}
- @Test(groups = { "contexts", "broken" })
+ @Test(groups = { "contexts" })
@SpecAssertions( {
@SpecAssertion(section = "6.2", id = "l")
} )
public void testGetWithCreationalContextReturnsNewInstance()
{
- MyContextual bean = new MyContextual(getCurrentManager());
+ MyContextual bean = AfterBeanDiscoveryObserver.getBean();
bean.setShouldReturnNullInstances(false);
- // TODO Remove use of this deprecated API
- //getCurrentManager().addBean(bean);
CreationalContext<MySessionBean> creationalContext = new MockCreationalContext<MySessionBean>();
MySessionBean newBean = getCurrentManager().getContext(SessionScoped.class).get(bean, creationalContext);
@@ -60,16 +62,14 @@
assert bean.isCreateCalled();
}
- @Test(groups = { "contexts" , "broken"})
+ @Test(groups = { "contexts" })
@SpecAssertion(section = "6.2", id = "nb")
public void testGetMayNotReturnNullUnlessContextualCreateReturnsNull()
{
// The case of no creational context is already tested where a null is
// returned. Here we just test that the contextual create can return null.
- MyContextual bean = new MyContextual(getCurrentManager());
+ MyContextual bean = AfterBeanDiscoveryObserver.getBean();
bean.setShouldReturnNullInstances(true);
- // TODO Remove use of this deprecated API
- //getCurrentManager().addBean(bean);
CreationalContext<MySessionBean> creationalContext = new MockCreationalContext<MySessionBean>();
assert getCurrentManager().getContext(SessionScoped.class).get(bean, creationalContext) == null;
Modified: cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/javax.enterprise.inject.spi.Extension
===================================================================
--- cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/javax.enterprise.inject.spi.Extension 2009-10-30 03:11:01 UTC (rev 4435)
+++ cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/javax.enterprise.inject.spi.Extension 2009-10-30 09:24:23 UTC (rev 4436)
@@ -1 +1 @@
-org.jboss.jsr299.tck.tests.context.ContextExtensions
\ No newline at end of file
+org.jboss.jsr299.tck.tests.context.AfterBeanDiscoveryObserver
\ No newline at end of file
15 years, 2 months
Weld SVN: r4435 - api/trunk/cdi/src/main/java/javax/enterprise/util.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-10-29 23:11:01 -0400 (Thu, 29 Oct 2009)
New Revision: 4435
Added:
api/trunk/cdi/src/main/java/javax/enterprise/util/package-info.java
Modified:
api/trunk/cdi/src/main/java/javax/enterprise/util/AnnotationLiteral.java
api/trunk/cdi/src/main/java/javax/enterprise/util/TypeLiteral.java
Log:
add package-info
Modified: api/trunk/cdi/src/main/java/javax/enterprise/util/AnnotationLiteral.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/util/AnnotationLiteral.java 2009-10-30 03:04:12 UTC (rev 4434)
+++ api/trunk/cdi/src/main/java/javax/enterprise/util/AnnotationLiteral.java 2009-10-30 03:11:01 UTC (rev 4435)
@@ -24,9 +24,7 @@
import java.lang.reflect.Type;
import java.util.Arrays;
-import javax.enterprise.inject.Instance;
-
/**
* <p>Supports inline instantiation of annotation type instances.</p>
*
Modified: api/trunk/cdi/src/main/java/javax/enterprise/util/TypeLiteral.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/util/TypeLiteral.java 2009-10-30 03:04:12 UTC (rev 4434)
+++ api/trunk/cdi/src/main/java/javax/enterprise/util/TypeLiteral.java 2009-10-30 03:11:01 UTC (rev 4435)
@@ -21,8 +21,6 @@
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
-import javax.enterprise.inject.Instance;
-
/**
* <p>Supports inline instantiation of objects that represent parameterized types
* with actual type parameters.</p>
Added: api/trunk/cdi/src/main/java/javax/enterprise/util/package-info.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/util/package-info.java (rev 0)
+++ api/trunk/cdi/src/main/java/javax/enterprise/util/package-info.java 2009-10-30 03:11:01 UTC (rev 4435)
@@ -0,0 +1,4 @@
+/**
+ * Contains shared, general-purpose helper classes and annotations.
+ */
+package javax.enterprise.util;
\ No newline at end of file
15 years, 2 months
Weld SVN: r4434 - in api/trunk/cdi/src/main/java/javax: enterprise/inject and 1 other directory.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-10-29 23:04:12 -0400 (Thu, 29 Oct 2009)
New Revision: 4434
Modified:
api/trunk/cdi/src/main/java/javax/decorator/Decorator.java
api/trunk/cdi/src/main/java/javax/decorator/Delegate.java
api/trunk/cdi/src/main/java/javax/decorator/package-info.java
api/trunk/cdi/src/main/java/javax/enterprise/inject/Any.java
Log:
@Inject @Delegate
Modified: api/trunk/cdi/src/main/java/javax/decorator/Decorator.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/decorator/Decorator.java 2009-10-30 02:47:44 UTC (rev 4433)
+++ api/trunk/cdi/src/main/java/javax/decorator/Decorator.java 2009-10-30 03:04:12 UTC (rev 4434)
@@ -41,7 +41,7 @@
* for instance passivation and conversational state defined by the
* EJB specification.</p>
*
- * @see javax.decorator.Delegate @Decorates identifies the
+ * @see javax.decorator.Delegate @Delegate identifies the
* delegate injection point of a decorator.
*
* @author Gavin King
Modified: api/trunk/cdi/src/main/java/javax/decorator/Delegate.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/decorator/Delegate.java 2009-10-30 02:47:44 UTC (rev 4433)
+++ api/trunk/cdi/src/main/java/javax/decorator/Delegate.java 2009-10-30 03:04:12 UTC (rev 4434)
@@ -33,16 +33,17 @@
* <pre>
* @Decorator
* class TimestampLogger implements Logger {
- * @Decorates @Any Logger logger;
+ * @Inject @Delegate @Any Logger logger;
* ...
* }
* </pre>
* <pre>
* @Decorator
* class TimestampLogger implements Logger {
- * private Logger logger;
+ * private Logger logger;
*
- * public TimestampLogger(@Decorates @Debug Logger logger) {
+ * @Inject
+ * public TimestampLogger(@Delegate @Debug Logger logger) {
* this.logger=logger;
* }
* ...
@@ -64,7 +65,7 @@
* <pre>
* @Decorator
* class TimestampLogger implements Logger {
- * @Decorates @Any Logger logger;
+ * @Inject @Delegate @Any Logger logger;
*
* void log(String message) {
* logger.log( timestamp() + ": " + message );
Modified: api/trunk/cdi/src/main/java/javax/decorator/package-info.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/decorator/package-info.java 2009-10-30 02:47:44 UTC (rev 4433)
+++ api/trunk/cdi/src/main/java/javax/decorator/package-info.java 2009-10-30 03:04:12 UTC (rev 4434)
@@ -39,7 +39,7 @@
* <p>All decorators have a
* {@linkplain javax.decorator.Delegate delegate injection point}.
* A delegate injection point is an injection point of the bean
- * class annotated {@link javax.decorator.Delegate @Decorates}.</p>
+ * class annotated {@link javax.decorator.Delegate @Delegate}.</p>
*
* <p>The type of the delegate injection point must implement or
* extend every decorated type. A decorator is not required to
Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/Any.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/Any.java 2009-10-30 02:47:44 UTC (rev 4433)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/Any.java 2009-10-30 03:04:12 UTC (rev 4434)
@@ -54,7 +54,7 @@
* </pre>
*
* <pre>
- * @Decorates @Any Logger logger;
+ * @Inject @Delegate @Any Logger logger;
* </pre>
*
* @author Gavin King
15 years, 2 months
Weld SVN: r4433 - api/trunk/cdi/src/main/java/javax/enterprise/inject.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-10-29 22:47:44 -0400 (Thu, 29 Oct 2009)
New Revision: 4433
Modified:
api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java
Log:
extensions are not managed beans
Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java 2009-10-29 23:52:46 UTC (rev 4432)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java 2009-10-30 02:47:44 UTC (rev 4433)
@@ -214,6 +214,7 @@
* {@link javax.decorator.Decorator @Decorator}.</li>
* <li>It is not annotated with an EJB component-defining annotation or declared
* as an EJB bean class in <tt>ejb-jar.xml</tt>.</li>
+ * <li>It does not implement {@link javax.enterprise.inject.spi.Extension}.</li>
* <li>It has an appropriate constructor; either the class has a constructor with
* no parameters, or the class declares a constructor annotated
* {@link javax.inject.Inject @Inject}.</li>
15 years, 2 months
Weld SVN: r4432 - in core/trunk/tests: src/test/java/org/jboss/weld/test/unit and 3 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-10-29 19:52:46 -0400 (Thu, 29 Oct 2009)
New Revision: 4432
Added:
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/ExtensionTest.java
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/Foo.java
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/SimpleExtension.java
core/trunk/tests/src/test/resources/org/jboss/weld/test/unit/extensions/
core/trunk/tests/src/test/resources/org/jboss/weld/test/unit/extensions/javax.enterprise.inject.spi.Extension
Modified:
core/trunk/tests/unit-tests.xml
Log:
tests for WELD-234
Added: core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/ExtensionTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/ExtensionTest.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/ExtensionTest.java 2009-10-29 23:52:46 UTC (rev 4432)
@@ -0,0 +1,22 @@
+package org.jboss.weld.test.unit.extensions;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.jsr299.Extension;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+@Artifact
+@IntegrationTest
+@Extension("javax.enterprise.inject.spi.Extension")
+public class ExtensionTest extends AbstractWeldTest
+{
+
+ @Test(description="WELD-234", groups="broken")
+ public void testExtensionInjectableAsBean()
+ {
+ assert SimpleExtension.getInstance() != null;
+ assert getCurrentManager().getInstanceByType(SimpleExtension.class).equals(SimpleExtension.getInstance());
+ }
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/ExtensionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/Foo.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/Foo.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/Foo.java 2009-10-29 23:52:46 UTC (rev 4432)
@@ -0,0 +1,15 @@
+package org.jboss.weld.test.unit.extensions;
+
+import javax.inject.Inject;
+
+public class Foo
+{
+
+ @Inject SimpleExtension simpleExtension;
+
+ public SimpleExtension getSimpleExtension()
+ {
+ return simpleExtension;
+ }
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/Foo.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/SimpleExtension.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/SimpleExtension.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/SimpleExtension.java 2009-10-29 23:52:46 UTC (rev 4432)
@@ -0,0 +1,22 @@
+package org.jboss.weld.test.unit.extensions;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.enterprise.inject.spi.Extension;
+
+
+public class SimpleExtension implements Extension
+{
+
+ private static SimpleExtension instance;
+
+ public void observe(@Observes BeforeBeanDiscovery event)
+ {
+ SimpleExtension.instance = this;
+ }
+
+ public static SimpleExtension getInstance()
+ {
+ return instance;
+ }
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/test/unit/extensions/SimpleExtension.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/resources/org/jboss/weld/test/unit/extensions/javax.enterprise.inject.spi.Extension
===================================================================
--- core/trunk/tests/src/test/resources/org/jboss/weld/test/unit/extensions/javax.enterprise.inject.spi.Extension (rev 0)
+++ core/trunk/tests/src/test/resources/org/jboss/weld/test/unit/extensions/javax.enterprise.inject.spi.Extension 2009-10-29 23:52:46 UTC (rev 4432)
@@ -0,0 +1 @@
+org.jboss.weld.test.unit.extensions.SimpleExtension
\ No newline at end of file
Modified: core/trunk/tests/unit-tests.xml
===================================================================
--- core/trunk/tests/unit-tests.xml 2009-10-29 23:15:12 UTC (rev 4431)
+++ core/trunk/tests/unit-tests.xml 2009-10-29 23:52:46 UTC (rev 4432)
@@ -37,7 +37,8 @@
<package name="org.jboss.weld.test.unit.decorator.simple" />
<package name="org.jboss.weld.test.unit.definition" />
<package name="org.jboss.weld.test.unit.deployment.structure" />
- <package name="org.jboss.weld.test.unit.evironments.servlet" />
+ <package name="org.jboss.weld.test.unit.environments.servlet" />
+ <package name="org.jboss.weld.test.unit.extensions" />
<package name="org.jboss.weld.test.unit.implementation" />
<package name="org.jboss.weld.test.unit.implementation.annotatedItem" />
<package name="org.jboss.weld.test.unit.implementation.enterpise" />
15 years, 2 months