[webbeans-commits] Webbeans SVN: r3390 - ri/trunk/api/src/main/java/javax/enterprise/inject/spi and 61 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Sun Aug 2 05:48:12 EDT 2009
Author: pete.muir at jboss.org
Date: 2009-08-02 05:48:11 -0400 (Sun, 02 Aug 2009)
New Revision: 3390
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Random.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/CatProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/DisabledEjbInterface.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EjbInterface.java
Removed:
ri/trunk/api/src/main/java/javax/enterprise/inject/deployment/
ri/trunk/impl/src/main/java/org/jboss/webbeans/WebBean.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Mock.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/AnotherDeploymentType.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/XmlBootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/Order.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/TestBean.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/annotationtype/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/deploy/
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/bootstrap/
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/deploy/
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/parser/schema/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/NonBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EjbRemote.java
Modified:
ri/trunk/api/src/main/java/javax/enterprise/inject/Policy.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Bean.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractReceiverBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewEnterpriseBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewSimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/JavaSEConversationTerminator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/NumericConversationIdGenerator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ServletConversationManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/MergedStereotypes.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/StereotypeModel.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/NameBasedResolver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/TypeSafeBeanResolver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/HttpSessionManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/BeansXmlParser.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/MockSentenceTranslator.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/ActivitiesTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/child/SameBeanTypeInChildActivityTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/current/ELCurrentActivityTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/current/InstanceCurrentActivityTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Elephant.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Panther.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Tiger.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Elephant.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Panther.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Salmon.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/SeaBass.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Sole.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Tiger.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Salmon.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/SeaBass.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Sole.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/Order.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/StereotypesTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/Salmon.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/SeaBass.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/Sole.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Order.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/examples/beans.xml
tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Managers.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MyContextual.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Television.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Violation.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CatBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Cat.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Cod.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Order.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/OrderProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/name/Haddock.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/name/SeaBass.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/Order.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/SeaBass.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Order.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/Chicken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/parameterAnnotatedObserves/DangerCall.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/SpiderStereotype.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/SpiderStereotype.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterAnnotatedDisposes/SpiderProducer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterAnnotatedObserves/SpiderProducer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/NonBeanWithStaticProducerMethod.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Cow_NotBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Donkey.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/MockEntity.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/OuterClass.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Sheep.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Turkey.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/tooManyInitializerAnnotatedConstructors/Goose_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Duck.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Goldfish.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/TunaFarm.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Order.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/ResolutionByNameTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/TunaFarm.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/NoClassWithSpecifiedNameTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/stereotype/NoAnnotationWithSpecifiedNameTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/ClassIsNotPolicyTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/stereotype/ClassIsNotPolicyTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/SameTypeListedTwiceTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EnabledEjb.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/NotEnabledEjb.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/SessionBeanPolicyTest.java
Log:
WBRi-306, policy support, and remove remaining deployment types
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/Policy.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/Policy.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/Policy.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -17,6 +17,8 @@
package javax.enterprise.inject;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@@ -31,7 +33,7 @@
* @author Pete Muir
*/
- at Target(TYPE)
+ at Target({TYPE, METHOD, FIELD})
@Retention(RUNTIME)
@Documented
public @interface Policy
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Bean.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Bean.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Bean.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -48,14 +48,6 @@
public Class<? extends Annotation> getScopeType();
/**
- * The deployment type of a bean
- * @deprecated
- *
- * @return the deployment type
- */
- public Class<? extends Annotation> getDeploymentType();
-
- /**
* The name of a bean
*
* @return the name
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -28,7 +28,6 @@
import javax.enterprise.context.spi.Context;
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.event.Observer;
import javax.enterprise.inject.AmbiguousResolutionException;
import javax.enterprise.inject.UnsatisfiedResolutionException;
@@ -302,14 +301,6 @@
public void addBean(Bean<?> bean);
/**
- * Exposes the list of enabled deployment types, in order of lower to higher
- * precedence, This method may be used by portable extensions to discover
- * information about the deployment.
- */
- @Deprecated
- public List<Class<? extends Annotation>> getEnabledDeploymentTypes();
-
- /**
* Associate a custom Context with a scope.
*
* This method may be called at any time in the applications lifecycle.
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -26,16 +26,13 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
-import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.SortedSet;
import java.util.Stack;
-import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;
@@ -52,11 +49,8 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.AmbiguousResolutionException;
import javax.enterprise.inject.BindingType;
-import javax.enterprise.inject.InjectionException;
import javax.enterprise.inject.UnproxyableResolutionException;
import javax.enterprise.inject.UnsatisfiedResolutionException;
-import javax.enterprise.inject.deployment.Production;
-import javax.enterprise.inject.deployment.Standard;
import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.Decorator;
@@ -207,7 +201,8 @@
* archive accessibility, and the configuration for this bean deployment
* archive
*/
- private transient List<Class<? extends Annotation>> enabledDeploymentTypes;
+ private transient Collection<Class<?>> enabledPolicyClasses;
+ private transient Collection<Class<? extends Annotation>> enabledPolicyStereotypes;
private transient List<Class<?>> enabledDecoratorClasses;
private transient List<Class<?>> enabledInterceptorClasses;
private transient final Set<CurrentActivity> currentActivities;
@@ -221,7 +216,7 @@
* structures that are transitive accessible from other bean deployment
* archives
*/
- private transient final TypeSafeResolver<Bean<?>> beanResolver;
+ private transient final TypeSafeBeanResolver<Bean<?>> beanResolver;
private transient final TypeSafeResolver<DecoratorBean<?>> decoratorResolver;
private transient final TypeSafeResolver<ObserverMethod<?,?>> observerResolver;
private transient final NameBasedResolver nameBasedResolver;
@@ -269,13 +264,7 @@
* @return
*/
public static BeanManagerImpl newRootManager(ServiceRegistry serviceRegistry)
- {
- List<Class<? extends Annotation>> defaultEnabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
- defaultEnabledDeploymentTypes.add(0, Standard.class);
- defaultEnabledDeploymentTypes.add(1, Production.class);
-
- List<Class<?>> defaultEnabledDecoratorClasses = new ArrayList<Class<?>>();
-
+ {
ListMultimap<Class<? extends Annotation>, Context> contexts = Multimaps.newListMultimap(new ConcurrentHashMap<Class<? extends Annotation>, Collection<Context>>(), new Supplier<List<Context>>()
{
@@ -297,7 +286,10 @@
new ClientProxyProvider(),
contexts,
new CopyOnWriteArraySet<CurrentActivity>(),
- new HashMap<Contextual<?>, Contextual<?>>(), defaultEnabledDeploymentTypes, defaultEnabledDecoratorClasses,
+ new HashMap<Contextual<?>, Contextual<?>>(),
+ new ArrayList<Class<?>>(),
+ new ArrayList<Class<? extends Annotation>>(),
+ new ArrayList<Class<?>>(),
new AtomicInteger());
}
@@ -328,8 +320,9 @@
parentManager.getClientProxyProvider(),
parentManager.getContexts(),
parentManager.getCurrentActivities(),
- parentManager.getSpecializedBeans(),
- parentManager.getEnabledDeploymentTypes(),
+ parentManager.getSpecializedBeans(),
+ parentManager.getEnabledPolicyClasses(),
+ parentManager.getEnabledPolicyStereotypes(),
parentManager.getEnabledDecoratorClasses(),
parentManager.getIds());
}
@@ -352,7 +345,8 @@
ListMultimap<Class<? extends Annotation>, Context> contexts,
Set<CurrentActivity> currentActivities,
Map<Contextual<?>, Contextual<?>> specializedBeans,
- List<Class<? extends Annotation>> enabledDeploymentTypes,
+ Collection<Class<?>> enabledPolicyClasses,
+ Collection<Class<? extends Annotation>> enabledPolicyStereotypes,
List<Class<?>> enabledDecoratorClasses,
AtomicInteger ids)
{
@@ -366,7 +360,8 @@
this.currentActivities = currentActivities;
this.specializedBeans = specializedBeans;
this.observers = observers;
- setEnabledDeploymentTypes(enabledDeploymentTypes);
+ this.enabledPolicyClasses = enabledPolicyClasses;
+ this.enabledPolicyStereotypes = enabledPolicyStereotypes;
setEnabledDecoratorClasses(enabledDecoratorClasses);
this.namespaces = namespaces;
this.ids = ids;
@@ -498,29 +493,6 @@
return accessibleManagers;
}
- /**
- * 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
- */
- protected void checkEnabledDeploymentTypes()
- {
- if (!this.enabledDeploymentTypes.get(0).equals(Standard.class))
- {
- throw new InjectionException("@Standard must be the lowest precedence deployment type");
- }
- }
-
- protected void addWebBeansDeploymentTypes()
- {
- if (!this.enabledDeploymentTypes.contains(WebBean.class))
- {
- this.enabledDeploymentTypes.add(1, WebBean.class);
- }
- }
-
public void addBean(Bean<?> bean)
{
if (beans.contains(bean))
@@ -615,14 +587,21 @@
}
/**
- * A strongly ordered, unmodifiable list of enabled deployment types
+ * A collection of enabled policy classes
*
- * @return The ordered enabled deployment types known to the manager
*/
- public List<Class<? extends Annotation>> getEnabledDeploymentTypes()
+ public Collection<Class<?>> getEnabledPolicyClasses()
{
- return Collections.unmodifiableList(enabledDeploymentTypes);
+ return Collections.unmodifiableCollection(enabledPolicyClasses);
}
+
+ /**
+ * @return the enabledPolicySterotypes
+ */
+ public Collection<Class<? extends Annotation>> getEnabledPolicyStereotypes()
+ {
+ return Collections.unmodifiableCollection(enabledPolicyStereotypes);
+ }
/**
* @return the enabledDecoratorClasses
@@ -640,18 +619,16 @@
return Collections.unmodifiableList(enabledInterceptorClasses);
}
- /**
- * Set the enabled deployment types
- *
- * @param enabledDeploymentTypes
- */
- public void setEnabledDeploymentTypes(List<Class<? extends Annotation>> enabledDeploymentTypes)
+ public void setEnabledPolicyClasses(Collection<Class<?>> enabledPolicyClasses)
{
- this.enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>(enabledDeploymentTypes);
- checkEnabledDeploymentTypes();
- addWebBeansDeploymentTypes();
+ this.enabledPolicyClasses = enabledPolicyClasses;
}
+ public void setEnabledPolicyStereotypes(Collection<Class<? extends Annotation>> enabledPolicySterotypes)
+ {
+ this.enabledPolicyStereotypes = enabledPolicySterotypes;
+ }
+
public void setEnabledDecoratorClasses(List<Class<?>> enabledDecoratorClasses)
{
this.enabledDecoratorClasses = enabledDecoratorClasses;
@@ -962,16 +939,12 @@
public <T> Bean<T> getBean(WBAnnotated<T, ?> element, Annotation... bindings)
{
- Set<Bean<?>> beans = getBeans(element, bindings);
- if (beans.size() == 0)
+ Bean<T> bean = (Bean<T>) resolve(getBeans(element, bindings));
+ if (bean == null)
{
throw new UnsatisfiedResolutionException(element + "Unable to resolve any Web Beans");
}
- else if (beans.size() > 1)
- {
- throw new AmbiguousResolutionException(element + "Resolved multiple Web Beans");
- }
- Bean<T> bean = (Bean<T>) beans.iterator().next();
+
boolean normalScoped = getServices().get(MetaAnnotationStore.class).getScopeModel(bean.getScopeType()).isNormal();
if (normalScoped && !Beans.isBeanProxyable(bean))
{
@@ -1028,7 +1001,7 @@
*
* @return The resolver
*/
- public TypeSafeResolver getBeanResolver()
+ public TypeSafeBeanResolver<Bean<?>> getBeanResolver()
{
return beanResolver;
}
@@ -1043,7 +1016,7 @@
{
StringBuilder buffer = new StringBuilder();
buffer.append("Manager\n");
- buffer.append("Enabled deployment types: " + getEnabledDeploymentTypes() + "\n");
+ buffer.append("Enabled policies: " + getEnabledPolicyClasses() + " " + getEnabledPolicyStereotypes() + "\n");
buffer.append("Registered contexts: " + contexts.keySet() + "\n");
buffer.append("Registered beans: " + getBeans().size() + "\n");
buffer.append("Specialized beans: " + specializedBeans.size() + "\n");
@@ -1340,34 +1313,19 @@
public <X> Bean<? extends X> resolve(Set<Bean<? extends X>> beans)
{
- if (beans.size() == 1)
+ Set<Bean<? extends X>> resolvedBeans = beanResolver.resolve(beans);
+ if (resolvedBeans.size() == 0)
{
- return beans.iterator().next();
+ return null;
}
- else if (beans.isEmpty())
+ if (resolvedBeans.size() == 1)
{
- return null;
+ return resolvedBeans.iterator().next();
}
-
- // make a copy so that the sort is stable with respect to new deployment types added through the SPI
- // TODO This code needs to be in Resolver
- // TODO This needs caching
- final List<Class<? extends Annotation>> enabledDeploymentTypes = getEnabledDeploymentTypes();
-
- SortedSet<Bean<? extends X>> sortedBeans = new TreeSet<Bean<? extends X>>(new Comparator<Bean<? extends X>>()
+ else
{
- public int compare(Bean<? extends X> o1, Bean<? extends X> o2)
- {
- int diff = enabledDeploymentTypes.indexOf(o1) - enabledDeploymentTypes.indexOf(o2);
- if (diff == 0)
- {
- throw new AmbiguousResolutionException();
- }
- return diff;
- }
- });
- sortedBeans.addAll(beans);
- return sortedBeans.last();
+ throw new AmbiguousResolutionException("Cannot resolve an ambiguous dependency between " + beans);
+ }
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -31,6 +31,7 @@
import javax.enterprise.inject.IllegalProductException;
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.New;
+import javax.enterprise.inject.Policy;
import javax.enterprise.inject.UnproxyableResolutionException;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.Decorator;
@@ -157,7 +158,7 @@
checkFacadeInjectionPoint(ij, Event.class);
Annotation[] bindings = ij.getBindings().toArray(new Annotation[0]);
WBAnnotated<?, ?> annotatedItem = ResolvableWBClass.of(ij.getType(), bindings, beanManager);
- Set<?> resolvedBeans = beanManager.getInjectableBeans(ij);
+ Set<?> resolvedBeans = beanManager.getBeanResolver().resolve(beanManager.getInjectableBeans(ij));
if (resolvedBeans.isEmpty())
{
throw new DeploymentException("The injection point " + ij + " with binding types " + Names.annotationsToString(ij.getBindings()) + " in " + ij.getBean() + " has unsatisfied dependencies with binding types ");
@@ -200,6 +201,7 @@
}
}
validateEnabledDecoratorClasses(manager);
+ validateEnabledPolicies(manager);
validateDisposalMethods(environment);
}
@@ -221,6 +223,35 @@
}
}
+ private void validateEnabledPolicies(BeanManagerImpl beanManager)
+ {
+ List<Class<?>> seenPolicies = new ArrayList<Class<?>>();
+ for (Class<? extends Annotation> stereotype : beanManager.getEnabledPolicyStereotypes())
+ {
+ if (!stereotype.isAnnotationPresent(Policy.class))
+ {
+ throw new DeploymentException("Enabled policy sterotype " + stereotype + " is not annotated @Policy");
+ }
+ if (seenPolicies.contains(stereotype))
+ {
+ throw new DeploymentException("Cannot enable the same policy sterotype " + stereotype + " in beans.xml");
+ }
+ seenPolicies.add(stereotype);
+ }
+ for (Class<?> clazz : beanManager.getEnabledPolicyClasses())
+ {
+ if (!clazz.isAnnotationPresent(Policy.class))
+ {
+ throw new DeploymentException("Enabled policy bean class " + clazz + " is not annotated @Policy");
+ }
+ if (seenPolicies.contains(clazz))
+ {
+ throw new DeploymentException("Cannot enable the same policy bean class " + clazz + " in beans.xml");
+ }
+ seenPolicies.add(clazz);
+ }
+ }
+
private void validateDisposalMethods(BeanDeployerEnvironment environment)
{
Set<DisposalMethodBean<?>> beans = environment.getUnresolvedDisposalBeans();
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/WebBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/WebBean.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/WebBean.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,42 +0,0 @@
-/*
- * 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.webbeans;
-
-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.enterprise.inject.deployment.DeploymentType;
-
-/**
- * Deployment type for Web Beans beans
- *
- * @author Pete Muir
- *
- */
- at Target( { TYPE, METHOD })
- at Retention(RUNTIME)
- at Documented
- at DeploymentType
-public @interface WebBean
-{
-
-}
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-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -29,8 +29,8 @@
import javax.enterprise.event.Event;
import javax.enterprise.inject.BindingType;
import javax.enterprise.inject.Named;
+import javax.enterprise.inject.Policy;
import javax.enterprise.inject.Specializes;
-import javax.enterprise.inject.deployment.Standard;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.stereotype.Stereotype;
@@ -98,8 +98,8 @@
protected Class<? extends Annotation> scopeType;
// The merged stereotypes
private MergedStereotypes<T, E> mergedStereotypes;
- // The deployment type
- protected Class<? extends Annotation> deploymentType;
+ // Is it a policy, either defined by stereotypes or directly?
+ private boolean policy;
// The type
protected Class<T> type;
// The API types
@@ -153,8 +153,7 @@
initPrimitive();
log.trace("Building Web Bean bean metadata for #0", getType());
initName();
- initDeploymentType();
- checkDeploymentType();
+ initPolicy();
initScopeType();
initSerializable();
initProxyable();
@@ -220,20 +219,16 @@
this.bindings.add(ANY_LITERAL);
}
- /**
- * Initializes the deployment types
- */
- protected abstract void initDeploymentType();
-
- protected void initDeploymentTypeFromStereotype()
+ protected void initPolicy()
{
- Map<Class<? extends Annotation>, Annotation> possibleDeploymentTypes = getMergedStereotypes().getPossibleDeploymentTypes();
- if (possibleDeploymentTypes.size() > 0)
+ if (getAnnotatedItem().isAnnotationPresent(Policy.class))
{
- this.deploymentType = getDeploymentType(manager.getEnabledDeploymentTypes(), possibleDeploymentTypes);
- log.trace("Deployment type #0 specified by stereotype", deploymentType);
- return;
+ this.policy = true;
}
+ else
+ {
+ this.policy = getMergedStereotypes().isPolicy();
+ }
}
/**
@@ -322,21 +317,6 @@
}
}
- /**
- * Validates the deployment type
- */
- protected void checkDeploymentType()
- {
- if (deploymentType == null)
- {
- throw new DefinitionException("type: " + getType() + " must specify a deployment type");
- }
- else if (deploymentType.equals(Standard.class) && !STANDARD_WEB_BEAN_CLASSES.contains(getAnnotatedItem().getJavaClass()))
- {
- throw new DefinitionException(getAnnotatedItem().getName() + " cannot have deployment type @Standard");
- }
- }
-
protected void postSpecialize()
{
if (getAnnotatedItem().isAnnotationPresent(Named.class) && getSpecializedBean().getAnnotatedItem().isAnnotationPresent(Named.class))
@@ -391,18 +371,6 @@
@Override
public abstract AbstractBean<?, ?> getSpecializedBean();
- /**
- * Gets the deployment type of the bean
- *
- * @return The deployment type
- *
- * @see org.jboss.webbeans.bean.BaseBean#getDeploymentType()
- */
- public Class<? extends Annotation> getDeploymentType()
- {
- return deploymentType;
- }
-
@Override
public Set<WBInjectionPoint<?, ?>> getAnnotatedInjectionPoints()
{
@@ -535,6 +503,11 @@
{
return Dependent.class.equals(getScopeType());
}
+
+ public boolean isPolicy()
+ {
+ return policy;
+ }
@Override
public boolean isSpecializing()
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -36,8 +36,6 @@
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Initializer;
import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.deployment.DeploymentType;
-import javax.enterprise.inject.deployment.Production;
import javax.enterprise.inject.spi.Decorator;
import javax.enterprise.inject.spi.InjectionPoint;
@@ -326,40 +324,6 @@
}
}
- @Override
- protected void initDeploymentType()
- {
- for (WBClass<?> clazz = getAnnotatedItem(); clazz != null; clazz = clazz.getSuperclass())
- {
- Set<Annotation> deploymentTypes = clazz.getDeclaredMetaAnnotations(DeploymentType.class);
- if (deploymentTypes.size() == 1)
- {
- if (getAnnotatedItem().isAnnotationPresent(deploymentTypes.iterator().next().annotationType()))
- {
- this.deploymentType = deploymentTypes.iterator().next().annotationType();
- log.trace("Deployment type " + deploymentType + " specified by annotation");
- }
- break;
- }
- else if (deploymentTypes.size() > 1)
- {
- throw new DefinitionException("At most one deployment type may be specified");
- }
- }
-
- if (this.deploymentType == null)
- {
- initDeploymentTypeFromStereotype();
- }
-
- if (this.deploymentType == null)
- {
- this.deploymentType = getDefaultDeploymentType();
- log.trace("Using default @Production deployment type");
- return;
- }
- }
-
/**
* Validates the bean implementation
*/
@@ -425,11 +389,6 @@
{
return "AbstractClassBean " + getName();
}
-
- protected Class<? extends Annotation> getDefaultDeploymentType()
- {
- return Production.class;
- }
@Override
public String getId()
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-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -34,7 +34,6 @@
import javax.enterprise.inject.IllegalProductException;
import javax.enterprise.inject.Initializer;
import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.deployment.DeploymentType;
import javax.enterprise.inject.spi.InjectionPoint;
import org.jboss.webbeans.BeanManagerImpl;
@@ -81,11 +80,6 @@
return getDeclaringBean().getBeanClass();
}
- protected Class<? extends Annotation> getDefaultDeploymentType()
- {
- return getDeclaringBean().getDeploymentType();
- }
-
/**
* Initializes the API types
*/
@@ -255,31 +249,6 @@
log.trace("Using default @Dependent scope");
}
}
-
- @Override
- protected void initDeploymentType()
- {
- Set<Annotation> deploymentTypes = getAnnotatedItem().getMetaAnnotations(DeploymentType.class);
- if (deploymentTypes.size() > 1)
- {
- throw new DefinitionException("At most one deployment type may be specified (" + deploymentTypes + " are specified) on " + getAnnotatedItem().toString());
- }
- else if (deploymentTypes.size() == 1)
- {
- this.deploymentType = deploymentTypes.iterator().next().annotationType();
- log.trace("Deployment type " + deploymentType + " specified by annotation");
- return;
- }
-
- initDeploymentTypeFromStereotype();
-
- if (this.deploymentType == null)
- {
- this.deploymentType = getDefaultDeploymentType();
- log.trace("Using default " + this.deploymentType + " deployment type");
- return;
- }
- }
@Override
protected void initSerializable()
@@ -317,11 +286,6 @@
protected abstract T produceInstance(CreationalContext<T> creationalContext);
- public boolean isPolicy()
- {
- return false;
- }
-
/**
* Gets a string representation
*
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractReceiverBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractReceiverBean.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractReceiverBean.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -19,6 +19,7 @@
import java.lang.reflect.Member;
import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.Policy;
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
@@ -36,6 +37,7 @@
private static final LogProvider log = Logging.getLogProvider(AbstractReceiverBean.class);
private AbstractClassBean<?> declaringBean;
+ private boolean policy;
public AbstractReceiverBean(AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
{
@@ -88,5 +90,31 @@
{
return declaringBean;
}
+
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.bean.AbstractBean#isPolicy()
+ */
+ @Override
+ public boolean isPolicy()
+ {
+ return policy;
+ }
+
+ @Override
+ protected void initPolicy()
+ {
+ if (getDeclaringBean().isPolicy())
+ {
+ this.policy = true;
+ }
+ else if (getAnnotatedItem().isAnnotationPresent(Policy.class))
+ {
+ this.policy = true;
+ }
+ else if (getMergedStereotypes().isPolicy())
+ {
+ this.policy = true;
+ }
+ }
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -233,11 +233,6 @@
return id;
}
- public boolean isPolicy()
- {
- return false;
- }
-
@Override
public AbstractBean<?, ?> getSpecializedBean()
{
@@ -251,24 +246,6 @@
// Disposal methods aren't scoped
}
- @Override
- public Class<? extends Annotation> getDeploymentType()
- {
- return getDeclaringBean().getDeploymentType();
- }
-
- @Override
- protected void initDeploymentType()
- {
- // Not used
- }
-
- @Override
- protected void checkDeploymentType()
- {
- // TODO sort out ordering of init, then we can use initDeploymentType and hence checkDeploymentType
- }
-
public Set<Class<? extends Annotation>> getStereotypes()
{
return Collections.emptySet();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -390,11 +390,6 @@
return manager.getServices().get(EjbServices.class).resolveEjb(getEjbDescriptor().delegate());
}
- public boolean isPolicy()
- {
- return false;
- }
-
public Set<Class<? extends Annotation>> getStereotypes()
{
return Collections.emptySet();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -87,16 +87,6 @@
return delegate().getBindings();
}
- /**
- * Gets the deployment types of the delegate
- *
- * @return The deployment types
- */
- public Class<? extends Annotation> getDeploymentType()
- {
- return delegate().getDeploymentType();
- }
-
public Set<InjectionPoint> getInjectionPoints()
{
return delegate().getInjectionPoints();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewEnterpriseBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewEnterpriseBean.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewEnterpriseBean.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -22,7 +22,6 @@
import java.util.Set;
import javax.enterprise.context.Dependent;
-import javax.enterprise.inject.deployment.Standard;
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
@@ -72,15 +71,10 @@
return Dependent.class;
}
- /**
- * Gets the deployment type
- *
- * @return The standard deployment type
- */
@Override
- public Class<? extends Annotation> getDeploymentType()
+ public boolean isPolicy()
{
- return Standard.class;
+ return false;
}
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewSimpleBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewSimpleBean.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewSimpleBean.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -22,7 +22,6 @@
import java.util.Set;
import javax.enterprise.context.Dependent;
-import javax.enterprise.inject.deployment.Standard;
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.introspector.WBClass;
@@ -71,15 +70,10 @@
return Dependent.class;
}
- /**
- * Gets the deployment type
- *
- * @return The standard deployment type
- */
@Override
- public Class<? extends Annotation> getDeploymentType()
+ public boolean isPolicy()
{
- return Standard.class;
+ return false;
}
/**
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-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -570,10 +570,4 @@
return specializedBean;
}
- public boolean isPolicy()
- {
- //TODO Implement the isPolicy() on SimpleBean
- return false;
- }
-
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -23,7 +23,6 @@
import java.util.Set;
import javax.enterprise.context.Dependent;
-import javax.enterprise.inject.deployment.Standard;
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
@@ -58,11 +57,6 @@
return DEFAULT_BINDING;
}
- public Class<? extends Annotation> getDeploymentType()
- {
- return Standard.class;
- }
-
public Class<? extends Annotation> getScopeType()
{
return Dependent.class;
@@ -109,7 +103,6 @@
public boolean isPolicy()
{
- //TODO Implement the isPolicy() method based on the annotations of this bean
return false;
}
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-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -257,8 +257,6 @@
DeploymentVisitor deploymentVisitor = new DeploymentVisitor(getServices().get(Deployment.class)).visit();
- parseBeansXml(deploymentVisitor.getBeansXmlUrls());
-
beginApplication(getApplicationContext());
BeanStore requestBeanStore = new ConcurrentHashMapBeanStore();
beginDeploy(requestBeanStore);
@@ -276,6 +274,9 @@
extensionBeanDeployer.addExtensions(ServiceLoader.load(Extension.class));
extensionBeanDeployer.createBeans().deploy();
+ // Parse beans.xml before main bean deployment
+ parseBeansXml(deploymentVisitor.getBeansXmlUrls());
+
BeanDeployer beanDeployer = new BeanDeployer(manager, ejbDescriptors);
fireBeforeBeanDiscoveryEvent(beanDeployer);
@@ -293,10 +294,14 @@
BeansXmlParser parser = new BeansXmlParser(getServices().get(ResourceLoader.class), urls);
parser.parse();
- if (parser.getEnabledDeploymentTypes() != null)
+ if (parser.getEnabledPolicyClasses() != null)
{
- manager.setEnabledDeploymentTypes(parser.getEnabledDeploymentTypes());
+ manager.setEnabledPolicyClasses(parser.getEnabledPolicyClasses());
}
+ if (parser.getEnabledPolicyStereotypes() != null)
+ {
+ manager.setEnabledPolicyStereotypes(parser.getEnabledPolicyStereotypes());
+ }
if (parser.getEnabledDecoratorClasses() != null)
{
manager.setEnabledDecoratorClasses(parser.getEnabledDecoratorClasses());
@@ -305,7 +310,7 @@
{
manager.setEnabledInterceptorClasses(parser.getEnabledInterceptorClasses());
}
- log.debug("Enabled deployment types: " + manager.getEnabledDeploymentTypes());
+ log.debug("Enabled policies: " + manager.getEnabledPolicyClasses() + " " + manager.getEnabledPolicyStereotypes());
log.debug("Enabled decorator types: " + manager.getEnabledDecoratorClasses());
log.debug("Enabled interceptor types: " + manager.getEnabledInterceptorClasses());
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/JavaSEConversationTerminator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/JavaSEConversationTerminator.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/JavaSEConversationTerminator.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -24,7 +24,6 @@
import javax.enterprise.context.SessionScoped;
-import org.jboss.webbeans.WebBean;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -35,7 +34,6 @@
* @see org.jboss.webbeans.conversation.ConversationTerminator
*/
@SessionScoped
- at WebBean
public class JavaSEConversationTerminator implements ConversationTerminator, Serializable
{
private static final long serialVersionUID = 7258623232951724618L;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/NumericConversationIdGenerator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/NumericConversationIdGenerator.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/NumericConversationIdGenerator.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -21,7 +21,6 @@
import javax.enterprise.context.SessionScoped;
-import org.jboss.webbeans.WebBean;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -32,7 +31,7 @@
*
*/
@SessionScoped
- at WebBean
+
public class NumericConversationIdGenerator implements ConversationIdGenerator, Serializable
{
private static final long serialVersionUID = -587408626962044442L;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ServletConversationManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ServletConversationManager.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ServletConversationManager.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -30,7 +30,6 @@
import javax.enterprise.inject.Produces;
import javax.servlet.http.HttpSession;
-import org.jboss.webbeans.WebBean;
import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -43,7 +42,6 @@
*
*/
@SessionScoped
- at WebBean
public class ServletConversationManager extends AbstractConversationManager implements Serializable
{
private static final long serialVersionUID = 1647848566880659085L;
@@ -64,7 +62,6 @@
@Produces
@ConversationInactivityTimeout
- @WebBean
public static long getConversationTimeoutInMilliseconds()
{
log.trace("Produced conversation timeout " + CONVERSATION_TIMEOUT_IN_MS);
@@ -73,7 +70,6 @@
@Produces
@ConversationConcurrentAccessTimeout
- @WebBean
public static long getConversationConcurrentAccessTimeout()
{
log.trace("Produced conversation concurrent access timeout " + CONVERSATION_CONCURRENT_ACCESS_TIMEOUT_IN_MS);
@@ -82,7 +78,6 @@
@Produces
@ConversationIdName
- @WebBean
public static String getConversationIdName()
{
log.trace("Produced conversation id name " + CONVERSATION_ID_NAME);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -132,7 +132,6 @@
Object value = null;
try
{
-
Bean<?> bean = manager.resolve(manager.getBeans(name));
CreationalContext<?> creationalContext = manager.createCreationalContext(bean);
if (bean != null)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -24,7 +24,6 @@
import javax.enterprise.context.ScopeType;
import javax.enterprise.inject.BindingType;
-import javax.enterprise.inject.deployment.DeploymentType;
import javax.enterprise.inject.spi.Annotated;
import javax.enterprise.inject.stereotype.Stereotype;
@@ -40,7 +39,7 @@
// The set of meta-annotations to map
@SuppressWarnings("unchecked")
- public static final Set<Class<? extends Annotation>> MAPPED_METAANNOTATIONS = new HashSet<Class<? extends Annotation>>(Arrays.asList(BindingType.class, DeploymentType.class, Stereotype.class, ScopeType.class));
+ public static final Set<Class<? extends Annotation>> MAPPED_METAANNOTATIONS = new HashSet<Class<? extends Annotation>>(Arrays.asList(BindingType.class, Stereotype.class, ScopeType.class));
/**
* Gets all annotations which are annotated with the given meta annotation
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/MergedStereotypes.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/MergedStereotypes.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/MergedStereotypes.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -17,9 +17,7 @@
package org.jboss.webbeans.metadata.cache;
import java.lang.annotation.Annotation;
-import java.util.HashMap;
import java.util.HashSet;
-import java.util.Map;
import java.util.Set;
import org.jboss.webbeans.BeanManagerImpl;
@@ -31,12 +29,12 @@
*/
public class MergedStereotypes<T, E>
{
- // The possible deployment types
- private final Map<Class<? extends Annotation>, Annotation> possibleDeploymentTypes;
// The possible scope types
private final Set<Annotation> possibleScopeTypes;
// Is the bean name defaulted?
private boolean beanNameDefaulted;
+ // Are any of the sterotypes policies
+ private boolean policy;
private final BeanManagerImpl manager;
@@ -47,7 +45,6 @@
*/
public MergedStereotypes(Set<Annotation> stereotypeAnnotations, BeanManagerImpl manager)
{
- this.possibleDeploymentTypes = new HashMap<Class<? extends Annotation>, Annotation>();
this.possibleScopeTypes = new HashSet<Annotation>();
this.manager = manager;
merge(stereotypeAnnotations);
@@ -68,9 +65,9 @@
{
throw new IllegalStateException("Stereotype " + stereotypeAnnotation + " not registered with container");
}
- if (stereotype.getDefaultDeploymentType() != null)
+ if (stereotype.isPolicy())
{
- possibleDeploymentTypes.put(stereotype.getDefaultDeploymentType().annotationType(), stereotype.getDefaultDeploymentType());
+ policy = true;
}
if (stereotype.getDefaultScopeType() != null)
{
@@ -83,14 +80,9 @@
}
}
- /**
- * Returns the possible deployment typess
- *
- * @return The deployment types
- */
- public Map<Class<? extends Annotation>, Annotation> getPossibleDeploymentTypes()
+ public boolean isPolicy()
{
- return possibleDeploymentTypes;
+ return policy;
}
/**
@@ -131,8 +123,8 @@
@Override
public String toString()
{
- return "Merged stereotype model with possible deployment types " +
- possibleDeploymentTypes + " and possible scopes " + possibleScopeTypes;
+ return "Merged stereotype model; Any of the sterotypes is a policy: " +
+ policy + "; possible scopes " + possibleScopeTypes;
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/StereotypeModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/StereotypeModel.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/StereotypeModel.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -22,7 +22,7 @@
import javax.enterprise.context.ScopeType;
import javax.enterprise.inject.BindingType;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.DeploymentType;
+import javax.enterprise.inject.Policy;
import javax.enterprise.inject.stereotype.Stereotype;
import javax.interceptor.InterceptorBindingType;
@@ -38,8 +38,8 @@
*/
public class StereotypeModel<T extends Annotation> extends AnnotationModel<T>
{
- // The default deployment type
- private Annotation defaultDeploymentType;
+ // Is the stereotype a policy
+ private boolean policy;
// The default scope type
private Annotation defaultScopeType;
// Is the bean name defaulted
@@ -55,7 +55,7 @@
public StereotypeModel(Class<T> sterotype, ClassTransformer transformer)
{
super(sterotype, transformer);
- initDefaultDeploymentType();
+ initPolicy();
initDefaultScopeType();
initBeanNameDefaulted();
initInterceptorBindings();
@@ -116,28 +116,15 @@
/**
* Initializes the default deployment type
*/
- private void initDefaultDeploymentType()
+ private void initPolicy()
{
- Set<Annotation> deploymentTypes = getAnnotatedAnnotation().getMetaAnnotations(DeploymentType.class);
- if (deploymentTypes.size() > 1)
+ if (getAnnotatedAnnotation().isAnnotationPresent(Policy.class))
{
- throw new DefinitionException("At most one deployment type may be specified on " + getAnnotatedAnnotation());
+ this.policy = true;
}
- else if (deploymentTypes.size() == 1)
- {
- this.defaultDeploymentType = deploymentTypes.iterator().next();
- }
}
- /**
- * Get the default deployment type the stereotype specifies
- *
- * @return The default deployment type, or null if none is specified
- */
- public Annotation getDefaultDeploymentType()
- {
- return defaultDeploymentType;
- }
+
/**
* Get the default scope type the stereotype specifies
@@ -180,4 +167,12 @@
return Stereotype.class;
}
+ /**
+ * @return
+ */
+ public boolean isPolicy()
+ {
+ return policy;
+ }
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/NameBasedResolver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/NameBasedResolver.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/NameBasedResolver.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -83,19 +83,12 @@
matchedBeans.add(bean);
}
}
- matchedBeans = Beans.retainHighestPrecedenceBeans(matchedBeans, manager.getEnabledDeploymentTypes());
- return sortBeans(matchedBeans);
+ return Beans.retainEnabledPolicies(matchedBeans, manager.getEnabledPolicyClasses(), manager.getEnabledPolicyStereotypes());
}
});
}
-
- protected Set<Bean<?>> sortBeans(Set<Bean<?>> matchedBeans)
- {
- return matchedBeans;
- }
-
/**
* Gets a string representation
*
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/TypeSafeBeanResolver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/TypeSafeBeanResolver.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/TypeSafeBeanResolver.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -67,7 +67,7 @@
@Override
protected Set<T> filterResult(Set<T> matched)
{
- return Beans.retainHighestPrecedenceBeans(matched, manager.getEnabledDeploymentTypes());
+ return Beans.retainEnabledPolicies(matched, manager.getEnabledPolicyClasses(), manager.getEnabledPolicyStereotypes());
}
@Override
@@ -81,5 +81,45 @@
{
return matched;
}
+
+ public <X> Set<Bean<? extends X>> resolve(Set<Bean<? extends X>> beans)
+ {
+ if (beans.size() <= 1)
+ {
+ return beans;
+ }
+
+ boolean removePolicies = false;
+
+ // TODO CACHE!!!!!
+
+ for (Bean<? extends X> bean : beans)
+ {
+ if (bean.isPolicy())
+ {
+ removePolicies = true;
+ }
+ }
+ // TODO Specialization!
+ if (removePolicies)
+ {
+ Set<Bean<? extends X>> policies = new HashSet<Bean<? extends X>>();
+ for (Bean<? extends X> bean : beans)
+ {
+ if (bean.isPolicy())
+ {
+ policies.add(bean);
+ }
+ }
+
+ return policies;
+ }
+ else
+ {
+ return beans;
+ }
+ }
+
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/HttpSessionManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/HttpSessionManager.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/HttpSessionManager.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -20,10 +20,7 @@
import javax.enterprise.inject.Produces;
import javax.servlet.http.HttpSession;
-import org.jboss.webbeans.WebBean;
-
@RequestScoped
- at WebBean
public class HttpSessionManager
{
private HttpSession session;
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-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -18,11 +18,9 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
+import java.util.Collection;
import java.util.HashSet;
-import java.util.List;
import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
import javax.decorator.Decorates;
import javax.enterprise.inject.BindingType;
@@ -39,7 +37,6 @@
import org.jboss.webbeans.introspector.WBField;
import org.jboss.webbeans.metadata.cache.BindingTypeModel;
import org.jboss.webbeans.metadata.cache.MetaAnnotationStore;
-import org.jboss.webbeans.util.collections.ListComparator;
/**
* Helper class for bean inspection
@@ -180,35 +177,41 @@
* @param enabledDeploymentTypes The enabled deployment types
* @return The filtered beans
*/
- public static <T extends Bean<?>> Set<T> retainHighestPrecedenceBeans(Set<T> beans, List<Class<? extends Annotation>> enabledDeployentTypes)
+ public static <T extends Bean<?>> Set<T> retainEnabledPolicies(Set<T> beans, Collection<Class<?>> enabledPolicyClasses, Collection<Class<? extends Annotation>> enabledPolicySterotypes)
{
- if (beans.size() > 0)
+ if (beans.size() == 0)
{
- SortedSet<Class<? extends Annotation>> possibleDeploymentTypes = new TreeSet<Class<? extends Annotation>>(new ListComparator<Class<? extends Annotation>>(enabledDeployentTypes));
- for (Bean<?> bean : beans)
+ return beans;
+ }
+ else
+ {
+ Set<T> enabledBeans = new HashSet<T>();
+ for (T bean : beans)
{
- possibleDeploymentTypes.add(bean.getDeploymentType());
- }
- possibleDeploymentTypes.retainAll(enabledDeployentTypes);
- Set<T> trimmed = new HashSet<T>();
- if (possibleDeploymentTypes.size() > 0)
- {
- Class<? extends Annotation> highestPrecedencePossibleDeploymentType = possibleDeploymentTypes.last();
-
- for (T bean : beans)
+ if (bean.isPolicy())
{
- if (bean.getDeploymentType().equals(highestPrecedencePossibleDeploymentType))
+ if (enabledPolicyClasses.contains(bean.getBeanClass()))
{
- trimmed.add(bean);
+ enabledBeans.add(bean);
}
+ else
+ {
+ for (Class<? extends Annotation> stereotype : bean.getStereotypes())
+ {
+ if (enabledPolicySterotypes.contains(stereotype))
+ {
+ enabledBeans.add(bean);
+ }
+ }
+ }
}
+ else
+ {
+ enabledBeans.add(bean);
+ }
}
- return trimmed;
+ return enabledBeans;
}
- else
- {
- return beans;
- }
}
public static boolean isTypePresent(Bean<?> bean, Type type)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/BeansXmlParser.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/BeansXmlParser.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/BeansXmlParser.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -81,15 +81,21 @@
private final Iterable<URL> beansXml;
private final ResourceLoader resourceLoader;
- private List<Class<? extends Annotation>> enabledDeploymentTypes;
+ private List<Class<? extends Annotation>> enabledPolicyStereotypes;
+ private List<Class<?>> enabledPolicyClasses;
private List<Class<?>> enabledDecoratorClasses;
private List<Class<?>> enabledInterceptorClasses;
- public List<Class<? extends Annotation>> getEnabledDeploymentTypes()
+ public List<Class<?>> getEnabledPolicyClasses()
{
- return enabledDeploymentTypes;
+ return enabledPolicyClasses;
}
+ public List<Class<? extends Annotation>> getEnabledPolicyStereotypes()
+ {
+ return enabledPolicyStereotypes;
+ }
+
public List<Class<?>> getEnabledDecoratorClasses()
{
return enabledDecoratorClasses;
@@ -117,9 +123,9 @@
{
throw new InjectionException("Error configuring XML parser", e);
}
- List<XmlElement> deployElements = new ArrayList<XmlElement>();
- List<XmlElement> decoratorElements = new ArrayList<XmlElement>();
- List<XmlElement> interceptorElements = new ArrayList<XmlElement>();
+ List<XmlElement> policiesElements = new ArrayList<XmlElement>();
+ List<XmlElement> decoratorsElements = new ArrayList<XmlElement>();
+ List<XmlElement> interceptorsElements = new ArrayList<XmlElement>();
for (URL url : beansXml)
{
InputStream is;
@@ -152,58 +158,58 @@
Element beans = document.getDocumentElement();
for (Node child : new NodeListIterable(beans.getChildNodes()))
{
- if (child instanceof Element && "deploy".equals(child.getNodeName()))
+ if (child instanceof Element && "policies".equals(child.getNodeName()))
{
- deployElements.add(new XmlElement(url, (Element) child));
+ policiesElements.add(new XmlElement(url, (Element) child));
}
if (child instanceof Element && "interceptors".equals(child.getNodeName()))
{
- interceptorElements.add(new XmlElement(url, (Element) child));
+ interceptorsElements.add(new XmlElement(url, (Element) child));
}
if (child instanceof Element && "decorators".equals(child.getNodeName()))
{
- decoratorElements.add(new XmlElement(url, (Element!
) child));
+ decoratorsElements.add(new XmlElement(url, (Element) child));
}
}
}
}
- if (deployElements.size() > 1)
+ if (policiesElements.size() > 1)
{
- throw new DeploymentException("<deploy> can only be specified once, but it is specified muliple times " + deployElements);
+ throw new DeploymentException("<policies> can only be specified once, but it is specified muliple times " + policiesElements);
}
- else if (deployElements.size() == 1)
+ else if (policiesElements.size() == 1)
{
- enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
- enabledDeploymentTypes.addAll(processDeployElement(resourceLoader, deployElements.get(0)));
+ enabledPolicyStereotypes = new ArrayList<Class<? extends Annotation>>();
+ enabledPolicyClasses = new ArrayList<Class<?>>();
+ processPolicyElement(resourceLoad!
er, policiesElements.get(0), enabledPolicyClasses, enabledPoli!
cyStereo
types);
}
- if (decoratorElements.size() > 1)
+ if (decoratorsElements.size() > 1)
{
- throw new DeploymentException("<decorator> can only be specified once, but it is specified muliple times " + decoratorElements);
+ throw new DeploymentException("<decorator> can only be specified once, but it is specified muliple times " + decoratorsElements);
}
- else if (decoratorElements.size() == 1)
+ else if (decoratorsElements.size() == 1)
{
enabledDecoratorClasses = new ArrayList<Class<?>>();
- enabledDecoratorClasses.addAll(processElement(resourceLoader, decoratorElements.get(0)));
+ enabledDecoratorClasses.addAll(processElement(resourceLoader, decoratorsElements.get(0)));
}
- if (interceptorElements.size() > 1)
+ if (interceptorsElements.size() > 1)
{
- throw new DeploymentException("<interceptor> can only be specified once, but it is specified !
muliple times " + interceptorElements);
+ throw new DeploymentException("<interceptor> can only be specified once, but it is specified muliple times " + interceptorsElements);
}
- else if (interceptorElements.size() == 1)
+ else if (interceptorsElements.size() == 1)
{
enabledInterceptorClasses = new ArrayList<Class<?>>();
- enabledInterceptorClasses.addAll(processElement(resourceLoader, interceptorElements.get(0)));
+ enabledInterceptorClasses.addAll(processElement(resourceLoader, interceptorsElements.get(0)));
}
}
- private static List<Class<? extends Annotation>> processDeployElement(ResourceLoader resourceLoader, XmlElement element)
+ private static void processPolicyElement(ResourceLoader resourceLoader, XmlElement element, List<Class<?>> enabledPolicyClasses, List<Class<? extends Annotation>> enabledPolicyStereotypes)
{
- List<Class<? extends Annotation>> list = new ArrayList!
<Class<? extends Annotation>>();
for (Node child : new !
NodeList
Iterable(element.getElement().getChildNodes()))
{
String className = processNode(child);
@@ -211,7 +217,15 @@
{
try
{
- list.add(resourceLoader.classForName(className).asSubclass(Annotation.class));
+ Class<?> clazz = resourceLoader.classForName(className);
+ if (clazz.isAnnotation())
+ {
+ enabledPolicyStereotypes.add(clazz.asSubclass(Annotation.class));
+ }
+ else
+ {
+ enabledPolicyClasses.add(clazz);
+ }
}
catch (ResourceLoadingException e)
{
@@ -219,7 +233,6 @@
}
}
}
- return list;
}
private static String processNode(Node node)
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -15,8 +15,6 @@
import javax.el.ELContext;
import javax.enterprise.inject.TypeLiteral;
-import javax.enterprise.inject.deployment.Production;
-import javax.enterprise.inject.deployment.Standard;
import javax.enterprise.inject.spi.Bean;
import org.jboss.testharness.AbstractTest;
@@ -71,17 +69,6 @@
return annotationTypeList.size() == 0;
}
- protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
- {
- return getDefaultDeploymentTypes();
- }
-
- @SuppressWarnings("unchecked")
- protected final List<Class<? extends Annotation>> getDefaultDeploymentTypes()
- {
- return Arrays.asList(Standard.class, Production.class);
- }
-
protected Iterable<URL> getResources(String name)
{
if (name.startsWith("/"))
Deleted: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Mock.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Mock.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Mock.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,20 +0,0 @@
-package org.jboss.webbeans.test.examples;
-
-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.enterprise.inject.deployment.DeploymentType;
-
- at Target( { TYPE, METHOD })
- at Retention(RUNTIME)
- at Documented
- at DeploymentType
-public @interface Mock
-{
-
-}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/MockSentenceTranslator.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/MockSentenceTranslator.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/MockSentenceTranslator.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,6 +1,8 @@
package org.jboss.webbeans.test.examples;
- at Mock
+import javax.enterprise.inject.Policy;
+
+ at Policy
public class MockSentenceTranslator implements Translator {
public String translate(String sentence) {
return "Lorem ipsum dolor sit amet";
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/ActivitiesTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/ActivitiesTest.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/ActivitiesTest.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -14,7 +14,6 @@
import javax.enterprise.event.Observer;
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.UnsatisfiedResolutionException;
-import javax.enterprise.inject.deployment.Production;
import javax.enterprise.inject.spi.Annotated;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
@@ -58,11 +57,6 @@
return bindings;
}
- public Class<? extends Annotation> getDeploymentType()
- {
- return Production.class;
- }
-
public Set<InjectionPoint> getInjectionPoints()
{
return injectionPoints;
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/child/SameBeanTypeInChildActivityTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/child/SameBeanTypeInChildActivityTest.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/child/SameBeanTypeInChildActivityTest.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -10,7 +10,6 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.InjectionException;
-import javax.enterprise.inject.deployment.Production;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.InjectionPoint;
@@ -51,11 +50,6 @@
return bindings;
}
- public Class<? extends Annotation> getDeploymentType()
- {
- return Production.class;
- }
-
public Set<InjectionPoint> getInjectionPoints()
{
return injectionPoints;
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/current/ELCurrentActivityTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/current/ELCurrentActivityTest.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/current/ELCurrentActivityTest.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -12,7 +12,6 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.event.Observer;
import javax.enterprise.inject.AnnotationLiteral;
-import javax.enterprise.inject.deployment.Production;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.InjectionPoint;
@@ -95,11 +94,6 @@
return BINDING_TYPES;
}
- public Class<? extends Annotation> getDeploymentType()
- {
- return Production.class;
- }
-
public Set<InjectionPoint> getInjectionPoints()
{
return Collections.emptySet();
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/current/InstanceCurrentActivityTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/current/InstanceCurrentActivityTest.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/current/InstanceCurrentActivityTest.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -12,7 +12,6 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.event.Observer;
import javax.enterprise.inject.AnnotationLiteral;
-import javax.enterprise.inject.deployment.Production;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.InjectionPoint;
@@ -108,11 +107,6 @@
return BINDING_TYPES;
}
- public Class<? extends Annotation> getDeploymentType()
- {
- return Production.class;
- }
-
public Set<InjectionPoint> getInjectionPoints()
{
return Collections.emptySet();
Deleted: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/AnotherDeploymentType.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/AnotherDeploymentType.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/AnotherDeploymentType.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,20 +0,0 @@
-package org.jboss.webbeans.test.unit.bootstrap;
-
-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.enterprise.inject.deployment.DeploymentType;
-
- at Target( { TYPE, METHOD })
- at Retention(RUNTIME)
- at Documented
- at DeploymentType
- at interface AnotherDeploymentType
-{
-
-}
Deleted: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/XmlBootstrapTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/XmlBootstrapTest.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/XmlBootstrapTest.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,30 +0,0 @@
-package org.jboss.webbeans.test.unit.bootstrap;
-
-import javax.enterprise.inject.deployment.Production;
-import javax.enterprise.inject.deployment.Standard;
-
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.Packaging;
-import org.jboss.testharness.impl.packaging.PackagingType;
-import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
-import org.jboss.webbeans.WebBean;
-import org.jboss.webbeans.test.AbstractWebBeansTest;
-import org.testng.annotations.Test;
-
- at Artifact
- at Packaging(PackagingType.EAR)
- at BeansXml("test-beans.xml")
-public class XmlBootstrapTest extends AbstractWebBeansTest
-{
-
- @Test
- public void testDeploymentTypesLoadedFromBeansXml()
- {
- assert getCurrentManager().getEnabledDeploymentTypes().size() == 4;
- assert getCurrentManager().getEnabledDeploymentTypes().get(0).equals(Standard.class);
- assert getCurrentManager().getEnabledDeploymentTypes().get(1).equals(WebBean.class);
- assert getCurrentManager().getEnabledDeploymentTypes().get(2).equals(Production.class);
- assert getCurrentManager().getEnabledDeploymentTypes().get(3).equals(AnotherDeploymentType.class);
- }
-
-}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Elephant.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Elephant.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Elephant.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -2,9 +2,7 @@
import javax.ejb.Remove;
import javax.ejb.Stateful;
-import javax.enterprise.inject.deployment.Production;
- at Production
@Stateful
class Elephant implements ElephantLocal
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Panther.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Panther.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Panther.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -2,9 +2,7 @@
import javax.ejb.Remove;
import javax.ejb.Stateful;
-import javax.enterprise.inject.deployment.Production;
- at Production
@Stateful
class Panther implements PantherLocal
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Tiger.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Tiger.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Tiger.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -2,9 +2,7 @@
import javax.ejb.Remove;
import javax.ejb.Stateful;
-import javax.enterprise.inject.deployment.Production;
- at Production
@Stateful
@Synchronous
public class Tiger implements TigerLocal
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Elephant.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Elephant.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Elephant.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -2,9 +2,7 @@
import javax.ejb.Remove;
import javax.ejb.Stateful;
-import javax.enterprise.inject.deployment.Production;
- at Production
@Stateful
class Elephant implements ElephantLocal
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Panther.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Panther.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Panther.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -2,9 +2,7 @@
import javax.ejb.Remove;
import javax.ejb.Stateful;
-import javax.enterprise.inject.deployment.Production;
- at Production
@Stateful
class Panther implements PantherLocal
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Salmon.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Salmon.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Salmon.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,9 +1,7 @@
package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
- at Production
@Named
class Salmon implements ScottishFish
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/SeaBass.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/SeaBass.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/SeaBass.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,9 +1,7 @@
package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.deployment.Production;
- at Production
@RequestScoped
class SeaBass implements Animal
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Sole.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Sole.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Sole.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,9 +1,7 @@
package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
- at Production
@Whitefish
@Named("whitefish")
class Sole implements ScottishFish
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Tiger.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Tiger.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Tiger.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -2,9 +2,7 @@
import javax.ejb.Remove;
import javax.ejb.Stateful;
-import javax.enterprise.inject.deployment.Production;
- at Production
@Stateful
@Synchronous
public class Tiger implements TigerLocal
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Salmon.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Salmon.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Salmon.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,9 +1,7 @@
package org.jboss.webbeans.test.unit.bootstrap.multipleSimple;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
- at Production
@Named
class Salmon implements ScottishFish
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/SeaBass.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/SeaBass.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/SeaBass.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,9 +1,7 @@
package org.jboss.webbeans.test.unit.bootstrap.multipleSimple;
import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.deployment.Production;
- at Production
@RequestScoped
class SeaBass implements Animal
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Sole.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Sole.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Sole.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,9 +1,7 @@
package org.jboss.webbeans.test.unit.bootstrap.multipleSimple;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
- at Production
@Whitefish
@Named("whitefish")
class Sole implements ScottishFish
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/Order.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/Order.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/Order.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,8 +1,6 @@
package org.jboss.webbeans.test.unit.definition;
-import javax.enterprise.inject.deployment.Production;
- at Production
class Order
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/StereotypesTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/StereotypesTest.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/StereotypesTest.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -22,7 +22,7 @@
assert animalStereotype.getDefaultScopeType().annotationType().equals(RequestScoped.class);
assert animalStereotype.getInterceptorBindings().size() == 0;
assert !animalStereotype.isBeanNameDefaulted();
- assert animalStereotype.getDefaultDeploymentType() == null;
+ assert !animalStereotype.isPolicy();
}
@Test
@@ -32,7 +32,7 @@
assert animalStereotype.getDefaultScopeType() == null;
assert animalStereotype.getInterceptorBindings().size() == 0;
assert !animalStereotype.isBeanNameDefaulted();
- assert animalStereotype.getDefaultDeploymentType() == null;
+ assert !animalStereotype.isPolicy();
}
@Test
@@ -42,7 +42,7 @@
assert animalStereotype.getDefaultScopeType() == null;
assert animalStereotype.getInterceptorBindings().size() == 0;
assert !animalStereotype.isBeanNameDefaulted();
- assert animalStereotype.getDefaultDeploymentType() == null;
+ assert !animalStereotype.isPolicy();
}
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/Salmon.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/Salmon.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/Salmon.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,9 +1,7 @@
package org.jboss.webbeans.test.unit.environments.servlet;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
- at Production
@Named
class Salmon implements ScottishFish
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/SeaBass.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/SeaBass.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/SeaBass.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,9 +1,7 @@
package org.jboss.webbeans.test.unit.environments.servlet;
import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.deployment.Production;
- at Production
@RequestScoped
class SeaBass implements Animal
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/Sole.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/Sole.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/Sole.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -2,9 +2,7 @@
import javax.ejb.EJB;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
- at Production
@Whitefish
@Named("whitefish")
class Sole implements ScottishFish
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -4,8 +4,7 @@
import java.util.Iterator;
import java.util.Set;
-import javax.enterprise.inject.deployment.DeploymentType;
-import javax.enterprise.inject.deployment.Production;
+import javax.enterprise.inject.BindingType;
import javax.enterprise.inject.stereotype.Stereotype;
import org.jboss.testharness.impl.packaging.Artifact;
@@ -27,7 +26,7 @@
{
WBClass<Order> annotatedElement = WBClassImpl.of(Order.class, transformer);
assert annotatedElement.getAnnotations().size() == 1;
- assert annotatedElement.getAnnotation(Production.class) != null;
+ assert annotatedElement.getAnnotation(Random.class) != null;
assert annotatedElement.getJavaClass().equals(Order.class);
}
@@ -35,11 +34,11 @@
public void testMetaAnnotations()
{
WBClass<Order> annotatedElement = WBClassImpl.of(Order.class, transformer);
- Set<Annotation> annotations = annotatedElement.getMetaAnnotations(DeploymentType.class);
+ Set<Annotation> annotations = annotatedElement.getMetaAnnotations(BindingType.class);
assert annotations.size() == 1;
Iterator<Annotation> it = annotations.iterator();
Annotation production = it.next();
- assert Production.class.equals(production.annotationType());
+ assert Random.class.equals(production.annotationType());
}
@Test
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Order.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Order.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Order.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,8 +1,7 @@
package org.jboss.webbeans.test.unit.implementation.annotatedItem;
-import javax.enterprise.inject.deployment.Production;
- at Production
+ at Random
class Order
{
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Random.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Random.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Random.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.implementation.annotatedItem;
+
+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.enterprise.inject.BindingType;
+
+ at Target( { TYPE, METHOD, PARAMETER, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+ at BindingType
+public @interface Random
+{
+
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Random.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -8,7 +8,6 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.deployment.Production;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
@@ -49,11 +48,6 @@
return DEFAULT_BINDINGS;
}
- public Class<? extends Annotation> getDeploymentType()
- {
- return Production.class;
- }
-
public Set<InjectionPoint> getInjectionPoints()
{
return Collections.emptySet();
Deleted: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/Order.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/Order.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/Order.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,42 +0,0 @@
-package org.jboss.webbeans.test.unit.xml.beans;
-
-import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.Initializer;
-
-import org.jboss.webbeans.test.unit.xml.beans.annotationtype.TestBindingType;
-import org.jboss.webbeans.test.unit.xml.beans.annotationtype.TestDeploymentType;
-import org.jboss.webbeans.test.unit.xml.beans.annotationtype.TestInterceptorBindingType;
-import org.jboss.webbeans.test.unit.xml.beans.annotationtype.TestStereotype;
-
- at RequestScoped
- at TestBindingType
- at TestInterceptorBindingType
- at TestStereotype
- at TestDeploymentType
-public class Order
-{
- private int val;
-
- private String[] strArr;
-
- @Initializer
- public Order()
- {
- this.val = 0;
- }
-
- public Order(int val)
- {
- this.val = val;
- }
-
- public int getVal()
- {
- return this.val;
- }
-
- public String[] getStrArr()
- {
- return this.strArr;
- }
-}
Deleted: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/TestBean.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/TestBean.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/TestBean.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.test.unit.xml.beans;
-
-public class TestBean
-{
-
-}
Modified: ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/examples/beans.xml
===================================================================
--- ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/examples/beans.xml 2009-07-31 19:00:50 UTC (rev 3389)
+++ ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/examples/beans.xml 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,7 +1,5 @@
<beans>
- <deploy>
- <type>javax.enterprise.inject.deployment.Standard</type>
- <type>javax.enterprise.inject.deployment.Production</type>
- <type>org.jboss.webbeans.test.examples.Mock</type>
- </deploy>
+ <policies>
+ <class>org.jboss.webbeans.test.examples.MockSentenceTranslator</class>
+ </policies>
</beans>
Modified: tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Managers.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Managers.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Managers.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,8 +1,5 @@
package org.jboss.jsr299.tck.spi;
-import java.lang.annotation.Annotation;
-import java.util.List;
-
import javax.enterprise.inject.spi.BeanManager;
import org.jboss.testharness.api.DeploymentException;
@@ -28,13 +25,6 @@
public BeanManager getManager();
/**
- * Returns a list of the enabled deployment types for the current manager
- *
- * @return
- */
- List<Class<? extends Annotation>> getEnabledDeploymentTypes();
-
- /**
* Checks whether there is a definition error, as described in Section 12.4,
* "Problems detected automatically by the container".
*
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -22,11 +22,6 @@
return delegate().getBindings();
}
- public Class<? extends Annotation> getDeploymentType()
- {
- return delegate().getDeploymentType();
- }
-
public Set<InjectionPoint> getInjectionPoints()
{
return delegate().getInjectionPoints();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MyContextual.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MyContextual.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MyContextual.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -10,7 +10,6 @@
import javax.enterprise.context.SessionScoped;
import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.deployment.Standard;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.InjectionPoint;
@@ -30,11 +29,6 @@
return Collections.emptySet();
}
- public Class<? extends Annotation> getDeploymentType()
- {
- return Standard.class;
- }
-
public Set<InjectionPoint> getInjectionPoints()
{
return Collections.emptySet();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,6 +1,9 @@
package org.jboss.jsr299.tck.tests.context.passivating;
- at NonBean class HelsinkiNonSerializable
+import javax.enterprise.inject.Policy;
+
+ at Policy
+class HelsinkiNonSerializable
{
public void ping()
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/NonBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/NonBean.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/NonBean.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,21 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.passivating;
-
-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.enterprise.inject.deployment.DeploymentType;
-
- at Target( { TYPE, METHOD, PARAMETER, FIELD })
- at Retention(RUNTIME)
- at Documented
- at DeploymentType
- at interface NonBean
-{
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Television.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Television.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Television.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,6 +1,8 @@
package org.jboss.jsr299.tck.tests.context.passivating;
- at NonBean
+import javax.enterprise.inject.Policy;
+
+ at Policy
class Television
{
public void turnOn() {}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Violation.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Violation.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Violation.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,6 +1,9 @@
package org.jboss.jsr299.tck.tests.context.passivating;
- at NonBean class Violation
+import javax.enterprise.inject.Policy;
+
+ at Policy
+class Violation
{
public void ping()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CatBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CatBean.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/CatBean.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -8,7 +8,6 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.event.Observes;
-import javax.enterprise.inject.deployment.Production;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
@@ -38,11 +37,6 @@
return new HashSet<Annotation>(){{ add(new CurrentLiteral());}};
}
- public Class<? extends Annotation> getDeploymentType()
- {
- return Production.class;
- }
-
public Set<InjectionPoint> getInjectionPoints()
{
getInjectionPointsCalled = true;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Cat.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Cat.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Cat.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,9 +1,7 @@
package org.jboss.jsr299.tck.tests.definition.binding;
-import javax.enterprise.inject.deployment.Production;
- at Production
@Synchronous
class Cat
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Cod.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Cod.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Cod.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,9 +1,7 @@
package org.jboss.jsr299.tck.tests.definition.binding;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
- at Production
@Whitefish
@Chunky(realChunky=true)
@Named("whitefish")
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Order.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Order.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Order.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,9 +1,7 @@
package org.jboss.jsr299.tck.tests.definition.binding;
import javax.enterprise.inject.Initializer;
-import javax.enterprise.inject.deployment.Production;
- at Production
class Order
{
@Initializer
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/OrderProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/OrderProcessor.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/OrderProcessor.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,8 +1,6 @@
package org.jboss.jsr299.tck.tests.definition.binding;
-import javax.enterprise.inject.deployment.Production;
- at Production
public class OrderProcessor
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/name/Haddock.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/name/Haddock.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/name/Haddock.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,9 +1,7 @@
package org.jboss.jsr299.tck.tests.definition.name;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
- at Production
@Named
class Haddock implements Animal
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/name/SeaBass.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/name/SeaBass.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/name/SeaBass.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,9 +1,7 @@
package org.jboss.jsr299.tck.tests.definition.name;
import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.deployment.Production;
- at Production
@RequestScoped
class SeaBass implements Animal
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/Order.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/Order.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/Order.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,8 +1,6 @@
package org.jboss.jsr299.tck.tests.definition.scope;
-import javax.enterprise.inject.deployment.Production;
- at Production
class Order
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/SeaBass.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/SeaBass.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/SeaBass.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,9 +1,7 @@
package org.jboss.jsr299.tck.tests.definition.scope;
import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.deployment.Production;
- at Production
@RequestScoped
class SeaBass implements Animal
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Order.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Order.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Order.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -2,9 +2,7 @@
import javax.ejb.Remove;
import javax.ejb.Stateful;
-import javax.enterprise.inject.deployment.Production;
- at Production
@Stateful
class Order implements OrderLocal
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/Chicken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/Chicken.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/Chicken.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,8 +1,6 @@
package org.jboss.jsr299.tck.tests.implementation.initializer;
-import javax.enterprise.inject.deployment.Production;
- at Production
class Chicken
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/parameterAnnotatedObserves/DangerCall.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/parameterAnnotatedObserves/DangerCall.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/parameterAnnotatedObserves/DangerCall.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,8 +1,6 @@
package org.jboss.jsr299.tck.tests.implementation.initializer.broken.parameterAnnotatedObserves;
-import javax.enterprise.inject.deployment.Production;
- at Production
class DangerCall
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/SpiderStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/SpiderStereotype.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/SpiderStereotype.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -27,7 +27,6 @@
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
import javax.enterprise.inject.stereotype.Stereotype;
/**
@@ -42,7 +41,6 @@
@Retention(RUNTIME)
@RequestScoped
@Named
- at Production
@interface SpiderStereotype
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/SpiderStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/SpiderStereotype.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/SpiderStereotype.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -27,7 +27,6 @@
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
import javax.enterprise.inject.stereotype.Stereotype;
/**
@@ -41,7 +40,6 @@
@Target( { TYPE, METHOD, FIELD })
@Retention(RUNTIME)
@RequestScoped
- at Production
@Named
public @interface SpiderStereotype
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterAnnotatedDisposes/SpiderProducer_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterAnnotatedDisposes/SpiderProducer_Broken.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterAnnotatedDisposes/SpiderProducer_Broken.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -2,9 +2,7 @@
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.deployment.Production;
- at Production
class SpiderProducer_Broken
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterAnnotatedObserves/SpiderProducer_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterAnnotatedObserves/SpiderProducer_Broken.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterAnnotatedObserves/SpiderProducer_Broken.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -2,9 +2,7 @@
import javax.enterprise.event.Observes;
import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.deployment.Production;
- at Production
class SpiderProducer_Broken
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/NonBeanWithStaticProducerMethod.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/NonBeanWithStaticProducerMethod.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/NonBeanWithStaticProducerMethod.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -2,9 +2,7 @@
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.deployment.Production;
- at Production
class NonBeanWithStaticProducerMethod
{
public NonBeanWithStaticProducerMethod(String someString)
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Cow_NotBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Cow_NotBean.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Cow_NotBean.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,8 +1,6 @@
package org.jboss.jsr299.tck.tests.implementation.simple.definition;
-import javax.enterprise.inject.deployment.Production;
- at Production
abstract class Cow_NotBean
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Donkey.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Donkey.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Donkey.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,8 +1,6 @@
package org.jboss.jsr299.tck.tests.implementation.simple.definition;
-import javax.enterprise.inject.deployment.Production;
- at Production
class Donkey
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/MockEntity.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/MockEntity.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/MockEntity.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,10 +1,8 @@
package org.jboss.jsr299.tck.tests.implementation.simple.definition;
-import javax.enterprise.inject.deployment.Production;
import javax.persistence.Entity;
import javax.persistence.Id;
- at Production
@Entity
public class MockEntity
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/OuterClass.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/OuterClass.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/OuterClass.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,11 +1,9 @@
package org.jboss.jsr299.tck.tests.implementation.simple.definition;
-import javax.enterprise.inject.deployment.Production;
class OuterClass
{
- @Production
class InnerClass_NotBeean
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Sheep.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Sheep.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Sheep.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -2,9 +2,7 @@
import javax.enterprise.inject.Initializer;
import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.deployment.Production;
- at Production
class Sheep
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Turkey.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Turkey.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Turkey.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -2,9 +2,7 @@
import javax.enterprise.inject.Initializer;
import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.deployment.Production;
- at Production
class Turkey
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/tooManyInitializerAnnotatedConstructors/Goose_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/tooManyInitializerAnnotatedConstructors/Goose_Broken.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/tooManyInitializerAnnotatedConstructors/Goose_Broken.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,9 +1,7 @@
package org.jboss.jsr299.tck.tests.implementation.simple.definition.tooManyInitializerAnnotatedConstructors;
import javax.enterprise.inject.Initializer;
-import javax.enterprise.inject.deployment.Production;
- at Production
class Goose_Broken
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Duck.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Duck.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Duck.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -2,10 +2,8 @@
import javax.enterprise.inject.Initializer;
import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.deployment.Production;
- at Production
class Duck
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Goldfish.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Goldfish.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Goldfish.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,11 +1,9 @@
package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.deployment.Production;
@RequestScopedAnimalStereotype
@RequestScoped
- at Production
class Goldfish implements Animal
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/TunaFarm.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/TunaFarm.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/TunaFarm.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,9 +1,7 @@
package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
import javax.enterprise.inject.Current;
-import javax.enterprise.inject.deployment.Production;
- at Production
class TunaFarm
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Order.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Order.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Order.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -2,9 +2,6 @@
import java.io.Serializable;
-import javax.enterprise.inject.deployment.Production;
-
- at Production
class Order implements Serializable
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/ResolutionByNameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/ResolutionByNameTest.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/ResolutionByNameTest.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -16,6 +16,10 @@
*/
package org.jboss.jsr299.tck.tests.lookup.byname;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Bean;
+
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
@@ -36,10 +40,11 @@
@SpecAssertion(section = "11.3.5", id = "aa"),
@SpecAssertion(section = "11.3.5", id = "b")
})
- // WBRI-306
+ // WBRI-331
public void testAmbiguousELNamesResolved() throws Exception
{
// Cod, Plaice and AlaskaPlaice are named "whitefish" - Cod is a not-enabled policy, AlaskaPlaice specializes Plaice
+ Set<Bean<?>> beans = getCurrentManager().getBeans("whitefish");
assert getCurrentManager().getBeans("whitefish").size() == 1;
assert getCurrentManager().getBeans("whitefish").iterator().next().getTypes().contains(AlaskaPlaice.class);
// Both Salmon and Sole are named "fish" - Sole is an enabled policy
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/TunaFarm.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/TunaFarm.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/TunaFarm.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,9 +1,7 @@
package org.jboss.jsr299.tck.tests.lookup.injection;
import javax.enterprise.inject.Current;
-import javax.enterprise.inject.deployment.Production;
- at Production
class TunaFarm
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -26,12 +26,12 @@
import javax.enterprise.inject.TypeLiteral;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecAssertions;
-import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.literals.AnyLiteral;
import org.jboss.jsr299.tck.literals.CurrentLiteral;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -194,9 +194,8 @@
assert !classes.contains(Sole.class);
}
- @Test(groups = { "ri-broken", "policy" })
+ @Test(groups = { "policy" })
@SpecAssertion(section = "5.2", id = "a")
- // WBRI-306
public void testPolicyNotAvailableInNonDeploymentArchive() throws Exception
{
Set<Bean<Spider>> spiders = getBeans(Spider.class, new CurrentLiteral());
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/CatProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/CatProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/CatProducer.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -0,0 +1,42 @@
+/*
+ * 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.policy;
+
+import javax.enterprise.inject.Policy;
+import javax.enterprise.inject.Produces;
+
+class CatProducer
+{
+
+ @Produces @Wild
+ public static final Cat wildCat = new Cat();
+
+ @Produces @Tame
+ @Policy
+ public static final Cat cat = new Cat();
+
+ @Produces @Wild
+ public Cat produceWildCat() {
+ return cat;
+ }
+
+ @Produces @Tame
+ @Policy
+ public Cat produce() {
+ return cat;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/CatProducer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -23,10 +23,10 @@
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.spi.Bean;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-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;
@@ -37,15 +37,18 @@
public class PolicyAvailabilityTest extends AbstractJSR299Test
{
- @Test(groups = {"policy", "ri-broken"})
+ @Test(groups = {"policy"})
@SpecAssertions( {
@SpecAssertion(section = "5.2", id = "b"),
@SpecAssertion(section = "5.2", id = "c"),
- @SpecAssertion(section = "5.2", id = "ea") })
- // WBRI-306
+ @SpecAssertion(section = "5.2", id = "ea"),
+ @SpecAssertion(section = "2.6", id = "a"),
+ @SpecAssertion(section = "2.6.1", id = "a")
+
+ })
public void testPolicyAvailability() throws Exception
{
- Set<Bean<Animal>> animals = getBeans(Animal.class);
+ Set<Bean<Animal>> animals = getBeans(Animal.class);
Set<Type> types = new HashSet<Type>();
for (Bean<Animal> animal : animals) {
types.addAll(animal.getTypes());
@@ -60,19 +63,37 @@
}
@Test(groups = {"policy"})
- @SpecAssertion(section = "5.2", id = "g")
+ @SpecAssertions({
+ @SpecAssertion(section = "5.2", id = "g"),
+ @SpecAssertion(section = "2.6.1", id = "b"),
+ @SpecAssertion(section = "2.7", id = "aa")
+ })
public void testAnyEnabledPolicyStereotypeMakesPolicyEnabled() throws Exception
{
assert getBeans(Bird.class).size() == 1;
assert getCurrentManager().getBeans("bird").size() == 1;
}
- @Test(groups = {"policy", "ri-broken"})
- @SpecAssertion(section = "5.2", id = "fa")
- // WBRI-306
- public void testProducerPolicies() throws Exception
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section = "5.2", id = "fa"),
+ @SpecAssertion(section = "2.6.1", id = "e")
+ })
+
+ public void testProducerPoliciesOnClass() throws Exception
{
assert getBeans(Sheep.class, new AnnotationLiteral<Wild>(){}).size() == 2;
assert getBeans(Sheep.class, new AnnotationLiteral<Tame>(){}).size() == 0;
}
+
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section = "2.6.1", id = "c"),
+ @SpecAssertion(section = "2.6.1", id = "d")
+ })
+ public void testProducerPoliciesOnMethodAndField() throws Exception
+ {
+ assert getBeans(Cat.class, new AnnotationLiteral<Wild>(){}).size() == 2;
+ assert getBeans(Cat.class, new AnnotationLiteral<Tame>(){}).size() == 0;
+ }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/NoClassWithSpecifiedNameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/NoClassWithSpecifiedNameTest.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/NoClassWithSpecifiedNameTest.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -16,10 +16,10 @@
*/
package org.jboss.jsr299.tck.tests.policy.broken.incorrect.name;
-import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
@@ -32,9 +32,8 @@
public class NoClassWithSpecifiedNameTest extends AbstractJSR299Test
{
- @Test(groups = { "policy", "ri-broken" })
+ @Test(groups = { "policy" })
@SpecAssertion(section="5.2", id="h")
- // WBRI-306
public void test()
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/stereotype/NoAnnotationWithSpecifiedNameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/stereotype/NoAnnotationWithSpecifiedNameTest.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/incorrect/name/stereotype/NoAnnotationWithSpecifiedNameTest.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -16,10 +16,10 @@
*/
package org.jboss.jsr299.tck.tests.policy.broken.incorrect.name.stereotype;
-import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
@@ -32,9 +32,8 @@
public class NoAnnotationWithSpecifiedNameTest extends AbstractJSR299Test
{
- @Test(groups = { "policy", "ri-broken" })
+ @Test(groups = { "policy"})
@SpecAssertion(section="5.2", id="i")
- // WBRI-306
public void test()
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/ClassIsNotPolicyTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/ClassIsNotPolicyTest.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/ClassIsNotPolicyTest.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -16,10 +16,10 @@
*/
package org.jboss.jsr299.tck.tests.policy.broken.not.policy;
-import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
@@ -32,9 +32,8 @@
public class ClassIsNotPolicyTest extends AbstractJSR299Test
{
- @Test(groups = { "policy", "ri-broken" })
+ @Test(groups = { "policy" })
@SpecAssertion(section="5.2", id="h")
- // WBRI-306
public void test()
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/stereotype/ClassIsNotPolicyTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/stereotype/ClassIsNotPolicyTest.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/not/policy/stereotype/ClassIsNotPolicyTest.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -16,10 +16,10 @@
*/
package org.jboss.jsr299.tck.tests.policy.broken.not.policy.stereotype;
-import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
@@ -32,9 +32,8 @@
public class ClassIsNotPolicyTest extends AbstractJSR299Test
{
- @Test(groups = { "policy", "ri-broken" })
+ @Test(groups = { "policy" })
@SpecAssertion(section="5.2", id="i")
- // WBRI-306
public void test()
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/SameTypeListedTwiceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/SameTypeListedTwiceTest.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/broken/same/type/twice/SameTypeListedTwiceTest.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -16,10 +16,10 @@
*/
package org.jboss.jsr299.tck.tests.policy.broken.same.type.twice;
-import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
@@ -32,9 +32,8 @@
public class SameTypeListedTwiceTest extends AbstractJSR299Test
{
- @Test(groups = { "policy", "ri-broken" })
+ @Test(groups = { "policy" })
@SpecAssertion(section="5.2", id="j")
- // WBRI-306
public void test()
{
assert false;
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/DisabledEjbInterface.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/DisabledEjbInterface.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/DisabledEjbInterface.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.policy.enterprise;
+
+import javax.ejb.Local;
+
+ at Local
+interface DisabledEjbInterface
+{
+ String hello();
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/DisabledEjbInterface.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EjbInterface.java (from rev 3383, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EjbRemote.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EjbInterface.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EjbInterface.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.policy.enterprise;
+
+import javax.ejb.Local;
+
+ at Local
+interface EjbInterface
+{
+ String hello();
+}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EjbRemote.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EjbRemote.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EjbRemote.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -1,9 +0,0 @@
-package org.jboss.jsr299.tck.tests.policy.enterprise;
-
-import javax.ejb.Local;
-
- at Local
-interface EjbRemote
-{
- String hello();
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EnabledEjb.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EnabledEjb.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/EnabledEjb.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -5,7 +5,7 @@
@Stateless
@Policy
-class EnabledEjb implements EjbRemote
+class EnabledEjb implements EjbInterface
{
public String hello() {
return "Hello world!";
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/NotEnabledEjb.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/NotEnabledEjb.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/NotEnabledEjb.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -5,7 +5,7 @@
@Stateless
@Policy
-class NotEnabledEjb implements EjbRemote
+class NotEnabledEjb implements DisabledEjbInterface
{
public String hello() {
return "Hi!";
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/SessionBeanPolicyTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/SessionBeanPolicyTest.java 2009-07-31 19:00:50 UTC (rev 3389)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/enterprise/SessionBeanPolicyTest.java 2009-08-02 09:48:11 UTC (rev 3390)
@@ -16,9 +16,9 @@
*/
package org.jboss.jsr299.tck.tests.policy.enterprise;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
-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;
@@ -34,12 +34,11 @@
public class SessionBeanPolicyTest extends AbstractJSR299Test
{
- @Test(groups = { "policy", "ri-broken" })
+ @Test(groups = { "policy"})
@SpecAssertion(section = "5.2", id = "eb")
- // WBRI-306
public void testEnabledPolicyAvailable()
{
- assert getBeans(EjbRemote.class).size() == 1;
- assert getBeans(EjbRemote.class).iterator().next().getTypes().contains(EnabledEjb.class);
+ assert getBeans(EjbInterface.class).size() == 1;
+ assert getBeans(EjbInterface.class).iterator().next().getTypes().contains(EjbInterface.class);
}
}
More information about the weld-commits
mailing list