Author: pete.muir(a)jboss.org
Date: 2009-10-18 08:43:37 -0400 (Sun, 18 Oct 2009)
New Revision: 4177
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/African.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Australian.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Cat.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/DomesticCat.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Emu.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/European.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/FlightlessBird.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Lion.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Tame.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Wild.java
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Canary.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Capercaillie.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/EnterpriseResolutionByTypeTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/PetShop.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml
Log:
Add tests and assertions for @Typed
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java 2009-10-18
05:49:43 UTC (rev 4176)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java 2009-10-18
12:43:37 UTC (rev 4177)
@@ -101,7 +101,7 @@
}
@Test
- @SpecAssertion(section = "2.2.2", id = "a")
+ @SpecAssertion(section = "2.2.3", id = "a")
@SuppressWarnings("unused")
public void testBeanClientCanCastBeanInstanceToAnyBeanType()
{
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/African.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/African.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/African.java 2009-10-18
12:43:37 UTC (rev 4177)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
+
+public class African
+{
+
+}
Property changes on:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/African.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Australian.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Australian.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Australian.java 2009-10-18
12:43:37 UTC (rev 4177)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
+
+public class Australian
+{
+
+}
Property changes on:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Australian.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Canary.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Canary.java 2009-10-18
05:49:43 UTC (rev 4176)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Canary.java 2009-10-18
12:43:37 UTC (rev 4177)
@@ -1,8 +1,8 @@
package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
-import javax.enterprise.inject.BeanTypes;
+import javax.enterprise.inject.Typed;
-(a)BeanTypes(Canary.class)
+(a)Typed(Canary.class)
public class Canary implements Bird
{
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Capercaillie.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Capercaillie.java 2009-10-18
05:49:43 UTC (rev 4176)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Capercaillie.java 2009-10-18
12:43:37 UTC (rev 4177)
@@ -1,10 +1,10 @@
package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
import javax.ejb.Stateless;
-import javax.enterprise.inject.BeanTypes;
+import javax.enterprise.inject.Typed;
@Stateless
-(a)BeanTypes(CapercaillieLocal.class)
+(a)Typed(CapercaillieLocal.class)
public class Capercaillie implements CapercaillieLocal
{
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Cat.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Cat.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Cat.java 2009-10-18
12:43:37 UTC (rev 4177)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
+
+public class Cat<T>
+{
+
+}
Property changes on:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Cat.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/DomesticCat.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/DomesticCat.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/DomesticCat.java 2009-10-18
12:43:37 UTC (rev 4177)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
+
+
+public class DomesticCat extends Cat<European>
+{
+
+ public DomesticCat(String name)
+ {
+ // TODO Auto-generated constructor stub
+ }
+
+}
Property changes on:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/DomesticCat.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Emu.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Emu.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Emu.java 2009-10-18
12:43:37 UTC (rev 4177)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
+
+import javax.enterprise.inject.Typed;
+
+(a)Typed(FlightlessBird.class)
+public class Emu extends FlightlessBird<Australian>
+{
+
+}
Property changes on:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Emu.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/EnterpriseResolutionByTypeTest.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/EnterpriseResolutionByTypeTest.java 2009-10-18
05:49:43 UTC (rev 4176)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/EnterpriseResolutionByTypeTest.java 2009-10-18
12:43:37 UTC (rev 4177)
@@ -30,10 +30,10 @@
@SpecVersion(spec="cdi", version="PFD2")
@Packaging(PackagingType.EAR)
public class EnterpriseResolutionByTypeTest extends AbstractJSR299Test
-{
+{
@Test
- @SpecAssertion(section = "TBD", id = "TBD")
+ @SpecAssertion(section = "2.2.2", id = "b")
public void testBeanTypesOnSessionBean()
{
assert getBeans(CapercaillieLocal.class).size() == 1;
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/European.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/European.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/European.java 2009-10-18
12:43:37 UTC (rev 4177)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
+
+public class European
+{
+
+}
Property changes on:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/European.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/FlightlessBird.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/FlightlessBird.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/FlightlessBird.java 2009-10-18
12:43:37 UTC (rev 4177)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
+
+public class FlightlessBird<T>
+{
+
+}
Property changes on:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/FlightlessBird.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Lion.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Lion.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Lion.java 2009-10-18
12:43:37 UTC (rev 4177)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
+
+public class Lion extends Cat<African>
+{
+
+ public Lion(String name)
+ {
+ // TODO Auto-generated constructor stub
+ }
+
+}
Property changes on:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Lion.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/PetShop.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/PetShop.java 2009-10-18
05:49:43 UTC (rev 4176)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/PetShop.java 2009-10-18
12:43:37 UTC (rev 4177)
@@ -1,18 +1,27 @@
package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
-import javax.enterprise.inject.BeanTypes;
import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.Typed;
public class PetShop
{
- @Produces @BeanTypes(Dove.class)
+ @Produces @Typed(Dove.class)
private Dove dove = new Dove("charlie");
- @Produces @BeanTypes(Parrot.class)
+ @Produces @Typed(Parrot.class)
public Parrot getParrot()
{
return new Parrot("polly");
}
+
+ @Produces @Typed(Cat.class) @Tame
+ private DomesticCat felix = new DomesticCat("felix");
+
+ @Produces @Typed(Cat.class) @Wild
+ public Lion getAslan()
+ {
+ return new Lion("timmy");
+ }
}
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java 2009-10-18
05:49:43 UTC (rev 4176)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java 2009-10-18
12:43:37 UTC (rev 4177)
@@ -16,6 +16,7 @@
*/
package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
+import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashSet;
@@ -40,6 +41,13 @@
public class ResolutionByTypeTest extends AbstractJSR299Test
{
+ private static final TypeLiteral<FlightlessBird<Australian>>
AUSTRALIAN_FLIGHTLESS_BIRD = new TypeLiteral<FlightlessBird<Australian>>()
{};
+ private static final TypeLiteral<FlightlessBird<European>>
EUROPEAN_FLIGHTLESS_BIRD = new TypeLiteral<FlightlessBird<European>>() {};
+ private static final TypeLiteral<Cat<European>> EUROPEAN_CAT = new
TypeLiteral<Cat<European>>() {};
+ private static final TypeLiteral<Cat<African>> AFRICAN_CAT = new
TypeLiteral<Cat<African>>() {};
+ private static final Annotation TAME = new AnnotationLiteral<Tame>() {};
+ private static final Annotation WILD = new AnnotationLiteral<Wild>() {};
+
@Test(groups = "resolution")
@SpecAssertion(section = "5.3", id = "lb")
public void testDefaultBindingTypeAssumed() throws Exception
@@ -211,11 +219,10 @@
}
@Test
- @SpecAssertion(section = "TBD", id = "TBD")
+ @SpecAssertion(section = "2.2.2", id = "a")
public void testBeanTypesOnManagedBean()
{
assert getBeans(Canary.class).size() == 1;
- Set<Bean<Bird>> beans = getBeans(Bird.class);
Bean<Canary> bean = getUniqueBean(Canary.class);
assert getBeans(Bird.class).isEmpty();
assert bean.getTypes().size() == 1;
@@ -223,7 +230,19 @@
}
@Test
- @SpecAssertion(section = "TBD", id = "TBD")
+ @SpecAssertion(section = "2.2.2", id = "e")
+ public void testGenericBeanTypesOnManagedBean()
+ {
+ assert getBeans(AUSTRALIAN_FLIGHTLESS_BIRD).size() == 1;
+ assert getBeans(Emu.class).isEmpty();
+ assert getBeans(EUROPEAN_FLIGHTLESS_BIRD).isEmpty();
+ Bean<FlightlessBird<Australian>> bean =
getUniqueBean(AUSTRALIAN_FLIGHTLESS_BIRD);
+ assert bean.getTypes().size() == 1;
+ assert
bean.getTypes().iterator().next().equals(AUSTRALIAN_FLIGHTLESS_BIRD.getType());
+ }
+
+ @Test
+ @SpecAssertion(section = "2.2.2", id = "c")
public void testBeanTypesOnProducerMethod()
{
assert getBeans(Parrot.class).size() == 1;
@@ -234,9 +253,31 @@
}
@Test
- @SpecAssertion(section = "TBD", id = "TBD")
- public void testBeanTypesOnProducerField()
+ @SpecAssertion(section = "2.2.2", id = "h")
+ public void testGenericBeanTypesOnProducerField()
{
+ assert getBeans(EUROPEAN_CAT, TAME).size() == 1;
+ assert getBeans(DomesticCat.class, TAME).isEmpty();
+ Bean<Cat<European>> bean = getUniqueBean(EUROPEAN_CAT, TAME);
+ assert bean.getTypes().size() == 1;
+ assert bean.getTypes().iterator().next().equals(EUROPEAN_CAT.getType());
+ }
+
+ @Test
+ @SpecAssertion(section = "2.2.2", id = "g")
+ public void testGenericBeanTypesOnProducerMethod()
+ {
+ assert getBeans(AFRICAN_CAT, WILD).size() == 1;
+ assert getBeans(Lion.class, WILD).isEmpty();
+ Bean<Cat<African>> bean = getUniqueBean(AFRICAN_CAT, WILD);
+ assert bean.getTypes().size() == 1;
+ assert bean.getTypes().iterator().next().equals(AFRICAN_CAT.getType());
+ }
+
+ @Test
+ @SpecAssertion(section = "2.2.2", id = "d")
+ public void testGeeBeanTypesOnProducerField()
+ {
assert getBeans(Dove.class).size() == 1;
assert getBeans(Bird.class).isEmpty();
Bean<Dove> bean = getUniqueBean(Dove.class);
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Tame.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Tame.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Tame.java 2009-10-18
12:43:37 UTC (rev 4177)
@@ -0,0 +1,34 @@
+/*
+ * 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.lookup.typesafe.resolution;
+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.inject.Qualifier;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Qualifier
+@interface Tame {
+
+}
Property changes on:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Tame.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Wild.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Wild.java
(rev 0)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Wild.java 2009-10-18
12:43:37 UTC (rev 4177)
@@ -0,0 +1,34 @@
+/*
+ * 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.lookup.typesafe.resolution;
+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.inject.Qualifier;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Qualifier
+@interface Wild {
+
+}
Property changes on:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Wild.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml
===================================================================
--- cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml 2009-10-18 05:49:43 UTC (rev
4176)
+++ cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml 2009-10-18 12:43:37 UTC (rev
4177)
@@ -97,8 +97,51 @@
<text>A parameterized type that contains a wildcard type parameter is not a
legal bean type.</text>
</assertion>
</section>
+
+ <section id="2.2.2" title="Restricting the bean types of a
bean">
+ <group>
+ <text>The bean types of a bean may be restricted by annotating the bean class
or producer method or field with the annotation @javax.enterprise.inject.BeanTypes. When a
@BeanTypes annotation is explicitly specified, only the types whose classes are explicitly
listed using the value member are bean types of the bean.</text>
+ <assertion id="a">
+ <text>Check managed bean</text>
+ </assertion>
+ <assertion id="b">
+ <text>Check session bean</text>
+ </assertion>
+ <assertion id="c">
+ <text>Check producer method</text>
+ </assertion>
+ <assertion id="d">
+ <text>Check producer field</text>
+ </assertion>
+ <assertion id="e">
+ <text>Check generic managed bean</text>
+ </assertion>
+ <assertion id="g">
+ <text>Check generic producer method</text>
+ </assertion>
+ <assertion id="h">
+ <text>Check generic producer field</text>
+ </assertion>
+ </group>
+
+ <group>
+ <text>If a bean class or producer method or field specifies a @BeanTypes
annotation, and the value member specifies a class which does not correspond to a type in
the unrestricted set of bean types of a bean, the container automatically detects the
problem and treats it as a definition error, as defined in Section 12.4, "Problems
detected automatically by the container".</text>
+ <assertion id="j">
+ <text>Check managed bean</text>
+ </assertion>
+ <assertion id="k">
+ <text>Check session bean</text>
+ </assertion>
+ <assertion id="l">
+ <text>Check producer method</text>
+ </assertion>
+ <assertion id="m">
+ <text>Check producer field</text>
+ </assertion>
+ </group>
+ </section>
- <section id="2.2.2" title="Typecasting between bean types">
+ <section id="2.2.3" title="Typecasting between bean types">
<assertion id="a">
<text>A client of a bean may typecast its contextual reference to a bean to
any bean type of the bean which is a Java interface. However, the client may not in
general typecast its contextual reference to an arbitrary concrete bean type of the
bean.</text>
</assertion>