[webbeans-commits] Webbeans SVN: r3399 - ri/trunk/osgi-bundle.
by webbeans-commits@lists.jboss.org
Author: rogerk
Date: 2009-08-04 12:57:40 -0400 (Tue, 04 Aug 2009)
New Revision: 3399
Modified:
ri/trunk/osgi-bundle/pom.xml
Log:
ported from 1.0.0.PREVIEW2 branch - namely the fixes to exporting packages
Modified: ri/trunk/osgi-bundle/pom.xml
===================================================================
--- ri/trunk/osgi-bundle/pom.xml 2009-08-04 06:56:39 UTC (rev 3398)
+++ ri/trunk/osgi-bundle/pom.xml 2009-08-04 16:57:40 UTC (rev 3399)
@@ -59,9 +59,9 @@
<_include>-osgi.bundle</_include>
<Embed-Dependency>*; scope=compile; inline=true</Embed-Dependency>
- <_exportcontents>javax.event; javax.context; javax.webbeans; javax.decorator; javax.inject; javax.enterprise.inject.spi; version=${osgi.version},
- org.jboss.webbeans.*.api.*; org.jboss.webbeans.*.spi.*; org.jboss.webbeans.conversation; org.jboss.webbeans.bootstrap; org.jboss.webbeans.introspector; org.jboss.webbeans.servlet; version=${osgi.version},
- org.jboss.webbeans.ejb; org.jboss.webbeans.el; include:="WebBeansELResolver"; version=${osgi.version},
+ <_exportcontents>javax.event; javax.context; javax.webbeans; javax.decorator; javax.inject; javax.enterprise.*; version=${osgi.version},
+ org.jboss.webbeans.ejb; org.jboss.webbeans.bean.proxy; org.jboss.webbeans.*.api.*; org.jboss.webbeans.*.spi.*; org.jboss.webbeans.conversation; org.jboss.webbeans; org.jboss.webbeans.bootstrap; org.jboss.webbeans.introspector; org.jboss.webbeans.servlet; version=${osgi.version},
+ org.jboss.webbeans.el; include:="WebBeansELResolver"; version=${osgi.version},
org.jboss.webbeans.jsf; include:="WebBeansPhaseListener"; version=${osgi.version},
javassist.util.proxy;version="3.8.1.GA"
</_exportcontents>
@@ -126,10 +126,10 @@
<artifactId>javassist</artifactId>
</dependency>
<dependency>
+ <groupId>com.google.collections</groupId>
+ <artifactId>google-collections</artifactId>
+ </dependency>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- </dependency>
</dependencies>
</project>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3398 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-08-04 02:56:39 -0400 (Tue, 04 Aug 2009)
New Revision: 3398
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxFarm.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxHole.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Missile.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/MissileInterceptor.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
Log:
dependent context tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-08-03 22:03:52 UTC (rev 3397)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-08-04 06:56:39 UTC (rev 3398)
@@ -43,6 +43,24 @@
FoxRun foxRun = foxRunBean.create(creationalContext);
assert !foxRun.fox.equals(foxRun.anotherFox);
}
+
+ @Test(groups = { "contexts", "injection" })
+ @SpecAssertions({
+ @SpecAssertion(section = "6.4.1", id = "ga"),
+ @SpecAssertion(section = "6.4.1", id = "gb"),
+ @SpecAssertion(section = "6.4.1", id = "gc")
+ })
+ public void testDependentBeanIsDependentObjectOfBeanInjectedInto()
+ {
+ FoxFarm foxFarm = getInstanceByType(FoxFarm.class);
+ FoxHole foxHole = getInstanceByType(FoxHole.class);
+
+ assert !foxFarm.fox.equals(foxHole.fox);
+ assert !foxFarm.fox.equals(foxFarm.constructorFox);
+
+ assert !foxFarm.constructorFox.equals(foxHole.initializerFox);
+ assert !foxHole.fox.equals(foxHole.initializerFox);
+ }
@Test(groups = { "contexts", "el" })
@SpecAssertion(section = "6.4", id = "c")
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxFarm.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxFarm.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxFarm.java 2009-08-04 06:56:39 UTC (rev 3398)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Initializer;
+
+class FoxFarm
+{
+ @Current public Fox fox;
+
+ public Fox constructorFox;
+
+ @Initializer
+ public FoxFarm(@Current Fox fox)
+ {
+ this.constructorFox = fox;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxHole.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxHole.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxHole.java 2009-08-04 06:56:39 UTC (rev 3398)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Initializer;
+
+class FoxHole
+{
+ @Current public Fox fox;
+
+ public Fox initializerFox;
+
+ @Initializer
+ public void init(@Current Fox fox)
+ {
+ this.initializerFox = fox;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Missile.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Missile.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Missile.java 2009-08-04 06:56:39 UTC (rev 3398)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+import javax.interceptor.Interceptors;
+
+(a)Interceptors(MissileInterceptor.class)
+class Missile
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/MissileInterceptor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/MissileInterceptor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/MissileInterceptor.java 2009-08-04 06:56:39 UTC (rev 3398)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+@Interceptor
+class MissileInterceptor
+{
+ public Object intercept(InvocationContext context) throws Exception
+ {
+ return context.proceed();
+ }
+}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3397 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-08-03 18:03:52 -0400 (Mon, 03 Aug 2009)
New Revision: 3397
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/AnimalStereotype.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Transactional.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/NonBindingType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Secure.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/SecureInterceptor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/ShoppingCart.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Transactional.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/TransactionalInterceptor.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Interceptor1.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorType1.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/DerivedBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
More tests for ch. 11 and removed unused method from BeanManagerImpl.
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-08-03 20:31:21 UTC (rev 3396)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-08-03 22:03:52 UTC (rev 3397)
@@ -1316,12 +1316,6 @@
throw new UnsupportedOperationException("Not yet implemented");
}
- @Deprecated
- public <X> Bean<? extends X> getHighestPrecedenceBean(Set<Bean<? extends X>> beans)
- {
- return resolve(beans);
- }
-
public ELResolver getELResolver()
{
return webbeansELResolver;
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/AnimalStereotype.java (from rev 3393, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/AnimalStereotype.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/AnimalStereotype.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/AnimalStereotype.java 2009-08-03 22:03:52 UTC (rev 3397)
@@ -0,0 +1,23 @@
+package org.jboss.jsr299.tck.tests.extensions.beanManager;
+
+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;
+
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.stereotype.Stereotype;
+
+@Stereotype
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@RequestScoped
+@Inherited
+@interface AnimalStereotype
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java 2009-08-03 20:31:21 UTC (rev 3396)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java 2009-08-03 22:03:52 UTC (rev 3397)
@@ -17,14 +17,28 @@
package org.jboss.jsr299.tck.tests.extensions.beanManager;
+import java.lang.annotation.Annotation;
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
import java.util.HashSet;
import java.util.Set;
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.context.ScopeType;
import javax.enterprise.inject.AmbiguousResolutionException;
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.BindingType;
import javax.enterprise.inject.InjectionException;
+import javax.enterprise.inject.Specializes;
+import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
+import javax.enterprise.inject.spi.InjectionTarget;
import javax.enterprise.inject.spi.PassivationCapable;
+import javax.enterprise.inject.stereotype.Stereotype;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
@@ -88,4 +102,93 @@
// Wrap the injection point to change the type to a more generalized class
getCurrentManager().validate(injectionPoint);
}
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "11.3.14", id = "aa")
+ public void testDetermineBindingType()
+ {
+ assert getCurrentManager().isBindingType(Tame.class);
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "11.3.14", id = "ab")
+ public void testDetermineScopeType()
+ {
+ assert getCurrentManager().isScopeType(ApplicationScoped.class);
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "11.3.14", id = "ac")
+ public void testDetermineStereotype()
+ {
+ assert getCurrentManager().isBindingType(AnimalStereotype.class);
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "11.3.14", id = "ad")
+ public void testDetermineInterceptorBindingType()
+ {
+ assert getCurrentManager().isInterceptorBindingType(Transactional.class);
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "11.3.14", id = "ae")
+ public void testGetMetaAnnotationsForStereotype()
+ {
+ Set<Annotation> stereotypeAnnotations = getCurrentManager().getStereotypeDefinition(AnimalStereotype.class);
+ assert stereotypeAnnotations.size() == 5;
+ assert stereotypeAnnotations.contains(new AnnotationLiteral<Stereotype>() {});
+ assert stereotypeAnnotations.contains(new AnnotationLiteral<Target>() {});
+ assert stereotypeAnnotations.contains(new AnnotationLiteral<Retention>() {});
+ assert stereotypeAnnotations.contains(new AnnotationLiteral<RequestScoped>() {});
+ assert stereotypeAnnotations.contains(new AnnotationLiteral<Inherited>() {});
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "11.3.14", id = "af")
+ public void testGetMetaAnnotationsForInterceptorBindingType()
+ {
+ Set<Annotation> metaAnnotations = getCurrentManager().getInterceptorBindingTypeDefinition(Transactional.class);
+ assert metaAnnotations.size() == 4;
+ assert metaAnnotations.contains(new AnnotationLiteral<Target>() {});
+ assert metaAnnotations.contains(new AnnotationLiteral<Retention>() {});
+ assert metaAnnotations.contains(new AnnotationLiteral<Documented>() {});
+ assert metaAnnotations.contains(new AnnotationLiteral<BindingType>() {});
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "11.3.14", id = "ag")
+ public void testGetScopeType()
+ {
+ ScopeType scopeType = getCurrentManager().getScopeDefinition(RequestScoped.class);
+ assert scopeType.normal();
+ assert scopeType.passivating();
+ }
+
+ @Test
+ @SpecAssertion(section = "11.3.16", id = "a")
+ public void testGetELResolver()
+ {
+ assert getCurrentManager().getELResolver() != null;
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "11.3.17", id = "a")
+ public void testObtainingAnnotatedType()
+ {
+ AnnotatedType<?> annotatedType = getCurrentManager().createAnnotatedType(DerivedBean.class);
+ assert annotatedType.isAnnotationPresent(Specializes.class);
+ assert annotatedType.isAnnotationPresent(Tame.class);
+ assert annotatedType.getFields().size() == 1;
+ assert annotatedType.getMethods().isEmpty();
+ assert annotatedType.getTypeClosure().size() == 3;
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "11.3.18", id = "aa")
+ public void testObtainingInjectionTarget()
+ {
+ AnnotatedType<?> annotatedType = getCurrentManager().createAnnotatedType(DerivedBean.class);
+ assert getCurrentManager().createInjectionTarget(annotatedType) != null;
+ }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/DerivedBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/DerivedBean.java 2009-08-03 20:31:21 UTC (rev 3396)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/DerivedBean.java 2009-08-03 22:03:52 UTC (rev 3397)
@@ -5,5 +5,5 @@
@Specializes @Tame
class DerivedBean extends SimpleBean
{
-
+ protected int simpleField;
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Transactional.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Transactional.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Transactional.java 2009-08-03 22:03:52 UTC (rev 3397)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.extensions.beanManager;
+
+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;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Transactional
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Transactional.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Interceptor1.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Interceptor1.java 2009-08-03 20:31:21 UTC (rev 3396)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Interceptor1.java 2009-08-03 22:03:52 UTC (rev 3397)
@@ -1,13 +0,0 @@
-package org.jboss.jsr299.tck.tests.interceptors.definition;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-@InterceptorType1
-class Interceptor1
-{
- @AroundInvoke public Object alwaysReturnThis(InvocationContext ctx) throws Exception
- {
- return ctx.proceed();
- }
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java 2009-08-03 20:31:21 UTC (rev 3396)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java 2009-08-03 22:03:52 UTC (rev 3397)
@@ -17,10 +17,14 @@
package org.jboss.jsr299.tck.tests.interceptors.definition;
+import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.spi.InterceptionType;
import javax.enterprise.inject.spi.Interceptor;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -49,7 +53,7 @@
public void testInterceptorsImplementInterceptorInterface()
{
boolean interfaceFound = false;
- for (Type type : getInterfacesImplemented(getBeans(Interceptor1.class).iterator().next().getClass()))
+ for (Type type : getInterfacesImplemented(getBeans(TransactionalInterceptor.class).iterator().next().getClass()))
{
if (type.equals(Interceptor.class))
{
@@ -66,4 +70,53 @@
interfaces.addAll(new HierarchyDiscovery(clazz).getFlattenedTypes());
return interfaces;
}
+
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.3.13", id = "a")
+ })
+ public void testResolveInterceptorsReturnsOrderedList()
+ {
+ Annotation transactionalBinding = new AnnotationLiteral<Transactional>() {};
+ Annotation secureBinding = new AnnotationLiteral<Secure>() {};
+ List<Interceptor<?>> interceptors = getCurrentManager().resolveInterceptors(
+ InterceptionType.AROUND_INVOKE,
+ transactionalBinding,
+ secureBinding
+ );
+ assert interceptors.size() == 2;
+ assert interceptors.get(0).getInterceptorBindingTypes().size() == 1;
+ assert interceptors.get(0).getInterceptorBindingTypes().contains(transactionalBinding);
+ assert interceptors.get(1).getInterceptorBindingTypes().size() == 1;
+ assert interceptors.get(1).getInterceptorBindingTypes().contains(secureBinding);
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.3.13", id = "b")
+ })
+ public void testSameBindingTypesToResolveInterceptorsFails()
+ {
+ Annotation transactionalBinding = new AnnotationLiteral<Transactional>() {};
+ getCurrentManager().resolveInterceptors(InterceptionType.AROUND_INVOKE, transactionalBinding, transactionalBinding);
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.3.13", id = "c")
+ })
+ public void testNoBindingTypesToResolveInterceptorsFails()
+ {
+ getCurrentManager().resolveInterceptors(InterceptionType.AROUND_INVOKE);
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.3.13", id = "d")
+ })
+ public void testNonBindingTypeToResolveInterceptorsFails()
+ {
+ Annotation nonBinding = new AnnotationLiteral<NonBindingType>() {};
+ getCurrentManager().resolveInterceptors(InterceptionType.AROUND_INVOKE, nonBinding);
+ }
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorType1.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorType1.java 2009-08-03 20:31:21 UTC (rev 3396)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorType1.java 2009-08-03 22:03:52 UTC (rev 3397)
@@ -1,18 +0,0 @@
-package org.jboss.jsr299.tck.tests.interceptors.definition;
-
-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.Retention;
-import java.lang.annotation.Target;
-
-import javax.interceptor.Interceptor;
-
-@Target({TYPE, METHOD})
-@Retention(RUNTIME)
-@Interceptor
-@interface InterceptorType1
-{
-
-}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/NonBindingType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/NonBindingType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/NonBindingType.java 2009-08-03 22:03:52 UTC (rev 3397)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition;
+
+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;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@interface NonBindingType
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/NonBindingType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Secure.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Secure.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Secure.java 2009-08-03 22:03:52 UTC (rev 3397)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition;
+
+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;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Secure
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Secure.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/SecureInterceptor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/SecureInterceptor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/SecureInterceptor.java 2009-08-03 22:03:52 UTC (rev 3397)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+@Secure @Interceptor
+class SecureInterceptor
+{
+ @AroundInvoke public Object alwaysReturnThis(InvocationContext ctx) throws Exception
+ {
+ return ctx.proceed();
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/SecureInterceptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/ShoppingCart.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/ShoppingCart.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/ShoppingCart.java 2009-08-03 22:03:52 UTC (rev 3397)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition;
+
+@Transactional @Secure
+class ShoppingCart
+{
+ public void placeOrder()
+ {
+
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/ShoppingCart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Transactional.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Transactional.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Transactional.java 2009-08-03 22:03:52 UTC (rev 3397)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition;
+
+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;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Transactional
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Transactional.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/TransactionalInterceptor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/TransactionalInterceptor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/TransactionalInterceptor.java 2009-08-03 22:03:52 UTC (rev 3397)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+@Transactional @Interceptor
+class TransactionalInterceptor
+{
+ @AroundInvoke public Object alwaysReturnThis(InvocationContext ctx) throws Exception
+ {
+ return ctx.proceed();
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/TransactionalInterceptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-03 20:31:21 UTC (rev 3396)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-03 22:03:52 UTC (rev 3397)
@@ -4549,9 +4549,33 @@
</section>
<section id="11.3.14" title="Determining if an annotation is a binding type, scope type, stereotype or interceptor binding type">
- <assertion id="a">
- <text>A portable extension may test an annotation to determine if it is a binding type, scope type, stereotype or interceptor binding type, obtain the set of meta-annotations declared by a stereotype or interceptor binding type, or obtain a |ScopeType| representing a scope type.</text>
+ <assertion id="aa">
+ <text>A portable extension may test an annotation to determine if it is a _binding type_, scope type, stereotype or interceptor binding type, obtain the set of meta-annotations declared by a stereotype or interceptor binding type, or obtain a |ScopeType| representing a scope type.</text>
</assertion>
+
+ <assertion id="ab">
+ <text>A portable extension may test an annotation to determine if it is a binding type, _scope type_, stereotype or interceptor binding type, obtain the set of meta-annotations declared by a stereotype or interceptor binding type, or obtain a |ScopeType| representing a scope type.</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>A portable extension may test an annotation to determine if it is a binding type, scope type, _stereotype_ or interceptor binding type, obtain the set of meta-annotations declared by a stereotype or interceptor binding type, or obtain a |ScopeType| representing a scope type.</text>
+ </assertion>
+
+ <assertion id="ad">
+ <text>A portable extension may test an annotation to determine if it is a binding type, scope type, stereotype or _interceptor binding type_, obtain the set of meta-annotations declared by a stereotype or interceptor binding type, or obtain a |ScopeType| representing a scope type.</text>
+ </assertion>
+
+ <assertion id="ae">
+ <text>A portable extension may test an annotation to determine if it is a binding type, scope type, stereotype or interceptor binding type, obtain the set of meta-annotations declared by a _stereotype_ or interceptor binding type, or obtain a |ScopeType| representing a scope type.</text>
+ </assertion>
+
+ <assertion id="af">
+ <text>A portable extension may test an annotation to determine if it is a binding type, scope type, stereotype or interceptor binding type, obtain the set of meta-annotations declared by a stereotype or _interceptor binding type_, or obtain a |ScopeType| representing a scope type.</text>
+ </assertion>
+
+ <assertion id="ag">
+ <text>A portable extension may test an annotation to determine if it is a binding type, scope type, stereotype or interceptor binding type, obtain the set of meta-annotations declared by a stereotype or interceptor binding type, or obtain a _|ScopeType| representing a scope type_.</text>
+ </assertion>
</section>
<section id="11.3.15" title="Obtaining the active Context for a scope">
@@ -4573,9 +4597,13 @@
</section>
<section id="11.3.18" title="Obtaining an InjectionTarget">
- <assertion id="a">
- <text>The method |BeanManager.createInjectionTarget()| returns a container provided implementation of |InjectionTarget| for a given |AnnotatedType| or throws an |IllegalArgumentException| if there is a definition error associated with any injection point of the type.</text>
+ <assertion id="aa">
+ <text>The method |BeanManager.createInjectionTarget()| returns a container provided implementation of |InjectionTarget| for a given |AnnotatedType| ~or throws an |IllegalArgumentException| if there is a definition error associated with any injection point of the type~.</text>
</assertion>
+
+ <assertion id="ab">
+ <text>The method |BeanManager.createInjectionTarget()| ~returns a container provided implementation of |InjectionTarget| for a given |AnnotatedType|~ or throws an |IllegalArgumentException| if there is a definition error associated with any injection point of the type.</text>
+ </assertion>
</section>
<section id="11.4" title="Alternative metadata sources">
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3396 - ri/trunk/impl/src/main/java/org/jboss/webbeans/util and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-03 16:31:21 -0400 (Mon, 03 Aug 2009)
New Revision: 3396
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/TypeSafeBeanResolver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java
Log:
WBRI-331
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-08-03 13:07:59 UTC (rev 3395)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/TypeSafeBeanResolver.java 2009-08-03 20:31:21 UTC (rev 3396)
@@ -18,6 +18,7 @@
import java.util.HashSet;
import java.util.Set;
+import java.util.concurrent.Callable;
import javax.enterprise.inject.spi.Bean;
@@ -26,6 +27,7 @@
import org.jboss.webbeans.bean.standard.InstanceBean;
import org.jboss.webbeans.util.Beans;
import org.jboss.webbeans.util.Reflections;
+import org.jboss.webbeans.util.collections.ConcurrentCache;
/**
* @author pmuir
@@ -34,9 +36,11 @@
public class TypeSafeBeanResolver<T extends Bean<?>> extends TypeSafeResolver<T>
{
- private final BeanManagerImpl manager;
public static final Set<ResolvableTransformer> TRANSFORMERS;
+ private final BeanManagerImpl manager;
+ private final ConcurrentCache<Set<?>, Set<Bean<?>>> disambiguatedBeans;
+
static
{
TRANSFORMERS = new HashSet<ResolvableTransformer>();
@@ -48,6 +52,7 @@
{
super(beans);
this.manager = manager;
+ this.disambiguatedBeans = new ConcurrentCache<Set<?>, Set<Bean<?>>>();
}
@Override
@@ -82,43 +87,33 @@
return matched;
}
- public <X> Set<Bean<? extends X>> resolve(Set<Bean<? extends X>> beans)
+ public <X> Set<Bean<? extends X>> resolve(final Set<Bean<? extends X>> beans)
{
- if (beans.size() <= 1)
+ return disambiguatedBeans.<Set<Bean<? extends X>>>putIfAbsent(beans, new Callable<Set<Bean<? extends X>>>()
{
- 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)
+ public Set<Bean<? extends X>> call() throws Exception
{
- if (bean.isPolicy())
+ Set<Bean<? extends X>> disambiguatedBeans = beans;
+ if (disambiguatedBeans.size() > 1)
{
- policies.add(bean);
+ boolean policyPresent = Beans.isPolicyPresent(disambiguatedBeans);
+ disambiguatedBeans = new HashSet<Bean<? extends X>>();
+
+ for (Bean<? extends X> bean : beans)
+ {
+ if (policyPresent ? bean.isPolicy() : true && !Beans.isSpecialized(bean, beans, manager.getSpecializedBeans()))
+ {
+ disambiguatedBeans.add(bean);
+ }
+ }
+
}
+ return disambiguatedBeans;
}
-
- return policies;
- }
- else
- {
- return beans;
- }
+
+ });
+
}
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-08-03 13:07:59 UTC (rev 3395)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-08-03 20:31:21 UTC (rev 3396)
@@ -20,9 +20,11 @@
import java.lang.reflect.Type;
import java.util.Collection;
import java.util.HashSet;
+import java.util.Map;
import java.util.Set;
import javax.decorator.Decorates;
+import javax.enterprise.context.spi.Contextual;
import javax.enterprise.inject.BindingType;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.Bean;
@@ -226,4 +228,43 @@
}
return false;
}
+
+ /**
+ * Check if any of the beans is a policy
+ *
+ * @param beans
+ * @return
+ */
+ public static <X> boolean isPolicyPresent(Set<Bean<? extends X>> beans)
+ {
+ for (Bean<?> bean : beans)
+ {
+ if (bean.isPolicy())
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Check if bean is specialized by any of beans
+ *
+ * @param bean
+ * @param beans
+ * @param specializedBeans
+ * @return
+ */
+ public static <X> boolean isSpecialized(Bean<? extends X> bean, Set<Bean<? extends X>> beans, Map<Contextual<?>, Contextual<?>> specializedBeans)
+ {
+ if (specializedBeans.containsKey(bean))
+ {
+ if (beans.contains(specializedBeans.get(bean)))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java 2009-08-03 13:07:59 UTC (rev 3395)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java 2009-08-03 20:31:21 UTC (rev 3396)
@@ -55,9 +55,8 @@
assert bean == passivatingBean;
}
- @Test(groups = "ri-broken")
+ @Test
@SpecAssertion(section = "11.3.8", id = "a")
- //WBRI-331
public void testAmbiguousDependencyResolved()
{
Set<Bean<?>> beans = new HashSet<Bean<?>>();
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3395 - in tck/trunk/impl/src/main: resources and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-08-03 09:07:59 -0400 (Mon, 03 Aug 2009)
New Revision: 3395
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxRun.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
more assertion groupings
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-08-03 11:19:53 UTC (rev 3394)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-08-03 13:07:59 UTC (rev 3395)
@@ -28,7 +28,10 @@
private static final Annotation PET_LITERAL = new AnnotationLiteral<Pet> () {};
@Test(groups = { "contexts", "injection" })
- @SpecAssertion(section = "6.4", id = "a")
+ @SpecAssertions({
+ @SpecAssertion(section = "6.4", id = "a"),
+ @SpecAssertion(section = "6.4.1", id = "ga")
+ })
public void testInstanceNotSharedBetweenInjectionPoints()
{
Set<Bean<Fox>> foxBeans = getBeans(Fox.class);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxRun.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxRun.java 2009-08-03 11:19:53 UTC (rev 3394)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxRun.java 2009-08-03 13:07:59 UTC (rev 3395)
@@ -6,10 +6,9 @@
@Named("foxRun")
class FoxRun
-{
-
+{
private static boolean destroyed = false;
-
+
@Current
public Fox fox;
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-03 11:19:53 UTC (rev 3394)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-03 13:07:59 UTC (rev 3395)
@@ -1703,22 +1703,26 @@
</assertion>
</section>
- <section id="4.3.2" title="Most specialized enabled bean for a bean">
- <assertion id="a">
- <text>Non-static producer methods, ~producer fields, disposal methods and observer methods~ of a bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 5.6.6, "Invocation of producer or disposal methods", Section 5.6.7, "Access to producer field values" and Section 5.6.8, "Invocation of observer methods".</text>
- </assertion>
+ <section id="4.3.2" title="Most specialized enabled bean for a bean">
+ <group>
+ <text>Non-static producer methods, producer fields, disposal methods and observer methods of a bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 5.6.6, "Invocation of producer or disposal methods", Section 5.6.7, "Access to producer field values" and Section 5.6.8, "Invocation of observer methods".</text>
+
+ <assertion id="a">
+ <text>Test with non-static producer method.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Test with non-static producer field.</text>
+ </assertion>
- <assertion id="b">
- <text>Non-static ~producer methods,~ producer fields~, disposal methods and observer methods~ of a bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 5.6.6, "Invocation of producer or disposal methods", Section 5.6.7, "Access to producer field values" and Section 5.6.8, "Invocation of observer methods".</text>
- </assertion>
-
- <assertion id="c">
- <text>Non-static ~producer methods, producer fields,~ disposal methods~ and observer methods~ of a bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 5.6.6, "Invocation of producer or disposal methods", Section 5.6.7, "Access to producer field values" and Section 5.6.8, "Invocation of observer methods".</text>
- </assertion>
-
- <assertion id="d">
- <text>Non-static ~producer methods, producer fields, disposal methods and~ observer methods of a bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 5.6.6, "Invocation of producer or disposal methods", Section 5.6.7, "Access to producer field values" and Section 5.6.8, "Invocation of observer methods".</text>
- </assertion>
+ <assertion id="c">
+ <text>Test with non-static disposal method.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Test with non-static observer method.</text>
+ </assertion>
+ </group>
</section>
@@ -1740,18 +1744,22 @@
</assertion>
</section>
- <section id="5.1" title="Inter-module accessibility in Java EE">
- <assertion id="aa">
- <text>Beans packaged in a certain Java EE _module or library are available for _injection_, lookup and EL resolution to classes and JSP/JSF pages packaged in some other Java EE module or library if and only if the first module or library is required to be accessible to the other module or library by the Java EE platform specification.</text>
- </assertion>
-
- <assertion id="ab">
- <text>Beans packaged in a certain Java EE module or library are available for injection, _lookup_ and EL resolution to classes and JSP/JSF pages packaged in some other Java EE module or library if and only if the first module or library is required to be accessible to the other module or library by the Java EE platform specification.</text>
- </assertion>
-
- <assertion id="ac">
- <text>Beans packaged in a certain Java EE module or library are available for injection, lookup and _EL resolution_ to classes and JSP/JSF pages packaged in some other Java EE module or library if and only if the first module or library is required to be accessible to the other module or library by the Java EE platform specification.</text>
- </assertion>
+ <section id="5.1" title="Inter-module accessibility in Java EE">
+ <group>
+ <text>Beans packaged in a certain Java EE _module or library are available for injection, lookup and EL resolution to classes and JSP/JSF pages packaged in some other Java EE module or library if and only if the first module or library is required to be accessible to the other module or library by the Java EE platform specification.</text>
+
+ <assertion id="aa">
+ <text>Test with injection.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>Test with lookup.</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>Test with EL resolution.</text>
+ </assertion>
+ </group>
<assertion id="b">
<text>For a custom implementation of the |Bean| interface defined in Section 11.1, "The Bean interface", the container calls |getBeanClass()| to determine the bean class of the bean.</text>
@@ -1772,10 +1780,6 @@
<text>A policy is never available for injection, lookup or EL resolution in a Java EE module or library that is not a bean deployment archive (a module or library with no beans.xml file).</text>
</assertion>
- <assertion id="a">
- <text>A policy is never available for injection, lookup or EL resolution in a Java EE module or library that is not a bean deployment archive (a module or library with no beans.xml file).</text>
- </assertion>
-
<assertion id="b">
<text>Nor is a policy available for injection, lookup or EL resolution in every bean deployment archive. A policy must be explicitly enabled in every bean deployment archive in which the policy should be available for injection, lookup and EL resolution.</text>
</assertion>
@@ -1787,26 +1791,30 @@
<assertion id="d" testable="false">
<text>The <policies> element contains a list of bean classes and stereotypes. </text>
</assertion>
+
+ <group>
+ <text>A policy is enabled for the bean deployment archive if the policy is a managed bean or session bean and the bean class of the bean is listed.</text>
+
+ <assertion id="ea">
+ <text>Test with a managed bean.</text>
+ </assertion>
+
+ <assertion id="eb">
+ <text>Test with a session bean.</text>
+ </assertion>
+ </group>
- <assertion id="ea">
- <text>A policy is enabled for the bean deployment archive if the policy is a _managed bean_ or ~session bean~ and the bean class of the bean is listed.</text>
- </assertion>
-
- <assertion id="eb">
- <text>A policy is enabled for the bean deployment archive if the policy is a ~managed bean~ or _session bean_ and the bean class of the bean is listed.</text>
- </assertion>
-
- <group>
- <text>A policy is enabled for the bean deployment archive if the policy is a producer method, field or resource, and the bean class that declares the method or field is listed.</text>
+ <group>
+ <text>A policy is enabled for the bean deployment archive if the policy is a producer method, field or resource, and the bean class that declares the method or field is listed.</text>
<assertion id="fa">
- <text>Test for enablement of a producer method and field.</text>
- </assertion>
+ <text>Test for enablement of a producer method and field.</text>
+ </assertion>
<assertion id="fb">
- <text>Test for enablement of a resource.</text>
- </assertion>
- </group>
+ <text>Test for enablement of a resource.</text>
+ </assertion>
+ </group>
<assertion id="g">
<text>A policy is enabled for the bean deployment archive if any |@Policy| stereotype of the policy is listed.</text>
@@ -1845,50 +1853,62 @@
<assertion id="hc">
<text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a _bean type that matches the required type_.</text>
</assertion>
-
- <assertion id="i">
- <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a bean type that matches the required type. For this purpose, _primitive types are considered to match their corresponding wrapper types in |java.lang|_ ~and array types are considered to match only if their element types are identical. Parameterized and raw types are considered to match if they are identical or if the bean type is assignable to the required type, as defined in Section 5.3.3, "Assignability of raw and parameterized types".~</text>
- </assertion>
+
+ <group>
+ <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a bean type that matches the required type. For this purpose, primitive types are considered to match their corresponding wrapper types in |java.lang| and array types are considered to match only if their element types are identical. Parameterized and raw types are considered to match if they are identical or if the bean type is assignable to the required type, as defined in Section 5.3.3, "Assignability of raw and parameterized types".</text>
+
+ <assertion id="i">
+ <text>Test with a primitive type.</text>
+ </assertion>
- <assertion id="j">
- <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a bean type that matches the required type. For this purpose, ~primitive types are considered to match their corresponding wrapper types in |java.lang| and~ _array types are considered to match only if their element types are identical_. ~Parameterized and raw types are considered to match if they are identical or if the bean type is assignable to the required type, as defined in Section 5.3.3, "Assignability of raw and parameterized types".~</text>
- </assertion>
+ <assertion id="j">
+ <text>Test with an array type.</text>
+ </assertion>
- <assertion id="ka">
- <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a bean type that matches the required type. For this purpose, ~primitive types are considered to match their corresponding wrapper types in |java.lang| and array types are considered to match only if their element types are identical.~ _Parameterized_ and raw types are considered to match if they are identical or if the bean type is assignable to the required type, as defined in Section 5.3.3, "Assignability of raw and parameterized types".</text>
- </assertion>
+ <assertion id="ka">
+ <text>Test with a parameterized type.</text>
+ </assertion>
- <assertion id="kb">
- <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a bean type that matches the required type. For this purpose, ~primitive types are considered to match their corresponding wrapper types in |java.lang| and array types are considered to match only if their element types are identical.~ Parameterized and _raw types_ are considered to match if they are identical or if the bean type is assignable to the required type, as defined in Section 5.3.3, "Assignability of raw and parameterized types".</text>
- </assertion>
-
- <assertion id="la">
- <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and _which have the required bindings_. If no required bindings were explicitly specified, the container assumes the required binding |@Current|. The container narrows the set of matching beans to just those where for each required binding, the bean declares a matching binding with (a) the same type and (b) the same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.NonBinding| (see Section 5.3.5, "Binding annotations with members").</text>
- </assertion>
+ <assertion id="kb">
+ <text>Test with a raw type.</text>
+ </assertion>
+ </group>
+
+ <group>
+ <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have the required bindings. If no required bindings were explicitly specified, the container assumes the required binding |@Current|. The container narrows the set of matching beans to just those where for each required binding, the bean declares a matching binding with (a) the same type and (b) the same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.NonBinding| (see Section 5.3.5, "Binding annotations with members").</text>
+
+ <assertion id="la">
+ <text>Test with beans with required bindings.</text>
+ </assertion>
+
+ <assertion id="lb">
+ <text>Test with beans without required bindings.</text>
+ </assertion>
+
+ <assertion id="lc">
+ <text>Test with matching beans with matching binding with same type.</text>
+ </assertion>
+
+ <assertion id="ld">
+ <text>Test with matching beans with matching binding with same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.NonBinding|.</text>
+ </assertion>
+ </group>
- <assertion id="lb">
- <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have the required bindings. _If no required bindings were explicitly specified, the container assumes the required binding |@Current|_. The container narrows the set of matching beans to just those where for each required binding, the bean declares a matching binding with (a) the same type and (b) the same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.NonBinding| (see Section 5.3.5, "Binding annotations with members").</text>
- </assertion>
-
- <assertion id="lc">
- <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have the required bindings. If no required bindings were explicitly specified, the container assumes the required binding |@Current|. The container narrows the set of matching beans to just those where for each required binding, the bean declares a matching binding with (a) _the same type_ and (b) the same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.NonBinding| (see Section 5.3.5, "Binding annotations with members").</text>
- </assertion>
-
- <assertion id="ld">
- <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have the required bindings. If no required bindings were explicitly specified, the container assumes the required binding |@Current|. The container narrows the set of matching beans to just those where for each required binding, the bean declares a matching binding with (a) the same type and (b) _the same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.NonBinding| (see Section 5.3.5, "Binding annotations with members")._</text>
- </assertion>
-
<assertion id="m">
<text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators. In a Java EE or servlet container, the bean class is required to be accessible to the class that declares the injection point, according to the class loading requirements of the Java EE platform and Java Servlet specifications.</text>
</assertion>
-
- <assertion id="na">
- <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which are not a policy, or is an enabled policy of the bean deployment archive of the class that declares the injection point. For a custom implementation of the |Bean| interface defined in Section 11.1, "The Bean interface", the container calls _|getTypes()|_ and |getBindings()| to determine the bean types and bindings.</text>
- </assertion>
-
- <assertion id="nb">
- <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which are not a policy, or is an enabled policy of the bean deployment archive of the class that declares the injection point. For a custom implementation of the |Bean| interface defined in Section 11.1, "The Bean interface", the container calls |getTypes()| and _|getBindings()|_ to determine the bean types and bindings.</text>
- </assertion>
+
+ <group>
+ <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which are not a policy, or is an enabled policy of the bean deployment archive of the class that declares the injection point. For a custom implementation of the |Bean| interface defined in Section 11.1, "The Bean interface", the container calls |getTypes()| and |getBindings()| to determine the bean types and bindings.</text>
+
+ <assertion id="na">
+ <text>Test |getTypes()| determines bean types.</text>
+ </assertion>
+
+ <assertion id="nb">
+ <text>Test |getBindings()| determines bindings.</text>
+ </assertion>
+ </group>
</section>
<section id="5.3.1" title="Unsatisfied and ambiguous dependencies">
@@ -1942,13 +1962,18 @@
</assertion>
</section>
- <section id="5.3.4" title="Primitive types and null values">
- <assertion id="aa">
- <text>If necessary, the container performs boxing ~or unboxing~ when it injects a value to a field or parameter of primitive or wrapper type.</text>
- </assertion>
- <assertion id="ab">
- <text>If necessary, the container performs ~boxing or~ unboxing when it injects a value to a field or parameter of primitive or wrapper type.</text>
- </assertion>
+ <section id="5.3.4" title="Primitive types and null values">
+ <group>
+ <text>If necessary, the container performs boxing or unboxing when it injects a value to a field or parameter of primitive or wrapper type.</text>
+
+ <assertion id="aa">
+ <text>Test boxing.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>Test unboxing.</text>
+ </assertion>
+ </group>
<assertion id="aa">
<text>If an injection point of primitive type resolves to a bean that may have null values, such as a producer method with a nonprimitive return type or a producer field with a non-primitive type, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4 "Problems detected automatically by the container".</text>
@@ -2576,14 +2601,33 @@
</assertion>
</section>
- <section id="6.4.1" title="Dependent objects">
- <assertion id="a">
+ <section id="6.4.1" title="Dependent objects">
+ <group>
<text>Instances of interceptors or decorators with scope |@Dependent| are dependent objects of the bean instance they decorate.</text>
- </assertion>
-
- <assertion id="g">
- <text>An instance of a bean with scope |@Dependent| injected into a field, bean constructor or initializer method is a dependent object of the bean or Java EE component class instance into which it was injected.</text>
- </assertion>
+ <assertion id="aa">
+ <text>Test with a |@Dependent|-scoped interceptor.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>Test with a |@Dependent|-scoped decorator.</text>
+ </assertion>
+ </group>
+
+ <group>
+ <text>An instance of a bean with scope |@Dependent| injected into a field, bean constructor or initializer method is a dependent object of the bean or Java EE component class instance into which it was injected.</text>
+
+ <assertion id="ga">
+ <text>Test with |@Dependent|-scoped bean injected into field.</text>
+ </assertion>
+
+ <assertion id="gb">
+ <text>Test with |@Dependent|-scoped bean injected into bean constructor.</text>
+ </assertion>
+
+ <assertion id="gc">
+ <text>Test with |@Dependent|-scoped bean injected into initializer method.</text>
+ </assertion>
+ </group>
<assertion id="h">
<text>An instance of a bean with scope |@Dependent| injected into a producer method is a dependent object of the producer method bean instance that is being produced.</text>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3394 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-08-03 07:19:53 -0400 (Mon, 03 Aug 2009)
New Revision: 3394
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/NonMeta.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Dog.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/DogHouse.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/InjectionPointDecorator.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Terrier.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/DecoratorDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/FooDecorator.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
New TCK tests for ch. 11 and some fixes to resolveDecorators() to properly check arguments.
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-08-03 08:43:00 UTC (rev 3393)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-08-03 11:19:53 UTC (rev 3394)
@@ -529,21 +529,11 @@
@SuppressWarnings("unchecked")
public <T> Set<ObserverMethod<?, T>> resolveObserverMethods(T event, Annotation... bindings)
{
+ checkBindingTypes(Arrays.asList(bindings));
Class<?> clazz = event.getClass();
- for (Annotation annotation : bindings)
- {
- if (!getServices().get(MetaAnnotationStore.class).getBindingTypeModel(annotation.annotationType()).isValid())
- {
- throw new IllegalArgumentException("Not a binding type " + annotation);
- }
- }
- HashSet<Annotation> bindingAnnotations = new HashSet<Annotation>(Arrays.asList(bindings));
- if (bindingAnnotations.size() < bindings.length)
- {
- throw new IllegalArgumentException("Duplicate binding types: " + bindings);
- }
// Manually hack in the default annotations here. We need to redo all the annotation defaulting throughout. PLM
+ HashSet<Annotation> bindingAnnotations = new HashSet<Annotation>(Arrays.asList(bindings));
if (bindingAnnotations.size() == 0)
{
bindingAnnotations.add(new CurrentLiteral());
@@ -559,6 +549,23 @@
return observers;
}
+ private void checkBindingTypes(Collection<Annotation> bindings)
+ {
+ HashSet<Annotation> bindingAnnotations = new HashSet<Annotation>(bindings);
+ for (Annotation annotation : bindings)
+ {
+ if (!getServices().get(MetaAnnotationStore.class).getBindingTypeModel(annotation.annotationType()).isValid())
+ {
+ throw new IllegalArgumentException("Not a binding type " + annotation);
+ }
+ }
+ if (bindingAnnotations.size() < bindings.size())
+ {
+ throw new IllegalArgumentException("Duplicate binding types: " + bindings);
+ }
+
+ }
+
private void checkEventType(Type eventType)
{
Type[] types;
@@ -971,16 +978,27 @@
*/
public List<Decorator<?>> resolveDecorators(Set<Type> types, Annotation... bindings)
{
+ checkResolveDecoratorsArguments(types, Arrays.asList(bindings));
// TODO Fix this cast and make the resolver return a list
- return new ArrayList(decoratorResolver.resolve(ResolvableFactory.of(types, bindings)));
+ return new ArrayList<Decorator<?>>(decoratorResolver.resolve(ResolvableFactory.of(types, bindings)));
}
public List<Decorator<?>> resolveDecorators(Set<Type> types, Set<Annotation> bindings)
{
+ checkResolveDecoratorsArguments(types, bindings);
// TODO Fix this cast and make the resolver return a list
- return new ArrayList(decoratorResolver.resolve(ResolvableFactory.of(types, bindings)));
+ return new ArrayList<Decorator<?>>(decoratorResolver.resolve(ResolvableFactory.of(types, bindings)));
}
+ private void checkResolveDecoratorsArguments(Set<Type> types, Collection<Annotation> bindings)
+ {
+ if (types.isEmpty())
+ {
+ throw new IllegalArgumentException("No decorator types were specified in the set");
+ }
+ checkBindingTypes(bindings);
+ }
+
/**
* Resolves a list of interceptors based on interception type and interceptor
* bindings
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/DecoratorDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/DecoratorDefinitionTest.java 2009-08-03 08:43:00 UTC (rev 3393)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/DecoratorDefinitionTest.java 2009-08-03 11:19:53 UTC (rev 3394)
@@ -17,9 +17,13 @@
package org.jboss.jsr299.tck.tests.decorators.definition;
import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.HashSet;
import java.util.List;
import javax.decorator.Decorates;
+import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.Current;
import javax.enterprise.inject.spi.Decorator;
@@ -70,7 +74,9 @@
({
@SpecAssertion(section="8.1", id="b"),
@SpecAssertion(section="8.1", id="c"),
- @SpecAssertion(section="11.1.1", id="b")
+ @SpecAssertion(section="11.1.1", id="b"),
+ @SpecAssertion(section="11.3.12", id="a"),
+ @SpecAssertion(section="11.3.12", id="b")
})
public void testDecoratedTypes()
{
@@ -115,7 +121,8 @@
@Test
@SpecAssertions({
@SpecAssertion(section="8.2", id="b"),
- @SpecAssertion(section="8.3", id="aa")
+ @SpecAssertion(section="8.3", id="aa"),
+ @SpecAssertion(section="11.3.12", id="a")
})
public void testDecoratorOrdering()
{
@@ -123,7 +130,6 @@
assert decorators.size() == 2;
assert decorators.get(0).getTypes().contains(BazDecorator.class);
assert decorators.get(1).getTypes().contains(BazDecorator1.class);
-
}
@Test
@@ -145,5 +151,27 @@
assert getCurrentManager().resolveDecorators(Field.TYPES).isEmpty();
}
+ @Test(expectedExceptions = IllegalArgumentException.class)
+ @SpecAssertion(section="11.3.12", id="c")
+ public void testDuplicateBindingsOnResolveDecoratorsFails()
+ {
+ Annotation binding = new AnnotationLiteral<Meta>() {};
+ getCurrentManager().resolveDecorators(FooBar.TYPES, binding, binding);
+ }
+ @Test(expectedExceptions = IllegalArgumentException.class)
+ @SpecAssertion(section="11.3.12", id="d")
+ public void testNonBindingsOnResolveDecoratorsFails()
+ {
+ Annotation binding = new AnnotationLiteral<NonMeta>() {};
+ getCurrentManager().resolveDecorators(FooBar.TYPES, binding);
+ }
+
+ @Test(expectedExceptions = IllegalArgumentException.class)
+ @SpecAssertion(section="11.3.12", id="e")
+ public void testEmptyTypeSetOnResolveDecoratorsFails()
+ {
+ Annotation binding = new AnnotationLiteral<NonMeta>() {};
+ getCurrentManager().resolveDecorators(new HashSet<Type>(), binding);
+ }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/FooDecorator.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/FooDecorator.java 2009-08-03 08:43:00 UTC (rev 3393)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/FooDecorator.java 2009-08-03 11:19:53 UTC (rev 3394)
@@ -24,6 +24,7 @@
*
*/
@Decorator
+@Meta
public class FooDecorator extends AbstractFooDecorator implements Foo, Bar
{
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/NonMeta.java (from rev 3392, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/Meta.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/NonMeta.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/NonMeta.java 2009-08-03 11:19:53 UTC (rev 3394)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.decorators.definition;
+
+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;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@interface NonMeta
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java 2009-08-03 08:43:00 UTC (rev 3393)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java 2009-08-03 11:19:53 UTC (rev 3394)
@@ -20,11 +20,15 @@
import java.util.HashSet;
import java.util.Set;
+import javax.enterprise.inject.AmbiguousResolutionException;
+import javax.enterprise.inject.InjectionException;
import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.spi.PassivationCapable;
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.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -61,4 +65,28 @@
beans.addAll(getCurrentManager().getBeans(DerivedBean.class));
getCurrentManager().resolve(beans);
}
+
+ @Test(expectedExceptions = AmbiguousResolutionException.class)
+ @SpecAssertion(section = "11.3.8", id = "b")
+ public void testAmbiguousDependencyNotResolved()
+ {
+ Set<Bean<?>> beans = new HashSet<Bean<?>>();
+ beans.addAll(getCurrentManager().getBeans(Dog.class));
+ beans.addAll(getCurrentManager().getBeans(Terrier.class));
+ getCurrentManager().resolve(beans);
+ }
+
+ @Test(groups = "ri-broken", expectedExceptions = InjectionException.class)
+ @SpecAssertions({
+ @SpecAssertion(section = "11.3.9", id = "a"),
+ @SpecAssertion(section = "11.3.9", id = "b")
+ })
+ //WBRI-333
+ public void testValidateThrowsException()
+ {
+ DogHouse dogHouse = getInstanceByType(DogHouse.class);
+ InjectionPoint injectionPoint = new InjectionPointDecorator(dogHouse.getDog().getInjectedMetadata());
+ // Wrap the injection point to change the type to a more generalized class
+ getCurrentManager().validate(injectionPoint);
+ }
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Dog.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Dog.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Dog.java 2009-08-03 11:19:53 UTC (rev 3394)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.extensions.beanManager;
+
+class Dog
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Dog.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/DogHouse.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/DogHouse.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/DogHouse.java 2009-08-03 11:19:53 UTC (rev 3394)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.extensions.beanManager;
+
+import javax.enterprise.inject.Current;
+
+class DogHouse
+{
+ @Current
+ private Terrier dog;
+
+ public Terrier getDog()
+ {
+ return dog;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/DogHouse.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/InjectionPointDecorator.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/InjectionPointDecorator.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/InjectionPointDecorator.java 2009-08-03 11:19:53 UTC (rev 3394)
@@ -0,0 +1,55 @@
+package org.jboss.jsr299.tck.tests.extensions.beanManager;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Member;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Annotated;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+class InjectionPointDecorator implements InjectionPoint
+{
+ private final InjectionPoint injectionPoint;
+
+ public InjectionPointDecorator(InjectionPoint injectionPoint)
+ {
+ this.injectionPoint = injectionPoint;
+ }
+
+ public Annotated getAnnotated()
+ {
+ return injectionPoint.getAnnotated();
+ }
+
+ public Bean<?> getBean()
+ {
+ return injectionPoint.getBean();
+ }
+
+ public Set<Annotation> getBindings()
+ {
+ return injectionPoint.getBindings();
+ }
+
+ public Member getMember()
+ {
+ return injectionPoint.getMember();
+ }
+
+ public Type getType()
+ {
+ return Dog.class;
+ }
+
+ public boolean isDelegate()
+ {
+ return injectionPoint.isDelegate();
+ }
+
+ public boolean isTransient()
+ {
+ return injectionPoint.isTransient();
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/InjectionPointDecorator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Terrier.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Terrier.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Terrier.java 2009-08-03 11:19:53 UTC (rev 3394)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.extensions.beanManager;
+
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+class Terrier extends Dog
+{
+ @Current
+ private InjectionPoint injectedMetadata;
+
+ public InjectionPoint getInjectedMetadata()
+ {
+ return injectedMetadata;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Terrier.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-03 08:43:00 UTC (rev 3393)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-03 11:19:53 UTC (rev 3394)
@@ -4412,8 +4412,9 @@
<section id="11.3.9" title="Validating a dependency">
<assertion id="a">
<text>The |BeanManager.validate()| operation validates a dependency.</text>
+ <note>Statement of intent</note>
</assertion>
-
+
<assertion id="b">
<text>The method |validate()| validates the dependency and throws an |InjectionException| if there is a deployment problem (for example, an unsatisfied or unresolvable ambiguous dependency) associated with the injection point.</text>
</assertion>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3393 - ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-08-03 04:43:00 -0400 (Mon, 03 Aug 2009)
New Revision: 3393
Modified:
ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/ManagersImpl.java
Log:
Fixed porting package to match latest Managers interface
Modified: ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/ManagersImpl.java
===================================================================
--- ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/ManagersImpl.java 2009-08-02 22:44:51 UTC (rev 3392)
+++ ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/ManagersImpl.java 2009-08-03 08:43:00 UTC (rev 3393)
@@ -1,9 +1,5 @@
package org.jboss.webbeans.tck;
-import java.lang.annotation.Annotation;
-import java.util.ArrayList;
-import java.util.List;
-
import javax.enterprise.inject.UnproxyableResolutionException;
import javax.enterprise.inject.spi.BeanManager;
@@ -11,7 +7,6 @@
import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.DefinitionException;
import org.jboss.webbeans.DeploymentException;
-import org.jboss.webbeans.WebBean;
public class ManagersImpl implements Managers
{
@@ -21,18 +16,6 @@
return CurrentManager.rootManager();
}
- public void setEnabledDeploymentTypes(List<Class<? extends Annotation>> enabledDeploymentTypes)
- {
- CurrentManager.rootManager().setEnabledDeploymentTypes(enabledDeploymentTypes);
- }
-
- public List<Class<? extends Annotation>> getEnabledDeploymentTypes()
- {
- List<Class<? extends Annotation>> deploymentTypes = new ArrayList<Class<? extends Annotation>>(CurrentManager.rootManager().getEnabledDeploymentTypes());
- deploymentTypes.remove(WebBean.class);
- return deploymentTypes;
- }
-
public boolean isDefinitionError(org.jboss.testharness.api.DeploymentException deploymentException)
{
return isDefinitionException(deploymentException.getCause());
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3392 - ri/trunk/impl/src/main/java/org/jboss/webbeans.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-02 18:44:51 -0400 (Sun, 02 Aug 2009)
New Revision: 3392
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
Log:
WBRI-333
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-08-02 22:39:41 UTC (rev 3391)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-08-02 22:44:51 UTC (rev 3392)
@@ -49,6 +49,7 @@
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.spi.AnnotatedType;
@@ -1247,7 +1248,14 @@
public void validate(InjectionPoint ij)
{
- getServices().get(Validator.class).validateInjectionPoint(ij, this);
+ try
+ {
+ getServices().get(Validator.class).validateInjectionPoint(ij, this);
+ }
+ catch (DeploymentException e)
+ {
+ throw new InjectionException(e.getMessage(), e.getCause());
+ }
}
public Set<Annotation> getInterceptorBindingTypeDefinition(Class<? extends Annotation> bindingType)
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3391 - ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache and 10 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-02 18:39:41 -0400 (Sun, 02 Aug 2009)
New Revision: 3391
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/Arrays2.java
Modified:
ri/trunk/api/src/main/java/javax/enterprise/inject/New.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/AnnotationModel.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/BindingTypeModel.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/ScopeModel.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/StereotypeModel.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Special.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/wbri279/IntFactory.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken11/British.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Synchronous.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Role.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/EventBindingTypesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/Wild.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/Role.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/Role.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Role.java
Log:
WBRI-316
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/New.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/New.java 2009-08-02 09:48:11 UTC (rev 3390)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/New.java 2009-08-02 22:39:41 UTC (rev 3391)
@@ -18,7 +18,9 @@
package javax.enterprise.inject;
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;
@@ -32,7 +34,7 @@
* @author Pete Muir
*/
-@Target( { FIELD, PARAMETER })
+@Target( { FIELD, PARAMETER, METHOD, TYPE })
@Retention(RUNTIME)
@Documented
@BindingType
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/AnnotationModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/AnnotationModel.java 2009-08-02 09:48:11 UTC (rev 3390)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/AnnotationModel.java 2009-08-02 22:39:41 UTC (rev 3391)
@@ -17,9 +17,13 @@
package org.jboss.webbeans.metadata.cache;
import java.lang.annotation.Annotation;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import org.jboss.webbeans.DefinitionException;
import org.jboss.webbeans.introspector.WBAnnotation;
+import org.jboss.webbeans.log.Log;
+import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.resources.ClassTransformer;
/**
@@ -29,10 +33,12 @@
*/
public abstract class AnnotationModel<T extends Annotation>
{
+ private static final Log log = Logging.getLog(AnnotationModel.class);
+
// The underlying annotation
private WBAnnotation<T> annotatedAnnotation;
// Is the data valid?
- private boolean valid;
+ protected boolean valid;
/**
* Constructor
@@ -70,7 +76,17 @@
*/
protected void initValid()
{
- this.valid = annotatedAnnotation.isAnnotationPresent(getMetaAnnotation());
+ this.valid = true;
+ if (!annotatedAnnotation.isAnnotationPresent(getMetaAnnotation()))
+ {
+ this.valid = false;
+ }
+ if (annotatedAnnotation.isAnnotationPresent(Retention.class) && !annotatedAnnotation.getAnnotation(Retention.class).value().equals(RetentionPolicy.RUNTIME))
+ {
+ this.valid = false;
+ log.debug("#0 is missing @Retention(RUNTIME)", annotatedAnnotation);
+ }
+
}
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/BindingTypeModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/BindingTypeModel.java 2009-08-02 09:48:11 UTC (rev 3390)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/BindingTypeModel.java 2009-08-02 22:39:41 UTC (rev 3391)
@@ -16,7 +16,13 @@
*/
package org.jboss.webbeans.metadata.cache;
+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 java.lang.annotation.Annotation;
+import java.lang.annotation.Target;
import java.lang.reflect.InvocationTargetException;
import java.util.Set;
@@ -25,8 +31,11 @@
import org.jboss.webbeans.DefinitionException;
import org.jboss.webbeans.introspector.WBMethod;
+import org.jboss.webbeans.log.Log;
+import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.resources.ClassTransformer;
import org.jboss.webbeans.util.Reflections;
+import org.jboss.webbeans.util.collections.Arrays2;
/**
*
@@ -37,8 +46,11 @@
*/
public class BindingTypeModel<T extends Annotation> extends AnnotationModel<T>
{
+ private static final Log log = Logging.getLog(BindingTypeModel.class);
+
// The non-binding types
private Set<WBMethod<?>> nonBindingTypes;
+
/**
* Constructor
@@ -60,6 +72,22 @@
initNonBindingTypes();
checkArrayAndAnnotationValuedMembers();
}
+
+ @Override
+ protected void initValid()
+ {
+ super.initValid();
+ if (!getAnnotatedAnnotation().isAnnotationPresent(Target.class))
+ {
+ this.valid = false;
+ log.debug("#0 is missing @Target annotation.", getAnnotatedAnnotation());
+ }
+ else if (!Arrays2.unorderedEquals(getAnnotatedAnnotation().getAnnotation(Target.class).value(), METHOD, FIELD, PARAMETER, TYPE))
+ {
+ this.valid = false;
+ log.debug("#0 is has incorrect @Target annotation. Should be @Target(METHOD, FIELD, TYPE, PARAMETER).", getAnnotatedAnnotation());
+ }
+ }
/**
* Validates the members
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/ScopeModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/ScopeModel.java 2009-08-02 09:48:11 UTC (rev 3390)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/ScopeModel.java 2009-08-02 22:39:41 UTC (rev 3391)
@@ -16,11 +16,19 @@
*/
package org.jboss.webbeans.metadata.cache;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+
import java.lang.annotation.Annotation;
+import java.lang.annotation.Target;
import javax.enterprise.context.ScopeType;
+import org.jboss.webbeans.log.Log;
+import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.resources.ClassTransformer;
+import org.jboss.webbeans.util.collections.Arrays2;
/**
*
@@ -31,6 +39,8 @@
*/
public class ScopeModel<T extends Annotation> extends AnnotationModel<T>
{
+ private static final Log log = Logging.getLog(ScopeModel.class);
+
/**
* Constrctor
*
@@ -40,6 +50,22 @@
{
super(scope, classTransformer);
}
+
+ @Override
+ protected void initValid()
+ {
+ super.initValid();
+ if (!getAnnotatedAnnotation().isAnnotationPresent(Target.class))
+ {
+ this.valid = false;
+ log.debug("#0 is missing @Target annotation.", getAnnotatedAnnotation());
+ }
+ else if (!Arrays2.unorderedEquals(getAnnotatedAnnotation().getAnnotation(Target.class).value(), METHOD, FIELD, TYPE))
+ {
+ this.valid = false;
+ log.debug("#0 is has incorrect @Target annotation. Should be @Target(METHOD, FIELD, TYPE).", getAnnotatedAnnotation());
+ }
+ }
/**
* Indicates if the scope is "normal"
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-08-02 09:48:11 UTC (rev 3390)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/cache/StereotypeModel.java 2009-08-02 22:39:41 UTC (rev 3391)
@@ -16,7 +16,12 @@
*/
package org.jboss.webbeans.metadata.cache;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+
import java.lang.annotation.Annotation;
+import java.lang.annotation.Target;
import java.util.Set;
import javax.enterprise.context.ScopeType;
@@ -27,7 +32,10 @@
import javax.interceptor.InterceptorBindingType;
import org.jboss.webbeans.DefinitionException;
+import org.jboss.webbeans.log.Log;
+import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.resources.ClassTransformer;
+import org.jboss.webbeans.util.collections.Arrays2;
/**
* A meta model for a stereotype, allows us to cache a stereotype and to
@@ -38,6 +46,8 @@
*/
public class StereotypeModel<T extends Annotation> extends AnnotationModel<T>
{
+ private static final Log log = Logging.getLog(StereotypeModel.class);
+
// Is the stereotype a policy
private boolean policy;
// The default scope type
@@ -123,6 +133,28 @@
this.policy = true;
}
}
+
+ @Override
+ protected void initValid()
+ {
+ super.initValid();
+ if (!getAnnotatedAnnotation().isAnnotationPresent(Target.class))
+ {
+ this.valid = false;
+ log.debug("#0 is missing @Target annotation.", getAnnotatedAnnotation());
+ }
+ else if (!(
+ Arrays2.unorderedEquals(getAnnotatedAnnotation().getAnnotation(Target.class).value(), METHOD, FIELD, TYPE) ||
+ Arrays2.unorderedEquals(getAnnotatedAnnotation().getAnnotation(Target.class).value(), TYPE) ||
+ Arrays2.unorderedEquals(getAnnotatedAnnotation().getAnnotation(Target.class).value(), METHOD) ||
+ Arrays2.unorderedEquals(getAnnotatedAnnotation().getAnnotation(Target.class).value(), FIELD) ||
+ Arrays2.unorderedEquals(getAnnotatedAnnotation().getAnnotation(Target.class).value(), METHOD, TYPE)
+ ))
+ {
+ this.valid = false;
+ log.debug("#0 is has incorrect @Target annotation. Should be @Target(METHOD, FIELD, TYPE, PARAMETER), @Target(METHOD, TYPE), @Target(METHOD), @Target(TYPE) or @Target(FIELD).", getAnnotatedAnnotation());
+ }
+ }
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/Arrays2.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/Arrays2.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/Arrays2.java 2009-08-02 22:39:41 UTC (rev 3391)
@@ -0,0 +1,40 @@
+/*
+ * 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.util.collections;
+
+import java.util.Arrays;
+
+/**
+ * @author pmuir
+ *
+ */
+public class Arrays2
+{
+
+ private Arrays2() {}
+
+ public static final boolean containsAll(Object[] array, Object... values)
+ {
+ return Arrays.asList(array).containsAll(Arrays.asList(values));
+ }
+
+ public static final boolean unorderedEquals(Object[] array, Object... values)
+ {
+ return containsAll(array, values) && array.length == values.length;
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/Arrays2.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Special.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Special.java 2009-08-02 09:48:11 UTC (rev 3390)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Special.java 2009-08-02 22:39:41 UTC (rev 3391)
@@ -1,6 +1,10 @@
package org.jboss.webbeans.test.unit.lookup;
-import java.lang.annotation.ElementType;
+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 java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@@ -9,7 +13,7 @@
@BindingType
@Retention(RetentionPolicy.RUNTIME)
-(a)Target({ElementType.FIELD, ElementType.METHOD, ElementType.TYPE})
+@Target({FIELD, METHOD, TYPE, PARAMETER})
public @interface Special
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/wbri279/IntFactory.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/wbri279/IntFactory.java 2009-08-02 09:48:11 UTC (rev 3390)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/wbri279/IntFactory.java 2009-08-02 22:39:41 UTC (rev 3391)
@@ -2,6 +2,7 @@
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 java.lang.annotation.Retention;
@@ -11,7 +12,7 @@
import javax.enterprise.inject.BindingType;
@Retention(RetentionPolicy.RUNTIME)
-@Target( { TYPE, FIELD, METHOD })
+@Target( { TYPE, FIELD, METHOD, PARAMETER })
@BindingType
public @interface IntFactory
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken11/British.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken11/British.java 2009-08-02 09:48:11 UTC (rev 3390)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken11/British.java 2009-08-02 22:39:41 UTC (rev 3391)
@@ -2,6 +2,7 @@
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;
@@ -12,7 +13,7 @@
@BindingType
-@Target({TYPE, METHOD, FIELD})
+@Target( { FIELD, PARAMETER, METHOD, TYPE })
@Retention(RUNTIME)
@interface British
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Synchronous.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Synchronous.java 2009-08-02 09:48:11 UTC (rev 3390)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Synchronous.java 2009-08-02 22:39:41 UTC (rev 3391)
@@ -1,5 +1,6 @@
package org.jboss.jsr299.tck.tests.definition.binding;
+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;
@@ -11,7 +12,7 @@
import javax.enterprise.inject.BindingType;
-@Target( { TYPE, METHOD, PARAMETER })
+@Target( { FIELD, PARAMETER, METHOD, TYPE })
@Retention(RUNTIME)
@Documented
@BindingType
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Role.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Role.java 2009-08-02 09:48:11 UTC (rev 3390)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Role.java 2009-08-02 22:39:41 UTC (rev 3391)
@@ -1,7 +1,9 @@
package org.jboss.jsr299.tck.tests.event;
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.Retention;
@@ -9,7 +11,7 @@
import javax.enterprise.inject.BindingType;
-@Target( { FIELD, PARAMETER })
+@Target( { FIELD, PARAMETER, METHOD, TYPE })
@Retention(RUNTIME)
@BindingType
@interface Role
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/EventBindingTypesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/EventBindingTypesTest.java 2009-08-02 09:48:11 UTC (rev 3390)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/EventBindingTypesTest.java 2009-08-02 22:39:41 UTC (rev 3391)
@@ -5,10 +5,10 @@
import javax.enterprise.inject.TypeLiteral;
import javax.enterprise.inject.spi.Bean;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.AnyLiteral;
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.literals.AnyLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -56,7 +56,7 @@
assert observer.getNumTimesNonRuntimeBindingTypeObserved() == 2;
}
- @Test(groups = { "events", "ri-broken" }, expectedExceptions = { IllegalArgumentException.class } )
+ @Test(groups = { "events"}, expectedExceptions = { IllegalArgumentException.class } )
@SpecAssertion(section = "10.1", id = "f")
public void testFireEventWithNonRuntimeBindingTypeFails()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/Wild.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/Wild.java 2009-08-02 09:48:11 UTC (rev 3390)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/Wild.java 2009-08-02 22:39:41 UTC (rev 3391)
@@ -1,7 +1,9 @@
package org.jboss.jsr299.tck.tests.event.bindingTypes;
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;
@@ -10,7 +12,7 @@
import javax.enterprise.inject.BindingType;
-@Target( { PARAMETER, FIELD })
+@Target( { FIELD, PARAMETER, METHOD, TYPE } )
@Retention(RUNTIME)
@Documented
@BindingType
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/Role.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/Role.java 2009-08-02 09:48:11 UTC (rev 3390)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/Role.java 2009-08-02 22:39:41 UTC (rev 3391)
@@ -1,7 +1,9 @@
package org.jboss.jsr299.tck.tests.event.fires;
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.Retention;
@@ -9,7 +11,7 @@
import javax.enterprise.inject.BindingType;
-@Target( { FIELD, PARAMETER })
+@Target( { FIELD, PARAMETER, METHOD, TYPE })
@Retention(RUNTIME)
@BindingType
@interface Role
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/Role.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/Role.java 2009-08-02 09:48:11 UTC (rev 3390)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/Role.java 2009-08-02 22:39:41 UTC (rev 3391)
@@ -1,13 +1,19 @@
package org.jboss.jsr299.tck.tests.event.observer;
+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.Retention;
+import java.lang.annotation.Target;
import javax.enterprise.inject.BindingType;
@BindingType
@Retention(RUNTIME)
+@Target( { FIELD, PARAMETER, METHOD, TYPE })
@interface Role
{
String value();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Role.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Role.java 2009-08-02 09:48:11 UTC (rev 3390)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Role.java 2009-08-02 22:39:41 UTC (rev 3391)
@@ -1,7 +1,9 @@
package org.jboss.jsr299.tck.tests.event.observer.resolve;
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.Retention;
@@ -9,7 +11,7 @@
import javax.enterprise.inject.BindingType;
-@Target( { FIELD, PARAMETER })
+@Target( { FIELD, PARAMETER, METHOD, TYPE })
@Retention(RUNTIME)
@BindingType
@interface Role
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3390 - ri/trunk/api/src/main/java/javax/enterprise/inject/spi and 61 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)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
*/
-@Target(TYPE)
+@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
- *
- */
-@Target( { TYPE, METHOD })
-@Retention(RUNTIME)
-@Documented
-@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
-@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
-@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
-@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
-@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;
-
-@Target( { TYPE, METHOD })
-@Retention(RUNTIME)
-@Documented
-@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;
-@Mock
+import javax.enterprise.inject.Policy;
+
+@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;
-
-@Target( { TYPE, METHOD })
-@Retention(RUNTIME)
-@Documented
-@DeploymentType
-@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;
-
-@Artifact
-(a)Packaging(PackagingType.EAR)
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@Production
+@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;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@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;
-
-@RequestScoped
-@TestBindingType
-@TestInterceptorBindingType
-@TestStereotype
-@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;
-@NonBean class HelsinkiNonSerializable
+import javax.enterprise.inject.Policy;
+
+@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;
-
-@Target( { TYPE, METHOD, PARAMETER, FIELD })
-@Retention(RUNTIME)
-@Documented
-@DeploymentType
-@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;
-@NonBean
+import javax.enterprise.inject.Policy;
+
+@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;
-@NonBean class Violation
+import javax.enterprise.inject.Policy;
+
+@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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
-@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
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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;
-@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
-@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;
-@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;
-
-@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;
-@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;
+
+@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;
+
+@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;
-
-@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);
}
}
15 years, 4 months