Author: pete.muir(a)jboss.org
Date: 2009-10-04 07:49:33 -0400 (Sun, 04 Oct 2009)
New Revision: 3836
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/CreationalContextForNonContextualTest.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java
tck/trunk/impl/src/main/resources/tck-audit-cdi.xml
Log:
Couple more tests, and a variety of fixes to audit
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/CreationalContextForNonContextualTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/CreationalContextForNonContextualTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/CreationalContextForNonContextualTest.java 2009-10-04
11:49:33 UTC (rev 3836)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.lookup.injection.non.contextual;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+@Artifact
+public class CreationalContextForNonContextualTest extends AbstractJSR299Test
+{
+
+ @Test
+ @SpecAssertion(section = "11.3.3", id = "b")
+ public void testCreationalContext()
+ {
+ assert getCurrentManager().createCreationalContext(null) != null;
+ }
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/CreationalContextForNonContextualTest.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-10-03
01:30:20 UTC (rev 3835)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java 2009-10-04
11:49:33 UTC (rev 3836)
@@ -62,6 +62,14 @@
assert getCurrentManager().getBeans("cat").size() == 1;
assert getCurrentManager().getBeans("dog").size() == 0;
}
+
+ @Test
+ @SpecAssertion(section = "11.1", id = "bc")
+ public void testIsAlternative()
+ {
+ Bean<?> cat =
getCurrentManager().resolve(getCurrentManager().getBeans(Cat.class));
+ assert cat.isAlternative();
+ }
@Test(groups = {"policy"})
@SpecAssertions({
Modified: tck/trunk/impl/src/main/resources/tck-audit-cdi.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit-cdi.xml 2009-10-03 01:30:20 UTC (rev
3835)
+++ tck/trunk/impl/src/main/resources/tck-audit-cdi.xml 2009-10-04 11:49:33 UTC (rev
3836)
@@ -4738,10 +4738,7 @@
<assertion id="faa">
<text>Test with producer method.</text>
</assertion>
-
- <assertion id="fba">
- <text>Test with producer field.</text>
- </assertion>
+
</group>
<assertion id="g">
@@ -5054,13 +5051,18 @@
</section>
<section id="11.3.18" title="Obtaining an InjectionTarget">
- <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>
+
+ <group>
+ <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>Check |InjectionTarget| is provided.</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>
+ <assertion id="ab">
+ <text>Check |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </group>
+
</section>
<section id="11.4" title="Alternative metadata sources">
@@ -5072,7 +5074,6 @@
<assertion id="b" testable="false">
<text>The interface |javax.enterprise.inject.spi.Annotated| exposes the
overriding annotations and type declarations.</text>
<note>Statement of intent</note>
-
</assertion>
<assertion id="c">
@@ -5095,9 +5096,111 @@
<text>|isAnnotationPresent()| returns true if the program element has an
annotation of the given annotation type, or false otherwise.</text>
</assertion>
- <assertion id="h">
- <text>The container must use the operations of |Annotated| and its
subinterfaces to discover program element types and annotations, instead of directly
calling the Java Reflection API. In particular, the container must call
|Annotated.getBaseType()| to determine the type of an injection point, event parameter or
disposed parameter, call |Annotated.getTypeClosure()| to determine the bean types of any
kind of bean, call |Annotated.getAnnotations()| to determine the scope, bindings,
stereotypes and interceptor bindings of a bean, call |Annotated.isAnnotationPresent()| and
|Annotated.getAnnotation()| to read any bean annotations defined by this specification,
and call |AnnotatedType.getConstructors()|, |AnnotatedType.getMethods()| and
|AnnotatedType.getFields()| to determine the members of a bean class.</text>
- </assertion>
+ <group>
+ <text>The container must use the operations of |Annotated| and its
subinterfaces to discover program element types and annotations, instead of directly
calling the Java Reflection API. In particular, the container must call
|Annotated.getBaseType()| to determine the type of an injection point, event parameter or
disposed parameter, call |Annotated.getTypeClosure()| to determine the bean types of any
kind of bean, call |Annotated.getAnnotations()| to determine the scope, qualifiers,
stereotypes and interceptor bindings of a bean, call |Annotated.isAnnotationPresent()| and
|Annotated.getAnnotation()| to read any bean annotations defined by this specification,
and call |AnnotatedType.getConstructors()|, |AnnotatedType.getMethods()| and
|AnnotatedType.getFields()| to determine the members of a bean class.</text>
+
+ <assertion id="h">
+ <text>Check that |getBaseType()| is used to determine the type of _an
injection point_. The base type should be different from the orignal type specified in the
class definition</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>Check that |getBaseType()| is used to determine the type of _an
event parameter_. The base type should be different from the orignal type specified in the
class definition</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>Check that |getBaseType()| is used to determine the type of
_disposed parameter_. The base type should be different from the orignal type specified in
the class definition</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>Check that a |getTypeClosure()| is used to determine the bean types.
The type closure should be different from the orignal type specified in the class
definition.</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>Check that |getAnnotations()| is used to determine the bean scope.
The annotations should be different from the orignal type specified in the class
definition.</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>Check that |getAnnotations()| is used to determine the bean
qualifiers. The annotations should be different from the orignal type specified in the
class definition.</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>Check that |getAnnotations()| is used to determine the bean
stereotypes. The annotations should be different from the orignal type specified in the
class definition.</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>Check that |getAnnotations()| is used to determine the bean
interceptors. The annotations should be different from the orignal type specified in the
class definition.</text>
+ </assertion>
+
+ <assertion id="q" testable="false">
+ <text>Check that |isAnnotationPresent()| returns the provided
annotations</text>
+ <note>No testable behavior</note>
+ </assertion>
+
+ <assertion id="r">
+ <text>Check that a previously non-inject-annotated constructor is used by
the container to instantiate a bean.</text>
+ </assertion>
+
+ <assertion id="s">
+ <text>Check that a qualifier added to a parameter is used by the container
to instantiate a bean.</text>
+ </assertion>
+
+ <assertion id="t">
+ <text>Check that a previously non-inject-annotated field is
injected.</text>
+ </assertion>
+
+ <assertion id="u">
+ <text>Check that an extra qualifier is applied.</text>
+ </assertion>
+
+ <assertion id="v">
+ <text>Check that |@Produces| added creates a producer field.</text>
+ </assertion>
+
+ <assertion id="w">
+ <text>Check that a previously non-inject-annotated method is
injected.</text>
+ </assertion>
+
+ <assertion id="x">
+ <text>Check that an extra qualifier is applied to an injectable
method</text>
+ </assertion>
+
+ <assertion id="y">
+ <text>Check that |@Produces| added creates a producer method</text>
+ </assertion>
+
+ <assertion id="z">
+ <text>Check that an extra qualifier is applied to a producer
method.</text>
+ </assertion>
+
+ <assertion id="aa">
+ <text>Check that a qualifer added to a producer method parameter is
applied.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>Check that |@Disposes| added to a parameter creates a disposes
method</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>Check that an extra qualifier is applied to a disposes method
parameter.</text>
+ </assertion>
+
+ <assertion id="ad">
+ <text>Check that a qualifer added to a disposes method injectable
parameter is applied.</text>
+ </assertion>
+
+ <assertion id="ae">
+ <text>Check that |@Observes| added to a parameter creates a observer
method</text>
+ </assertion>
+
+ <assertion id="af">
+ <text>Check that an extra qualifier is applied to an observes method
parameter.</text>
+ </assertion>
+
+ <assertion id="ag">
+ <text>Check that a qualifer added to a observes method injectable
parameter is applied.</text>
+ </assertion>
+
+ </group>
</section>
<section id="11.5" title="Container lifecycle events">
@@ -5163,17 +5266,38 @@
<text>|addDefinitionError()| registers a definition error with the container,
causing the container to abort deployment after all observers have been
notified.</text>
</assertion>
- <assertion id="d">
+ <group>
<text>|addBean()| fires an event of type |ProcessBean| containing the given
|Bean| and then registers the |Bean| with the container, thereby making it available for
injection into other beans. The given |Bean| may implement |Interceptor| or
|Decorator|.</text>
- </assertion>
+
+ <assertion id="da">
+ <text>Check that |ProcessBean| is fired</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>Check that a bean is registered</text>
+ </assertion>
+
+ <assertion id="dc">
+ <text>Check that a decorator is registered</text>
+ </assertion>
+
+ <assertion id="dd">
+ <text>Check that an interceptor is registered</text>
+ </assertion>
+ </group>
- <assertion id="e">
+ <group>
<text>|addObserverMethod()| fires an event of type |ProcessObserverMethod|
containing the given |ObserverMethod| and then registers the |ObserverMethod| with the
container, thereby making it available for event notifications.</text>
- </assertion>
+ <assertion id="ea">
+ <text>Check that the |ProcessObserverMethod| is fired</text>
+ </assertion>
+ <assertion id="eb">
+ <text>Check that the observer method is registered</text>
+ </assertion>
+ </group>
<assertion id="f">
- <text>|addContext()| registers a custom |Context| object with the container.
-A portable extension may take advantage of this event to register beans, interceptors,
decorators, observer methods and custom context objects with the container.</text>
+ <text>|addContext()| registers a custom |Context| object with the container.
A portable extension may take advantage of this event to register beans, interceptors,
decorators, observer methods and custom context objects with the container.</text>
</assertion>
<assertion id="g">
@@ -5236,17 +5360,112 @@
</section>
<section id="11.5.6" title="ProcessInjectionTarget event">
- <assertion id="a">
+ <group>
<text>The container must fire an event for each managed bean, session bean,
Java EE component class supporting injection, producer method or producer field it
discovers. The event object must be of type
|javax.enterprise.inject.spi.ProcessInjectionTarget<X>|, where |X| is the
managed bean class, session bean class or Java EE component class supporting
injection.</text>
- </assertion>
-
- <assertion id="ab">
- <text>|getAnnotatedType()| returns the |AnnotatedType| representing the managed
bean class, session bean or other Java EE component class supporting
injection.</text>
- </assertion>
+ <assertion id="aaa">
+ <text>Test event is fired for a managed bean</text>
+ </assertion>
+ <assertion id="aab">
+ <text>Test event is fired for a session bean</text>
+ </assertion>
+ <assertion id="aac">
+ <text>Test event is fired for a servlet listener</text>
+ </assertion>
+ <assertion id="aad">
+ <text>Test event is fired for a tag handler</text>
+ </assertion>
+ <assertion id="aae">
+ <text>Test event is fired for a tag library listener</text>
+ </assertion>
+ <assertion id="aaf">
+ <text>Test event is fired for an EJB Interceptor</text>
+ </assertion>
+ <assertion id="aag">
+ <text>Test event is fired for a WS endpoint</text>
+ </assertion>
+ <assertion id="aah">
+ <text>Test event is fired for a servlet</text>
+ </assertion>
+ <assertion id="aai">
+ <text>Test event is fired for a filter</text>
+ </assertion>
+ <assertion id="aaj">
+ <text>Test event is fired for a producer method</text>
+ </assertion>
+ <assertion id="aak">
+ <text>Test event is fired for a producer field</text>
+ </assertion>
+ <assertion id="aal">
+ <text>Test type for a managed bean</text>
+ </assertion>
+ <assertion id="aam">
+ <text>Test type for a session bean</text>
+ </assertion>
+ <assertion id="aan">
+ <text>Test type for a servlet listener</text>
+ </assertion>
+ <assertion id="aao">
+ <text>Test type for a tag handler</text>
+ </assertion>
+ <assertion id="aap">
+ <text>Test type for a tag library listener</text>
+ </assertion>
+ <assertion id="aaq">
+ <text>Test type for an EJB Interceptor</text>
+ </assertion>
+ <assertion id="aar">
+ <text>Test type for a WS endpoint</text>
+ </assertion>
+ <assertion id="aas">
+ <text>Test type for a servlet</text>
+ </assertion>
+ <assertion id="aat">
+ <text>Test type for a filter</text>
+ </assertion>
+ <assertion id="aau">
+ <text>Test type for a producer method</text>
+ </assertion>
+ <assertion id="aav">
+ <text>Test type for a producer field</text>
+ </assertion>
+ </group>
- <assertion id="ba">
- <text>|getInjectionTarget()| returns the |InjectionTarget| object that will
be used by the container to perform injection.</text>
- </assertion>
+ <group>
+ <text>|getAnnotatedType()| returns the |AnnotatedType| representing the
managed bean class, session bean or other Java EE component class supporting
injection.</text>
+ <assertion id="aba">
+ <text>Test type for a managed bean</text>
+ </assertion>
+ <assertion id="abb">
+ <text>Test type for a session bean</text>
+ </assertion>
+ <assertion id="abc">
+ <text>Test type for a servlet listener</text>
+ </assertion>
+ <assertion id="abd">
+ <text>Test type for a tag handler</text>
+ </assertion>
+ <assertion id="abe">
+ <text>Test type for a tag library listener</text>
+ </assertion>
+ <assertion id="abf">
+ <text>Test type for an EJB Interceptor</text>
+ </assertion>
+ <assertion id="abg">
+ <text>Test type for a WS endpoint</text>
+ </assertion>
+ <assertion id="abh">
+ <text>Test type for a servlet</text>
+ </assertion>
+ <assertion id="abi">
+ <text>Test type for a filter</text>
+ </assertion>
+ <assertion id="abj">
+ <text>Test type for a producer method</text>
+ </assertion>
+ <assertion id="abk">
+ <text>Test type for a producer field</text>
+ </assertion>
+ </group>
<assertion id="bb">
<text>|setInjectionTarget()| replaces the |InjectionTarget|.</text>
@@ -5256,9 +5475,42 @@
<text>|addDefinitionError()| registers a definition error with the container,
causing the container to abort deployment after bean discovery is complete.</text>
</assertion>
- <assertion id="e">
+ <group>
<text>Any observer of this event is permitted to wrap and/or replace the
|InjectionTarget|. The container must use the final value of this property, after all
observers have been called, whenever it performs injection upon the managed bean, session
bean or other Java EE component class supporting injection.</text>
- </assertion>
+ <assertion id="ea">
+ <text>Test type for a managed bean</text>
+ </assertion>
+ <assertion id="eb">
+ <text>Test type for a session bean</text>
+ </assertion>
+ <assertion id="ec">
+ <text>Test type for a servlet listener</text>
+ </assertion>
+ <assertion id="ed">
+ <text>Test type for a tag handler</text>
+ </assertion>
+ <assertion id="ee">
+ <text>Test type for a tag library listener</text>
+ </assertion>
+ <assertion id="ef">
+ <text>Test type for an EJB Interceptor</text>
+ </assertion>
+ <assertion id="eg">
+ <text>Test type for a WS endpoint</text>
+ </assertion>
+ <assertion id="eh">
+ <text>Test type for a servlet</text>
+ </assertion>
+ <assertion id="ei">
+ <text>Test type for a filter</text>
+ </assertion>
+ <assertion id="ej">
+ <text>Test type for a producer method</text>
+ </assertion>
+ <assertion id="ek">
+ <text>Test type for a producer field</text>
+ </assertion>
+ </group>
<assertion id="f">
<text>If any observer method of a |ProcessInjectionTarget| event throws an
exception, the exception is treated as a definition error by the container.</text>
@@ -5266,21 +5518,48 @@
</section>
<section id="11.5.7" title="ProcessProducer event">
- <assertion id="a">
+ <group>
<text>The container must fire an event for each producer method or field,
including resources.</text>
- </assertion>
+ <assertion id="aa">
+ <text>Test producer method</text>
+ </assertion>
+ <assertion id="ab">
+ <text>Test producer field</text>
+ </assertion>
+ <assertion id="ac">
+ <text>Test resource producer field</text>
+ </assertion>
+ </group>
- <assertion id="ba">
+ <group>
<text>The event object must be of type
|javax.enterprise.inject.spi.ProcessProducer<T, X>|, where |T| is the bean
class of the bean that declares the producer method or field and |X| is the return type of
the producer method or the type of the producer field.</text>
- </assertion>
-
- <assertion id="c">
+ <assertion id="ba">
+ <text>Test producer method</text>
+ </assertion>
+ <assertion id="bb">
+ <text>Test producer field</text>
+ </assertion>
+ </group>
+
+ <group>
<text>|getAnnotatedMember()| returns the |AnnotatedField| representing the
producer field or the |AnnotatedMethod| representing the producer method.</text>
- </assertion>
+ <assertion id="ca">
+ <text>Test producer method</text>
+ </assertion>
+ <assertion id="cb">
+ <text>Test producer field</text>
+ </assertion>
+ </group>
- <assertion id="d">
+ <group>
<text>|getProducer()| returns the |Producer| object that will be used by the
container to call the producer method or read the producer field.</text>
- </assertion>
+ <assertion id="da">
+ <text>Test producer method</text>
+ </assertion>
+ <assertion id="db">
+ <text>Test producer field</text>
+ </assertion>
+ </group>
<assertion id="e">
<text>|setProducer()| replaces the |Producer|.</text>
@@ -5290,9 +5569,15 @@
<text>|addDefinitionError()| registers a definition error with the container,
causing the container to abort deployment after bean discovery is complete.</text>
</assertion>
- <assertion id="g">
+ <group>
<text>Any observer of this event is permitted to wrap and/or replace the
|Producer|. The container must use the final value of this property, after all observers
have been called, whenever it calls the producer or disposer.</text>
- </assertion>
+ <assertion id="ga">
+ <text>Test producer method</text>
+ </assertion>
+ <assertion id="gb">
+ <text>Test producer field</text>
+ </assertion>
+ </group>
<assertion id="h">
<text>If any observer method of a |ProcessProducer| event throws an
exception, the exception is treated as a definition error by the container.</text>
@@ -5327,10 +5612,16 @@
<assertion id="ed">
<text>The interface |javax.enterprise.inject.spi.ProcessBean| is a supertype
of all these event types.</text>
</assertion>
-
- <assertion id="ef">
+
+ <group>
<text>|getAnnotated()| returns the |AnnotatedType| representing the bean
class, the |AnnotatedMethod| representing the producer method, or the |AnnotatedField|
representing the producer field.</text>
- </assertion>
+ <assertion id="efa">
+ <text>Test producer method</text>
+ </assertion>
+ <assertion id="efb">
+ <text>Test producer field</text>
+ </assertion>
+ </group>
<assertion id="fa">
<text>|getBean()| returns the |Bean| object that is about to be registered.
The |Bean| may implement |Interceptor| or |Decorator|.</text>