[webbeans-commits] Webbeans SVN: r2289 - in ri/trunk: impl/src/main/java/org/jboss/webbeans/bean and 6 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-31 19:29:11 -0400 (Tue, 31 Mar 2009)
New Revision: 2289
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventObserver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/MergedStereotypes.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/MetaDataCache.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/PassivatingContextTest.java
Log:
convert MetaDataCache to a manager service
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-03-31 23:28:02 UTC (rev 2288)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-03-31 23:29:11 UTC (rev 2289)
@@ -116,7 +116,7 @@
throw new AmbiguousDependencyException("The injection point " + injectionPoint + " with binding types " + Names.annotationsToString(injectionPoint.getBindings()) + " in " + bean + " has ambiguous dependencies");
}
Bean<?> resolvedBean = (Bean<?>) resolvedBeans.iterator().next();
- if (MetaDataCache.instance().getScopeModel(resolvedBean.getScopeType()).isNormal() && !Proxies.isTypeProxyable(injectionPoint.getType()))
+ if (manager.getServices().get(MetaDataCache.class).getScopeModel(resolvedBean.getScopeType()).isNormal() && !Proxies.isTypeProxyable(injectionPoint.getType()))
{
throw new UnproxyableDependencyException("The injection point " + injectionPoint + " has non-proxyable dependencies");
}
@@ -124,7 +124,7 @@
{
throw new NullableDependencyException("The injection point " + injectionPoint + " has nullable dependencies");
}
- if (Beans.isPassivatingBean(bean) && !resolvedBean.isSerializable() && resolvedBean.getScopeType().equals(Dependent.class))
+ if (Beans.isPassivatingBean(bean, manager) && !resolvedBean.isSerializable() && resolvedBean.getScopeType().equals(Dependent.class))
{
throw new UnserializableDependencyException("The bean " + bean + " declares a passivating scopes but has non-serializable dependencies");
}
@@ -145,7 +145,7 @@
specializedBeans.add(abstractBean.getSpecializedBean());
}
}
- boolean normalScoped = MetaDataCache.instance().getScopeModel(bean.getScopeType()).isNormal();
+ boolean normalScoped = manager.getServices().get(MetaDataCache.class).getScopeModel(bean.getScopeType()).isNormal();
if (normalScoped && !Beans.isBeanProxyable(bean))
{
throw new UnproxyableDependencyException("Normal scoped bean " + bean + " is not proxyable");
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java 2009-03-31 23:28:02 UTC (rev 2288)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java 2009-03-31 23:29:11 UTC (rev 2289)
@@ -41,7 +41,7 @@
// The binding types the helper operates on
protected final Set<? extends Annotation> bindings;
// The Web Beans manager
- protected final Manager manager;
+ protected final RootManager manager;
// The type of the operation
protected final Class<T> type;
@@ -52,7 +52,7 @@
* @param manager The Web Beans manager
* @param bindings The binding types
*/
- protected FacadeImpl(Class<T> type, Manager manager, Set<? extends Annotation> bindings)
+ protected FacadeImpl(Class<T> type, RootManager manager, Set<? extends Annotation> bindings)
{
this.manager = manager;
this.type = type;
@@ -76,7 +76,7 @@
result.addAll(bindings);
for (Annotation newAnnotation : newBindings)
{
- if (!MetaDataCache.instance().getBindingTypeModel(newAnnotation.annotationType()).isValid())
+ if (!manager.getServices().get(MetaDataCache.class).getBindingTypeModel(newAnnotation.annotationType()).isValid())
{
throw new IllegalArgumentException(newAnnotation + " is not a binding for " + this);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java 2009-03-31 23:28:02 UTC (rev 2288)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java 2009-03-31 23:29:11 UTC (rev 2289)
@@ -47,7 +47,7 @@
* @param manager The Web Beans manager
* @param bindings The binding types
*/
- private InstanceImpl(Class<T> type, Manager manager, Set<Annotation> bindings)
+ private InstanceImpl(Class<T> type, RootManager manager, Set<Annotation> bindings)
{
super(type, manager, bindings);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java 2009-03-31 23:28:02 UTC (rev 2288)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java 2009-03-31 23:29:11 UTC (rev 2289)
@@ -133,7 +133,7 @@
private transient final Set<Interceptor> interceptors;
// The EJB resolver provided by the container
- private transient final ServiceRegistry simpleServiceRegistry;
+ private transient final ServiceRegistry services;
private transient final EjbDescriptorCache ejbDescriptorCache;
@@ -148,7 +148,7 @@
*/
public RootManager(ServiceRegistry simpleServiceRegistry)
{
- this.simpleServiceRegistry = simpleServiceRegistry;
+ this.services = simpleServiceRegistry;
this.beans = new CopyOnWriteArrayList<Bean<?>>();
this.newEnterpriseBeanMap = new ConcurrentHashMap<Class<?>, EnterpriseBean<?>>();
this.riBeans = new ConcurrentHashMap<String, RIBean<?>>();
@@ -157,7 +157,7 @@
this.decorators = new HashSet<Decorator>();
this.interceptors = new HashSet<Interceptor>();
this.contextMap = new ContextMap();
- this.eventManager = new EventManager();
+ this.eventManager = new EventManager(this);
this.ejbDescriptorCache = new EjbDescriptorCache();
this.currentInjectionPoint = new ThreadLocal<Stack<InjectionPoint>>()
{
@@ -252,7 +252,7 @@
Class<?> clazz = event.getClass();
for (Annotation annotation : bindings)
{
- if (!MetaDataCache.instance().getBindingTypeModel(annotation.annotationType()).isValid())
+ if (!getServices().get(MetaDataCache.class).getBindingTypeModel(annotation.annotationType()).isValid())
{
throw new IllegalArgumentException("Not a binding type " + annotation);
}
@@ -361,7 +361,7 @@
{
for (Annotation annotation : element.getAnnotationsAsSet())
{
- if (!MetaDataCache.instance().getBindingTypeModel(annotation.annotationType()).isValid())
+ if (!getServices().get(MetaDataCache.class).getBindingTypeModel(annotation.annotationType()).isValid())
{
throw new IllegalArgumentException("Not a binding type " + annotation);
}
@@ -632,7 +632,7 @@
{
return getInstance((Bean<T>) specializedBeans.get(bean), creationalContext);
}
- else if (MetaDataCache.instance().getScopeModel(bean.getScopeType()).isNormal())
+ else if (getServices().get(MetaDataCache.class).getScopeModel(bean.getScopeType()).isNormal())
{
if (creationalContext != null || (creationalContext == null && getContext(bean.getScopeType()).get(bean) != null))
{
@@ -778,7 +778,7 @@
throw new AmbiguousDependencyException(element + "Resolved multiple Web Beans");
}
Bean<T> bean = beans.iterator().next();
- boolean normalScoped = MetaDataCache.instance().getScopeModel(bean.getScopeType()).isNormal();
+ boolean normalScoped = getServices().get(MetaDataCache.class).getScopeModel(bean.getScopeType()).isNormal();
if (normalScoped && !Beans.isBeanProxyable(bean))
{
throw new UnproxyableDependencyException("Normal scoped bean " + bean + " is not proxyable");
@@ -915,7 +915,7 @@
public ServiceRegistry getServices()
{
- return simpleServiceRegistry;
+ return services;
}
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-03-31 23:28:02 UTC (rev 2288)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-03-31 23:29:11 UTC (rev 2289)
@@ -141,7 +141,7 @@
*/
public void initialize(BeanDeployerEnvironment environment)
{
- mergedStereotypes = new MergedStereotypes<T, E>(getAnnotatedItem().getMetaAnnotations(Stereotype.class));
+ mergedStereotypes = new MergedStereotypes<T, E>(getAnnotatedItem().getMetaAnnotations(Stereotype.class), manager);
if (isSpecializing())
{
preSpecialize();
@@ -261,7 +261,7 @@
private boolean checkInjectionPointsAreSerializable()
{
- boolean passivating = MetaDataCache.instance().getScopeModel(this.getScopeType()).isPassivating();
+ boolean passivating = manager.getServices().get(MetaDataCache.class).getScopeModel(this.getScopeType()).isPassivating();
for (AnnotatedInjectionPoint<?, ?> injectionPoint : getInjectionPoints())
{
Annotation[] bindings = injectionPoint.getMetaAnnotationsAsArray(BindingType.class);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-03-31 23:28:02 UTC (rev 2288)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-03-31 23:29:11 UTC (rev 2289)
@@ -197,7 +197,7 @@
{
throw new IllegalProductException("Cannot return null from a non-dependent producer method");
}
- boolean passivating = MetaDataCache.instance().getScopeModel(getScopeType()).isPassivating();
+ boolean passivating = manager.getServices().get(MetaDataCache.class).getScopeModel(getScopeType()).isPassivating();
if (passivating && !Reflections.isSerializable(instance.getClass()))
{
throw new IllegalProductException("Producers cannot declare passivating scope and return a non-serializable class");
@@ -207,7 +207,7 @@
{
return;
}
- if (isDependent() && Beans.isPassivatingBean(injectionPoint.getBean()))
+ if (isDependent() && Beans.isPassivatingBean(injectionPoint.getBean(), manager))
{
if (injectionPoint.getMember() instanceof Field)
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-03-31 23:28:02 UTC (rev 2288)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-03-31 23:29:11 UTC (rev 2289)
@@ -331,7 +331,7 @@
{
throw new DefinitionException("Simple bean " + type + " cannot be a parameterized type");
}
- boolean passivating = MetaDataCache.instance().getScopeModel(scopeType).isPassivating();
+ boolean passivating = manager.getServices().get(MetaDataCache.class).getScopeModel(scopeType).isPassivating();
if (passivating && !_serializable)
{
throw new DefinitionException("Simple bean declaring a passivating scope must have a serializable implementation class " + toString());
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-03-31 23:28:02 UTC (rev 2288)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-03-31 23:29:11 UTC (rev 2289)
@@ -54,6 +54,7 @@
import org.jboss.webbeans.literal.InitializedLiteral;
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.metadata.MetaDataCache;
import org.jboss.webbeans.resources.DefaultNamingContext;
import org.jboss.webbeans.resources.DefaultResourceLoader;
import org.jboss.webbeans.resources.spi.NamingContext;
@@ -119,6 +120,7 @@
getServices().add(EJBApiAbstraction.class, new EJBApiAbstraction(resourceLoader));
getServices().add(JSFApiAbstraction.class, new JSFApiAbstraction(resourceLoader));
getServices().add(ServletApiAbstraction.class, new ServletApiAbstraction(resourceLoader));
+ getServices().add(MetaDataCache.class, new MetaDataCache());
}
public RootManager getManager()
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-03-31 23:28:02 UTC (rev 2288)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-03-31 23:29:11 UTC (rev 2289)
@@ -19,16 +19,13 @@
import java.io.Serializable;
import java.lang.annotation.Annotation;
-import java.util.Arrays;
-import java.util.HashSet;
import java.util.Set;
import javax.event.Event;
-import javax.event.Fires;
import javax.event.Observer;
-import javax.inject.manager.Manager;
import org.jboss.webbeans.FacadeImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.util.Strings;
/**
@@ -44,10 +41,7 @@
private static final long serialVersionUID = 8130060821283091287L;
- @SuppressWarnings("unchecked")
- private static final Set<Class<? extends Annotation>> FILTERED_ANNOTATIONS = new HashSet<Class<? extends Annotation>>(Arrays.asList(Fires.class));
-
- public static <E> Event<E> of(Class<E> eventType, Manager manager, Set<Annotation> bindings)
+ public static <E> Event<E> of(Class<E> eventType, RootManager manager, Set<Annotation> bindings)
{
return new EventImpl<E>(eventType, manager, bindings);
}
@@ -60,7 +54,7 @@
* @param manager The Web Beans manager
* @param bindings The binding types
*/
- public EventImpl(Class<T> eventType, Manager manager, Set<Annotation> bindings)
+ public EventImpl(Class<T> eventType, RootManager manager, Set<Annotation> bindings)
{
super(eventType, manager, bindings);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java 2009-03-31 23:28:02 UTC (rev 2288)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java 2009-03-31 23:29:11 UTC (rev 2289)
@@ -28,6 +28,7 @@
import javax.event.Observer;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
@@ -125,14 +126,16 @@
// The map of registered observers for a give
private final RegisteredObserversMap registeredObservers;
+ private final RootManager manager;
/**
* Initializes a new instance of the EventManager.
*/
- public EventManager()
+ public EventManager(RootManager manager)
{
registeredObservers = new RegisteredObserversMap();
+ this.manager = manager;
}
/**
@@ -144,7 +147,7 @@
*/
public <T> void addObserver(Observer<T> observer, Type eventType, Annotation... bindings)
{
- EventObserver<T> eventObserver = new EventObserver<T>(observer, eventType, bindings);
+ EventObserver<T> eventObserver = new EventObserver<T>(observer, eventType, manager, bindings);
registeredObservers.put(eventType, eventObserver);
log.debug("Added observer " + observer + " observing event type " + eventType);
}
@@ -213,7 +216,7 @@
public <T> void removeObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings)
{
List<EventObserver<?>> observers = registeredObservers.get(eventType);
- EventObserver<T> eventObserver = new EventObserver<T>(observer, eventType, bindings);
+ EventObserver<T> eventObserver = new EventObserver<T>(observer, eventType, manager, bindings);
observers.remove(eventObserver);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventObserver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventObserver.java 2009-03-31 23:28:02 UTC (rev 2288)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventObserver.java 2009-03-31 23:29:11 UTC (rev 2289)
@@ -26,6 +26,7 @@
import javax.inject.Current;
import javax.inject.DuplicateBindingTypeException;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.metadata.MetaDataCache;
import org.jboss.webbeans.util.Reflections;
import org.jboss.webbeans.util.Strings;
@@ -49,6 +50,7 @@
private final Type eventType;
private final List<Annotation> eventBindings;
private final Observer<T> observer;
+ private final RootManager manager;
/**
* Constructs a new wrapper for an observer.
@@ -57,11 +59,12 @@
* @param eventType The class of event being observed
* @param eventBindings The array of annotation event bindings, if any
*/
- public EventObserver(final Observer<T> observer, final Type eventType, final Annotation... eventBindings)
+ public EventObserver(final Observer<T> observer, final Type eventType, RootManager manager, final Annotation... eventBindings)
{
this.observer = observer;
this.eventType = eventType;
this.eventBindings = new ArrayList<Annotation>();
+ this.manager = manager;
checkEventBindings(eventBindings);
}
@@ -139,7 +142,7 @@
boolean found = false;
for (Annotation y : bindings)
{
- if (MetaDataCache.instance().getBindingTypeModel(x.annotationType()).isEqual(x, y))
+ if (manager.getServices().get(MetaDataCache.class).getBindingTypeModel(x.annotationType()).isEqual(x, y))
{
found = true;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java 2009-03-31 23:28:02 UTC (rev 2288)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java 2009-03-31 23:29:11 UTC (rev 2289)
@@ -284,7 +284,7 @@
{
for (Annotation binding : element.getBindings())
{
- BindingTypeModel<?> bindingType = MetaDataCache.instance().getBindingTypeModel(binding.annotationType());
+ BindingTypeModel<?> bindingType = manager.getServices().get(MetaDataCache.class).getBindingTypeModel(binding.annotationType());
if (bindingType.getNonBindingTypes().size() > 0)
{
boolean matchFound = false;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/MergedStereotypes.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/MergedStereotypes.java 2009-03-31 23:28:02 UTC (rev 2288)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/MergedStereotypes.java 2009-03-31 23:29:11 UTC (rev 2289)
@@ -21,6 +21,7 @@
import java.util.HashSet;
import java.util.Set;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.introspector.AnnotationStore.AnnotationMap;
/**
@@ -31,27 +32,30 @@
public class MergedStereotypes<T, E>
{
// The possible deployment types
- private AnnotationMap possibleDeploymentTypes;
+ private final AnnotationMap possibleDeploymentTypes;
// The possible scope types
- private Set<Annotation> possibleScopeTypes;
+ private final Set<Annotation> possibleScopeTypes;
// Is the bean name defaulted?
private boolean beanNameDefaulted;
// The required types
- private Set<Class<?>> requiredTypes;
+ private final Set<Class<?>> requiredTypes;
// The supported scopes
- private Set<Class<? extends Annotation>> supportedScopes;
+ private final Set<Class<? extends Annotation>> supportedScopes;
+ private final RootManager manager;
+
/**
* Constructor
*
* @param stereotypeAnnotations The stereotypes to merge
*/
- public MergedStereotypes(Set<Annotation> stereotypeAnnotations)
+ public MergedStereotypes(Set<Annotation> stereotypeAnnotations, RootManager manager)
{
- possibleDeploymentTypes = new AnnotationMap();
- possibleScopeTypes = new HashSet<Annotation>();
- requiredTypes = new HashSet<Class<?>>();
- supportedScopes = new HashSet<Class<? extends Annotation>>();
+ this.possibleDeploymentTypes = new AnnotationMap();
+ this.possibleScopeTypes = new HashSet<Annotation>();
+ this.requiredTypes = new HashSet<Class<?>>();
+ this.supportedScopes = new HashSet<Class<? extends Annotation>>();
+ this.manager = manager;
merge(stereotypeAnnotations);
}
@@ -65,7 +69,7 @@
for (Annotation stereotypeAnnotation : stereotypeAnnotations)
{
// Retrieve and merge all metadata from stereotypes
- StereotypeModel<?> stereotype = MetaDataCache.instance().getStereotype(stereotypeAnnotation.annotationType());
+ StereotypeModel<?> stereotype = manager.getServices().get(MetaDataCache.class).getStereotype(stereotypeAnnotation.annotationType());
if (stereotype == null)
{
throw new IllegalStateException("Stereotype " + stereotypeAnnotation + " not registered with container");
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/MetaDataCache.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/MetaDataCache.java 2009-03-31 23:28:02 UTC (rev 2288)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/MetaDataCache.java 2009-03-31 23:29:11 UTC (rev 2289)
@@ -20,6 +20,7 @@
import java.lang.annotation.Annotation;
import java.util.concurrent.Callable;
+import org.jboss.webbeans.bootstrap.api.Service;
import org.jboss.webbeans.util.collections.ConcurrentCache;
/**
@@ -28,26 +29,9 @@
* @author Pete Muir
*
*/
-public class MetaDataCache
+public class MetaDataCache implements Service
{
- // The singleton instance
- private static MetaDataCache instance;
- /**
- * Gets the singleton
- *
- * @return The instance
- */
- public static MetaDataCache instance()
- {
- return instance;
- }
-
- static
- {
- instance = new MetaDataCache();
- }
-
// The stereotype models
private ConcurrentCache<Class<? extends Annotation>, StereotypeModel<?>> stereotypes = new ConcurrentCache<Class<? extends Annotation>, StereotypeModel<?>>();
// The scope models
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-03-31 23:28:02 UTC (rev 2288)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-03-31 23:29:11 UTC (rev 2289)
@@ -24,6 +24,7 @@
import javax.inject.Produces;
import javax.inject.manager.Bean;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.bean.EnterpriseBean;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.injection.FieldInjectionPoint;
@@ -46,7 +47,7 @@
* @param bean The bean to inspect
* @return True if passivating, false otherwise
*/
- public static boolean isPassivatingBean(Bean<?> bean)
+ public static boolean isPassivatingBean(Bean<?> bean, RootManager manager)
{
if (bean instanceof EnterpriseBean)
{
@@ -54,7 +55,7 @@
}
else
{
- return MetaDataCache.instance().getScopeModel(bean.getScopeType()).isPassivating();
+ return manager.getServices().get(MetaDataCache.class).getScopeModel(bean.getScopeType()).isPassivating();
}
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/PassivatingContextTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/PassivatingContextTest.java 2009-03-31 23:28:02 UTC (rev 2288)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/PassivatingContextTest.java 2009-03-31 23:29:11 UTC (rev 2289)
@@ -20,7 +20,7 @@
@Test(groups = { "contexts", "passivation" })
public void testIsSessionScopePassivating()
{
- assert MetaDataCache.instance().getScopeModel(SessionScoped.class).isPassivating();
+ assert manager.getServices().get(MetaDataCache.class).getScopeModel(SessionScoped.class).isPassivating();
}
/**
@@ -30,7 +30,7 @@
@Test(groups = { "contexts", "passivation" })
public void testIsConversationScopePassivating()
{
- assert MetaDataCache.instance().getScopeModel(ConversationScoped.class).isPassivating();
+ assert manager.getServices().get(MetaDataCache.class).getScopeModel(ConversationScoped.class).isPassivating();
}
/**
@@ -40,7 +40,7 @@
@Test(groups = { "contexts", "passivation" })
public void testIsApplicationScopeNonPassivating()
{
- assert !MetaDataCache.instance().getScopeModel(ApplicationScoped.class).isPassivating();
+ assert !manager.getServices().get(MetaDataCache.class).getScopeModel(ApplicationScoped.class).isPassivating();
}
/**
@@ -50,7 +50,7 @@
@Test(groups = { "contexts", "passivation" })
public void testIsRequestScopeNonPassivating()
{
- assert !MetaDataCache.instance().getScopeModel(RequestScoped.class).isPassivating();
+ assert !manager.getServices().get(MetaDataCache.class).getScopeModel(RequestScoped.class).isPassivating();
}
}
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2288 - in extensions/trunk/logger/src: test/java/org/jboss/webbeans and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-31 19:28:02 -0400 (Tue, 31 Mar 2009)
New Revision: 2288
Added:
extensions/trunk/logger/src/test/java/org/jboss/webbeans/annotation/
extensions/trunk/logger/src/test/java/org/jboss/webbeans/annotation/Logger.java
Removed:
extensions/trunk/logger/src/main/java/org/jboss/webbeans/annotation/
extensions/trunk/logger/src/test/java/org/jboss/webbeans/annotation/Logger.java
Modified:
extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/AbstractLogTest.java
Log:
minor
Copied: extensions/trunk/logger/src/test/java/org/jboss/webbeans/annotation (from rev 2255, extensions/trunk/logger/src/main/java/org/jboss/webbeans/annotation)
Deleted: extensions/trunk/logger/src/test/java/org/jboss/webbeans/annotation/Logger.java
===================================================================
--- extensions/trunk/logger/src/main/java/org/jboss/webbeans/annotation/Logger.java 2009-03-29 19:35:48 UTC (rev 2255)
+++ extensions/trunk/logger/src/test/java/org/jboss/webbeans/annotation/Logger.java 2009-03-31 23:28:02 UTC (rev 2288)
@@ -1,32 +0,0 @@
-package org.jboss.webbeans.annotation;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.annotation.NonBinding;
-import javax.inject.BindingType;
-
-/**
- * Injects a log
- *
- * @author Gavin King
- */
-@Target({METHOD, FIELD, PARAMETER, TYPE})
-@Retention(RUNTIME)
-@Documented
-@BindingType
-public @interface Logger
-{
- /**
- * @return the log category
- */
- @NonBinding
- String value() default "";
-}
Copied: extensions/trunk/logger/src/test/java/org/jboss/webbeans/annotation/Logger.java (from rev 2287, extensions/trunk/logger/src/main/java/org/jboss/webbeans/annotation/Logger.java)
===================================================================
--- extensions/trunk/logger/src/test/java/org/jboss/webbeans/annotation/Logger.java (rev 0)
+++ extensions/trunk/logger/src/test/java/org/jboss/webbeans/annotation/Logger.java 2009-03-31 23:28:02 UTC (rev 2288)
@@ -0,0 +1,32 @@
+package org.jboss.webbeans.annotation;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.annotation.NonBinding;
+import javax.inject.BindingType;
+
+/**
+ * Injects a log
+ *
+ * @author Gavin King
+ */
+@Target({METHOD, FIELD, PARAMETER, TYPE})
+@Retention(RUNTIME)
+@Documented
+@BindingType
+public @interface Logger
+{
+ /**
+ * @return the log category
+ */
+ @NonBinding
+ String value() default "";
+}
Modified: extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/AbstractLogTest.java
===================================================================
--- extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/AbstractLogTest.java 2009-03-31 21:49:34 UTC (rev 2287)
+++ extensions/trunk/logger/src/test/java/org/jboss/webbeans/test/AbstractLogTest.java 2009-03-31 23:28:02 UTC (rev 2288)
@@ -17,9 +17,10 @@
package org.jboss.webbeans.test;
+import javax.inject.manager.Manager;
+
import org.jboss.testharness.AbstractTest;
import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.ManagerImpl;
import org.testng.ITestContext;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
@@ -33,7 +34,7 @@
*/
public abstract class AbstractLogTest extends AbstractTest
{
- private ManagerImpl manager;
+ private Manager manager;
@Override
@BeforeSuite
@@ -59,7 +60,7 @@
manager = null;
}
- public ManagerImpl getCurrentManager()
+ public Manager getCurrentManager()
{
return manager;
}
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2287 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/context/application/ejb and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-03-31 17:49:34 -0400 (Tue, 31 Mar 2009)
New Revision: 2287
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/FilterTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/IntrospectApplication.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/SimpleApplicationBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/Bird.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/BirdFeederService.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/CommonKingfisher.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMS.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FeederService.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/SimpleApplicationBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/ApplicationContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/NearMiss.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/SimpleApplicationBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TargetEvent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasDisplay.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasToFmsLink.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/application/SimplePage.html
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ApplicationContextTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/application/web.xml
Log:
A few tests for application context
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ApplicationContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ApplicationContextTest.java 2009-03-31 15:26:16 UTC (rev 2286)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ApplicationContextTest.java 2009-03-31 21:49:34 UTC (rev 2287)
@@ -9,16 +9,20 @@
import org.jboss.testharness.impl.packaging.war.WarArtifactDescriptor;
import org.testng.annotations.Test;
+import com.gargoylesoftware.htmlunit.TextPage;
import com.gargoylesoftware.htmlunit.WebClient;
/**
*
+ * @author David Allen
+ *
* Spec version: PRD2
*/
@Artifact
@IntegrationTest(runLocally=true)
@Resources({
- @Resource(destination=WarArtifactDescriptor.WEB_XML_DESTINATION, source="web.xml")
+ @Resource(destination=WarArtifactDescriptor.WEB_XML_DESTINATION, source="web.xml"),
+ @Resource(destination="SimplePage.html", source="SimplePage.html")
})
public class ApplicationContextTest extends AbstractJSR299Test
{
@@ -32,62 +36,45 @@
webClient.getPage(getContextPath() + "serviceMethodTest");
}
- @Test(groups = { "stub", "contexts", "servlet", "integration" })
+ @Test(groups = { "contexts", "servlet", "integration" })
@SpecAssertion(section = "8.5.3", id = "b")
public void testApplicationScopeActiveDuringDoFilterMethod() throws Exception
{
- assert false;
+ WebClient webClient = new WebClient();
+ webClient.setThrowExceptionOnFailingStatusCode(true);
+ webClient.getPage(getContextPath() + "SimplePage.html");
}
- @Test(groups = { "stub", "contexts", "webservice", "integration" })
- @SpecAssertion(section = "8.5.3", id = "c")
- public void testApplicationScopeActiveDuringWebSericeInvocation()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "contexts", "events", "integration" })
- @SpecAssertion(section = "8.5.3", id = "d")
- public void testApplicationScopeActiveDuringAsynchronousObserverMethodInvocation()
- {
- assert false;
- }
-
@Test(groups = { "stub", "contexts", "ejb3", "integration" })
@SpecAssertion(section = "8.5.3", id = "e")
public void testApplicationScopeActiveDuringRemoteMethodInvocationOfEjb()
{
+ //TODO Easy to implement once global naming w/EJB3.1 is available
assert false;
}
- @Test(groups = { "stub", "contexts", "ejb3", "integration" })
- @SpecAssertion(section = "8.5.3", id = "f")
- public void testApplicationScopeActiveDuringCallToEjbTimeoutMethod()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "contexts", "ejb3", "integration" })
+ @Test(groups = { "stub", "contexts", "ejb3", "jms", "integration" })
@SpecAssertion(section = "8.5.3", id = "g")
- public void testApplicationScopeActiveDuringEjbMessageDelivery()
+ public void testApplicationScopeActiveDuringMdbMessageDelivery()
{
assert false;
}
- @Test(groups = { "stub", "contexts", "integration" })
+ @Test(groups = { "contexts", "integration" })
@SpecAssertion(section = "8.5.3", id = "h")
- public void testApplicationContextSharedBetweenServletRequests()
+ public void testApplicationContextSharedBetweenServletRequests() throws Exception
{
- assert false;
+ WebClient webClient = new WebClient();
+ webClient.setThrowExceptionOnFailingStatusCode(true);
+ TextPage firstRequestResult = webClient.getPage(getContextPath() + "IntrospectApplication");
+ assert firstRequestResult.getContent() != null;
+ assert Double.parseDouble(firstRequestResult.getContent()) != 0;
+ // Make a second request and make sure the same context is used
+ TextPage secondRequestResult = webClient.getPage(getContextPath() + "IntrospectApplication");
+ assert secondRequestResult.getContent() != null;
+ assert Double.parseDouble(secondRequestResult.getContent()) == Double.parseDouble(firstRequestResult.getContent());
}
- @Test(groups = { "stub", "contexts", "events", "integration" })
- @SpecAssertion(section = "8.5.3", id = "i")
- public void testApplicationContextSharedBetweenAsynchronousObservers()
- {
- assert false;
- }
-
@Test(groups = { "stub", "contexts", "webservice", "integration" })
@SpecAssertion(section = "8.5.3", id = "j")
public void testApplicationContextSharedBetweenWebServices()
@@ -99,16 +86,10 @@
@SpecAssertion(section = "8.5.3", id = "k")
public void testApplicationContextSharedBetweenRemoteMethodInvokations()
{
+ //TODO Easy to implement once global naming w/EJB3.1 is available
assert false;
}
- @Test(groups = { "stub", "contexts", "ejb3", "integration" })
- @SpecAssertion(section = "8.5.3", id = "l")
- public void testApplicationContextSharedBetweenEJBTimeoutInvokations()
- {
- assert false;
- }
-
@Test(groups = { "stub", "contexts", "jms", "integration" })
@SpecAssertion(section = "8.5.3", id = "m")
public void testApplicationContextSharedBetweenMDBMessageDeliveries()
@@ -116,10 +97,11 @@
assert false;
}
- @Test(groups = { "stub", "contexts", "integration" })
+ @Test(groups = { "underInvestigation", "contexts", "integration" })
@SpecAssertion(section = "8.5.3", id = "n")
public void testApplicationScopeDestroyedWhenApplicationIsUndeployed()
{
+ //TODO How can the WB container be tested after the app is undeployed?
assert false;
}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/FilterTest.java (from rev 2242, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/FilterTest.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/FilterTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/FilterTest.java 2009-03-31 21:49:34 UTC (rev 2287)
@@ -0,0 +1,55 @@
+package org.jboss.jsr299.tck.tests.context.application;
+
+import java.io.IOException;
+
+import javax.context.ApplicationScoped;
+import javax.inject.Current;
+import javax.inject.manager.Manager;
+import javax.naming.InitialContext;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+public class FilterTest implements Filter
+{
+ @Current
+ private Manager jsr299Manager;
+
+ public void destroy()
+ {
+ jsr299Manager = null;
+ }
+
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
+ {
+ if (!jsr299Manager.getContext(ApplicationScoped.class).isActive())
+ {
+ throw new ServletException("Application context is not active");
+ }
+ else
+ {
+ chain.doFilter(request, response);
+ }
+ }
+
+ public void init(FilterConfig filterConfig) throws ServletException
+ {
+ //TODO Remove init code once injection works in servlet container
+ try
+ {
+ if (jsr299Manager == null)
+ {
+ InitialContext ic = new InitialContext();
+ jsr299Manager = (Manager) ic.lookup("java:app/Manager");
+ }
+ }
+ catch (Exception e)
+ {
+ throw new ServletException("Error looking up manager", e);
+ }
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/IntrospectApplication.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/IntrospectApplication.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/IntrospectApplication.java 2009-03-31 21:49:34 UTC (rev 2287)
@@ -0,0 +1,50 @@
+package org.jboss.jsr299.tck.tests.context.application;
+
+import java.io.IOException;
+
+import javax.inject.Current;
+import javax.inject.manager.Manager;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class IntrospectApplication extends HttpServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ @Current
+ private Manager jsr299Manager;
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+ {
+ resp.setContentType("text/text");
+ SimpleApplicationBean aBean = jsr299Manager.getInstanceByType(SimpleApplicationBean.class);
+ resp.getWriter().print(aBean.getId());
+ }
+
+ @Override
+ public void init() throws ServletException
+ {
+ //TODO Remove init code once injection works in servlet container
+ try
+ {
+ InitialContext ic = new InitialContext();
+ jsr299Manager = (Manager) ic.lookup("java:app/Manager");
+ }
+ catch (NamingException e)
+ {
+ throw new ServletException("Error looking up manager", e);
+ }
+ }
+
+ @Override
+ public void init(ServletConfig config) throws ServletException
+ {
+ init();
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/IntrospectApplication.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/SimpleApplicationBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/SimpleApplicationBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/SimpleApplicationBean.java 2009-03-31 21:49:34 UTC (rev 2287)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.context.application;
+
+import javax.context.ApplicationScoped;
+
+@ApplicationScoped
+class SimpleApplicationBean
+{
+ private double id = Math.random();
+
+ public double getId()
+ {
+ return id;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/SimpleApplicationBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/Bird.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/Bird.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/Bird.java 2009-03-31 21:49:34 UTC (rev 2287)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.context.application.ejb;
+
+import javax.ejb.Local;
+
+@Local
+public interface Bird
+{
+ public void eat();
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/Bird.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/BirdFeederService.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/BirdFeederService.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/BirdFeederService.java 2009-03-31 21:49:34 UTC (rev 2287)
@@ -0,0 +1,37 @@
+package org.jboss.jsr299.tck.tests.context.application.ejb;
+
+import javax.context.ApplicationScoped;
+import javax.ejb.Stateless;
+import javax.inject.Current;
+import javax.inject.manager.Manager;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@Stateless
+@WebService
+public class BirdFeederService implements FeederService
+{
+ @Current
+ private Manager jsr299Manager;
+
+ private static boolean applicationScopeActive = false;
+
+ @WebMethod
+ public void refillFood()
+ {
+ if (jsr299Manager.getContext(ApplicationScoped.class).isActive())
+ {
+ applicationScopeActive = true;
+ }
+ else
+ {
+ applicationScopeActive = false;
+ }
+ }
+
+ public boolean adequateFood()
+ {
+ return applicationScopeActive;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/BirdFeederService.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/CommonKingfisher.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/CommonKingfisher.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/CommonKingfisher.java 2009-03-31 21:49:34 UTC (rev 2287)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.context.application.ejb;
+
+import javax.ejb.Stateless;
+import javax.xml.ws.WebServiceRef;
+
+@Stateless
+public class CommonKingfisher implements Bird
+{
+
+ @WebServiceRef
+ private FeederService birdFeeder;
+
+ public void eat()
+ {
+ birdFeeder.refillFood();
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/CommonKingfisher.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java 2009-03-31 21:49:34 UTC (rev 2287)
@@ -0,0 +1,55 @@
+package org.jboss.jsr299.tck.tests.context.application.ejb;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.testng.annotations.Test;
+
+/**
+ * EJB and related tests with the built-in application context.
+ *
+ * @author David Allen
+ *
+ * Spec version: PRD2
+ */
+@Artifact
+@IntegrationTest
+(a)Packaging(PackagingType.EAR)
+public class EJBApplicationContextTest extends AbstractJSR299Test
+{
+ @Test(groups = { "broken", "contexts", "webservice", "integration" })
+ @SpecAssertion(section = "8.5.3", id = "c")
+ public void testApplicationScopeActiveDuringWebSericeInvocation()
+ {
+ //TODO This test might work better with a separate client over HTTP
+ FeederService birdFeeder = getCurrentManager().getInstanceByType(FeederService.class);
+ Bird bird = getCurrentManager().getInstanceByType(Bird.class);
+ bird.eat();
+ assert birdFeeder.adequateFood();
+ }
+
+ @Test(groups = { "contexts", "ejb3", "integration" })
+ @SpecAssertion(section = "8.5.3", id = "f")
+ public void testApplicationScopeActiveDuringCallToEjbTimeoutMethod() throws Exception
+ {
+ FMS flightManagementSystem = getCurrentManager().getInstanceByType(FMS.class);
+ flightManagementSystem.climb();
+ Thread.sleep(250);
+ assert flightManagementSystem.isApplicationScopeActive();
+ }
+
+ @Test(groups = { "contexts", "ejb3", "integration" })
+ @SpecAssertion(section = "8.5.3", id = "l")
+ public void testApplicationContextSharedBetweenEJBTimeoutInvokations() throws Exception
+ {
+ FMS flightManagementSystem = getCurrentManager().getInstanceByType(FMS.class);
+ flightManagementSystem.climb();
+ flightManagementSystem.descend();
+ Thread.sleep(250);
+ assert flightManagementSystem.isSameBean();
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMS.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMS.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMS.java 2009-03-31 21:49:34 UTC (rev 2287)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.context.application.ejb;
+
+import javax.ejb.Local;
+
+@Local
+public interface FMS
+{
+ public void turnLeft();
+
+ public void turnRight();
+
+ public void climb();
+
+ public void descend();
+
+ public boolean isApplicationScopeActive();
+
+ public void setApplicationScopeActive(boolean applicationScopeActive);
+
+ public boolean isSameBean();
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMS.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java 2009-03-31 21:49:34 UTC (rev 2287)
@@ -0,0 +1,82 @@
+package org.jboss.jsr299.tck.tests.context.application.ejb;
+
+import javax.annotation.Resource;
+import javax.context.ApplicationScoped;
+import javax.ejb.Stateless;
+import javax.ejb.Timeout;
+import javax.ejb.Timer;
+import javax.ejb.TimerService;
+import javax.inject.Current;
+import javax.inject.manager.Manager;
+
+@Stateless
+public class FMSModelIII implements FMS
+{
+ private static final long serialVersionUID = 1L;
+
+ @Resource
+ private TimerService timerService;
+
+ @Current
+ private Manager manager;
+
+ private static boolean applicationScopeActive = false;
+ private static double beanId = 0.0d;
+ private static boolean sameBean = false;
+
+ public void climb()
+ {
+ timerService.createTimer(200, "Climb command timeout");
+ }
+
+ public void descend()
+ {
+ timerService.createTimer(100, "Descend command timeout");
+ beanId = 0.0d;
+ sameBean = false;
+ }
+
+ public void turnLeft()
+ {
+ }
+
+ public void turnRight()
+ {
+ }
+
+ @Timeout
+ public void timeout(Timer timer)
+ {
+ if (manager.getContext(ApplicationScoped.class).isActive())
+ {
+ applicationScopeActive = true;
+ if (beanId > 0.0)
+ {
+ if (beanId == manager.getInstanceByType(SimpleApplicationBean.class).getId())
+ {
+ sameBean = true;
+ }
+ }
+ else
+ {
+ beanId = manager.getInstanceByType(SimpleApplicationBean.class).getId();
+ }
+ }
+ }
+
+ public boolean isApplicationScopeActive()
+ {
+ return applicationScopeActive;
+ }
+
+ public void setApplicationScopeActive(boolean applicationScopeActive)
+ {
+ FMSModelIII.applicationScopeActive = applicationScopeActive;
+ }
+
+ public boolean isSameBean()
+ {
+ return sameBean;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FeederService.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FeederService.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FeederService.java 2009-03-31 21:49:34 UTC (rev 2287)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.context.application.ejb;
+
+import javax.ejb.Local;
+
+@Local
+public interface FeederService
+{
+ public void refillFood();
+ public boolean adequateFood();
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FeederService.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/SimpleApplicationBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/SimpleApplicationBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/SimpleApplicationBean.java 2009-03-31 21:49:34 UTC (rev 2287)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.context.application.ejb;
+
+import javax.context.ApplicationScoped;
+
+@ApplicationScoped
+class SimpleApplicationBean
+{
+ private double id = Math.random();
+
+ public double getId()
+ {
+ return id;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/SimpleApplicationBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/ApplicationContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/ApplicationContextTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/ApplicationContextTest.java 2009-03-31 21:49:34 UTC (rev 2287)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.jsr299.tck.tests.context.application.standalone;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+/**
+ * @author David Allen
+ *
+ * Spec version: PRD2
+ *
+ */
+@Artifact
+public class ApplicationContextTest extends AbstractJSR299Test
+{
+ @Test(groups = { "contexts", "events" })
+ @SpecAssertion(section = "8.5.3", id = "d")
+ public void testApplicationScopeActiveDuringAsynchronousObserverMethodInvocation() throws Exception
+ {
+ getCurrentManager().fireEvent(new TargetEvent());
+ Thread.sleep(200);
+ assert TcasDisplay.isApplicationScopeActive();
+ }
+
+ @Test(groups = { "contexts", "events", "integration" })
+ @SpecAssertion(section = "8.5.3", id = "i")
+ public void testApplicationContextSharedBetweenAsynchronousObservers() throws Exception
+ {
+ NearMiss event = new NearMiss();
+ getCurrentManager().fireEvent(event);
+ Thread.sleep(200);
+ assert event.isSameBean();
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/ApplicationContextTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/NearMiss.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/NearMiss.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/NearMiss.java 2009-03-31 21:49:34 UTC (rev 2287)
@@ -0,0 +1,32 @@
+package org.jboss.jsr299.tck.tests.context.application.standalone;
+
+class NearMiss
+{
+ private SimpleApplicationBean bean;
+ private boolean sameBean = false;
+
+ public SimpleApplicationBean getBean()
+ {
+ return bean;
+ }
+ public void setBean(SimpleApplicationBean bean)
+ {
+ if (this.bean == null)
+ {
+ this.bean = bean;
+ }
+ else
+ {
+ sameBean = this.bean.getId() == bean.getId();
+ }
+ }
+ public boolean isSameBean()
+ {
+ return sameBean;
+ }
+ public void setSameBean(boolean sameBean)
+ {
+ this.sameBean = sameBean;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/NearMiss.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/SimpleApplicationBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/SimpleApplicationBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/SimpleApplicationBean.java 2009-03-31 21:49:34 UTC (rev 2287)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.context.application.standalone;
+
+import javax.context.ApplicationScoped;
+
+@ApplicationScoped
+class SimpleApplicationBean
+{
+ private double id = Math.random();
+
+ public double getId()
+ {
+ return id;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/SimpleApplicationBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TargetEvent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TargetEvent.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TargetEvent.java 2009-03-31 21:49:34 UTC (rev 2287)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.context.application.standalone;
+
+class TargetEvent
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TargetEvent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasDisplay.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasDisplay.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasDisplay.java 2009-03-31 21:49:34 UTC (rev 2287)
@@ -0,0 +1,38 @@
+package org.jboss.jsr299.tck.tests.context.application.standalone;
+
+import javax.context.ApplicationScoped;
+import javax.event.Asynchronously;
+import javax.event.Observes;
+import javax.inject.Current;
+import javax.inject.manager.Manager;
+
+class TcasDisplay
+{
+ @Current
+ private Manager manager;
+
+ private static boolean applicationScopeActive = false;
+
+ public void drawTarget(@Observes @Asynchronously TargetEvent targetEvent)
+ {
+ if (manager.getContext(ApplicationScoped.class).isActive())
+ {
+ applicationScopeActive = true;
+ }
+ }
+
+ public void drawNearMiss(@Observes @Asynchronously NearMiss event)
+ {
+ event.setBean(manager.getInstanceByType(SimpleApplicationBean.class));
+ }
+
+ public static boolean isApplicationScopeActive()
+ {
+ return applicationScopeActive;
+ }
+
+ public static void setApplicationScopeActive(boolean applicationScopeActive)
+ {
+ TcasDisplay.applicationScopeActive = applicationScopeActive;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasDisplay.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasToFmsLink.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasToFmsLink.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasToFmsLink.java 2009-03-31 21:49:34 UTC (rev 2287)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.context.application.standalone;
+
+import javax.event.Asynchronously;
+import javax.event.Observes;
+import javax.inject.Current;
+import javax.inject.manager.Manager;
+
+class TcasToFmsLink
+{
+ @Current
+ private Manager manager;
+
+ public void avoidanceAction(@Observes @Asynchronously NearMiss event)
+ {
+ event.setBean(manager.getInstanceByType(SimpleApplicationBean.class));
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasToFmsLink.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/application/SimplePage.html (from rev 2242, tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/session/SimplePage.html)
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/application/SimplePage.html (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/application/SimplePage.html 2009-03-31 21:49:34 UTC (rev 2287)
@@ -0,0 +1,11 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
+<head>
+</head>
+
+<body>
+</body>
+
+</html>
Modified: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/application/web.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/application/web.xml 2009-03-31 15:26:16 UTC (rev 2286)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/application/web.xml 2009-03-31 21:49:34 UTC (rev 2287)
@@ -3,6 +3,15 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<description>Test servlets used to test session contexts.</description>
<display-name>Session Context Tests</display-name>
+ <filter>
+ <display-name>Test Filter for Sessions</display-name>
+ <filter-name>filterTest</filter-name>
+ <filter-class>org.jboss.jsr299.tck.tests.context.application.FilterTest</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>filterTest</filter-name>
+ <url-pattern>/SimplePage.html</url-pattern>
+ </filter-mapping>
<listener>
<listener-class>org.jboss.testharness.impl.runner.servlet.HarnessServletListener</listener-class>
</listener>
@@ -11,10 +20,19 @@
<servlet-name>service</servlet-name>
<servlet-class>org.jboss.jsr299.tck.tests.context.application.ServiceMethodServlet</servlet-class>
</servlet>
+ <servlet>
+ <display-name>Introspection Service for Application Context</display-name>
+ <servlet-name>applicatoinIntrospector</servlet-name>
+ <servlet-class>org.jboss.jsr299.tck.tests.context.application.IntrospectApplication</servlet-class>
+ </servlet>
<servlet-mapping>
<servlet-name>service</servlet-name>
<url-pattern>/serviceMethodTest</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>applicationIntrospector</servlet-name>
+ <url-pattern>/IntrospectApplication</url-pattern>
+ </servlet-mapping>
<session-config>
<session-timeout>10</session-timeout>
</session-config>
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2286 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2 and 12 other directories.
by webbeans-commits@lists.jboss.org
Author: danielc.roth
Date: 2009-03-31 11:26:16 -0400 (Tue, 31 Mar 2009)
New Revision: 2286
Added:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/beans.xml
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/beans.xml
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/beans.xml
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/beans.xml
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/beans.xml
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/beans.xml
Log:
Fix structure
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/beans.xml
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/beans.xml 2009-03-31 11:13:25 UTC (rev 2285)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/beans.xml 2009-03-31 15:26:16 UTC (rev 2286)
@@ -1,7 +0,0 @@
-<Beans xmlns="urn:java:ee" xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken1" >
- <Deploy>
- <Standard />
- <Production />
- <test:AnotherDeploymentType />
- </Deploy>
-</Beans>
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/beans.xml
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/beans.xml 2009-03-31 11:13:25 UTC (rev 2285)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/beans.xml 2009-03-31 15:26:16 UTC (rev 2286)
@@ -1,8 +0,0 @@
-<Beans xmlns="urn:java:ee"
- xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken2" >
- <Deploy>
- <Standard />
- <Production />
- <test:AnotherDeploymentType />
- </Deploy>
-</Beans>
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/beans.xml
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/beans.xml 2009-03-31 11:13:25 UTC (rev 2285)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/beans.xml 2009-03-31 15:26:16 UTC (rev 2286)
@@ -1,8 +0,0 @@
-<Beans xmlns="urn:java:ee"
- xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken3" >
- <Deploy>
- <Standard />
- <Production />
- <test:AnotherDeploymentType />
- </Deploy>
-</Beans>
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/beans.xml
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/beans.xml 2009-03-31 11:13:25 UTC (rev 2285)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/beans.xml 2009-03-31 15:26:16 UTC (rev 2286)
@@ -1,8 +0,0 @@
-<Beans xmlns="urn:java:ee"
- xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken4" >
- <Deploy>
- <Standard />
- <Production />
- <test:AnotherDeploymentType />
- </Deploy>
-</Beans>
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/beans.xml
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/beans.xml 2009-03-31 11:13:25 UTC (rev 2285)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/beans.xml 2009-03-31 15:26:16 UTC (rev 2286)
@@ -1,8 +0,0 @@
-<Beans xmlns="urn:java:ee"
- xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken5" >
- <Deploy>
- <Standard />
- <Production />
- <test:AnotherDeploymentType />
- </Deploy>
-</Beans>
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/beans.xml 2009-03-31 15:26:16 UTC (rev 2286)
@@ -0,0 +1,7 @@
+<Beans xmlns="urn:java:ee" xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken1" >
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/beans.xml 2009-03-31 15:26:16 UTC (rev 2286)
@@ -0,0 +1,8 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken2" >
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/beans.xml 2009-03-31 15:26:16 UTC (rev 2286)
@@ -0,0 +1,8 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken3" >
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/beans.xml 2009-03-31 15:26:16 UTC (rev 2286)
@@ -0,0 +1,8 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken4" >
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/beans.xml 2009-03-31 15:26:16 UTC (rev 2286)
@@ -0,0 +1,8 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken5" >
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2285 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1.
by webbeans-commits@lists.jboss.org
Author: danielc.roth
Date: 2009-03-31 07:13:25 -0400 (Tue, 31 Mar 2009)
New Revision: 2285
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/beans.xml
Log:
Windows character
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/beans.xml
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/beans.xml 2009-03-31 09:40:48 UTC (rev 2284)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/beans.xml 2009-03-31 11:13:25 UTC (rev 2285)
@@ -1,5 +1,4 @@
-<Beans xmlns="urn:java:ee"
- xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken1" >
+<Beans xmlns="urn:java:ee" xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken1" >
<Deploy>
<Standard />
<Production />
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2284 - in ri/trunk/impl/src/main/java/org/jboss/webbeans: bootstrap and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: danielc.roth
Date: 2009-03-31 05:40:48 -0400 (Tue, 31 Mar 2009)
New Revision: 2284
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
Log:
more fixes
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-03-31 09:40:24 UTC (rev 2283)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-03-31 09:40:48 UTC (rev 2284)
@@ -101,7 +101,7 @@
{
super.initialize(environment);
checkProducerMethod();
- // initDisposalMethod();
+ initDisposalMethod(environment);
initInjectionPoints();
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-03-31 09:40:24 UTC (rev 2283)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-03-31 09:40:48 UTC (rev 2284)
@@ -8,6 +8,7 @@
import javax.event.Observes;
import javax.inject.BindingType;
import javax.inject.DeploymentType;
+import javax.inject.Disposes;
import javax.inject.Initializer;
import javax.inject.Produces;
import javax.inject.Realizes;
@@ -126,8 +127,8 @@
private void checkDisposalMethods() {
Set<DisposalMethodBean<?>> all = new HashSet<DisposalMethodBean<?>>(beanDeployerEnvironment.getAllDisposalBeans());
- Set<DisposalMethodBean<?>> resolved = new HashSet<DisposalMethodBean<?>>(beanDeployerEnvironment.getResolvedDisposalBeans());
- if(resolved.containsAll(all)) {
+ Set<DisposalMethodBean<?>> resolved = new HashSet<DisposalMethodBean<?>>(beanDeployerEnvironment.getResolvedDisposalBeans());
+ if(all.size()>0 && !resolved.containsAll(all)) {
StringBuffer buff = new StringBuffer();
buff.append("The following Disposal methods where not resolved\n");
all.removeAll(resolved);
@@ -182,7 +183,13 @@
private void createDisposalMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
{
-
+ for (AnnotatedMethod<?> method : annotatedClass.getDeclaredMethodsWithAnnotatedParameters(Disposes.class))
+ {
+ DisposalMethodBean<?> disposalBean = DisposalMethodBean.of(manager, method, declaringBean);
+ beanDeployerEnvironment.addAllDisposalBean(disposalBean);
+ manager.getResolver().addInjectionPoints(disposalBean.getInjectionPoints());
+ manager.addBean(disposalBean);
+ }
}
private <T> void createProducerMethod(AbstractClassBean<?> declaringBean, AnnotatedMethod<T> annotatedMethod)
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2283 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation: enterprise/newBean and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: danielc.roth
Date: 2009-03-31 05:40:24 -0400 (Tue, 31 Mar 2009)
New Revision: 2283
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/MultipleDisposeParametersDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/GoldenRetriever.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/GoldenRetrieverLocal.java
Log:
fixing tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/MultipleDisposeParametersDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/MultipleDisposeParametersDefinitionTest.java 2009-03-31 09:06:08 UTC (rev 2282)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/MultipleDisposeParametersDefinitionTest.java 2009-03-31 09:40:24 UTC (rev 2283)
@@ -6,6 +6,7 @@
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
/**
@@ -15,6 +16,7 @@
*/
@Artifact
@ExpectedDeploymentException(DefinitionException.class)
+@BeansXml("beans.xml")
public class MultipleDisposeParametersDefinitionTest extends AbstractJSR299Test
{
@Test
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/GoldenRetriever.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/GoldenRetriever.java 2009-03-31 09:06:08 UTC (rev 2282)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/GoldenRetriever.java 2009-03-31 09:40:24 UTC (rev 2283)
@@ -4,14 +4,13 @@
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.event.Observes;
-import javax.inject.Disposes;
@Stateful
@RequestScoped
class GoldenRetriever implements GoldenRetrieverLocal
{
@Remove
- public void bye(@Disposes Object something) {
+ public void bye(Object something) {
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/GoldenRetrieverLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/GoldenRetrieverLocal.java 2009-03-31 09:06:08 UTC (rev 2282)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/GoldenRetrieverLocal.java 2009-03-31 09:40:24 UTC (rev 2283)
@@ -6,6 +6,8 @@
public interface GoldenRetrieverLocal
{
+ public void bye(Object something);
+
public void anObserverMethod(String event);
}
\ No newline at end of file
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2282 - doc/trunk/reference/it-IT.
by webbeans-commits@lists.jboss.org
Author: nico.ben
Date: 2009-03-31 05:06:08 -0400 (Tue, 31 Mar 2009)
New Revision: 2282
Modified:
doc/trunk/reference/it-IT/environments.po
doc/trunk/reference/it-IT/part5.po
doc/trunk/reference/it-IT/producermethods.po
doc/trunk/reference/it-IT/ri-spi.po
doc/trunk/reference/it-IT/ri.po
Log:
Italian translation
Modified: doc/trunk/reference/it-IT/environments.po
===================================================================
--- doc/trunk/reference/it-IT/environments.po 2009-03-31 08:25:56 UTC (rev 2281)
+++ doc/trunk/reference/it-IT/environments.po 2009-03-31 09:06:08 UTC (rev 2282)
@@ -6,7 +6,7 @@
"Project-Id-Version: Web_Beans:_Java_Contexts_and_Dependency_Injection VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-03-28 17:09+0000\n"
-"PO-Revision-Date: 2009-03-30 21:57+0100\n"
+"PO-Revision-Date: 2009-03-31 10:37+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -17,25 +17,25 @@
#: environments.xml:4
#, no-c-format
msgid "Application Servers and environments supported by Web Beans"
-msgstr ""
+msgstr "Application Server ed ambienti supportati da Web Beans"
#. Tag: title
#: environments.xml:7
#, no-c-format
msgid "Using Web Beans with JBoss AS"
-msgstr ""
+msgstr "Usare Web Beans con JBoss AS"
#. Tag: para
#: environments.xml:9
#, no-c-format
msgid "No special configuration of your application, beyond adding either <literal>META-INF/beans.xml</literal> or <literal>WEB-INF/beans.xml</literal> is needed."
-msgstr ""
+msgstr "Non occorre alcuna configurazione speciale dell'applicazione oltre all'aggiunta di <literal>META-INF/beans.xml</literal> o <literal>WEB-INF/beans.xml</literal>."
#. Tag: para
#: environments.xml:15
#, no-c-format
msgid "If you are using JBoss AS 5.0.1.GA then you'll need to install Web Beans as an extra. First we need to tell Web Beans where JBoss is located. Edit <literal>jboss-as/build.properties</literal> and set the <literal>jboss.home</literal> property. For example:"
-msgstr ""
+msgstr "Se si usa JBoss AS 5.0.1.GA allora occorre installare Web Beans come extra. Innanzitutto occorre dire a Web Beans dove si trova JBoss. Modificare <literal>jboss-as/build.properties</literal> ed impostare la proprietà <literal>jboss.home</literal>. Per esempio:"
#. Tag: programlisting
#: environments.xml:22
@@ -47,7 +47,7 @@
#: environments.xml:24
#, no-c-format
msgid "Now we can install Web Beans:"
-msgstr ""
+msgstr "Ora installiamo Web Beans:"
#. Tag: programlisting
#: environments.xml:28
@@ -63,13 +63,13 @@
#: environments.xml:31
#, no-c-format
msgid "A new deployer, <literal>webbeans.deployer</literal> is added to JBoss AS. This adds supports for JSR-299 deployments to JBoss AS, and allows Web Beans to query the EJB3 container and discover which EJBs are installed in your application."
-msgstr ""
+msgstr "Un nuovo deploer - <literal>webbeans.deployer</literal> - viene aggiunto a JBoss AS. Questo aggiunge a JBoss AS il supporto ai deploy JSR-299, e consente a Web Beans di interrogare il container EJB3 per scoprire quali EJB sono installati nell'applicazione."
#. Tag: para
#: environments.xml:40
#, no-c-format
msgid "Web Beans is built into all releases of JBoss AS from 5.1 onwards."
-msgstr ""
+msgstr "Web Beans è incluso in tutte le release di JBoss AS da 5.1 in avanti."
#. Tag: title
#: environments.xml:47
@@ -94,19 +94,19 @@
#: environments.xml:55
#, no-c-format
msgid "Web Beans can be used in Tomcat 6.0."
-msgstr ""
+msgstr "Web Beans può essere usato in Tomcat 6.0."
#. Tag: para
#: environments.xml:58
#, no-c-format
msgid "Web Beans doesn't support deploying session beans, injection using <literal>@EJB</literal>, <literal>@Resource</literal>, or <literal>@PersistenceContext</literal> or using transactional events on Tomcat."
-msgstr ""
+msgstr "Web Beans non supporta il deploy di bean di sessione, dell'injection tramite <literal>@EJB</literal>, <literal>@Resource</literal> o <literal>@PersistenceContext</literal> o usando gli eventi transazionali su Tomcat."
#. Tag: para
#: environments.xml:66
#, no-c-format
msgid "Web Beans should be used as a web application library in Tomcat. You should place <literal>webbeans-tomcat.jar</literal> in <literal>WEB-INF/lib</literal>. <literal>webbeans-tomcat.jar</literal> is an \"uber-jar\" provided for your convenience. Instead, you could use it's component jars:"
-msgstr ""
+msgstr "Web Beans dovrebbe essere usato come libreria web application in Tomcat. Occorre mettere <literal>webbeans-tomcat.jar</literal> in <literal>WEB-INF/lib</literal>. <literal>webbeans-tomcat.jar</literal> è un \"uber-jar\" fornito per comodità. Invece si possono usare i suoi componenti jar:"
#. Tag: literal
#: environments.xml:77
@@ -160,7 +160,7 @@
#: environments.xml:117
#, no-c-format
msgid "You also need to explicitly specify the Tomcat servlet listener (used to boot Web Beans, and control it's interaction with requests) in <literal>web.xml</literal>:"
-msgstr ""
+msgstr "Occorre inoltre specificare esplicitamente il servlet listener in Tomcat (usato per avviare Web Beans, e controllare le sue interazioni con le richieste) in <literal>web.xml</literal>:"
#. Tag: programlisting
#: environments.xml:123
@@ -178,7 +178,7 @@
#: environments.xml:125
#, no-c-format
msgid "Tomcat has a read-only JNDI, so Web Beans can't automatically bind the Manager. To bind the Manager into JNDI, you should add the following to your <literal>META-INF/context.xml</literal>:"
-msgstr ""
+msgstr "Tomcat ha un JNDI read-only, e quindi Web Beans non può automaticamente associare il Manager. Per associare il Manager a JNDI occorre aggiungere a <literal>META-INF/context.xml</literal>:"
#. Tag: programlisting
#: environments.xml:131
@@ -200,7 +200,7 @@
#: environments.xml:133
#, no-c-format
msgid "and make it available to your deployment by adding this to <literal>web.xml</literal>:"
-msgstr ""
+msgstr "e renderlo disponibile nel proprio deploy aggiungendo questo a <literal>web.xml</literal>:"
#. Tag: programlisting
#: environments.xml:138
@@ -228,7 +228,7 @@
#: environments.xml:140
#, no-c-format
msgid "Tomcat doesn't only allows you to bind entries to <literal>java:comp/env</literal>, so the Manager will be available at <literal>java:comp/env/app/Manager</literal>"
-msgstr ""
+msgstr "Tomcat non consente di associare le entry a <literal>java:comp/env</literal>, e quindi il Manager sarà disponibile in <literal>java:comp/env/app/Manager</literal>"
#. Tag: title
#: environments.xml:149
Modified: doc/trunk/reference/it-IT/part5.po
===================================================================
--- doc/trunk/reference/it-IT/part5.po 2009-03-31 08:25:56 UTC (rev 2281)
+++ doc/trunk/reference/it-IT/part5.po 2009-03-31 09:06:08 UTC (rev 2282)
@@ -6,8 +6,8 @@
"Project-Id-Version: Web_Beans:_Java_Contexts_and_Dependency_Injection VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-03-28 17:09+0000\n"
-"PO-Revision-Date: 2009-03-28 17:09+0000\n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2009-03-31 10:42+0100\n"
+"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -16,23 +16,12 @@
#. Tag: para
#: part5.xml:5
#, no-c-format
-msgid ""
-"Web Beans is the reference implementation of JSR-299, and is used by JBoss "
-"AS and Glassfish to provide JSR-299 services for Java Enterprise Edition "
-"applications. Web Beans also goes beyond the environments and APIs defined "
-"by the JSR-299 specification and provides support for a number of other "
-"environments (such as a servlet container such as Tomcat, or Java SE) and "
-"additional APIs and modules (such as logging, XSD generation for the JSR-299 "
-"XML deployment descriptors)."
-msgstr ""
+msgid "Web Beans is the reference implementation of JSR-299, and is used by JBoss AS and Glassfish to provide JSR-299 services for Java Enterprise Edition applications. Web Beans also goes beyond the environments and APIs defined by the JSR-299 specification and provides support for a number of other environments (such as a servlet container such as Tomcat, or Java SE) and additional APIs and modules (such as logging, XSD generation for the JSR-299 XML deployment descriptors)."
+msgstr "Web Beans è la reference implementatio di JSR-299, ed è usata da JBoss AS e Glassfish per fornire i servizi JSR-299 per le applicazioni Java Enterprise Edition. Web Beans va oltre gli ambienti e le API definite dalla specifica JSR-299 e fornisce supporto ad un numero di altri ambienti (quali servlet container quali Tomcat o Java SE) ed API e moduli addizionali (quali il logging la generazione XSD per i descrittori di deploy XML JSR-299)."
#. Tag: para
#: part5.xml:15
#, no-c-format
-msgid ""
-"If you want to get started quickly using Web Beans with JBoss AS or Tomcat "
-"and experiment with one of the examples, take a look at <xref linkend=\"ri\"/"
-">. Otherwise read on for a exhaustive discussion of using Web Beans in all "
-"the environments and application servers it supports, as well the Web Beans "
-"extensions."
-msgstr ""
+msgid "If you want to get started quickly using Web Beans with JBoss AS or Tomcat and experiment with one of the examples, take a look at <xref linkend=\"ri\"/>. Otherwise read on for a exhaustive discussion of using Web Beans in all the environments and application servers it supports, as well the Web Beans extensions."
+msgstr "Se si vuole velocemente iniziare ad usare Web Beans con JBoss AS o Tomcat e provare con un esempio, si guardi in <xref linkend=\"ri\"/>. Altrimenti continuare a leggere la discussione esaustiva per usare Web Beans in tutti gli ambienti e gli application server che vengono supportati, così come le estensioni Web Beans."
+
Modified: doc/trunk/reference/it-IT/producermethods.po
===================================================================
--- doc/trunk/reference/it-IT/producermethods.po 2009-03-31 08:25:56 UTC (rev 2281)
+++ doc/trunk/reference/it-IT/producermethods.po 2009-03-31 09:06:08 UTC (rev 2282)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-03-28 17:09+0000\n"
-"PO-Revision-Date: 2009-03-30 22:01+0100\n"
+"PO-Revision-Date: 2009-03-31 11:05+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -35,25 +35,25 @@
#: producermethods.xml:16
#, no-c-format
msgid "A Web Beans producer method acts as a source of objects to be injected, where:"
-msgstr ""
+msgstr "Un metodo produttore Web Beans agisce come sorgente di oggetti da iniettare, dove:"
#. Tag: para
#: producermethods.xml:20
#, no-c-format
msgid "the objects to be injected are not required to be instances of Web Beans,"
-msgstr ""
+msgstr "gli oggetti da iniettare non sono richiesti come istanze di Web Beans,"
#. Tag: para
#: producermethods.xml:23
#, no-c-format
msgid "the concrete type of the objects to be injected may vary at runtime or"
-msgstr ""
+msgstr "il tipo concreto di oggetti da iniettare può variare a runtime o"
#. Tag: para
#: producermethods.xml:26
#, no-c-format
msgid "the objects require some custom initialization that is not performed by the Web Bean constructor"
-msgstr ""
+msgstr "gli oggetti richiedono alcune inizializzazioni personalizzate che non vengono eseguite da costruttore Web Bean"
#. Tag: para
#: producermethods.xml:33
@@ -65,31 +65,31 @@
#: producermethods.xml:37
#, no-c-format
msgid "expose a JPA entity as a Web Bean,"
-msgstr ""
+msgstr "espone un entity JPA come Web Bean,"
#. Tag: para
#: producermethods.xml:40
#, no-c-format
msgid "expose any JDK class as a Web Bean,"
-msgstr ""
+msgstr "espone qualsiasi classe JDK come Web Bean,"
#. Tag: para
#: producermethods.xml:43
#, no-c-format
msgid "define multiple Web Beans, with different scopes or initialization, for the same implementation class, or"
-msgstr ""
+msgstr "definisce più Web Bean con differenti scope o inizializzazioni, per la stessa classe di implementazione, o"
#. Tag: para
#: producermethods.xml:47
#, no-c-format
msgid "vary the implementation of an API type at runtime."
-msgstr ""
+msgstr "varia l'implementazione di un tipo di API a runtime."
#. Tag: para
#: producermethods.xml:51
#, no-c-format
msgid "In particular, producer methods let us use runtime polymorphism with Web Beans. As we've seen, deployment types are a powerful solution to the problem of deployment-time polymorphism. But once the system is deployed, the Web Bean implementation is fixed. A producer method has no such limitation:"
-msgstr ""
+msgstr "In particolare i metodi produttori consentono l'uso del polimorfismo a runtime con Web Beans. Come visto, i tipi di deploy sono soluzioni potenti al problema del polimorfismo a deployment-time. Ma una volta che il sistema è deployato, l'implementazione Web Bean è sistemata. Un metodo produttore non ha tali limitazioni:"
#. Tag: programlisting
#: producermethods.xml:56
@@ -137,7 +137,7 @@
#: producermethods.xml:58
#, no-c-format
msgid "Consider an injection point:"
-msgstr ""
+msgstr "Si consideri un punto di iniezione:"
#. Tag: programlisting
#: producermethods.xml:60
@@ -149,7 +149,7 @@
#: producermethods.xml:62
#, no-c-format
msgid "This injection point has the same type and binding annotations as the producer method, so it resolves to the producer method using the usual Web Beans injection rules. The producer method will be called by the Web Bean manager to obtain an instance to service this injection point."
-msgstr ""
+msgstr "Il punto di iniezione ha lo stesso tipo e le stesse annotazioni di binding del metodo produttore, e quindi risolve il metodo produttore usando le solite regole di iniezione Web Beans. Il metodo produttore verrà chiamato dal manager Web Bean per ottenere un'istanza per servire questo punto di iniezione:"
#. Tag: chapter
#: producermethods.xml:65
Modified: doc/trunk/reference/it-IT/ri-spi.po
===================================================================
--- doc/trunk/reference/it-IT/ri-spi.po 2009-03-31 08:25:56 UTC (rev 2281)
+++ doc/trunk/reference/it-IT/ri-spi.po 2009-03-31 09:06:08 UTC (rev 2282)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-03-28 17:09+0000\n"
-"PO-Revision-Date: 2009-03-30 21:47+0100\n"
+"PO-Revision-Date: 2009-03-31 10:55+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -293,17 +293,18 @@
msgid "JPA services"
msgstr "Servizi JPA"
+# rivedere la frase.
#. Tag: para
#: ri-spi.xml:100
#, no-c-format
msgid "Just as resolution of <literal>@EJB</literal> is delegated to the container, so is resolution of <literal>@PersistenceContext</literal>."
-msgstr ""
+msgstr "Solo come risoluzione di <literal>@EJB</literal> è delegata al container, e quindi è la risoluzione di <literal>@PersistenceContext</literal>."
#. Tag: para
#: ri-spi.xml:106
#, no-c-format
msgid "OPEN ISSUE: Web Beans also requires the container to provide a list of entities in the deployment, so that they aren't discovered as simple beans."
-msgstr ""
+msgstr "PROBLEMA APERTO: Web Beans richiede anche che il container fornisca una lista di entity nel deploy, cosicché non siano rilevati come semplici bean."
#. Tag: title
#: ri-spi.xml:114
@@ -431,7 +432,7 @@
#: ri-spi.xml:180
#, no-c-format
msgid "The bootstrap supports multiple environments. Different environments require different services to be present (for example servlet doesn't require transaction, EJB or JPA services). By default an EE environment is assumed, but you can adjust the environment by calling <literal>bootstrap.setEnvironment()</literal>."
-msgstr ""
+msgstr "Il bootstrap supporta più ambienti. Diversi ambienti richiedono diversi servizi presenti (per esempio servlet non richiede i servizi di transazione, EJB o JPA). Di default viene assunto un ambiente EE, ma si può impostare un ambiente chiamando <literal>bootstrap.setEnvironment()</literal>."
#. Tag: para
#: ri-spi.xml:188
Modified: doc/trunk/reference/it-IT/ri.po
===================================================================
--- doc/trunk/reference/it-IT/ri.po 2009-03-31 08:25:56 UTC (rev 2281)
+++ doc/trunk/reference/it-IT/ri.po 2009-03-31 09:06:08 UTC (rev 2282)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-03-28 17:09+0000\n"
-"PO-Revision-Date: 2009-03-30 21:48+0100\n"
+"PO-Revision-Date: 2009-03-31 10:58+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -15,27 +15,27 @@
#. Tag: title
#: ri.xml:4
-#, fuzzy, no-c-format
+#, no-c-format
msgid "Web Beans, the Reference Implementation of JSR-299"
-msgstr "Implementazione di riferimento di Web Beans"
+msgstr "Implementazione di riferimento di Web Beans JSR-299"
#. Tag: para
#: ri.xml:6
-#, fuzzy, no-c-format
+#, no-c-format
msgid "The Web Beans is being developed at <ulink url=\"http://seamframework.org/WebBeans\">the Seam project</ulink>. You can download the latest developer release of Web Beans from the <ulink url=\"http://seamframework.org/Download\">the downloads page</ulink>."
-msgstr "La Web Beans Reference Implementation viene sviluppata all'indirizzo <ulink url=\"http://seamframework.org/WebBeans\">the Seam project</ulink>. Si può scaricare l'ultima release di Web Beans dalla <ulink url=\"http://seamframework.org/Download\">pagina di download</ulink>."
+msgstr "Web Beans viene sviluppato all'indirizzo <ulink url=\"http://seamframework.org/WebBeans\">the Seam project</ulink>. Si può scaricare l'ultima release di Web Beans dalla <ulink url=\"http://seamframework.org/Download\">pagina di download</ulink>."
#. Tag: para
#: ri.xml:13
-#, fuzzy, no-c-format
+#, no-c-format
msgid "Web Beans comes with a two deployable example applications: <literal>webbeans-numberguess</literal>, a war example, containing only simple beans, and <literal>webbeans-translator</literal> an ear example, containing enterprise beans. There are also two variations on the numberguess example, the tomcat example (suitable for deployment to Tomcat) and the jsf2 example, which you can use if you are running JSF2. To run the examples you'll need the following:"
-msgstr "La Web Beans RI (Reference Implementation) viene distribuita con due applicazioni deployabili d'esempio, <literal>webbeans-numberguess</literal>, un esempio in formato war, che contiene solo bean semplici, e <literal>webbeans-translator</literal>, un esempio in formato ear, che contiene bean enterprise. Per eseguire gli esempi occorre fare le seguenti cose:"
+msgstr "Web Beans viene distribuito con due applicazioni deployabili d'esempio, <literal>webbeans-numberguess</literal>, un esempio in formato war, che contiene solo bean semplici, e <literal>webbeans-translator</literal>, un esempio in formato ear, che contiene bean enterprise. Ci sono anche due varianti dell'esempio Indovina Numero, per Tomcat e con jsf2, che può essere usato con JSF2. Per eseguire gli esempi occorre fare le seguenti cose:"
#. Tag: para
#: ri.xml:25
-#, fuzzy, no-c-format
+#, no-c-format
msgid "the latest release of Web Beans,"
-msgstr "l'ultima release di Web Beans RI,"
+msgstr "l'ultima release di Web Beans,"
#. Tag: para
#: ri.xml:28
@@ -63,9 +63,9 @@
#. Tag: para
#: ri.xml:41
-#, fuzzy, no-c-format
+#, no-c-format
msgid "You'll need to download JBoss AS 5.0.1.GA from <ulink url=\"http://www.jboss.org/jbossas/downloads/\">jboss.org</ulink>, and unzip it. For example:"
-msgstr "Attualmente, la RI di Web Beans può essere eseguita solo sull'Application Server 5 di JBoss. Occorre scaricare JBoss AS 5.0.1.GA da <ulink url=\"http://www.jboss.org/jbossas/downloads/\">jboss.org</ulink>, e scompattarlo. Per esempio:"
+msgstr "Occorre scaricare JBoss AS 5.0.1.GA da <ulink url=\"http://www.jboss.org/jbossas/downloads/\">jboss.org</ulink>, e scompattarlo. Per esempio:"
#. Tag: programlisting
#: ri.xml:47
@@ -80,9 +80,9 @@
#. Tag: para
#: ri.xml:49
#: ri.xml:170
-#, fuzzy, no-c-format
+#, no-c-format
msgid "Next, download Web Beans from <ulink url=\"http://seamframework.org/Download\">seamframework.org</ulink>, and unzip it. For example"
-msgstr "Scaricare Web Beans RI da <ulink url=\"http://seamframework.org/Download\">seamframework.org</ulink>, e scompattarla. Per esempio"
+msgstr "Scaricare Web Beans da <ulink url=\"http://seamframework.org/Download\">seamframework.org</ulink>, e scompattarlo. Per esempio"
#. Tag: programlisting
#: ri.xml:55
@@ -147,9 +147,9 @@
#. Tag: para
#: ri.xml:85
-#, fuzzy, no-c-format
+#, no-c-format
msgid "The build scripts for the examples offer a number of targets for JBoss AS, these are:"
-msgstr "Gli script di build degli esempio offrono una quantità di target, cioè:"
+msgstr "Gli script di build degli esempio offrono una quantità di target per JBoss AS, quali:"
#. Tag: para
#: ri.xml:91
@@ -224,9 +224,9 @@
#. Tag: para
#: ri.xml:143
-#, fuzzy, no-c-format
+#, no-c-format
msgid "Web Beans includes a second simple example that will translate your text into Latin. The numberguess example is a war example, and uses only simple beans; the translator example is an ear example, and includes enterprise beans, packaged in an EJB module. To try it out:"
-msgstr "La RI di Web Beans include un secondo semplice esempio che tradurrà i vostri testi in Latino. L'esempio Indovina Numero è in formato war, e usa soltanto bean semplici; l'esempio col traduttore è in formato ear, e include dei bean enterprise, assemblati in un modulo EJB. Per provarlo:"
+msgstr "Web Beans include un secondo semplice esempio che tradurrà i vostri testi in Latino. L'esempio Indovina Numero è in formato war, e usa soltanto bean semplici; l'esempio col traduttore è in formato ear, e include dei bean enterprise, assemblati in un modulo EJB. Per provarlo:"
#. Tag: programlisting
#: ri.xml:150
@@ -252,9 +252,9 @@
#. Tag: para
#: ri.xml:162
-#, fuzzy, no-c-format
+#, no-c-format
msgid "You'll need to download Tomcat 6.0.18 or later from <ulink url=\"http://tomcat.apache.org/download-60.cgi\">tomcat.apache.org</ulink>, and unzip it. For example:"
-msgstr "Scaricare Web Beans RI da <ulink url=\"http://seamframework.org/Download\">seamframework.org</ulink>, e scompattarla. Per esempio"
+msgstr "Scaricare Tomcat 6.0.18 o successivo da <ulink url=\"http://tomcat.apache.org/download-60.cgi\">tomcat.apache.org</ulink>, e scompattarlo. Per esempio"
#. Tag: programlisting
#: ri.xml:168
@@ -268,9 +268,9 @@
#. Tag: para
#: ri.xml:178
-#, fuzzy, no-c-format
+#, no-c-format
msgid "Next, we need to tell Web Beans where Tomcat is located. Edit <literal>jboss-as/build.properties</literal> and set the <literal>tomcat.home</literal> property. For example:"
-msgstr "Quindi, occorre indicare a Web Beans dove è stato installato JBoss. Modificate il file <literal>jboss-as/build.properties</literal> e valorizzate la proprietà <literal>jboss.home</literal>. Per esempio:"
+msgstr "Quindi, occorre indicare a Web Beans dove è stato installato Tomcat. Modificate il file <literal>jboss-as/build.properties</literal> e valorizzate la proprietà <literal>tomcat.home</literal>. Per esempio:"
#. Tag: programlisting
#: ri.xml:184
@@ -280,45 +280,45 @@
#. Tag: para
#: ri.xml:187
-#, fuzzy, no-c-format
+#, no-c-format
msgid "The build scripts for the examples offer a number of targets for Tomcat, these are:"
-msgstr "Gli script di build degli esempio offrono una quantità di target, cioè:"
+msgstr "Gli script di build degli esempi offrono una quantità di target per Tomcat, quali:"
#. Tag: para
#: ri.xml:193
-#, fuzzy, no-c-format
+#, no-c-format
msgid "<literal>ant tomcat.restart</literal> - deploy the example in exploded format"
-msgstr "<literal>ant restart</literal> - fa il deploy dell'esempio in formato esploso"
+msgstr "<literal>ant tomcat.restart</literal> - esegue il deploy dell'esempio in formato esploso"
#. Tag: para
#: ri.xml:199
-#, fuzzy, no-c-format
+#, no-c-format
msgid "<literal>ant tomcat.explode</literal> - update an exploded example, without restarting the deployment"
-msgstr "<literal>ant explode</literal> - aggiorna un esempio in formato esploso, senza riavviare il deploy"
+msgstr "<literal>ant tomcat.explode</literal> - aggiorna un esempio in formato esploso, senza riavviare il deploy"
#. Tag: para
#: ri.xml:205
-#, fuzzy, no-c-format
+#, no-c-format
msgid "<literal>ant tomcat.deploy</literal> - deploy the example in compressed jar format"
-msgstr "<literal>ant deploy</literal> - fa il deploy dell'esempio in formato jar compresso"
+msgstr "<literal>ant tomcat.deploy</literal> - esegue il deploy dell'esempio in formato jar compresso"
#. Tag: para
#: ri.xml:210
-#, fuzzy, no-c-format
+#, no-c-format
msgid "<literal>ant tomcat.undeploy</literal> - remove the example from the server"
-msgstr "<literal>ant undeploy</literal> - rimuove l'esempio dal server"
+msgstr "<literal>ant tomcat.undeploy</literal> - rimuove l'esempio dal server"
#. Tag: para
#: ri.xml:215
-#, fuzzy, no-c-format
+#, no-c-format
msgid "<literal>ant tomcat.clean</literal> - clean the example"
-msgstr "<literal>ant clean</literal> - ripulisce l'esempio"
+msgstr "<literal>ant tomcat.clean</literal> - ripulisce l'esempio"
#. Tag: para
#: ri.xml:222
-#, fuzzy, no-c-format
+#, no-c-format
msgid "To deploy the numberguess example for tomcat:"
-msgstr "Per fare il deploy dell'esempio Indovina Numero:"
+msgstr "Per eseguire il deploy dell'esempio Indovina Numero per tomcat:"
#. Tag: programlisting
#: ri.xml:226
@@ -904,19 +904,19 @@
#: ri.xml:433
#, no-c-format
msgid "The numberguess for Tomcat differs in a couple of ways. Firstly, Web Beans should be deployed as a Web Application library in <literal>WEB-INF/lib</literal>. For your convenience we provide a single jar suitable for running Web Beans on Tomcat <literal>webbeans-tomcat.jar</literal>."
-msgstr ""
+msgstr "L'Indovina Numero di Tomcat differisce in un paio di punti. Innanzitutto Web Beans dovrebbe essere deployato come libreria Web Application in <literal>WEB-INF/lib</literal>. Per comodità viene fornito un singolo jar <literal>webbeans-tomcat.jar</literal> adatto per Web Beans in Tomcat."
#. Tag: para
#: ri.xml:442
#, no-c-format
msgid "Of course, you must also include JSF and EL, as well common annotations (<literal>jsr250-api.jar</literal>) which a JEE server includes by default."
-msgstr ""
+msgstr "Certamente occorre anche includere JSF e EL, e le annotazioni comuni (<literal>jsr250-api.jar</literal>) che un server JEE include di default."
#. Tag: para
#: ri.xml:449
#, no-c-format
msgid "Secondly, we need to explicitly specify the Tomcat servlet listener (used to boot Web Beans, and control it's interaction with requests) in <literal>web.xml</literal>:"
-msgstr ""
+msgstr "In secondo luogo, occorre specificare esplicitamente il servlet listener di Tomcat (usato per avviare Web Beans, e controllare la sua interazione con le richieste) in <literal>web.xml</literal>:"
#. Tag: programlisting
#: ri.xml:455
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2281 - in ri/trunk/impl/src/main/java/org/jboss/webbeans: bean and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: danielc.roth
Date: 2009-03-31 04:25:56 -0400 (Tue, 31 Mar 2009)
New Revision: 2281
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
Log:
Fixing oops...
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java 2009-03-31 07:38:46 UTC (rev 2280)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java 2009-03-31 08:25:56 UTC (rev 2281)
@@ -94,28 +94,28 @@
*/
public class RootManager implements WebBeansManager, Serializable
{
-
+
private static final Log log = Logging.getLog(RootManager.class);
-
+
private static final long serialVersionUID = 3021562879133838561L;
-
+
// The JNDI key to place the manager under
public static final String JNDI_KEY = "java:app/Manager";
-
+
// The enabled deployment types from web-beans.xml
private transient List<Class<? extends Annotation>> enabledDeploymentTypes;
// The Web Beans event manager
private transient final EventManager eventManager;
-
+
// An executor service for asynchronous tasks
private transient final ExecutorService taskExecutor = Executors.newSingleThreadExecutor();
-
+
// An injection point metadata beans factory
private transient final ThreadLocal<Stack<InjectionPoint>> currentInjectionPoint;
-
+
// The bean resolver
private transient final Resolver resolver;
-
+
// The registered contexts
private transient final ContextMap contextMap;
// The client proxy pool
@@ -124,28 +124,27 @@
private transient List<Bean<?>> beans;
// The registered beans, mapped by implementation class
private transient final Map<Class<?>, EnterpriseBean<?>> newEnterpriseBeanMap;
-
+
private transient final Map<String, RIBean<?>> riBeans;
-
+
// The registered decorators
private transient final Set<Decorator> decorators;
// The registered interceptors
private transient final Set<Interceptor> interceptors;
-
+
// The EJB resolver provided by the container
private transient final ServiceRegistry simpleServiceRegistry;
-
+
private transient final EjbDescriptorCache ejbDescriptorCache;
-
+
private final transient Map<Bean<?>, Bean<?>> specializedBeans;
-
+
private final transient NonContextualInjector nonContextualInjector;
-
+
/**
* Create a new manager
*
- * @param ejbServices
- * the ejbResolver to use
+ * @param ejbServices the ejbResolver to use
*/
public RootManager(ServiceRegistry simpleServiceRegistry)
{
@@ -175,13 +174,13 @@
defaultEnabledDeploymentTypes.add(1, Production.class);
setEnabledDeploymentTypes(defaultEnabledDeploymentTypes);
}
-
+
/**
* Set up the enabled deployment types, if none are specified by the user,
* the default @Production and @Standard are used. For internal use.
*
- * @param enabledDeploymentTypes
- * The enabled deployment types from web-beans.xml
+ * @param enabledDeploymentTypes The enabled deployment types from
+ * web-beans.xml
*/
protected void checkEnabledDeploymentTypes()
{
@@ -190,7 +189,7 @@
throw new DeploymentException("@Standard must be the lowest precedence deployment type");
}
}
-
+
protected void addWebBeansDeploymentTypes()
{
if (!this.enabledDeploymentTypes.contains(WebBean.class))
@@ -198,12 +197,11 @@
this.enabledDeploymentTypes.add(1, WebBean.class);
}
}
-
+
/**
* Registers a bean with the manager
*
- * @param bean
- * The bean to register
+ * @param bean The bean to register
* @return A reference to manager
*
* @see javax.inject.manager.Manager#addBean(javax.inject.manager.Bean)
@@ -218,29 +216,31 @@
beans.add(bean);
return this;
}
-
+
/**
* Resolve the disposal method for the given producer method. For internal
* use.
*
- * @param apiType
- * The API type to match
- * @param bindings
- * The binding types to match
+ * @param apiType The API type to match
+ * @param bindings The binding types to match
* @return The set of matching disposal methods
*/
- public <T> Set<Bean<T>> resolveDisposalBeans(Class<T> apiType, Annotation... bindings)
+ public <T> Set<DisposalMethodBean<T>> resolveDisposalBeans(Class<T> apiType, Annotation... bindings)
{
- return resolveByType(apiType, bindings);
+ // Correct?
+ Set<Bean<T>> beans = resolveByType(apiType, bindings);
+ Set<DisposalMethodBean<T>> disposalBeans = new HashSet<DisposalMethodBean<T>>();
+ for (Bean<T> bean : beans)
+ if (bean instanceof DisposalMethodBean)
+ disposalBeans.add((DisposalMethodBean<T>) bean);
+ return disposalBeans;
}
-
+
/**
* Resolves observers for given event and bindings
*
- * @param event
- * The event to match
- * @param bindings
- * The binding types to match
+ * @param event The event to match
+ * @param bindings The binding types to match
* @return The set of matching observers
*
* @see javax.inject.manager.Manager#resolveObservers(java.lang.Object,
@@ -276,7 +276,7 @@
}
return eventManager.getObservers(event, bindings);
}
-
+
/**
* A strongly ordered, unmodifiable list of enabled deployment types
*
@@ -286,7 +286,7 @@
{
return Collections.unmodifiableList(enabledDeploymentTypes);
}
-
+
/**
* Set the enabled deployment types
*
@@ -298,14 +298,12 @@
checkEnabledDeploymentTypes();
addWebBeansDeploymentTypes();
}
-
+
/**
* Resolves beans by API type and binding types
*
- * @param type
- * The API type to match
- * @param bindings
- * The binding types to match
+ * @param type The API type to match
+ * @param bindings The binding types to match
* @return The set of matching beans
*
* @see javax.inject.manager.Manager#resolveByType(java.lang.Class,
@@ -315,14 +313,12 @@
{
return resolveByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
}
-
+
/**
* Resolves beans by API type literal and binding types
*
- * @param type
- * The API type literal to match
- * @param bindings
- * The binding types to match
+ * @param type The API type literal to match
+ * @param bindings The binding types to match
* @return The set of matching beans
*
* @see javax.inject.manager.Manager#resolveByType(javax.inject.TypeLiteral,
@@ -332,7 +328,7 @@
{
return resolveByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
}
-
+
public <T> Set<Bean<T>> resolveByType(AnnotatedItem<T, ?> element, InjectionPoint injectionPoint, Annotation... bindings)
{
boolean registerInjectionPoint = !injectionPoint.getType().equals(InjectionPoint.class);
@@ -352,15 +348,13 @@
}
}
}
-
+
/**
* Check the resolution request is valid, and then ask the resolver to
* perform the resolution. For internal use.
*
- * @param element
- * The item to resolve
- * @param bindings
- * The binding types to match
+ * @param element The item to resolve
+ * @param bindings The binding types to match
* @return The set of matching beans
*/
public <T> Set<Bean<T>> resolveByType(AnnotatedItem<T, ?> element, Annotation... bindings)
@@ -389,15 +383,14 @@
}
return resolver.get(element);
}
-
+
/**
* Wraps a collection of beans into a thread safe list. Since this overwrites
* any existing list of beans in the manager, this should only be done on
* startup and other controlled situations. Also maps the beans by
* implementation class. For internal use.
*
- * @param beans
- * The set of beans to add
+ * @param beans The set of beans to add
* @return A reference to the manager
*/
// TODO Build maps in the deployer :-)
@@ -417,7 +410,7 @@
resolver.clear();
}
}
-
+
/**
* Gets the class-mapped beans. For internal use.
*
@@ -427,7 +420,7 @@
{
return newEnterpriseBeanMap;
}
-
+
/**
* The beans registered with the Web Bean manager. For internal use
*
@@ -437,17 +430,16 @@
{
return Collections.unmodifiableList(beans);
}
-
+
public Map<String, RIBean<?>> getRiBeans()
{
return Collections.unmodifiableMap(riBeans);
}
-
+
/**
* Registers a context with the manager
*
- * @param context
- * The context to add
+ * @param context The context to add
* @return A reference to the manager
*
* @see javax.inject.manager.Manager#addContext(javax.context.Context)
@@ -457,12 +449,11 @@
contextMap.add(context);
return this;
}
-
+
/**
* Registers a decorator with the manager
*
- * @param decorator
- * The decorator to register
+ * @param decorator The decorator to register
* @return A reference to the manager
*
* @see javax.inject.manager.Manager#addDecorator(javax.inject.manager.Decorator)
@@ -472,12 +463,11 @@
decorators.add(decorator);
return this;
}
-
+
/**
* Registers an interceptor with the manager
*
- * @param interceptor
- * The interceptor to register
+ * @param interceptor The interceptor to register
* @return A reference to the manager
*
* @see javax.inject.manager.Manager#addInterceptor(javax.inject.manager.Interceptor)
@@ -487,16 +477,13 @@
interceptors.add(interceptor);
return this;
}
-
+
/**
* Registers an observer for a given event type and binding types
*
- * @param observer
- * The observer to register
- * @param eventType
- * The event type to match
- * @param bindings
- * The bindings to match
+ * @param observer The observer to register
+ * @param eventType The event type to match
+ * @param bindings The bindings to match
* @return A reference to the manager
*
* @see javax.inject.manager.Manager#addObserver(javax.event.Observer,
@@ -507,22 +494,19 @@
this.eventManager.addObserver(observer, eventType, bindings);
return this;
}
-
+
public <T> Manager addObserver(ObserverImpl<T> observer)
{
this.eventManager.addObserver(observer, observer.getEventType(), observer.getBindingsAsArray());
return this;
}
-
+
/**
* Registers an observer for a given event type literal and binding types
*
- * @param observer
- * The observer to register
- * @param eventType
- * The event type literal to match
- * @param bindings
- * The bindings to match
+ * @param observer The observer to register
+ * @param eventType The event type literal to match
+ * @param bindings The bindings to match
* @return A reference to the manager
*
* @see javax.inject.manager.Manager#addObserver(javax.event.Observer,
@@ -533,14 +517,12 @@
eventManager.addObserver(observer, eventType.getType(), bindings);
return this;
}
-
+
/**
* Fires an event object with given event object for given bindings
*
- * @param event
- * The event object to pass along
- * @param bindings
- * The binding types to match
+ * @param event The event object to pass along
+ * @param bindings The binding types to match
*
* @see javax.inject.manager.Manager#fireEvent(java.lang.Object,
* java.lang.annotation.Annotation[])
@@ -561,20 +543,19 @@
throw new IllegalArgumentException("Event type " + event.getClass().getName() + " cannot be fired with non-binding type " + binding.getClass().getName() + " specified");
}
}
-
+
// Get the observers for this event. Although resolveObservers is
// parameterized, this method is not, so we have to use
// Observer<Object> for observers.
Set<Observer<Object>> observers = resolveObservers(event, bindings);
eventManager.notifyObservers(observers, event);
}
-
+
/**
* Gets an active context of the given scope. Throws an exception if there
* are no active contexts found or if there are too many matches
*
- * @param scopeType
- * The scope to match
+ * @param scopeType The scope to match
* @return A single active context of the given scope
*
* @see javax.inject.manager.Manager#getContext(java.lang.Class)
@@ -599,24 +580,22 @@
}
return activeContexts.iterator().next();
}
-
+
/**
* Direct access to built in contexts. For internal use.
*
- * @param scopeType
- * The scope type of the context
+ * @param scopeType The scope type of the context
* @return The context
*/
public Context getBuiltInContext(Class<? extends Annotation> scopeType)
{
return contextMap.getBuiltInContext(scopeType);
}
-
+
/**
* Returns an instance of a bean
*
- * @param bean
- * The bean to instantiate
+ * @param bean The bean to instantiate
* @return An instance of the bean
*
* @see javax.inject.manager.Manager#getInstance(javax.inject.manager.Bean)
@@ -625,7 +604,7 @@
{
return getInstance(bean, true);
}
-
+
public <T> T getInstance(Bean<T> bean, boolean create)
{
if (create)
@@ -637,12 +616,11 @@
return getInstance(bean, null);
}
}
-
+
/**
* Returns an instance of a bean
*
- * @param bean
- * The bean to instantiate
+ * @param bean The bean to instantiate
* @return An instance of the bean
*
* @see javax.inject.manager.Manager#getInstance(javax.inject.manager.Bean)
@@ -670,17 +648,17 @@
return getContext(bean.getScopeType()).get(bean, creationalContext);
}
}
-
+
public <T> T getInstanceToInject(InjectionPoint injectionPoint)
{
return this.<T> getInstanceToInject(injectionPoint, null);
}
-
+
public void injectNonContextualInstance(Object instance)
{
nonContextualInjector.inject(instance);
}
-
+
@SuppressWarnings("unchecked")
public <T> T getInstanceToInject(InjectionPoint injectionPoint, CreationalContext<?> creationalContext)
{
@@ -718,13 +696,12 @@
}
}
}
-
+
/**
* Gets an instance by name, returning null if none is found and throwing an
* exception if too many beans match
*
- * @param name
- * The name to match
+ * @param name The name to match
* @return An instance of the bean
*
* @see javax.inject.manager.Manager#getInstanceByName(java.lang.String)
@@ -745,14 +722,12 @@
return getInstance(beans.iterator().next());
}
}
-
+
/**
* Returns an instance by API type and binding types
*
- * @param type
- * The API type to match
- * @param bindings
- * The binding types to match
+ * @param type The API type to match
+ * @param bindings The binding types to match
* @return An instance of the bean
*
* @see javax.inject.manager.Manager#getInstanceByType(java.lang.Class,
@@ -762,14 +737,12 @@
{
return getInstanceByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
}
-
+
/**
* Returns an instance by type literal and binding types
*
- * @param type
- * The type to match
- * @param bindings
- * The binding types to match
+ * @param type The type to match
+ * @param bindings The binding types to match
* @return An instance of the bean
*
* @see javax.inject.manager.Manager#getInstanceByType(javax.inject.TypeLiteral,
@@ -779,22 +752,20 @@
{
return getInstanceByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
}
-
+
/**
* Resolve an instance, verify that the resolved bean can be instantiated,
* and return
*
- * @param element
- * The annotated item to match
- * @param bindings
- * The binding types to match
+ * @param element The annotated item to match
+ * @param bindings The binding types to match
* @return An instance of the bean
*/
private <T> T getInstanceByType(AnnotatedItem<T, ?> element, Annotation... bindings)
{
return getInstance(getBeanByType(element, bindings));
}
-
+
public <T> Bean<T> getBeanByType(AnnotatedItem<T, ?> element, Annotation... bindings)
{
Set<Bean<T>> beans = resolveByType(element, bindings);
@@ -814,16 +785,13 @@
}
return bean;
}
-
+
/**
* Removes an observer
*
- * @param observer
- * The observer to remove
- * @param eventType
- * The event type to match
- * @param bindings
- * the binding types to match
+ * @param observer The observer to remove
+ * @param eventType The event type to match
+ * @param bindings the binding types to match
* @return A reference to the manager
*
* @see javax.inject.manager.Manager#removeObserver(javax.event.Observer,
@@ -834,16 +802,13 @@
this.eventManager.removeObserver(observer, eventType, bindings);
return this;
}
-
+
/**
* Removes an observer
*
- * @param observer
- * The observer to remove
- * @param eventType
- * The event type to match
- * @param bindings
- * the binding types to match
+ * @param observer The observer to remove
+ * @param eventType The event type to match
+ * @param bindings the binding types to match
* @return A reference to the manager
*
* @see javax.inject.manager.Manager#removeObserver(javax.event.Observer,
@@ -854,12 +819,11 @@
this.eventManager.removeObserver(observer, eventType.getRawType(), bindings);
return this;
}
-
+
/**
* Resolves a set of beans based on their name
*
- * @param The
- * name to match
+ * @param The name to match
* @return The set of matching beans
*
* @see javax.inject.manager.Manager#resolveByName(java.lang.String)
@@ -868,14 +832,12 @@
{
return resolver.get(name);
}
-
+
/**
* Resolves a list of decorators based on API types and binding types Os
*
- * @param types
- * The set of API types to match
- * @param bindings
- * The binding types to match
+ * @param types The set of API types to match
+ * @param bindings The binding types to match
* @return A list of matching decorators
*
* @see javax.inject.manager.Manager#resolveDecorators(java.util.Set,
@@ -885,15 +847,13 @@
{
throw new UnsupportedOperationException();
}
-
+
/**
* Resolves a list of interceptors based on interception type and interceptor
* bindings
*
- * @param type
- * The interception type to resolve
- * @param interceptorBindings
- * The binding types to match
+ * @param type The interception type to resolve
+ * @param interceptorBindings The binding types to match
* @return A list of matching interceptors
*
* @see javax.inject.manager.Manager#resolveInterceptors(javax.inject.manager.InterceptionType,
@@ -903,7 +863,7 @@
{
throw new UnsupportedOperationException();
}
-
+
/**
* Get the web bean resolver. For internal use
*
@@ -913,12 +873,12 @@
{
return resolver;
}
-
+
public EjbDescriptorCache getEjbDescriptorCache()
{
return ejbDescriptorCache;
}
-
+
/**
* Gets a string representation
*
@@ -937,27 +897,27 @@
buffer.append("Specialized beans: " + specializedBeans.size() + "\n");
return buffer.toString();
}
-
+
public Manager parse(InputStream xmlStream)
{
throw new UnsupportedOperationException();
}
-
+
public Manager createActivity()
{
return new ChildManager(this);
}
-
+
public Manager setCurrent(Class<? extends Annotation> scopeType)
{
throw new UnsupportedOperationException();
}
-
+
public ServiceRegistry getServices()
{
return simpleServiceRegistry;
}
-
+
/**
* Accesses the factory used to create each instance of InjectionPoint that
* is injected into web beans.
@@ -975,7 +935,7 @@
return null;
}
}
-
+
/**
*
* @return
@@ -985,14 +945,14 @@
// TODO make this unmodifiable after deploy!
return specializedBeans;
}
-
+
// Serialization
-
+
protected Object readResolve()
{
return CurrentManager.rootManager();
}
-
+
/**
* Provides access to the executor service used for asynchronous tasks.
*
@@ -1002,7 +962,7 @@
{
return taskExecutor;
}
-
+
public void shutdown()
{
log.trace("Ending application");
@@ -1012,7 +972,7 @@
ApplicationContext.INSTANCE.setBeanStore(null);
getServices().get(NamingContext.class).unbind(RootManager.JNDI_KEY);
}
-
+
/**
* Shuts down any executor services in the manager.
*/
@@ -1040,5 +1000,5 @@
Thread.currentThread().interrupt();
}
}
-
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-03-31 07:38:46 UTC (rev 2280)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-03-31 08:25:56 UTC (rev 2281)
@@ -162,11 +162,11 @@
*/
protected void initDisposalMethod(BeanDeployerEnvironment environment)
{
- Set<Bean<T>> disposalBeans = manager.resolveDisposalBeans(getType(), bindings.toArray(new Annotation[0]));
+ Set<DisposalMethodBean<T>> disposalBeans = manager.resolveDisposalBeans(getType(), bindings.toArray(new Annotation[0]));
if (disposalBeans.size() == 1)
{
- this.disposalMethodBean = (DisposalMethodBean<?>) disposalBeans.iterator().next();
+ this.disposalMethodBean = disposalBeans.iterator().next();
environment.addResolvedDisposalBean(disposalMethodBean);
}
else if (disposalBeans.size() > 1)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-03-31 07:38:46 UTC (rev 2280)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-03-31 08:25:56 UTC (rev 2281)
@@ -127,7 +127,7 @@
private void checkDisposalMethods() {
Set<DisposalMethodBean<?>> all = new HashSet<DisposalMethodBean<?>>(beanDeployerEnvironment.getAllDisposalBeans());
Set<DisposalMethodBean<?>> resolved = new HashSet<DisposalMethodBean<?>>(beanDeployerEnvironment.getResolvedDisposalBeans());
- if(resolved.contains(all)) {
+ if(resolved.containsAll(all)) {
StringBuffer buff = new StringBuffer();
buff.append("The following Disposal methods where not resolved\n");
all.removeAll(resolved);
15 years, 8 months
[webbeans-commits] Webbeans SVN: r2280 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation: disposal and 8 other directories.
by webbeans-commits@lists.jboss.org
Author: danielc.roth
Date: 2009-03-31 03:38:46 -0400 (Tue, 31 Mar 2009)
New Revision: 2280
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/MultipleDisposeParametersDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/Spider.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/SpiderProducer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/beans.xml
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/ProducesUnallowedDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/Spider.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/SpiderProducer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/beans.xml
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/InitializerUnallowedDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/Spider.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/SpiderProducer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/beans.xml
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/ObserverParameterUnallowedDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/Spider.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/SpiderProducer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/beans.xml
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/Cat.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/Spider.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/SpiderProducer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/UnresolvedDisposalMethodDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/beans.xml
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducer_Broken.java
Log:
Initial Disposal Method commit
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/AnotherDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/AnotherDeploymentType.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken1;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.DeploymentType;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface AnotherDeploymentType
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/MultipleDisposeParametersDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/MultipleDisposeParametersDefinitionTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/MultipleDisposeParametersDefinitionTest.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,27 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken1;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: PRD2
+ *
+ */
+@Artifact
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class MultipleDisposeParametersDefinitionTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertion(section = "3.4.8", id = "a")
+ public void testMultipleDisposeParameters()
+ {
+ assert false;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/Spider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/Spider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/Spider.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken1;
+
+
+class Spider
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/SpiderProducer_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/SpiderProducer_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/SpiderProducer_Broken.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken1;
+
+import javax.inject.Disposes;
+import javax.inject.Produces;
+
+@AnotherDeploymentType
+class SpiderProducer_Broken
+{
+
+ @Produces
+ public static Spider getSpider()
+ {
+ return new Spider();
+ }
+
+ public static void destorySpider(@Disposes Spider spider, @Disposes Spider another)
+ {
+
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/beans.xml
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/beans.xml 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,8 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken1" >
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/AnotherDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/AnotherDeploymentType.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken2;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.DeploymentType;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface AnotherDeploymentType
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/ProducesUnallowedDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/ProducesUnallowedDefinitionTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/ProducesUnallowedDefinitionTest.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,27 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken2;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: PRD2
+ *
+ */
+@Artifact
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class ProducesUnallowedDefinitionTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertion(section = "3.4.8", id = "b")
+ public void testProducesUnallowed()
+ {
+ assert false;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/Spider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/Spider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/Spider.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken2;
+
+
+class Spider
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/SpiderProducer_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/SpiderProducer_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/SpiderProducer_Broken.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken2;
+
+import javax.inject.Disposes;
+import javax.inject.Produces;
+
+@AnotherDeploymentType
+class SpiderProducer_Broken
+{
+
+ @Produces
+ public static Spider getSpider()
+ {
+ return new Spider();
+ }
+
+ @Produces
+ public static void destorySpider(@Disposes Spider spider)
+ {
+
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/beans.xml
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/beans.xml 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,8 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken2" >
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/AnotherDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/AnotherDeploymentType.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken3;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.DeploymentType;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface AnotherDeploymentType
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/InitializerUnallowedDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/InitializerUnallowedDefinitionTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/InitializerUnallowedDefinitionTest.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,29 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken3;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: PRD2
+ *
+ */
+@Artifact
+(a)ExpectedDeploymentException(DefinitionException.class)
+@BeansXml("beans.xml")
+public class InitializerUnallowedDefinitionTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertion(section = "3.4.8", id = "c")
+ public void testInitializerUnallowed()
+ {
+ assert false;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/Spider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/Spider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/Spider.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken3;
+
+
+class Spider
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/SpiderProducer_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/SpiderProducer_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/SpiderProducer_Broken.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,23 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken3;
+
+import javax.inject.Disposes;
+import javax.inject.Initializer;
+import javax.inject.Produces;
+
+@AnotherDeploymentType
+class SpiderProducer_Broken
+{
+
+ @Produces
+ public static Spider getSpider()
+ {
+ return new Spider();
+ }
+
+ @Initializer
+ public static void destorySpider(@Disposes Spider spider)
+ {
+
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/beans.xml
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/beans.xml 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,8 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken3" >
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/AnotherDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/AnotherDeploymentType.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken4;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.DeploymentType;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface AnotherDeploymentType
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/ObserverParameterUnallowedDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/ObserverParameterUnallowedDefinitionTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/ObserverParameterUnallowedDefinitionTest.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,29 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken4;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: PRD2
+ *
+ */
+@Artifact
+(a)ExpectedDeploymentException(DefinitionException.class)
+@BeansXml("beans.xml")
+public class ObserverParameterUnallowedDefinitionTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertion(section = "3.4.8", id = "d")
+ public void testObserverParameterUnallowed()
+ {
+ assert false;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/Spider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/Spider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/Spider.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken4;
+
+
+class Spider
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/SpiderProducer_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/SpiderProducer_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/SpiderProducer_Broken.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken4;
+
+import javax.event.Observes;
+import javax.inject.Disposes;
+import javax.inject.Produces;
+
+@AnotherDeploymentType
+class SpiderProducer_Broken
+{
+
+ @Produces
+ public static Spider getSpider()
+ {
+ return new Spider();
+ }
+
+ public static void destorySpider(@Disposes @Observes Spider spider)
+ {
+
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/beans.xml
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/beans.xml 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,8 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken4" >
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/AnotherDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/AnotherDeploymentType.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken5;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.DeploymentType;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface AnotherDeploymentType
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/Cat.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/Cat.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/Cat.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken5;
+
+
+class Cat
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/Spider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/Spider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/Spider.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken5;
+
+
+class Spider
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/SpiderProducer_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/SpiderProducer_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/SpiderProducer_Broken.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,27 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken5;
+
+import javax.inject.Disposes;
+import javax.inject.Produces;
+
+@AnotherDeploymentType
+class SpiderProducer_Broken
+{
+
+ @Produces
+ public static Spider getSpider()
+ {
+ return new Spider();
+ }
+
+ public static void destorySpider(@Disposes Spider spider)
+ {
+
+ }
+
+ public static void destorySpider2(@Disposes Cat cat)
+ {
+
+ }
+
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/UnresolvedDisposalMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/UnresolvedDisposalMethodDefinitionTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/UnresolvedDisposalMethodDefinitionTest.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,29 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken5;
+
+import javax.inject.UnsatisfiedDependencyException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: PRD2
+ *
+ */
+@Artifact
+(a)ExpectedDeploymentException(UnsatisfiedDependencyException.class)
+@BeansXml("beans.xml")
+public class UnresolvedDisposalMethodDefinitionTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertion(section = "3.4.7", id = "a")
+ public void testUnresolvedDisposalMethod()
+ {
+ assert false;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/beans.xml
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/beans.xml 2009-03-31 07:38:46 UTC (rev 2280)
@@ -0,0 +1,8 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken5" >
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-03-31 07:38:18 UTC (rev 2279)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -1,153 +1,45 @@
-package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
-
-import javax.context.CreationalContext;
-import javax.inject.AnnotationLiteral;
-import javax.inject.CreationException;
-import javax.inject.IllegalProductException;
-import javax.inject.manager.Bean;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.hibernate.tck.annotations.SpecAssertions;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
-import org.testng.annotations.Test;
-
-/**
- *
- * Spec version: PRD2
- *
- */
-@Artifact
-@BeansXml("beans.xml")
-public class ProducerMethodLifecycleTest extends AbstractJSR299Test
-{
-
- @Test(groups = { "producerMethod" })
- @SpecAssertions({
- @SpecAssertion(section = "3.4", id = "c"),
- @SpecAssertion(section = "3.4", id = "k"),
- @SpecAssertion(section = "3.4.2", id = "a"),
- @SpecAssertion(section = "6", id = "b"),
- @SpecAssertion(section = "6.7", id = "e")
- })
- public void testProducerMethodBeanCreate() throws Exception
- {
- Tarantula tarantula = getCurrentManager().getInstanceByType(Tarantula.class);
- assert tarantula != null : "Producer method did not produce product";
- assert tarantula.getValue().equals("Pete") : "Producer method not used to create Tarantula";
- }
-
- @Test(groups = { "producerMethod", "disposalMethod", "ri-broken" })
- @SpecAssertions({
- @SpecAssertion(section = "6", id = "f")
- })
- public void testProducerMethodBeanDestroy() throws Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- SpiderProducer.setTarantulaDestroyed(false);
- Tarantula tarantula = getCurrentManager().getInstanceByType(Tarantula.class);
- Bean<Tarantula> tarantulaBean = getCurrentManager().resolveByType(Tarantula.class).iterator().next();
- tarantulaBean.destroy(tarantula);
- assert SpiderProducer.isTarantulaDestroyed();
- }
-
- }.run();
- }
-
- @Test(groups = { "specialization" })
- @SpecAssertions({
- @SpecAssertion(section = "6.7", id = "g"),
- @SpecAssertion(section = "4.3.2", id = "c")
- })
- public void testSpecializedBeanAlwaysUsed() throws Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- Egg egg = getCurrentManager().getInstanceByType(Egg.class);
- assert egg != null;
- assert egg.equals(AndalusianChicken.egg);
- }
-
- }.run();
- }
-
- @Test(groups = { "stub", "disposalMethod", "beanLifecycle" })
- @SpecAssertion(section = "6.7", id = "m")
- public void testDisposalMethodCalled()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups = { "producerMethod" })
- @SpecAssertions({
- @SpecAssertion(section = "3.4", id = "e"),
- @SpecAssertion(section = "6.7", id = "k")
- })
- public void testProducerMethodReturnsNullIsDependent() throws Exception
- {
- Bean<Spider> spiderBean = getCurrentManager().resolveByType(Spider.class, new AnnotationLiteral<Null>() {}).iterator().next();
- CreationalContext<Spider> creationalContext = new MockCreationalContext<Spider>();
- assert spiderBean.create(creationalContext) == null;
- }
-
- @Test(groups = "producerMethod", expectedExceptions = IllegalProductException.class)
- @SpecAssertions({
- @SpecAssertion(section = "3.4", id = "f"),
- @SpecAssertion(section = "6.7", id = "l")
- })
- public void testProducerMethodReturnsNullIsNotDependent() throws Exception
- {
- assert getCurrentManager().resolveByType(Spider.class, new AnnotationLiteral<Request>() {}).size() == 1;
- Bean<Spider> spider = getCurrentManager().resolveByType(Spider.class, new AnnotationLiteral<Request>() {}).iterator().next();
- // Do the create ourselves, otherwise we may get a proxy back...
- spider.create(new CreationalContext<Spider>() {
-
- public void push(Spider incompleteInstance)
- {
- // TODO Auto-generated method stub
-
- }});
- }
-
- @Test(expectedExceptions = CreationException.class)
- @SpecAssertion(section="6.2", id="h")
- public void testCreationExceptionWrapsCheckedExceptionThrownFromCreate() throws Exception
- {
- new RunInDependentContext()
- {
-
- protected void execute() throws Exception
- {
- getCurrentManager().getInstanceByType(Lorry.class);
- }
-
- }.run();
- }
-
- @Test(expectedExceptions = FooException.class)
- @SpecAssertion(section="6.2", id="g")
- public void testUncheckedExceptionThrownFromCreateNotWrapped() throws Exception
- {
- new RunInDependentContext()
- {
-
- protected void execute() throws Exception
- {
- getCurrentManager().getInstanceByType(Ship.class);
- }
-
- }.run();
- }
-
-}
+package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
+
+import javax.inject.manager.Bean;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: PRD2
+ *
+ */
+@Artifact
+@BeansXml("beans.xml")
+public class ProducerMethodLifecycleTest extends AbstractJSR299Test
+{
+
+ @Test(groups = { "producerMethod", "disposalMethod", "ri-broken" })
+ @SpecAssertions({
+ @SpecAssertion(section = "6", id = "f")
+ })
+ public void testProducerMethodBeanDestroy() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ SpiderProducer.setTarantulaDestroyed(false);
+ Tarantula tarantula = getCurrentManager().getInstanceByType(Tarantula.class);
+ Bean<Tarantula> tarantulaBean = getCurrentManager().resolveByType(Tarantula.class).iterator().next();
+ tarantulaBean.destroy(tarantula);
+ assert SpiderProducer.isTarantulaDestroyed();
+ }
+
+ }.run();
+ }
+
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducer.java 2009-03-31 07:38:18 UTC (rev 2279)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducer.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -1,35 +1,35 @@
-package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
-
-import javax.inject.Disposes;
-import javax.inject.Produces;
-
-@AnotherDeploymentType
-class SpiderProducer
-{
- private static boolean tarantulaDestroyed;
-
- @Produces public Tarantula produceTarantula()
- {
- return new Tarantula("Pete");
- }
-
- @Produces @Null public Spider getNullSpider()
- {
- return null;
- }
-
- public void destroyTarantula(@Disposes Tarantula spider)
- {
- tarantulaDestroyed = true;
- }
-
- public static boolean isTarantulaDestroyed()
- {
- return tarantulaDestroyed;
- }
-
- public static void setTarantulaDestroyed(boolean tarantulaDestroyed)
- {
- SpiderProducer.tarantulaDestroyed = tarantulaDestroyed;
- }
-}
+package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
+
+import javax.inject.Disposes;
+import javax.inject.Produces;
+
+@AnotherDeploymentType
+class SpiderProducer
+{
+ private static boolean tarantulaDestroyed;
+
+ @Produces public Tarantula produceTarantula()
+ {
+ return new Tarantula("Pete");
+ }
+
+ @Produces @Null public Spider getNullSpider()
+ {
+ return null;
+ }
+
+ public static void destroyTarantula(@Disposes Tarantula spider)
+ {
+ tarantulaDestroyed = true;
+ }
+
+ public static boolean isTarantulaDestroyed()
+ {
+ return tarantulaDestroyed;
+ }
+
+ public static void setTarantulaDestroyed(boolean tarantulaDestroyed)
+ {
+ SpiderProducer.tarantulaDestroyed = tarantulaDestroyed;
+ }
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducer_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducer_Broken.java 2009-03-31 07:38:18 UTC (rev 2279)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducer_Broken.java 2009-03-31 07:38:46 UTC (rev 2280)
@@ -1,15 +1,18 @@
-package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
-
-import javax.context.RequestScoped;
-import javax.inject.Produces;
-
-@AnotherDeploymentType
-class SpiderProducer_Broken
-{
-
- @Produces @RequestScoped @Request public Spider getRequestScopedSpider()
- {
- return null;
- }
-
-}
+package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
+
+import javax.context.RequestScoped;
+import javax.inject.Produces;
+
+@AnotherDeploymentType
+class SpiderProducer_Broken
+{
+
+ @Produces
+ @RequestScoped
+ @Request
+ public Spider getRequestScopedSpider()
+ {
+ return null;
+ }
+
+}
15 years, 8 months