[webbeans-commits] Webbeans SVN: r2746 - ri/trunk/tests and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-03 08:14:10 -0400 (Wed, 03 Jun 2009)
New Revision: 2746
Modified:
ri/trunk/jboss-tck-runner/pom.xml
ri/trunk/tests/pom.xml
tck/trunk/impl/pom.xml
Log:
copy stuff in process-resources always
Modified: ri/trunk/jboss-tck-runner/pom.xml
===================================================================
--- ri/trunk/jboss-tck-runner/pom.xml 2009-06-03 12:13:31 UTC (rev 2745)
+++ ri/trunk/jboss-tck-runner/pom.xml 2009-06-03 12:14:10 UTC (rev 2746)
@@ -49,7 +49,7 @@
<executions>
<execution>
<id>copy</id>
- <phase>generate-test-sources</phase>
+ <phase>process-resources</phase>
<goals>
<goal>copy</goal>
</goals>
Modified: ri/trunk/tests/pom.xml
===================================================================
--- ri/trunk/tests/pom.xml 2009-06-03 12:13:31 UTC (rev 2745)
+++ ri/trunk/tests/pom.xml 2009-06-03 12:14:10 UTC (rev 2746)
@@ -145,7 +145,7 @@
<executions>
<execution>
<id>copy</id>
- <phase>generate-test-sources</phase>
+ <phase>process-resources</phase>
<goals>
<goal>copy</goal>
</goals>
Modified: tck/trunk/impl/pom.xml
===================================================================
--- tck/trunk/impl/pom.xml 2009-06-03 12:13:31 UTC (rev 2745)
+++ tck/trunk/impl/pom.xml 2009-06-03 12:14:10 UTC (rev 2746)
@@ -141,7 +141,7 @@
<executions>
<execution>
<id>copy-in-container-dependencies</id>
- <phase>compile</phase>
+ <phase>process-resources</phase>
<goals>
<goal>copy</goal>
</goals>
15 years, 7 months
[webbeans-commits] Webbeans SVN: r2745 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-03 08:13:31 -0400 (Wed, 03 Jun 2009)
New Revision: 2745
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
Log:
Mark known broken test failing in ri
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-06-03 07:36:29 UTC (rev 2744)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-06-03 12:13:31 UTC (rev 2745)
@@ -84,7 +84,7 @@
* @throws ClassNotFoundException
* @throws IOException
*/
- @Test(groups = { "contexts", "passivation" })
+ @Test(groups = { "contexts", "passivation", "incontainer-ri-broken" })
@SpecAssertion(section = "8.4", id = "j")
public void testDependentEJBsAreSerializable() throws IOException, ClassNotFoundException
{
15 years, 7 months
[webbeans-commits] Webbeans SVN: r2744 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-06-03 03:36:29 -0400 (Wed, 03 Jun 2009)
New Revision: 2744
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
section 5 assertions updated
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-02 15:19:20 UTC (rev 2743)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-03 07:36:29 UTC (rev 2744)
@@ -1984,9 +1984,6 @@
</section>
<section id="5" title="Lookup, dependency injection and EL resolution">
- <assertion id="a">
- <text>The container is required to ensure that any injected reference to a contextual instance of a bean may be cast to any bean type of the bean.</text>
- </assertion>
<assertion id="b">
<text>The container is required to support circularities in the bean dependency graph</text>
@@ -1994,630 +1991,534 @@
</assertion>
</section>
- <section id="5.1" title="Unsatisfied and ambiguous dependencies">
- <assertion id="a">
- <text>The container must validate all injection points of all enabled beans at deployment time to ensure that there are no unsatisfied or ambiguous dependencies. If an unsatisfied or ambiguous dependency exists, an |UnsatisfiedDependencyException| or |AmbiguousDependencyException| is thrown by the container at deployment time, as defined in Section 5.7.1, "Resolving dependencies".</text>
- <note>These need expanding out - one for each assertion that results in an exception in 5.7.1</note>
+ <section id="5.1" title="Typesafe resolution algorithm">
+
+ <assertion id="faa">
+ <text>When the container is resolving a bean by type, it identifies the set of matching enabled beans which have a bean type that matches the required type.</text>
</assertion>
- </section>
-
- <section id="5.2" 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 id="fb">
+ <text>Primitive types are considered to be identical to their corresponding wrapper types in |java.lang|.</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>
-
- <assertion id="a">
- <text>If an injection point of primitive type resolves to a bean that may be null, such as a producer method with a nonprimitive return type or a producer field with a non-primitive type, a |NullableDependencyException| is thrown by the container at deployment time</text>
+
+ <assertion id="fc">
+ <text>Array types are considered identical only if their element types are identical.</text>
</assertion>
- <assertion id="b">
- <text>The method |Bean.isNullable()| may be used to detect if a bean has null values</text>
+ <assertion id="fd">
+ <text>Parameterized types are considered identical only if both the type and all type parameters are identical.</text>
</assertion>
- </section>
-
- <section id="5.3" title="Injected reference validity">
- <assertion id="a">
- <text>Any reference to a bean with a normal scope is valid as long as the application maintains a hard reference to it. However, it may only be invoked when the context associated with the normal scope is active. If it is invoked when the context is inactive, a |ContextNotActiveException| is thrown by the container</text>
+
+ <assertion id="gaa">
+ <text>_If no bindings were explicitly specified, the container assumes the binding |@Current|_. </text>
</assertion>
- <assertion id="b">
- <text>Any reference to a bean with a pseudo-scope (such as |@Dependent|) is valid until the bean instance to which it refers is destroyed. It may be invoked even if the context associated with the pseudo-scope is not active. If the application invokes a method of a reference to an instance that has already been destroyed, the behavior is undefined</text>
+ <assertion id="gba">
+ <text>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|.</text>
</assertion>
+
+ <assertion id="gca">
+ <text>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 |javax.enterprise.inject.@NonBinding|.</text>
+ </assertion>
+
+ <assertion id="ha">
+ <text>When the container is resolving a bean by type, it examines the deployment types of the matching beans, as defined in Section 2.5.6, "Deployment type precedence", and returns the set of beans with the highest precedence deployment type that occurs in the set.</text>
+ </assertion>
+
+ <assertion id="hb">
+ <text>When the container is resolving a bean by type, it examines the deployment types of the matching beans, as defined in Section 2.5.6, "Deployment type precedence", and returns the set of beans with the highest precedence deployment type that occurs in the set. _If there are no matching beans, an empty set is returned_</text>
+ </assertion>
</section>
- <section id="5.4" title="Client proxies">
+ <section id="5.1.1" title="Assignability of raw and parameterized types">
+
<assertion id="a">
- <text>Client proxies are never required for a bean whose scope is a pseudo-scope such as |@Dependent|</text>
- </assertion>
+ <text>A parameterized bean type is considered assignable to a raw required type if the raw types are identical and all type parameters of the bean type are either unbounded type variables or |java.lang.Object|.</text>
+ </assertion>
<assertion id="b">
- <text>Client proxies are used for normal scoped beans</text>
+ <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter and the bean type parameter are actual types with identical raw type, and, if the type is parameterized, the bean type is assignable to the required type according to these rules.</text>
</assertion>
<assertion id="c">
- <text>All client proxies must be serializable</text>
+ <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter is a wildcard, the bean type parameter is an actual type and the actual type is a subtype of the upper bound, if any, of the wildcard and a supertype of the upper bound, if any, or the wildcard.
+ </text>
</assertion>
-
+
<assertion id="d">
- <text>The container must guarantee that when any valid injected reference to a bean of normal scope is invoked, the invocation is always processed by the current instance of the injected bean.</text>
+ <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter is a wildcard with no lower bound, the bean type parameter is a type variable and the upper bound of the type variable is aa subtype of the upper bound, if any, of the wildcard.</text>
</assertion>
- </section>
-
- <section id="5.4.1" title="Unproxyable bean types">
- <assertion id="a">
- <text>Classes without a non-private constructor with no parameters cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, an |UnproxyableDependencyException| is thrown by the container at deployment time.</text>
+
+ <assertion id="e">
+ <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter is an actual type, the bean type parameter is a type variable and the actual type is a subtype of the upper bound, if any, of the type variable.</text>
</assertion>
-
- <assertion id="ba">
- <text>Classes which are declared final ~or have final methods~ cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, an |UnproxyableDependencyException| is thrown by the container at deployment time</text>
+
+ <assertion id="f">
+ <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter and the bean type parameter are both type variables and the upper bound of the required type parameter is a subtype of the upper bound, if any, of the bean type parameter</text>
</assertion>
- <assertion id="bb">
- <text>Classes which ~are declared final or ~have final methods cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, an |UnproxyableDependencyException| is thrown by the container at deployment time</text>
+ <assertion id="g">
+ <text>If the injection point is declared by a parameterized superclass, and the type declaration of the injection point contains type parameters declared by the superclass, the required type is the declared type, after substitution of actual type arguments declared by subclasses.</text>
</assertion>
-
- <assertion id="c">
- <text>Primitive types cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, an |UnproxyableDependencyException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>Array types cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, an |UnproxyableDependencyException| is thrown by the container at deployment time</text>
- </assertion>
+
</section>
- <section id="5.4.2" title="Client proxy invocation">
- <assertion id="a">
- <text>Every time a method of the bean is invoked upon a client proxy, the client proxy must obtain the context object by calling |Manager.getContext()|, passing the bean scope, then obtain an instance of the bean by calling |Context.get()|, passing the Bean instance representing the bean and an instance of |CreationalContext|, and invoke the method upon the bean</text>
- </assertion>
+ <section id="5.1.2" title="Unsatisfied and ambiguous dependencies">
+ <assertion id="aa">
+ <text>The container must validate all injection points of all enabled beans when the application is initialized to ensure that there are no unsatisfied or ambiguous dependencies. If an unsatisfied or ambiguous dependency exists, 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>
+ <note>These need expanding out - one for each assertion that results in an exception in 5.7.1</note>
+ </assertion>
<assertion id="b">
- <text>The behavior of all methods declared by |java.lang.Object|, except for |toString()|, is undefined for a client proxy</text>
+ <text>For a custom implementation of the Bean interface defined in Section 11.1, "The Bean interface", the container calls |getInjectionPoints()| to determine the injection points of the bean.</text>
</assertion>
-
- </section>
+
+ </section>
- <section id="5.5" title="The default binding at injection points">
- <assertion id="a">
- <text>If an injection point declares no binding, the default binding |@Current| is assumed</text>
- </assertion>
- </section>
+ <section id="5.1.3" title="Primitive types and null values">
- <section id="5.6" title="Injection point metadata">
- <assertion id="a">
- <text>The |javax.enterprise.inject.spi.InjectionPoint.getBean()| method returns the Bean object representing the bean that defines the injection point</text>
+ <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>
+
+ <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>
+ </assertion>
<assertion id="ba">
- <text>The |javax.enterprise.inject.spi.InjectionPoint.getType()| method returns the declared type of the injection point.</text>
+ <text>For a custom implementation of the Bean interface defined in Section 11.1, "The Bean interface", the container calls |isNullable()| to determine whether the bean may have null values.</text>
</assertion>
-
- <assertion id="bb">
- <text>An injection point declared in XML has it's type determined according to Section 9.10, "Specifying bean types and bindings"</text>
+ </section>
+
+ <section id="5.1.4" title="Binding annotations with members">
+ <assertion id="a" testable="false">
+ <text>Binding types with members are supported</text>
+ <note>A statement of intent</note>
</assertion>
- <assertion id="bc">
- <text>The |javax.enterprise.inject.spi.InjectionPoint.getBindings()| method returns the declared bindings of the injection point.</text>
+ <assertion id="b">
+ <text>An annotation member may be excluded from consideration using the |@NonBinding| annotation</text>
</assertion>
<assertion id="ca">
- <text>The |javax.enterprise.inject.spi.InjectionPoint.getMember()| method returns the |Field| object in the case of field injection</text>
+ <text>Array-valued ~or annotation-valued~ members of a binding type must be annotated |@NonBinding|. If an array-valued ~or annotation-valued~ member of a binding type is not annotated |@NonBinding|, 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>
<assertion id="cb">
- <text>The |javax.enterprise.inject.spi.InjectionPoint.getMember()| method returns the |Method| object in the case of method parameter injection</text>
+ <text>~Array-valued or ~annotation-valued members of a binding type must be annotated |@NonBinding|. If an ~array-valued or ~annotation-valued member of a binding type is not annotated |@NonBinding|, 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>
-
- <assertion id="cc">
- <text>The |javax.enterprise.inject.spi.InjectionPoint.getMember()| method returns the |Constructor| object in the case of constructor parameter injection</text>
+ </section>
+
+ <section id="5.1.5" title="Multiple bindings">
+ <assertion id="a">
+ <text>A bean class may declare multiple bindings</text>
</assertion>
- <assertion id="da">
- <text>The |javax.enterprise.inject.spi.InjectionPoint.getAnnotation()| method returns annotations of the field in the case of field injection</text>
+ <assertion id="b">
+ <text>A producer method may declare multiple bindings</text>
</assertion>
- <assertion id="db">
- <text>The |javax.enterprise.inject.spi.InjectionPoint.getAnnotation()| method returns annotations of the parameter in the case of method parameter</text>
- </assertion>
+ <assertion id="c">
+ <text>A producer field may declare multiple bindings</text>
+ </assertion>
- <assertion id="dc">
- <text>The |javax.enterprise.inject.spi.InjectionPoint.getAnnotation()| method returns annotations annotations of the parameter in the case of constructor parameter injection.</text>
+ <assertion id="d">
+ <text>A bean must declare all of the bindings that are specified at the injection point to be considered a candidate for injection</text>
</assertion>
+ </section>
+
+ <section id="5.2" title="EL Name resolution algorithm">
- <assertion id="dd">
- <text>The |javax.enterprise.inject.spi.InjectionPoint.getAnnotations()| method returns annotations of the field in the case of field injection</text>
+ <assertion id="b">
+ <text>When resolving a bean by name, the container must identify the set of matching enabled beans which have the given EL name</text>
</assertion>
- <assertion id="de">
- <text>The |javax.enterprise.inject.spi.InjectionPoint.getAnnotations()| method returns annotations of the parameter in the case of method parameter</text>
+ <assertion id="c">
+ <text>After the container identifies the set of matching beans, it examines the deployment types of the matching beans, as defined in Section 2.5.6, "Deployment type precedence", and returns the set of beans with the highest precedence deployment type that occurs in the set.</text>
</assertion>
- <assertion id="df">
- <text>The |javax.enterprise.inject.spi.InjectionPoint.getAnnotations()| method returns annotations annotations of the parameter in the case of constructor parameter injection.</text>
+ <assertion id="d">
+ <text>If there are no matching beans, an empty set is returned.</text>
</assertion>
-
- <assertion id="dg">
- <text>|getAnnotation()| returns a null value if no annotation of the given type exists at the field injection point</text>
+ </section>
+
+ <section id="5.2.1" title="Ambiguous EL names">
+ <assertion id="a">
+ <text>If, in a particular deployment two enabled beans have the same EL name and the same deployment 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>
</assertion>
- <assertion id="dh">
- <text>|getAnnotation()| returns a null value if no annotation of the given type exists at the method parameter injection point</text>
+ <assertion id="b">
+ <text>If, in a particular deployment, the EL name of an enabled bean is of the form |x.y|, where |y| is a valid bean EL name, and |x| is the EL name of some other enabled bean, 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>
</assertion>
-
- <assertion id="di">
- <text>|getAnnotation()| returns a null value if no annotation of the given type exists at the constructor injection point</text>
- </assertion>
-
</section>
- <section id="5.6.1" title="Injecting InjectionPoint">
-
- <assertion id="za">
- <text>The container must provide a bean with deployment type |@Standard|.</text>
+ <section id="5.3" title="Client proxies">
+ <assertion id="a">
+ <text>Client proxies are never required for a bean whose scope is a pseudo-scope such as |@Dependent|</text>
</assertion>
- <assertion id="zb">
- <text>The container must provide a bean with scope |@Dependent|.</text>
+ <assertion id="b">
+ <text>Client proxies are used for normal scoped beans</text>
</assertion>
- <assertion id="zc">
- <text>The container must provide a bean with bean type |InjectionPoint|.</text>
+ <assertion id="d">
+ <text>The container must guarantee that when any valid injected reference to a bean of normal scope is invoked, the invocation is always processed by the current instance of the injected bean.</text>
</assertion>
-
- <assertion id="zd">
- <text>The container must provide a bean with binding |@Current|.</text>
- </assertion>
+ </section>
- <assertion id="a">
- <text>Whenever a |@Dependent| scoped object is instantiated by the container for injection into a second bean, any injection point of type |InjectionPoint| and binding |@Current| receives an instance of |InjectionPoint| that represents the injection point of the second bean</text>
+ <section id="5.3.1" title="Unproxyable bean types">
+ <assertion id="aa">
+ <text>Classes without a non-private constructor with no parameters cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, 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>
</assertion>
- <assertion id="b">
- <text>When a |@Dependent| scoped object is instantiated by the container to receive a producer method, any injection point of type |InjectionPoint| and binding |@Current| receives a null value</text>
+ <assertion id="baa">
+ <text>Classes which are declared final ~or have final methods~ cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, 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>
</assertion>
- <assertion id="c">
- <text>When a |@Dependent| scoped object is instantiated by the container to receive a producer field, any injection point of type |InjectionPoint| and binding |@Current| receives a null value</text>
+ <assertion id="bba">
+ <text>Classes which ~are declared final or ~have final methods cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, 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>
</assertion>
- <assertion id="d">
- <text>When a |@Dependent| scoped object is instantiated by the container to receive an observer , any injection point of type |InjectionPoint| and binding |@Current| receives a null value</text>
+ <assertion id="ca">
+ <text>Primitive types cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, 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>
</assertion>
- <assertion id="e">
- <text>When a |@Dependent| scoped object is instantiated by the container to receive a disposal method invocation, any injection point of type |InjectionPoint| and binding |@Current| receives a null value</text>
+ <assertion id="da">
+ <text>Array types cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, 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>
</assertion>
-
- <assertion id="f">
- <text>When a |@Dependent| scoped object is instantiated by the container during EL expression evaluation, any injection point of type |InjectionPoint| and binding |@Current| receives a null value</text>
+ </section>
+
+ <section id="5.3.2" title="Client proxy invocation">
+ <assertion id="aa">
+ <text>Every time a method of the bean is invoked upon a client proxy, the client proxy must obtain a contextual instance of the bean, as defined in Section 6.5.2, "Contextual instance of a bean", and invoke the method upon this instance.</text>
</assertion>
- <assertion id="g">
- <text>When a |@Dependent| scoped object is instantiated by the container as a result of a direct call to the Manager API, any injection point of type |InjectionPoint| and binding |@Current| receives a null value</text>
+ <assertion id="b">
+ <text>The behavior of all methods declared by |java.lang.Object|, except for |toString()|, is undefined for a client proxy</text>
</assertion>
-
- <assertion id="h">
- <text>If a bean that declares any scope other than |@Dependent| has an injection point of type |InjectionPoint| and binding |@Current|, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="i">
- <text>If an object that is not a bean has an injection point of type |InjectionPoint| and binding |@Current|, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
- </section>
+
+ </section>
- <section id="5.7" title="The Manager object">
-
- </section>
-
- <section id="5.7.1" title="Resolving dependencies">
- <assertion id="a" testable="false">
- <text>Implementations of Bean maintain a reference to an instance of |Manager|</text>
+ <section id="5.4" title="Dependency injection">
+ <assertion id="a">
+ <text>The container is required to perform dependency injection whenever it creates a contextual instance of a session bean.</text>
</assertion>
<assertion id="b">
- <text>When the |Bean| implementation performs dependency injection, it must obtain the contextual instances to inject by calling |Manager.getInstanceToInject()|, passing an instance of |InjectionPoint| that represents the injection point and the instance of |CreationalContext| that was passed to |Bean.create()|</text>
+ <text>The container is required to perform dependency injection whenever it creates a contextual instance of a managed bean.</text>
</assertion>
<assertion id="c">
- <text>|Manager.getInstanceToInject()| returns a contextual instance or client proxy to be injected to the given injection point</text>
+ <text>The container is required to perform dependency injection whenever it instantiates non-contextual instances of session beans (for example, session beans obtained by the application from JNDI or injected using |@EJB|).</text>
</assertion>
<assertion id="d">
- <text>The |Manager.getInstanceToInject()| method must Identify the bean by calling |Manager.resolveByType()|, passing the type and bindings of the injection point</text>
+ <text>The container is required to perform dependency injection whenever it instantiates non-contextual instances of managed beans.</text>
</assertion>
-
+
<assertion id="e">
- <text>The |Manager.getInstanceToInject()| method must throw an |UnsatisfiedDependencyException| if |resolveByType()| did not return a bean</text>
+ <text>The container is required to perform dependency injection whenever it instantiates instances of any other Java EE component class supporting injection.</text>
</assertion>
<assertion id="f">
- <text>The |Manager.getInstanceToInject()| method must throw an |AmbiguousDependencyException| if |resolveByType()| returned more than one bean</text>
+ <text>In a Java EE 5 environment, the container is not required to support injection for non-contextual objects.</text>
</assertion>
<assertion id="g">
- <text>The |Manager.getInstanceToInject()| method must throw an |UnproxyableDependencyException| if the bean has a normal scope and the type cannot be proxied by the container, as defined in Section 5.4.1, "Unproxyable bean types"</text>
+ <text>The container interacts with instances of beans and other Java EE component classes supporting injection by calling methods and getting and setting the field values.</text>
</assertion>
-
- <assertion id="h">
- <text>The |Manager.getInstanceToInject()| method must obtain an instance of the bean (or a client proxy) by calling |Manager.getInstance()|, passing the |Bean| object representing the bean, and return it. Alternatively, return an incompletely initialized instance of the bean that was registered by calling |CreationalContext.push()|, as defined in Section 6.1, "The Contextual interface"</text>
- </assertion>
</section>
- <section id="5.7.2" title="Obtaining contextual instances">
+ <section id="5.4.1" title="Injectable references">
<assertion id="a">
- <text>Any bean may obtain an instance of |Manager| by injecting it</text>
+ <text>To obtain an injectable reference for an injection point, the container must identify a bean according to the rules defined in Section 5.1, "Typesafe resolution algorithm".</text>
</assertion>
- <assertion id="aa">
- <text>The container provides a built-in bean with bean type |Manager|</text>
- </assertion>
-
- <assertion id="ab">
- <text>The container-provided |Manager| bean has a scope type of |@Dependent|</text>
- </assertion>
-
- <assertion id="ac">
- <text>The container-provided |Manager| bean has a deployment type of |@Standard|</text>
- </assertion>
-
- <assertion id="ad">
- <text>The container-provided |Manager| bean has a binding of |@Current|.</text>
- </assertion>
-
<assertion id="b">
- <text>The application may obtain the |Manager| object from JNDI. The container must register an instance of |Manager| with name |java:app/Manager| in JNDI at deployment time</text>
+ <text>If typesafe resolution resulted in an empty set, throw an |UnsatisfiedResolutionException|.</text>
</assertion>
<assertion id="c">
- <text>A contextual instance of a bean may be obtained by calling |Manager.getInstance()|, passing the |Bean| object representing the bean</text>
+ <text>If typesafe resolution resulted in more than one bean, throw an |AmbiguousResolutionException|.</text>
</assertion>
<assertion id="d">
- <text>|Manager.getInstance()| returns a contextual instance or client proxy for the given bean</text>
+ <text>Otherwise, obtain a contextual reference for this bean for the type of the injection point according to Section 6.5.3, "Contextual reference for a bean".</text>
</assertion>
<assertion id="e">
- <text>If the given Bean instance represents a bean with a normal scope, as defined in Section 8.2, "Normal scopes and pseudo-scopes", |Manager.getInstance()| must return a client proxy</text>
+ <text>The container is permitted to directly inject a contextual instance of the bean, as defined in Section 6.5.2, "Contextual instance of a bean".</text>
</assertion>
<assertion id="f">
- <text>If the Bean instance represents a bean with a pseudo-scope, as defined in Section 8.2, "Normal scopes and pseudo-scopes", |Manager.getInstance()| must obtain the context object by calling |Manager.getContext()|, passing the bean scope, then obtain an instance of the bean by calling |Context.get()|, passing the Bean instance representing the bean and an instance of |CreationalContext|</text>
+ <text>If an incompletely initialized instance of the bean is registered with the current |CreationalContext|, as defined in Section
+6.1, "The Contextual interface", the container is permitted to directly inject this instance.</text>
</assertion>
- <assertion id="g" testable="false">
- <text>The |Manager.getInstanceByType()| methods obtain a contextual instance of a bean</text>
- <note>A statement of intent</note>
+ </section>
+
+ <section id="5.4.2" title="Injected reference validity">
+ <assertion id="c">
+ <text>Injected references to a bean are valid until the object into which they were injected is destroyed. The application should not invoke a method of an invalid reference. If the application invokes a method of an injected reference after the object into which it was injected has been destroyed, the behavior is undefined.</text>
</assertion>
-
- <assertion id="h">
- <text>If no bindings are passed to |Manager.getInstanceByType()|, the default binding |@Current| is assumed</text>
+ </section>
+
+ <section id="5.4.3" title="Injection using the bean constructor">
+ <assertion id="a">
+ <text>When the container instantiates a managed bean with a constructor annotated |@Initializer|, the container calls this constructor, passing an injectable reference to each parameter. If there is no constructor annotated |@Initializer|, the container calls the constructor with no parameters.</text>
+ </assertion>
+ </section>
+
+ <section id="5.4.4" title="Injection of fields and initializer methods">
+ <assertion id="a">
+ <text>When the container creates a new instance of a managed bean, session bean, or of any other Java EE component class supporting injection, the container must initialize the values of all injected fields after injection of Java EE component environment resources has been performed and before the |@PostConstruct| callback occurs and before the servlet |init()| method is called. The container sets the value of each injected field to an injectable reference.</text>
</assertion>
- <assertion id="ia">
- <text>If a parameterized type with a type parameter ~or wildcard~ is passed to |resolveByType()|, an |IllegalArgumentException| is thrown</text>
+ <assertion id="b">
+ <text>After the container initializes the values of the injected fields, it must call all initializer methods, passing an injectable reference to each parameter.</text>
</assertion>
- <assertion id="ib">
- <text>If a parameterized type with a ~type parameter or~ wildcard is passed to |resolveByType()|, an |IllegalArgumentException| is thrown</text>
+ <assertion id="c">
+ <text>After the container calls initializer methods, it must build the interceptor and decorator stacks for the instance (if the component has interceptors or decorators).</text>
+ </assertion>
+ </section>
+
+ <section id="5.4.5" title="Destruction of dependent objects">
+ <text>When the container destroys an instance of a bean or of any Java EE component class supporting injection, the container destroys all dependent objects, as defined in Section 6.4.3, "Dependent object destruction", after the |@PreDestroy| callback completes and after the servlet |destroy()| method is called.</text>
+ </section>
+
+ <section id="5.4.6" title="Invocation of producer or disposal methods">
+ <assertion id="a">
+ <text>When the container calls a producer method, if the method is static, the container must invoke the method.</text>
</assertion>
- <assertion id="j">
- <text>If two instances of the same binding type are passed to |getInstanceByType()|, a |DuplicateBindingTypeException| is thrown</text>
+ <assertion id="b">
+ <text>When the container calls a disposal method, if the method is static, the container must invoke the method.</text>
</assertion>
- <assertion id="k">
- <text>If an instance of an annotation that is not a binding type is passed to |getInstanceByType()|, an |IllegalArgumentException| is thrown</text>
+ <assertion id="c">
+ <text>When the container calls a producer method, if the method is non-static the container must determine the most specialized enabled bean that specializes the bean which declares the method, as defined in Section 4.3.2 "Most specializaed enabled bean for a bean", then obtain a contextual instance of the most specialized bean, as defined by Section 6.5.2 "Contextual instance of a bean", then invoke the method upon this instance.</text>
</assertion>
- <assertion id="l">
- <text>The |getInstanceByType()| method must identify the bean by calling |Manager.resolveByType()|, passing the given type and bindings</text>
+ <assertion id="d">
+ <text>When the container calls a disposal method, if the method is non-static the container must determine the most specialized enabled bean that specializes the bean which declares the method, as defined in Section 4.3.2 "Most specializaed enabled bean for a bean", then obtain a contextual instance of the most specialized bean, as defined by Section 6.5.2 "Contextual instance of a bean", then invoke the method upon this instance.</text>
</assertion>
- <assertion id="m">
- <text>The |getInstanceByType()| method must throw an |UnsatisfiedDependencyException| if |resolveByType()| did not return a bean</text>
+ <assertion id="e">
+ <text>The container passes an injectable reference to each injected method parameter. The container is also responsible for destroying dependent objects created during this invocation, as defined in Section 6.4.3 "Dependent object destruction".</text>
+ </assertion>
+ </section>
+
+ <section id="5.4.7" title="Access to producer field values">
+ <assertion id="a">
+ <text>When the container accesses the value of a producer field, if the producer field is static, the container must access the field value.</text>
</assertion>
- <assertion id="n">
- <text>The |getInstanceByType()| method must throw an |AmbiguousDependencyException| if |resolveByType()| returned more than one bean</text>
+ <assertion id="b">
+ <text>When the container accesses the value of a producer field, if the producer field is non-static, the container must determine the most specialized enabled bean that specializes the bean which declares the producer field, as defined in Section 4.3.2 "Most specialized enabled bean for a bean", then obtain a contextual instance of the most specialized bean, as defined by Section 6.5.2 "Contextual instance of a bean", then access the field value of this instance.</text>
</assertion>
-
- <assertion id="o">
- <text>The |getInstanceByType()| method must obtain an instance of the bean (or a client proxy) by calling |Manager.getInstance()|, passing the Bean object representing the bean, and return it</text>
- </assertion>
</section>
- <section id="5.8" title="Dynamic lookup">
-
+ <section id="5.4.8" title="Invocation of observer methods">
<assertion id="a">
- <text>An instance of the |javax.inject.Instance| interface may be injected via use of the
-|(a)javax.inject.Obtains| binding</text>
+ <text>When the container calls an observer method (defined in Section 10.5 "Observer methods"), if the observer method is static, the container must invoke the method.</text>
</assertion>
<assertion id="b">
- <text>Additional bindings may be specified at the injection point</text>
+ <text>When the container calls an observer method (defined in Section 10.5 "Observer methods"), if the observer method is non-static, the container must determine the most specialized enabled bean that specializes the bean which declares the observer method, as defined in Section 4.3.2 "Most specialized enabled bean for a bean", then obtain a contextual instance of the bean according to Section 6.5.2 "Contextual instance of a bean". If this observer method is a conditional observer method, obtain the contextual instance that already exists, without creating a new contextual instance. Finally, the container must invoke the observer method on the resulting instance, if any.</text>
</assertion>
<assertion id="c">
- <text>The |Instance| interface provides a method for obtaining instances of beans of a specific type</text>
+ <text>The container must pass the event object to the event parameter and an injectable instance to each injected method parameter.</text>
</assertion>
<assertion id="d">
- <text>If two instances of the same binding type are passed to |Instance.get()|, a |DuplicateBindingTypeException| is thrown</text>
+ <text>The container is also responsible for destroying dependent objects created during this invocation, as defined in Section 6.4.3, "Dependent object destruction".</text>
+ </assertion>
+ </section>
+
+ <section id="5.4.9" title="Injection point metadata">
+ <assertion id="aa">
+ <text>The |javax.enterprise.inject.spi.InjectionPoint.getBean()| method returns the Bean object representing the bean that defines the injection point. If the injection point does not belong to a bean, |getBean()| returns a null value.</text>
</assertion>
- <assertion id="e">
- <text>If an instance of an annotation that is not a binding type is passed to |Instance.get()|, an |IllegalArgumentException| is thrown</text>
+ <assertion id="ba">
+ <text>The |javax.enterprise.inject.spi.InjectionPoint.getType()| method returns the declared type of the injection point.</text>
</assertion>
- <assertion id="f">
- <text>The |@Obtains| annotation or |<Obtains>| element may be applied to any injection point of type |Instance| where an actual type parameter is specified</text>
+ <assertion id="bc">
+ <text>The |javax.enterprise.inject.spi.InjectionPoint.getBindings()| method returns the declared bindings of the injection point.</text>
</assertion>
- <assertion id="g">
- <text>If the type of the injection point is not of type |Instance| a |DefinitionException| is thrown by the container at deployment time</text>
+ <assertion id="ca">
+ <text>The |javax.enterprise.inject.spi.InjectionPoint.getMember()| method returns the |Field| object in the case of field injection.</text>
</assertion>
- <assertion id="h">
- <text>If no actual type parameter is specified a |DefinitionException| is thrown by the container at deployment time</text>
+ <assertion id="cb">
+ <text>The |javax.enterprise.inject.spi.InjectionPoint.getMember()| method returns the |Method| object in the case of method parameter injection.</text>
</assertion>
- <assertion id="i">
- <text>If the type parameter contains a type variable a |DefinitionException| is thrown by the container at deployment time</text>
+ <assertion id="cc">
+ <text>The |javax.enterprise.inject.spi.InjectionPoint.getMember()| method returns the |Constructor| object in the case of constructor parameter injection</text>
</assertion>
- <assertion id="j">
- <text>If the type parameter contains a wildcard a |DefinitionException| is thrown by the container at deployment time</text>
+ <assertion id="daa">
+ <text>The |getAnnotated()| method returns an instance of |javax.enterprise.inject.spi.AnnotatedField| or |javax.enterprise.inject.spi.AnnotatedParameter|, depending upon whether the injection point is an injected field or a constructor/method parameter.</text>
</assertion>
- <assertion id="k" testable="false">
- <text>Whenever the |@Obtains| annotation appears at an injection point, an implicit bean exists with exactly the bean type and bindings that appear at the injection point</text>
- <note>As the bean is implicit, it cannot be resolved</note>
+ <assertion id="dba">
+ <text>The |isDelegate()| method returns true if the injection point is a decorator delegate injection point, and false otherwise.</text>
</assertion>
- <assertion id="l" testable="false">
- <text>Whenever the |@Obtains| annotation appears at an injection point, an implicit bean exists with deployment type |@Standard|</text>
- <note>As the bean is implicit, it cannot be resolved</note>
+ <assertion id="dca">
+ <text>The |isTransient()| method returns true if the injection point is a transient field, and false otherwise.</text>
</assertion>
+
+ <assertion id="e">
+ <text>The container must provide a bean with deployment type |@Standard|, scope |@Dependent|, bean type |InjectionPoint| and binding |@Current|, allowing dependent objects, as defined in Section 6.4.2, "Dependent objects", to obtain information about the injection point to which they belong. The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable dependencies".</text>
+ </assertion>
- <assertion id="m" testable="false">
- <text>Whenever the |@Obtains| annotation appears at an injection point, an implicit bean exists with |@Dependent| scope</text>
- <note>As the bean is implicit, it cannot be resolved</note>
+ <assertion id="f">
+ <text>If a bean that declares any scope other than |@Dependent| has an injection point of type |InjectionPoint| and binding |@Current|, 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>
- <assertion id="n" testable="false">
- <text>Whenever the |@Obtains| annotation appears at an injection point, an implicit bean exists with no bean name</text>
- <note>As the bean is implicit, it cannot be resolved</note>
+ <assertion id="g">
+ <text>If an object that is not a bean has an injection point of type |InjectionPoint| and binding |@Current|, 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>
+ </section>
+
+ <section id="5.5" title="Programmatic lookup">
+ <assertion id="aa">
+ <text>An instance of the |javax.enterprise.inject.Instance| interface may be injected.</text>
</assertion>
- <assertion id="o" testable="false">
- <text>Whenever the |@Obtains| annotation appears at an injection point, an implicit bean exists with an implementation provided automatically by the container</text>
- <note>As the bean is implicit, it cannot be resolved</note>
+ <assertion id="ba">
+ <text>The method |javax.enterprise.inject.Instance.get()| returns a contextual reference.</text>
</assertion>
- <assertion id="p">
- <text>The |get()| method of the provided implementation of Instance must call |Manager.getInstanceByType()|, passing all bindings declared at the injection point, except |@Obtains|, and all bindings passed to |Instance.get()|</text>
+ <assertion id="ca">
+ <text>Any combination of bindings may be specified at the injection point.</text>
</assertion>
- <assertion id="q">
- <text>The application may obtain a contextual instance by calling the |Instance.get()| method</text>
+ <assertion id="da">
+ <text>The |@Any| binding may be used to allow the application to specify bindings dynamically.</text>
</assertion>
+ </section>
- <assertion id="r">
- <text>When the application calls |Instance.get()| to obtain a contextual instance dynamically, it may need to pass instances of binding annotation types</text>
- </assertion>
- </section>
-
- <section id="5.9" title="Typesafe resolution algorithm">
+ <section id="5.5.1" title="The Instance interface">
<assertion id="a">
- <text>The |resolveByType()| method of the |Manager| interface returns the result of the typesafe resolution</text>
- <note>Here we just do a general test that resolveByType() is producing sensible results</note>
+ <text>The |Instance| interface provides a method for obtaining instances of beans of a specific type, and inherits the ability to iterate
+beans of a specific type from |java.lang.Iterable|.</text>
</assertion>
<assertion id="b">
- <text>If no bindings are passed to |Manager.resolveByType()|, the default binding |@Current| is assumed</text>
+ <text>The |select()| method of the provided implementation of |Instance| returns a child Instance for a subtype of the bean type and additional bindings. If no subtype is given, the bean type is the same as the parent.</text>
</assertion>
- <assertion id="ca">
- <text>If a parameterized type with a type parameter ~or wildcard~ is passed to |Manager.resolveByType()|, an |IllegalArgumentException| is thrown</text>
+ <assertion id="c">
+ <text>If a parameterized type with a type parameter or wildcard is passed to |select()|, an |IllegalArgumentException| is thrown.</text>
</assertion>
- <assertion id="cb">
- <text>If a parameterized type with a ~type parameter or~ wildcard is passed to |Manager.resolveByType()|, an |IllegalArgumentException| is thrown</text>
- </assertion>
-
<assertion id="d">
- <text>If two instances of the same binding type are passed to |Manager.resolveByType()|, a |DuplicateBindingTypeException| is thrown</text>
+ <text>If two instances of the same binding type are passed to |select()|, a |DuplicateBindingTypeException| is thrown.</text>
</assertion>
<assertion id="e">
- <text>If an instance of an annotation that is not a binding type is passed to |Manager.resolveByType()|, an |IllegalArgumentException| is thrown</text>
+ <text>If an instance of an annotation that is not a binding type is passed to |select()|, an |IllegalArgumentException| is thrown.</text>
</assertion>
- <assertion id="fa">
- <text>When the container is resolving a bean by type, it identifies the set of matching enabled beans which have the given bean type.</text>
+ <assertion id="f">
+ <text>The |get()| method of the provided implementation of |Instance| must identify the bean by calling |BeanManager.getBeans()|, passing the type and bindings specified at the injection point. A child |Instance| passes the bean subtype and the additional bindings, along with the bindings of its parent.</text>
</assertion>
- <assertion id="fb">
- <text>When the container is resolving a bean by type~, it identifies the set of matching enabled beans which have the given bean type~. For this purpose, primitive types are considered to be identical to their corresponding wrapper types in |java.lang|~, array types are considered identical only if their element types are identical and parameterized types are considered identical only if both the type and all type parameters are identical~</text>
+ <assertion id="g">
+ <text>If |getBeans()| did not return a bean, throw an |UnsatisfiedResolutionException|.</text>
</assertion>
- <assertion id="fc">
- <text>When the container is resolving a bean by type~, it identifies the set of matching enabled beans which have the given bean type~. For this purpose, ~primitive types are considered to be identical to their corresponding wrapper types in |java.lang|,~ array types are considered identical only if their element types are identical~ and parameterized types are considered identical only if both the type and all type parameters are identical~</text>
+ <assertion id="h">
+ <text>If |getBeans()| returned more than one bean, throw an |AmbiguousResolutionException|.</text>
</assertion>
- <assertion id="fd">
- <text>When the container is resolving a bean by type~, it identifies the set of matching enabled beans which have the given bean type~. For this purpose, ~primitive types are considered to be identical to their corresponding wrapper types in |java.lang|, array types are considered identical only if their element types are identical and~ parameterized types are considered identical only if both the type and all type parameters are identical</text>
+ <assertion id="i">
+ <text>Otherwise, obtain a contextual reference for the bean by calling |BeanManager.getReference()|, passing the |Bean| object representing the bean and the bean type or subtype, and return it.</text>
</assertion>
-
- <assertion id="ga">
- <text>When the container is resolving a bean by type, it considers the given bindings. _If no bindings were passed to |resolveByType()|, the container assumes the binding |@Current|_. </text>
- </assertion>
- <assertion id="gb">
- <text>When the container is resolving a bean by type, it considers the given bindings. ~If no bindings were passed to |resolveByType()|, the container assumes the binding |@Current|~. The container narrows the set of matching beans to just those where for each given binding, the bean declares a binding with _(a) the same type_ and (b) the same annotation member value for each member which is not annotated |@NonBinding| (see Section 5.9.1, "Binding annotations with members")</text>
+ <assertion id="j">
+ <text>The |iterator()| method of the provided implementation of |Instance| must identify the set of beans by calling |BeanManager.getBeans()|, passing the type and bindings specified at the injection point. A child Instance passes the subtype, the bindings specified at the injection point and the additional bindings.</text>
</assertion>
- <assertion id="gc">
- <text>When the container is resolving a bean by type, it considers the given bindings. ~If no bindings were passed to |resolveByType()|, the container assumes the binding |@Current|~. The container narrows the set of matching beans to just those where for each given binding, the bean declares a binding with (a) the same type and _(b) the same annotation member value for each member_ which is not annotated |@NonBinding| (see Section 5.9.1, "Binding annotations with members")</text>
- </assertion>
-
- <assertion id="gd">
- <text>When the container is resolving a bean by type, it considers the given bindings. ~If no bindings were passed to |resolveByType()|, the container assumes the binding |@Current|~. The container narrows the set of matching beans to just those where for each given binding, the bean declares a binding with (a) the same type and (b) the same annotation member value for each member which is _not annotated |@NonBinding|_ (see Section 5.9.1, "Binding annotations with members")</text>
- </assertion>
-
- <assertion id="ha">
- <text>When the container is resolving a bean by type, it examines the deployment types of the matching beans, as defined in Section 2.5.7, "Deployment type precedence", and returns the set of beans with the highest precedence deployment type that occurs in the set.</text>
- </assertion>
-
- <assertion id="hb">
- <text>When the container is resolving a bean by type, it examines the deployment types of the matching beans, as defined in Section 2.5.7, "Deployment type precedence", and returns the set of beans with the highest precedence deployment type that occurs in the set. _If there are no matching beans, an empty set is returned_</text>
- </assertion>
-
- </section>
+ <assertion id="k">
+ <text>The |iterator()| method of the provided implementation of |Instance| must return an |Iterator|, that iterates over the set of contextual references for the resulting beans by calling |BeanManager.getReference()|, passing the |Bean| object representing the current bean and the bean type or subtype.</text>
+ </assertion>
+ </section>
- <section id="5.9.1" title="Binding annotations with members">
- <assertion id="a" testable="false">
- <text>Binding types with members are supported</text>
- <note>A statement of intent</note>
- </assertion>
-
- <assertion id="b">
- <text>An annotation member may be excluded from consideration using the |@NonBinding| annotation</text>
- </assertion>
-
- <assertion id="ca">
- <text>Array-valued ~or annotation-valued~ members of a binding type must be annotated |@NonBinding|. If an array-valued ~or annotation-valued~ member of a binding type is not annotated |@NonBinding|, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="cb">
- <text>~Array-valued or ~annotation-valued members of a binding type must be annotated |@NonBinding|. If an ~array-valued or ~annotation-valued member of a binding type is not annotated |@NonBinding|, a |DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="5.9.2" title="Multiple bindings">
+ <section id="5.5.2" title="The built-in Instance">
<assertion id="a">
- <text>A bean class may declare multiple bindings</text>
+ <text>The container must provide a built-in bean with |Instance<X>| for every legal bean type X in its set of bean types</text>
</assertion>
<assertion id="b">
- <text>A producer method may declare multiple bindings</text>
+ <text>The container must provide a built-in bean with every binding type in its set of binding types.</text>
</assertion>
<assertion id="c">
- <text>A producer field may declare multiple bindings</text>
- </assertion>
-
- <assertion id="d">
- <text>A bean must declare all of the bindings that are specified at the injection point to be considered a candidate for injection</text>
+ <text>The container must provide a built-in bean with deployment type @Standard.</text>
</assertion>
- </section>
-
- <section id="5.10" title="EL name resolution">
-
- <assertion id="aa">
- <text>The container must provide a Unified EL ELResolver to the servlet engine ~and JSF implementation~ that resolves bean names</text>
- <note>This is testable implicitly by trying to resolve using EL from a servlet</note>
- </assertion>
- <assertion id="ab">
- <text>The container must provide a Unified EL ELResolver to the ~servlet engine~ and JSF implementation that resolves bean names</text>
- <note>This is testable implicitly by trying to resolve using EL from a JSF view</note>
- </assertion>
-
- <assertion id="b">
- <text>When this resolver is called with a null base object, it calls the method |Manager.getInstanceByName()| to obtain an instance of the bean named in the EL expression</text>
- </assertion>
-
- <assertion id="c">
- <text>The |Manager.getInstanceByName()| method must identify the bean by calling |Manager.resolveByName()|, passing the name</text>
- </assertion>
-
<assertion id="d">
- <text>The |Manager.getInstanceByName()| method must return a null value, if |Manager.resolveByName()| returned an empty set</text>
+ <text>The container must provide a built-in bean with scope @Dependent.</text>
</assertion>
<assertion id="e">
- <text>The |Manager.getInstanceByName()| method must throw an |AmbiguousDependencyException| if |Manager.resolveByName()| returned more than one bean</text>
+ <text>The container must provide a built-in bean with no bean EL name.</text>
</assertion>
<assertion id="f">
- <text>The |Manager.getInstanceByName()| method must obtain an instance of the bean by calling |Manager.getInstance()|, passing the |Bean| instance representing the bean if exactly one bean was returned by |Manager.resolveByName()|. For each distinct name that appears in the EL expression, |getInstanceByName()| must be called at most once</text>
+ <text>The container must provide a built-in bean with an implementation provided automatically by the container. </text>
</assertion>
<assertion id="g">
- <text>Even if a name appears more than once in the same expression, the container may not call |getInstanceByName()| multiple times with that name. This restriction ensures that there is a unique instance of each bean with scope |@Dependent| in any EL evaluation</text>
+ <text>The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable dependencies".</text>
</assertion>
</section>
- <section id="5.11" title="Name resolution algorithm">
+ <section id="5.5.3" title="Using AnnotationLiteral">
<assertion id="a">
- <text>The |resolveByName()| method of the |Manager| interface performs name resolution</text>
+ <text>When the application calls select(), it may pass instances of binding annotation types.</text>
</assertion>
-
- <assertion id="b">
- <text>When resolving a bean by name, the container must identify the set of matching enabled beans which have the given name</text>
- </assertion>
-
- <assertion id="c">
- <text>After the container identifies the set of matching beans, it examines the deployment types of the matching beans, as defined in Section 2.5.7, "Deployment type precedence", and returns the set of beans with the highest precedence deployment type that occurs in the set</text>
- </assertion>
-
- <assertion id="d">
- <text>If there are no matching beans, an empty set is returned</text>
- </assertion>
</section>
- <section id="5.12" title="Injection into non-contextual objects">
- <assertion id="a" testable="false">
- <text>The container is required to perform dependency injection upon certain non-contextual objects</text>
- <note>This is a statement of intent</note>
+ <section id="5.6" title="Integration with Unified EL">
+ <assertion id="aaa">
+ <text>The container must provide a Unified EL ELResolver to the servlet engine ~and JSF implementation~ that resolves bean EL names using the name resolution algorithm defined in Section 5.2 "EL name resolution algorithm".</text>
+ <note>This is testable implicitly by trying to resolve using EL from a servlet</note>
</assertion>
- </section>
-
- <section id="5.12.1" title="Non-contextual instances of session beans">
- <assertion id="a">
- <text>The container is required to perform dependency injection for session bean instances obtained directly from JNDI</text>
- </assertion>
- <assertion id="b">
- <text>The container is required to perform dependency injection for session bean instances injected using |@EJB|</text>
+ <assertion id="aba">
+ <text>The container must provide a Unified EL |ELResolver| to the ~servlet engine~ and JSF implementation that resolves bean EL names using the name resolution algorithm defined in Section 5.2 "EL name resolution algorithm".</text>
+ <note>This is testable implicitly by trying to resolve using EL from a JSF view</note>
</assertion>
- <assertion id="c">
- <text>The container is required to perform dependency injection for session bean instances injected using |@Resource|</text>
+ <assertion id="ba">
+ <text>If a name used in an EL expression resolves to more than one bean, the |ELResolver| must throw an |AmbiguousResolutionException|.</text>
</assertion>
- <assertion id="d">
- <text>The container is required to perform dependency injection for session bean instances created by the container to receive remote method calls</text>
+ <assertion id="bb">
+ <text>If a name used in an EL expression does not resolve to any bean, the |ELResolver| must return a null value.</text>
</assertion>
- <assertion id="e">
- <text>The container is required to perform dependency injection for session bean instances created by the container to receive timeouts</text>
+ <assertion id="bc">
+ <text>Otherwise, if a name used in an EL expression resolves to exactly one bean, the |ELResolver| must return a contextual instance of the bean, as defined in Section 6.5.2, "Contextual instance of a bean".</text>
</assertion>
- <assertion id="p">
- <text>For the purposes of dependency injection, the container must treat non-contextual instances of session beans as instances of the most specialized bean that specializes the bean with binding |@New| and deployment type |@Standard| defined in Section 3.3.6, "Session beans with the |@New| binding"</text>
+ <assertion id="c">
+ <text>For each distinct name that appears in the EL expression, the resolver must be called at most once. Even if a name appears more than once in the same expression, the container may not call the resolver multiple times with that name. This restriction ensures that there is a unique instance of each bean with scope |@Dependent| in any EL evaluation.</text>
</assertion>
-
</section>
-
- <section id="5.12.2" title="Message-driven beans">
-
- <assertion id="a">
- <text>The container performs dependency injection for message-driven bean instances according to the bean class annotations</text>
- </assertion>
- </section>
-
- <section id="5.12.3" title="Servlets">
- <assertion id="a">
- <text>The container performs dependency injection for servlets according to the servlet class annotations</text>
- </assertion>
- </section>
-
+
<section id="6" title="Bean lifecycle">
<assertion id="a">
<text>To create a contextual instance of a session bean, the container creates an EJB local object reference</text>
15 years, 7 months
[webbeans-commits] Webbeans SVN: r2743 - ri/trunk/impl/src/main/java/org/jboss/webbeans and 38 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-02 11:19:20 -0400 (Tue, 02 Jun 2009)
New Revision: 2743
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/BeanInstanceImpl.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanInstance.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/MockCreationalContext.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals/AnyBinding.java
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractDecorator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractInterceptor.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/BaseBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextualInstance.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MyCreationalContext.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/MockCreationalContext.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/MockCreationalContext.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/AnyBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/MockCreationalContext.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/MockCreationalContext.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/MyCreationalContext.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/ejb/MyCreationalContext.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/MyCreationalContext.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/resource/MyCreationalContext.java
Modified:
ri/trunk/api/src/main/java/javax/enterprise/context/spi/Contextual.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/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/ProducerFieldBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractJavaEEResourceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsQueueMethodHandler.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsTopicMethodHandler.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/SessionContextual.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InjectionPointBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ManagerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentInstancesStore.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/beanstore/AbstractAttributeBackedBeanStore.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java
ri/trunk/jboss-tck-runner/pom.xml
ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/AbstractMapBackedBeanStore.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ConcurrentHashMapBeanStore.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleSimple/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java
tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/child/SameBeanTypeInChildActivityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetTest.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/MySessionBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java
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/ejb/DependentContextEjbTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Cod.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/ejb/EjbInjectionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextInjectionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/resource/InjectionOfResourceTest.java
Log:
Refactor to support release() method on CreationalContext
Modified: ri/trunk/api/src/main/java/javax/enterprise/context/spi/Contextual.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/context/spi/Contextual.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/api/src/main/java/javax/enterprise/context/spi/Contextual.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -45,6 +45,8 @@
*
* @param instance
* the insance to destroy
+ * @param creationalContext
+ * the creational context used to create the instance
*/
- public void destroy(T instance);
+ public void destroy(T instance, CreationalContext<T> creationalContext);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -42,7 +42,6 @@
import javax.inject.Obtains;
import javax.inject.UnserializableDependencyException;
-import org.jboss.webbeans.bean.BaseBean;
import org.jboss.webbeans.bean.NewEnterpriseBean;
import org.jboss.webbeans.bean.NewSimpleBean;
import org.jboss.webbeans.bean.RIBean;
@@ -78,7 +77,7 @@
*/
public void validate()
{
- final List<BaseBean<?>> specializedBeans = new ArrayList<BaseBean<?>>();
+ final List<RIBean<?>> specializedBeans = new ArrayList<RIBean<?>>();
for (Bean<?> bean : manager.getBeans())
{
for (InjectionPoint injectionPoint : bean.getInjectionPoints())
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-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -381,7 +381,6 @@
*
* @see org.jboss.webbeans.bean.BaseBean#getBindings()
*/
- @Override
public Set<Annotation> getBindings()
{
return bindings;
@@ -404,7 +403,6 @@
*
* @see org.jboss.webbeans.bean.BaseBean#getDeploymentType()
*/
- @Override
public Class<? extends Annotation> getDeploymentType()
{
return deploymentType;
@@ -433,7 +431,6 @@
*
* @see org.jboss.webbeans.bean.BaseBean#getName()
*/
- @Override
public String getName()
{
return name;
@@ -446,7 +443,6 @@
*
* @see org.jboss.webbeans.bean.BaseBean#getScopeType()
*/
- @Override
public Class<? extends Annotation> getScopeType()
{
return scopeType;
@@ -470,7 +466,6 @@
*
* @see org.jboss.webbeans.bean.BaseBean#getTypes()
*/
- @Override
public Set<Type> getTypes()
{
return types;
@@ -495,7 +490,6 @@
*
* @see org.jboss.webbeans.bean.BaseBean#isNullable()
*/
- @Override
public boolean isNullable()
{
return !isPrimitive();
@@ -512,7 +506,6 @@
return primitive;
}
- @Override
public boolean isSerializable()
{
return _serializable && checkInjectionPointsAreSerializable();
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractDecorator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractDecorator.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractDecorator.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -1,64 +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.bean;
-
-import java.lang.annotation.Annotation;
-import java.util.Set;
-
-import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.Decorator;
-
-
-/**
- * The Bean object for a a decorator
- *
- * This interface should not be called directly by the application.
- *
- * @author Pete Muir
- *
- */
-public abstract class AbstractDecorator extends BaseBean<Object> implements Decorator<Object>
-{
-
- /**
- * Create an interceptor bean
- *
- * @param beanManager
- * the manager to create the interceptor for
- */
- protected AbstractDecorator(BeanManager beanManager)
- {
- super(beanManager);
- }
-
- /* (non-Javadoc)
- * @see javax.enterprise.inject.spi.Decorator#getDelegateType()
- */
- public abstract Class<?> getDelegateType();
-
- /* (non-Javadoc)
- * @see javax.enterprise.inject.spi.Decorator#getDelegateBindings()
- */
- public abstract Set<Annotation> getDelegateBindings();
-
- /* (non-Javadoc)
- * @see javax.enterprise.inject.spi.Decorator#setDelegate(java.lang.Object, java.lang.Object)
- */
- public abstract void setDelegate(Object instance, Object delegate);
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractInterceptor.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractInterceptor.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractInterceptor.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -1,61 +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.bean;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.util.Set;
-
-import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.InterceptionType;
-import javax.enterprise.inject.spi.Interceptor;
-
-
-/**
- * The contract between the manager and a interceptor.
- *
- * This interface should not be called directly by the application.
- *
- * @author Pete Muir
- *
- */
-public abstract class AbstractInterceptor extends BaseBean<Object> implements Interceptor<Object>
-{
-
- /**
- * Create an interceptor bean
- *
- * @param beanManager
- * the manager to create the interceptor for
- */
- protected AbstractInterceptor(BeanManager beanManager)
- {
- super(beanManager);
- }
-
- /* (non-Javadoc)
- * @see javax.inject.manager.Interceptor#getInterceptorBindingTypes()
- */
- public abstract Set<Annotation> getInterceptorBindingTypes();
-
- /* (non-Javadoc)
- * @see javax.inject.manager.Interceptor#getMethod(javax.inject.manager.InterceptionType)
- */
- public abstract Method getMethod(InterceptionType type);
-
-}
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-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -359,14 +359,6 @@
}
}
- public void destroy(T instance)
- {
- /*
- * try { DependentContext.INSTANCE.setActive(true); } finally {
- * DependentContext.INSTANCE.setActive(false); }
- */
- }
-
protected abstract T produceInstance(CreationalContext<T> creationalContext);
/**
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/BaseBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/BaseBean.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/BaseBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -1,100 +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.bean;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Set;
-
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.InjectionPoint;
-
-/**
- * The contract between the manager and a bean. This interface
- * should not be called directly by the application.
- *
- * @author Gavin King
- *
- * @param <T> an API type of the bean
- */
-public abstract class BaseBean<T> implements Bean<T>
-{
- private final BeanManager beanManager;
-
- /**
- * Create an instance of a bean
- *
- * @param beanManager
- */
- protected BaseBean(BeanManager beanManager)
- {
- this.beanManager = beanManager;
- }
-
- /**
- * Get the manager used to create this bean
- *
- * @return an instance of the manager
- */
- protected BeanManager getManager()
- {
- return beanManager;
- }
-
- /* (non-Javadoc)
- * @see javax.inject.manager.Bean#getTypes()
- */
- public abstract Set<Type> getTypes();
-
- /* (non-Javadoc)
- * @see javax.inject.manager.Bean#getBindings()
- */
- public abstract Set<Annotation> getBindings();
-
- /* (non-Javadoc)
- * @see javax.inject.manager.Bean#getScopeType()
- */
- public abstract Class<? extends Annotation> getScopeType();
-
- /* (non-Javadoc)
- * @see javax.inject.manager.Bean#getDeploymentType()
- */
- public abstract Class<? extends Annotation> getDeploymentType();
-
- /* (non-Javadoc)
- * @see javax.inject.manager.Bean#getName()
- */
- public abstract String getName();
-
- /* (non-Javadoc)
- * @see javax.inject.manager.Bean#isSerializable()
- */
- public abstract boolean isSerializable();
-
- /* (non-Javadoc)
- * @see javax.inject.manager.Bean#isNullable()
- */
- public abstract boolean isNullable();
-
- /* (non-Javadoc)
- * @see javax.inject.manager.Bean#getInjectionPoints()
- */
- public abstract Set<InjectionPoint> getInjectionPoints();
-
-}
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-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -345,7 +345,7 @@
return specializedBean;
}
- public void destroy(T instance)
+ public void destroy(T instance, CreationalContext<T> creationalContext)
{
// No-op. Producer method dependent objects are destroyed in producer method bean
}
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-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -251,7 +251,7 @@
}
}
- public void destroy(T instance)
+ public void destroy(T instance, CreationalContext<T> creationalContext)
{
if (instance == null)
{
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-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -32,20 +32,10 @@
*
* @param <T>
*/
-public abstract class ForwardingBean<T> extends BaseBean<T>
+public abstract class ForwardingBean<T> implements Bean<T>
{
/**
- * Constructor
- *
- * @param beanManager The Web Beans manager
- */
- public ForwardingBean(BeanManager beanManager)
- {
- super(beanManager);
- }
-
- /**
* Creates an instance of the delegate
*
* @return an instance of the delegate
@@ -60,9 +50,9 @@
*
* @param instance The instance to destroy
*/
- public void destroy(T instance)
+ public void destroy(T instance, CreationalContext<T> creationalContext)
{
- delegate().destroy(instance);
+ delegate().destroy(instance, creationalContext);
}
/**
@@ -70,7 +60,6 @@
*
* @return The binding types
*/
- @Override
public Set<Annotation> getBindings()
{
return delegate().getBindings();
@@ -81,7 +70,6 @@
*
* @return The deployment types
*/
- @Override
public Class<? extends Annotation> getDeploymentType()
{
return delegate().getDeploymentType();
@@ -92,7 +80,6 @@
*
* @return The name
*/
- @Override
public String getName()
{
return delegate().getName();
@@ -103,7 +90,6 @@
*
* @return The scope type
*/
- @Override
public Class<? extends Annotation> getScopeType()
{
return delegate().getScopeType();
@@ -114,7 +100,6 @@
*
* @return The API types
*/
- @Override
public Set<Type> getTypes()
{
return delegate().getTypes();
@@ -125,7 +110,6 @@
*
* @return True if nullable, false otherwise
*/
- @Override
public boolean isNullable()
{
return delegate().isNullable();
@@ -136,13 +120,11 @@
*
* @return True if serializable, false otherwise
*/
- @Override
public boolean isSerializable()
{
return delegate().isSerializable();
}
- @Override
public Set<InjectionPoint> getInjectionPoints()
{
return delegate().getInjectionPoints();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -83,8 +83,14 @@
{
return field.get(getReceiver(creationalContext));
}
+
+ public void destroy(T instance, CreationalContext<T> creationalContext)
+ {
+
+ }
+
/**
* Gets the annotated item representing the field
*
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -176,8 +176,7 @@
}
}
- @Override
- public void destroy(T instance)
+ public void destroy(T instance, CreationalContext<T> creationalContext)
{
DependentStorageRequest dependentStorageRequest = DependentStorageRequest.of(dependentInstancesStore, new Object());
try
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -22,6 +22,7 @@
import java.util.concurrent.atomic.AtomicInteger;
import javax.enterprise.context.Dependent;
+import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
import org.jboss.webbeans.ManagerImpl;
@@ -33,7 +34,7 @@
*
* @author Pete Muir
*/
-public abstract class RIBean<T> extends BaseBean<T>
+public abstract class RIBean<T> implements Bean<T>
{
private static final ConcurrentMap<String, AtomicInteger> ids = new ConcurrentHashMap<String, AtomicInteger>();
@@ -42,7 +43,6 @@
protected RIBean(ManagerImpl manager)
{
- super(manager);
this.manager = manager;
// TODO better ID strategy (human readable)
}
@@ -53,7 +53,6 @@
return prefix + "-" + i;
}
- @Override
protected ManagerImpl getManager()
{
return manager;
@@ -76,7 +75,6 @@
public abstract Set<AnnotatedInjectionPoint<?, ?>> getAnnotatedInjectionPoints();
- @Override
public Set<InjectionPoint> getInjectionPoints()
{
return (Set) getAnnotatedInjectionPoints();
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-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -143,7 +143,7 @@
*
* @param instance The instance
*/
- public void destroy(T instance)
+ public void destroy(T instance, CreationalContext<T> creationalContext)
{
try
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractJavaEEResourceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractJavaEEResourceBean.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractJavaEEResourceBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -115,25 +115,21 @@
this.proxyClass = proxyClass;
}
- @Override
public Set<Annotation> getBindings()
{
return bindings;
}
- @Override
public Class<? extends Annotation> getScopeType()
{
return Dependent.class;
}
- @Override
public String getName()
{
return null;
}
- @Override
public Class<? extends Annotation> getDeploymentType()
{
return deploymentType;
@@ -145,7 +141,6 @@
return type;
}
- @Override
public Set<Type> getTypes()
{
return Collections.unmodifiableSet(types);
@@ -175,7 +170,6 @@
return Collections.emptySet();
}
- @Override
public boolean isNullable()
{
return true;
@@ -187,7 +181,6 @@
return false;
}
- @Override
public boolean isSerializable()
{
return true;
@@ -232,7 +225,7 @@
}
- public void destroy(T instance)
+ public void destroy(T instance, CreationalContext<T> creationalContext)
{
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsQueueMethodHandler.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsQueueMethodHandler.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsQueueMethodHandler.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -16,6 +16,7 @@
*/
package org.jboss.webbeans.bean.ee.jms;
+import javax.enterprise.context.spi.CreationalContext;
import javax.inject.ExecutionException;
import javax.jms.JMSException;
import javax.jms.Queue;
@@ -57,6 +58,11 @@
return jmsServices.getQueueConnectionFactory().createQueueConnection();
}
+ public void destroy(QueueConnection instance, CreationalContext<QueueConnection> creationalContext)
+ {
+
+ }
+
};
this.sessionContextual = new SessionContextual<QueueSession>()
{
@@ -89,6 +95,11 @@
}
}
+ public void destroy(QueueSender instance, CreationalContext<QueueSender> creationalContext)
+ {
+
+ }
+
};
this.messageConsumerContextual = new MessageConsumerContextual<QueueReceiver>()
{
@@ -109,6 +120,11 @@
}
}
+ public void destroy(QueueReceiver instance, CreationalContext<QueueReceiver> creationalContext)
+ {
+
+ }
+
};
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsTopicMethodHandler.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsTopicMethodHandler.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsTopicMethodHandler.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -16,6 +16,7 @@
*/
package org.jboss.webbeans.bean.ee.jms;
+import javax.enterprise.context.spi.CreationalContext;
import javax.inject.ExecutionException;
import javax.jms.JMSException;
import javax.jms.Session;
@@ -61,6 +62,11 @@
return jmsServices.getTopicConnectionFactory().createTopicConnection();
}
+ public void destroy(TopicConnection instance, CreationalContext<TopicConnection> creationalContext)
+ {
+
+ }
+
};
this.sessionContextual = new SessionContextual<TopicSession>()
{
@@ -93,6 +99,11 @@
}
}
+ public void destroy(TopicPublisher instance, CreationalContext<TopicPublisher> creationalContext)
+ {
+
+ }
+
};
this.messageConsumerContextual = new MessageConsumerContextual<TopicSubscriber>()
{
@@ -113,6 +124,11 @@
}
}
+ public void destroy(TopicSubscriber instance, CreationalContext<TopicSubscriber> creationalContext)
+ {
+
+ }
+
};
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/SessionContextual.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/SessionContextual.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/SessionContextual.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -43,7 +43,7 @@
protected abstract T createSession() throws JMSException;
- public void destroy(T instance)
+ public void destroy(T instance, CreationalContext<T> creationalContext)
{
try
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -93,7 +93,7 @@
return result;
}
- public void destroy(T instance)
+ public void destroy(T instance, CreationalContext<T> creationalContext)
{
// TODO Auto-generated method stub
}
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-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -53,20 +53,16 @@
}
-
- @Override
public Set<Annotation> getBindings()
{
return DEFAULT_BINDING;
}
- @Override
public Class<? extends Annotation> getDeploymentType()
{
return Standard.class;
}
- @Override
public Class<? extends Annotation> getScopeType()
{
return Dependent.class;
@@ -78,7 +74,6 @@
return null;
}
- @Override
public String getName()
{
return null;
@@ -90,7 +85,6 @@
return Collections.emptySet();
}
- @Override
public boolean isNullable()
{
return true;
@@ -102,7 +96,6 @@
return false;
}
- @Override
public boolean isSerializable()
{
return false;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -24,7 +24,6 @@
import javax.enterprise.inject.TypeLiteral;
import javax.event.Event;
-import javax.enterprise.inject.Any;
import javax.inject.Obtains;
import org.jboss.webbeans.ManagerImpl;
@@ -59,7 +58,6 @@
return TYPE;
}
- @Override
public Set<Type> getTypes()
{
return DEFAULT_TYPES;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InjectionPointBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InjectionPointBean.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InjectionPointBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -62,7 +62,7 @@
return getManager().getInjectionPoint();
}
- public void destroy(InjectionPoint instance)
+ public void destroy(InjectionPoint instance, CreationalContext<InjectionPoint> creationalContext)
{
}
@@ -73,7 +73,6 @@
return InjectionPoint.class;
}
- @Override
public Set<Type> getTypes()
{
return TYPES;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -58,7 +58,6 @@
return TYPE;
}
- @Override
public Set<Type> getTypes()
{
return DEFAULT_TYPES;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ManagerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ManagerBean.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ManagerBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -52,13 +52,12 @@
return ManagerImpl.class;
}
- @Override
public Set<Type> getTypes()
{
return TYPES;
}
- public void destroy(ManagerImpl instance)
+ public void destroy(ManagerImpl instance, CreationalContext<ManagerImpl> creationalContext)
{
// No-op
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractContext.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractContext.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -19,6 +19,7 @@
import java.lang.annotation.Annotation;
import javax.enterprise.context.spi.Context;
+import javax.enterprise.context.spi.Contextual;
/**
* Common Context operation
@@ -93,5 +94,7 @@
{
return active.get();
}
+
+ public abstract <T> void destroy(Contextual<T> contextual, T instance);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -23,7 +23,7 @@
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
-import org.jboss.webbeans.bean.BaseBean;
+import org.jboss.webbeans.context.api.BeanInstance;
import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -75,10 +75,10 @@
{
throw new IllegalStateException("No bean store available for " + toString());
}
- T instance = getBeanStore().get(contextual);
- if (instance != null)
+ BeanInstance<T> beanInstance = getBeanStore().get(contextual);
+ if (beanInstance != null)
{
- return instance;
+ return beanInstance.getInstance();
}
else if (creationalContext != null)
{
@@ -88,16 +88,17 @@
if(needCreationLock)
{
creationLock.lock();
- instance = getBeanStore().get(contextual);
- if (instance != null)
+ beanInstance = getBeanStore().get(contextual);
+ if (beanInstance != null)
{
- return instance;
+ return beanInstance.getInstance();
}
}
- instance = contextual.create(creationalContext);
+ T instance = contextual.create(creationalContext);
if (instance != null)
{
- getBeanStore().put(contextual, instance);
+ beanInstance = new BeanInstanceImpl<T>(contextual, instance, creationalContext);
+ getBeanStore().put(beanInstance);
}
return instance;
}
@@ -124,17 +125,25 @@
* Destroys a bean
*
* @param <T> The type of the bean
- * @param bean The bean to destroy
+ * @param contextual The contextual type to destroy
*/
- private <T> void destroy(Contextual<T> bean)
+ public <T> void destroy(Contextual<T> contextual, T instance)
{
- log.trace("Destroying " + bean);
+ log.trace("Destroying " + contextual);
if (getBeanStore() == null)
{
throw new IllegalStateException("No bean store available for " + toString());
}
- bean.destroy(getBeanStore().get(bean));
+ BeanInstance<T> beanInstance = getBeanStore().get(contextual);
+ contextual.destroy(beanInstance.getInstance(), beanInstance.getCreationalContext());
}
+
+ private <T> void destroy(Contextual<T> contextual)
+ {
+ BeanInstance<T> beanInstance = getBeanStore().get(contextual);
+ destroy(contextual, beanInstance.getInstance());
+ }
+
/**
* Destroys the context
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/BeanInstanceImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/BeanInstanceImpl.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/BeanInstanceImpl.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -0,0 +1,37 @@
+package org.jboss.webbeans.context;
+
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+
+import org.jboss.webbeans.context.api.BeanInstance;
+
+public class BeanInstanceImpl<T> implements BeanInstance<T>
+{
+
+ private final Contextual<T> contextual;
+ private final T instance;
+ private final CreationalContext<T> creationalContext;
+
+ public BeanInstanceImpl(Contextual<T> contextual, T instance, CreationalContext<T> creationalContext)
+ {
+ this.contextual = contextual;
+ this.instance = instance;
+ this.creationalContext = creationalContext;
+ }
+
+ public Contextual<T> getContextual()
+ {
+ return contextual;
+ }
+
+ public T getInstance()
+ {
+ return instance;
+ }
+
+ public CreationalContext<T> getCreationalContext()
+ {
+ return creationalContext;
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/BeanInstanceImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextualInstance.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextualInstance.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ContextualInstance.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -1,67 +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.context;
-
-import javax.enterprise.context.spi.Contextual;
-
-/**
- * A representation of a contextual bean plus associated instance
- *
- * @author Pete Muir
- */
-public class ContextualInstance<T>
-{
- // The contextual object
- private Contextual<T> contextual;
- // The instance
- private T instance;
-
- /**
- * Protected constructor
- *
- * @param contextual The contextual item
- * @param instance The instance
- */
- protected ContextualInstance(Contextual<T> contextual, T instance)
- {
- this.contextual = contextual;
- this.instance = instance;
- }
-
- /**
- * Static constructor wrapper
- *
- * @param <T> The type of the contextual item
- * @param contextual The contextual item
- * @param instance The instance
- * @return A new ContextualInstance from the given parameters
- */
- public static <T> ContextualInstance<T> of(Contextual<T> contextual, T instance)
- {
- return new ContextualInstance<T>(contextual, instance);
- }
-
- /**
- * Destroys the instance by passing it to the destroy method of the
- * contextual item
- */
- public void destroy()
- {
- contextual.destroy(instance);
- }
-
-}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentContext.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentContext.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -28,9 +28,11 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.bootstrap.api.Service;
+import org.jboss.webbeans.context.api.BeanInstance;
/**
* The dependent context
@@ -84,7 +86,8 @@
T instance = contextual.create(creationalContext);
if (dependentStorageRequest.get() != null)
{
- dependentStorageRequest.get().getDependentInstancesStore().addDependentInstance(dependentStorageRequest.get().getKey(), ContextualInstance.of(contextual, instance));
+ BeanInstance<T> beanInstance = new BeanInstanceImpl<T>(contextual, instance, creationalContext);
+ dependentStorageRequest.get().getDependentInstancesStore().addDependentInstance(dependentStorageRequest.get().getKey(), beanInstance);
}
return instance;
}
@@ -156,5 +159,14 @@
this.dependentStorageRequest.set(null);
}
}
+
+ public <T> void destroy(Contextual<T> contextual, T instance)
+ {
+ if (contextual instanceof Bean)
+ {
+ CreationalContext<T> creationalContext = new CreationalContextImpl<T>((Bean<T>) contextual);
+ contextual.destroy(instance, creationalContext);
+ }
+ }
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentInstancesStore.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentInstancesStore.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentInstancesStore.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -21,6 +21,7 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
+import org.jboss.webbeans.context.api.BeanInstance;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -34,14 +35,14 @@
private static LogProvider log = Logging.getLogProvider(DependentInstancesStore.class);
// A object -> List of contextual instances mapping
- private Map<Object, List<ContextualInstance<?>>> dependentInstances;
+ private Map<Object, List<BeanInstance<?>>> dependentInstances;
/**
* Creates a new DependentInstancesStore
*/
public DependentInstancesStore()
{
- dependentInstances = new ConcurrentHashMap<Object, List<ContextualInstance<?>>>();
+ dependentInstances = new ConcurrentHashMap<Object, List<BeanInstance<?>>>();
}
/**
@@ -50,12 +51,12 @@
* @param key The key to store the instance under
* @param contextualInstance The instance to store
*/
- public <T> void addDependentInstance(Object key, ContextualInstance<T> contextualInstance)
+ public <T> void addDependentInstance(Object key, BeanInstance<T> contextualInstance)
{
- List<ContextualInstance<?>> instances = dependentInstances.get(key);
+ List<BeanInstance<?>> instances = dependentInstances.get(key);
if (instances == null)
{
- instances = new CopyOnWriteArrayList<ContextualInstance<?>>();
+ instances = new CopyOnWriteArrayList<BeanInstance<?>>();
dependentInstances.put(key, instances);
}
log.trace("Registered dependent instance " + contextualInstance + " under key " + key);
@@ -75,11 +76,16 @@
{
return;
}
- for (ContextualInstance<?> injectedInstance : dependentInstances.get(key))
+ for (BeanInstance<?> injectedInstance : dependentInstances.get(key))
{
- injectedInstance.destroy();
+ destroy(injectedInstance);
}
dependentInstances.remove(key);
}
+
+ private static <T> void destroy(BeanInstance<T> beanInstance)
+ {
+ beanInstance.getContextual().destroy(beanInstance.getInstance(), beanInstance.getCreationalContext());
+ }
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/beanstore/AbstractAttributeBackedBeanStore.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/beanstore/AbstractAttributeBackedBeanStore.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/beanstore/AbstractAttributeBackedBeanStore.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -23,6 +23,7 @@
import javax.enterprise.context.spi.Contextual;
import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.context.api.BeanInstance;
import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -47,10 +48,10 @@
* @return The instance
*/
@SuppressWarnings("unchecked")
- public <T> T get(Contextual<? extends T> contextual)
+ public <T> BeanInstance<T> get(Contextual<? extends T> contextual)
{
String key = getNamingScheme().getContextualKey(contextual);
- T instance = (T) getAttribute(key);
+ BeanInstance<T> instance = (BeanInstance<T>) getAttribute(key);
log.trace("Looked for " + key + " and got " + instance);
return instance;
}
@@ -63,7 +64,7 @@
*/
public <T> T remove(Contextual<? extends T> contextual)
{
- T instance = get(contextual);
+ T instance = get(contextual).getInstance();
String key = getNamingScheme().getContextualKey(contextual);
removeAttribute(key);
log.trace("Removed bean under key " + key);
@@ -126,11 +127,11 @@
* @param instance The instance
* @return The instance added
*/
- public <T> void put(Contextual<? extends T> bean, T instance)
+ public <T> void put(BeanInstance<T> beanInstance)
{
- String key = getNamingScheme().getContextualKey(bean);
- setAttribute(key, instance);
- log.trace("Added bean " + bean + " under key " + key);
+ String key = getNamingScheme().getContextualKey(beanInstance.getContextual());
+ setAttribute(key, beanInstance);
+ log.trace("Added Contextual type " + beanInstance.getContextual() + " under key " + key);
}
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -34,7 +34,6 @@
import javax.inject.DefinitionException;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.bean.BaseBean;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.context.DependentInstancesStore;
@@ -57,7 +56,7 @@
*/
public class ObserverImpl<T> implements Observer<T>
{
- protected final BaseBean<?> observerBean;
+ protected final RIBean<?> observerBean;
protected final MethodInjectionPoint<?> observerMethod;
private final boolean conditional;
private final boolean asynchronous;
@@ -73,7 +72,7 @@
* @param observerBean The observer bean
* @param manager The Web Beans manager
*/
- protected ObserverImpl(final AnnotatedMethod<?> observer, final BaseBean<?> observerBean, final ManagerImpl manager)
+ protected ObserverImpl(final AnnotatedMethod<?> observer, final RIBean<?> observerBean, final ManagerImpl manager)
{
this.manager = manager;
this.observerBean = observerBean;
@@ -206,7 +205,7 @@
manager.getTaskExecutor().execute(deferredEvent);
}
- private <B> B getInstance(BaseBean<B> observerBean)
+ private <B> B getInstance(RIBean<B> observerBean)
{
return manager.getInstance(observerBean, !isConditional());
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -28,7 +28,7 @@
import javax.transaction.Synchronization;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.bean.BaseBean;
+import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.transaction.spi.TransactionServices;
@@ -72,7 +72,7 @@
* @param observerBean The bean declaring the observer method
* @param manager The JCDI manager in use
*/
- protected TransactionalObserverImpl(AnnotatedMethod<?> observer, BaseBean<?> observerBean, ManagerImpl manager)
+ protected TransactionalObserverImpl(AnnotatedMethod<?> observer, RIBean<?> observerBean, ManagerImpl manager)
{
super(observer, observerBean, manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -29,7 +29,6 @@
import javax.enterprise.inject.spi.InjectionPoint;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.bean.BaseBean;
import org.jboss.webbeans.context.ApplicationContext;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.resources.ClassTransformer;
@@ -48,52 +47,44 @@
{
this.instances = new ConcurrentCache<Class<?>, Set<FieldInjectionPoint<?>>>();
this.manager = manager;
- nonContextualBean = new BaseBean<Object>(manager)
+ nonContextualBean = new Bean<Object>()
{
- @Override
public Set<Annotation> getBindings()
{
return Collections.emptySet();
}
- @Override
public Class<? extends Annotation> getDeploymentType()
{
return Standard.class;
}
- @Override
public Set<InjectionPoint> getInjectionPoints()
{
return Collections.emptySet();
}
- @Override
public String getName()
{
return null;
}
- @Override
public Class<? extends Annotation> getScopeType()
{
return Dependent.class;
}
- @Override
public Set<Type> getTypes()
{
return Collections.emptySet();
}
- @Override
public boolean isNullable()
{
return false;
}
- @Override
public boolean isSerializable()
{
return true;
@@ -104,9 +95,10 @@
return null;
}
- public void destroy(Object instance)
+ public void destroy(Object instance, CreationalContext<Object> context)
{
}
+
};
}
Modified: ri/trunk/jboss-tck-runner/pom.xml
===================================================================
--- ri/trunk/jboss-tck-runner/pom.xml 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/jboss-tck-runner/pom.xml 2009-06-02 15:19:20 UTC (rev 2743)
@@ -121,7 +121,9 @@
<profile>
<id>run</id>
<activation>
- <activeByDefault />
+ <property>
+ <name>!osgi.bundles.defaultStartLevel</name>
+ </property>
</activation>
<dependencies>
Modified: ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java
===================================================================
--- ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -1,7 +1,11 @@
package org.jboss.webbeans.tck;
+import javax.enterprise.context.spi.Context;
+import javax.enterprise.inject.spi.Bean;
+
import org.jboss.jsr299.tck.spi.Beans;
import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.context.AbstractContext;
import org.jboss.webbeans.ejb.spi.EjbDescriptor;
import org.jboss.webbeans.ejb.spi.EjbServices;
import org.jboss.webbeans.util.Reflections;
@@ -77,4 +81,24 @@
throw new NullPointerException("No EJB found for " + localInterface.getName() + " on bean " + beanType.getName());
}
+ public <T> T createBeanInstance(Bean<T> bean)
+ {
+ return CurrentManager.rootManager().getCurrent().getInstance(bean, true);
+ }
+
+ public <T> void destroyBeanInstance(Bean<T> bean, T instance)
+ {
+ Context context = CurrentManager.rootManager().getCurrent().getContext(bean.getScopeType());
+ if (context instanceof AbstractContext)
+ {
+ ((AbstractContext) context).destroy(bean, instance);
+ }
+ else
+ {
+ throw new IllegalStateException("Don't know how to destroy a bean from " + context);
+ }
+ }
+
+
+
}
Added: ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanInstance.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanInstance.java (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanInstance.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.context.api;
+
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+
+public interface BeanInstance<T>
+{
+
+ public T getInstance();
+
+ public CreationalContext<T> getCreationalContext();
+
+ public Contextual<T> getContextual();
+
+}
Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanInstance.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -35,7 +35,7 @@
* @param bean The bean whose instance to return
* @return The instance. Null if not found
*/
- public abstract <T extends Object> T get(Contextual<? extends T> bean);
+ public abstract <T> BeanInstance<T> get(Contextual<? extends T> bean);
/**
* Removes an instance of a bean from the storage
@@ -64,5 +64,5 @@
* @param instance The instance to add
* @return The instance added
*/
- public abstract <T> void put(Contextual<? extends T> bean, T instance);
+ public abstract <T> void put(BeanInstance<T> beanInstance);
}
\ No newline at end of file
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/AbstractMapBackedBeanStore.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/AbstractMapBackedBeanStore.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/AbstractMapBackedBeanStore.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -5,6 +5,7 @@
import javax.enterprise.context.spi.Contextual;
+import org.jboss.webbeans.context.api.BeanInstance;
import org.jboss.webbeans.context.api.BeanStore;
public abstract class AbstractMapBackedBeanStore implements BeanStore
@@ -15,7 +16,7 @@
super();
}
- public abstract Map<Contextual<? extends Object>, Object> delegate();
+ public abstract Map<Contextual<? extends Object>, BeanInstance<? extends Object>> delegate();
/**
* Gets an instance from the store
@@ -25,10 +26,10 @@
*
* @see org.jboss.webbeans.context.api.BeanStore#get(BaseBean)
*/
- public <T extends Object> T get(Contextual<? extends T> bean)
+ public <T extends Object> BeanInstance<T> get(Contextual<? extends T> bean)
{
@SuppressWarnings("unchecked")
- T instance = (T) delegate().get(bean);
+ BeanInstance<T> instance = (BeanInstance<T>) delegate().get(bean);
return instance;
}
@@ -75,11 +76,11 @@
* @param bean The bean
* @param instance the instance
*
- * @see org.jboss.webbeans.context.api.BeanStore#put(BaseBean, Object)
+ * @see org.jboss.webbeans.context.api.BeanStore#put(Contextual, Object)
*/
- public <T> void put(Contextual<? extends T> bean, T instance)
+ public <T> void put(BeanInstance<T> beanInstance)
{
- delegate().put(bean, instance);
+ delegate().put(beanInstance.getContextual(), beanInstance);
}
@Override
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ConcurrentHashMapBeanStore.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ConcurrentHashMapBeanStore.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ConcurrentHashMapBeanStore.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -23,6 +23,8 @@
import javax.enterprise.context.spi.Contextual;
+import org.jboss.webbeans.context.api.BeanInstance;
+
/**
* A BeanStore that uses a HashMap as backing storage
*
@@ -34,14 +36,14 @@
private static final long serialVersionUID = 4770689245633688471L;
// The backing map
- protected Map<Contextual<? extends Object>, Object> delegate;
+ protected Map<Contextual<? extends Object>, BeanInstance<? extends Object>> delegate;
/**
* Constructor
*/
public ConcurrentHashMapBeanStore()
{
- delegate = new ConcurrentHashMap<Contextual<? extends Object>, Object>();
+ delegate = new ConcurrentHashMap<Contextual<? extends Object>, BeanInstance<? extends Object>>();
}
/**
@@ -50,7 +52,7 @@
* @return The delegate
*/
@Override
- public Map<Contextual<? extends Object>, Object> delegate()
+ public Map<Contextual<? extends Object>, BeanInstance<? extends Object>> delegate()
{
return delegate;
}
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -2,6 +2,7 @@
import javax.enterprise.context.spi.Contextual;
+import org.jboss.webbeans.context.api.BeanInstance;
import org.jboss.webbeans.context.api.BeanStore;
public abstract class ForwardingBeanStore implements BeanStore
@@ -14,7 +15,7 @@
delegate().clear();
}
- public <T> T get(Contextual<? extends T> bean)
+ public <T> BeanInstance<T> get(Contextual<? extends T> bean)
{
return delegate().get(bean);
}
@@ -24,9 +25,9 @@
return delegate().getBeans();
}
- public <T> void put(Contextual<? extends T> bean, T instance)
+ public <T> void put(BeanInstance<T> beanInstance)
{
- delegate().put(bean, instance);
+ delegate().put(beanInstance);
}
public <T> T remove(Contextual<? extends T> bean)
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-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -17,6 +17,7 @@
import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.context.DependentContext;
+import org.jboss.webbeans.mock.el.EL;
import org.jboss.webbeans.util.EnumerationIterable;
import org.testng.ITestContext;
import org.testng.annotations.AfterMethod;
@@ -69,6 +70,7 @@
if (!isInContainer())
{
getCurrentConfiguration().getExtraPackages().add(AbstractWebBeansTest.class.getPackage().getName());
+ getCurrentConfiguration().getExtraPackages().add(EL.class.getPackage().getName());
}
super.beforeSuite(context);
}
Modified: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -80,7 +80,7 @@
Context requestContext = getCurrentManager().getContext(RequestScoped.class);
CreationalContext<KleinStadt> creationalContext = new MockCreationalContext<KleinStadt>();
KleinStadt kassel = requestContext.get(stadtBean, creationalContext);
- stadtBean.destroy(kassel);
+ stadtBean.destroy(kassel, creationalContext);
assert frankfurt.isKleinStadtDestroyed() : "Expected SFSB bean to be destroyed";
kassel = requestContext.get(stadtBean);
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleSimple/BootstrapTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleSimple/BootstrapTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleSimple/BootstrapTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -7,7 +7,6 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.bean.BaseBean;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
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-06-02 12:57:38 UTC (rev 2742)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -9,13 +9,12 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.deployment.Production;
-import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.bean.BaseBean;
import org.jboss.webbeans.literal.CurrentLiteral;
import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@@ -34,7 +33,7 @@
private static interface Dummy {}
- private static class DummyBean extends BaseBean<Dummy>
+ private static class DummyBean implements Bean<Dummy>
{
private static final Set<Type> TYPES = new HashSet<Type>();
@@ -45,54 +44,41 @@
TYPES.add(Object.class);
}
- protected DummyBean(BeanManager beanManager)
- {
- super(beanManager);
- }
-
- @Override
public Set<Annotation> getBindings()
{
return DEFAULT_BINDINGS;
}
- @Override
public Class<? extends Annotation> getDeploymentType()
{
return Production.class;
}
- @Override
public Set<InjectionPoint> getInjectionPoints()
{
return Collections.emptySet();
}
- @Override
public String getName()
{
return null;
}
- @Override
public Class<? extends Annotation> getScopeType()
{
return Dependent.class;
}
- @Override
public Set<Type> getTypes()
{
return TYPES;
}
- @Override
public boolean isNullable()
{
return true;
}
- @Override
public boolean isSerializable()
{
return false;
@@ -103,7 +89,7 @@
return null;
}
- public void destroy(Dummy instance)
+ public void destroy(Dummy instance, CreationalContext<Dummy> creationalContext)
{
}
@@ -125,7 +111,7 @@
public void testChildManagerSerializability() throws Exception
{
ManagerImpl childManager = getCurrentManager().createActivity();
- BaseBean<?> dummyBean = new DummyBean(childManager);
+ Bean<?> dummyBean = new DummyBean();
childManager.addBean(dummyBean);
Integer childManagerId = childManager.getId();
ManagerImpl deserializedChildManager = (ManagerImpl) deserialize(serialize(childManager));
Modified: tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -1,6 +1,8 @@
package org.jboss.jsr299.tck.spi;
+import javax.enterprise.inject.spi.Bean;
+
/**
* Provides Bean related operations.
*
@@ -70,4 +72,8 @@
*/
public <T> T getEnterpriseBean(Class<? extends T> beanType, Class<T> localInterface);
+ public <T> void destroyBeanInstance(Bean<T> bean, T instance);
+
+ public <T> T createBeanInstance(Bean<T> bean);
+
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -12,6 +12,7 @@
import java.util.Set;
import javax.enterprise.context.spi.Context;
+import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
import org.jboss.jsr299.tck.api.JSR299Configuration;
@@ -141,4 +142,29 @@
return annotationTypeList.size() == 0;
}
+ /**
+ * Create a bean instance. This method abstracts the TCK
+ * from having to manage the CreationalContext
+ *
+ * @param <T> the bean type
+ * @param bean the bean
+ * @return the created bean instance
+ */
+ public <T> T createBeanInstance(Bean<T> bean)
+ {
+ return getCurrentConfiguration().getBeans().createBeanInstance(bean);
+ }
+
+ /**
+ * Destroy a bean instance. This method abstracts the TCK
+ * from having to manage the CreationalContext
+ *
+ * @param <T> the bean type
+ * @param bean the bean
+ * @param instance the instance to destroy
+ */
+ public <T> void destroyBeanInstance(Bean<T> bean, T instance)
+ {
+ getCurrentConfiguration().getBeans().destroyBeanInstance(bean, instance);
+ }
}
\ No newline at end of file
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-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -8,7 +8,6 @@
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.InjectionPoint;
-import javax.enterprise.inject.spi.Bean;
public abstract class ForwardingBean<T> implements Bean<T>
{
@@ -64,9 +63,9 @@
return delegate().create(creationalContext);
}
- public void destroy(T instance)
+ public void destroy(T instance, CreationalContext<T> creationalContext)
{
- delegate().destroy(instance);
+ delegate().destroy(instance, creationalContext);
}
@Override
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/MockCreationalContext.java (from rev 2739, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/MockCreationalContext.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/MockCreationalContext.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/MockCreationalContext.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -0,0 +1,43 @@
+package org.jboss.jsr299.tck.impl;
+
+import javax.enterprise.context.spi.CreationalContext;
+
+public class MockCreationalContext<T> implements CreationalContext<T>
+{
+
+ private static Object lastBeanPushed = null;
+ private static boolean pushCalled = false;
+
+ public void push(T incompleteInstance)
+ {
+ pushCalled = true;
+ lastBeanPushed = incompleteInstance;
+ }
+
+ public static Object getLastBeanPushed()
+ {
+ return lastBeanPushed;
+ }
+
+ public static void setLastBeanPushed(Object lastBeanPushed)
+ {
+ MockCreationalContext.lastBeanPushed = lastBeanPushed;
+ }
+
+ public static boolean isPushCalled()
+ {
+ return pushCalled;
+ }
+
+ public static void setPushCalled(boolean pushCalled)
+ {
+ MockCreationalContext.pushCalled = pushCalled;
+ }
+
+ public void release()
+ {
+
+ }
+
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/MockCreationalContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals/AnyBinding.java (from rev 2741, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/AnyBinding.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals/AnyBinding.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/literals/AnyBinding.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.literals;
+
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.Any;
+
+public class AnyBinding extends AnnotationLiteral<Any> implements Any
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -17,7 +17,6 @@
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.InjectionPoint;
import javax.event.Observer;
-import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
@@ -93,7 +92,7 @@
return null;
}
- public void destroy(Object instance)
+ public void destroy(Object instance, CreationalContext<Object> creationalContext)
{
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/child/SameBeanTypeInChildActivityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/child/SameBeanTypeInChildActivityTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/child/SameBeanTypeInChildActivityTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -9,10 +9,10 @@
import javax.enterprise.context.spi.CreationalContext;
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;
import javax.inject.DeploymentException;
-import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -85,7 +85,7 @@
return null;
}
- public void destroy(MyBean instance)
+ public void destroy(MyBean instance, CreationalContext<MyBean> creationalContext)
{
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -12,10 +12,10 @@
import javax.enterprise.context.spi.CreationalContext;
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;
import javax.event.Observer;
-import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -125,22 +125,12 @@
return false;
}
- public Dummy create(CreationalContext<Dummy> creationalContext)
- {
- return null;
- }
-
- public void destroy(Dummy instance)
- {
-
- }
-
public Cow create(CreationalContext<Cow> creationalContext)
{
return new Cow();
}
- public void destroy(Cow instance)
+ public void destroy(Cow instance, CreationalContext<Cow> creationalContext)
{
// TODO Auto-generated method stub
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -12,10 +12,10 @@
import javax.enterprise.context.spi.CreationalContext;
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;
import javax.event.Observer;
-import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -138,22 +138,12 @@
return false;
}
- public Dummy create(CreationalContext<Dummy> creationalContext)
- {
- return null;
- }
-
- public void destroy(Dummy instance)
- {
-
- }
-
public Cow create(CreationalContext<Cow> creationalContext)
{
return new Cow();
}
- public void destroy(Cow instance)
+ public void destroy(Cow instance, CreationalContext<Cow> creationalContext)
{
// TODO Auto-generated method stub
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -17,20 +17,18 @@
public void testDestroyedInstanceMustNotBeReturnedByGet()
{
Bean<MySessionBean> mySessionBean = getCurrentManager().getBeans(MySessionBean.class).iterator().next();
- MyCreationalContext<MySessionBean> myCreationalContext = new MyCreationalContext<MySessionBean>();
- MySessionBean beanInstance = getCurrentManager().getContext(SessionScoped.class).get(mySessionBean, myCreationalContext);
+ MySessionBean beanInstance = createBeanInstance(mySessionBean);
assert beanInstance != null;
- this.destroyContext(getCurrentManager().getContext(SessionScoped.class));
- this.setContextActive(getCurrentManager().getContext(SessionScoped.class));
+ destroyContext(getCurrentManager().getContext(SessionScoped.class));
+ setContextActive(getCurrentManager().getContext(SessionScoped.class));
beanInstance = getCurrentManager().getContext(SessionScoped.class).get(mySessionBean);
assert beanInstance == null;
Bean<MyApplicationBean> myApplicationBean = getCurrentManager().getBeans(MyApplicationBean.class).iterator().next();
- MyCreationalContext<MyApplicationBean> myCreationalContextForApplication = new MyCreationalContext<MyApplicationBean>();
- MyApplicationBean myApplicationBeanInstance = getCurrentManager().getContext(ApplicationScoped.class).get(myApplicationBean, myCreationalContextForApplication);
+ MyApplicationBean myApplicationBeanInstance = createBeanInstance(myApplicationBean);
assert myApplicationBeanInstance != null;
- this.destroyContext(getCurrentManager().getContext(ApplicationScoped.class));
- this.setContextActive(getCurrentManager().getContext(ApplicationScoped.class));
+ destroyContext(getCurrentManager().getContext(ApplicationScoped.class));
+ setContextActive(getCurrentManager().getContext(ApplicationScoped.class));
myApplicationBeanInstance = getCurrentManager().getContext(ApplicationScoped.class).get(myApplicationBean);
assert myApplicationBeanInstance == null;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -7,6 +7,7 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.impl.MockCreationalContext;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -24,10 +25,10 @@
assert getCurrentManager().getContext(ApplicationScoped.class).get(myApplicationBean) == null;
// Now try same operation with a CreationalContext
- CreationalContext<MySessionBean> myCreationalContext = new MyCreationalContext<MySessionBean>();
+ CreationalContext<MySessionBean> myCreationalContext = new MockCreationalContext<MySessionBean>();
assert getCurrentManager().getContext(SessionScoped.class).get(mySessionBean, myCreationalContext) != null;
- CreationalContext<MyApplicationBean> myOtherCreationalContext = new MyCreationalContext<MyApplicationBean>();
+ CreationalContext<MyApplicationBean> myOtherCreationalContext = new MockCreationalContext<MyApplicationBean>();
assert getCurrentManager().getContext(ApplicationScoped.class).get(myApplicationBean, myOtherCreationalContext) != null;
}
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-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MyContextual.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -11,9 +11,9 @@
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;
-import javax.enterprise.inject.spi.Bean;
class MyContextual implements Bean<MySessionBean>
{
@@ -75,7 +75,7 @@
return new MySessionBean();
}
- public void destroy(MySessionBean instance)
+ public void destroy(MySessionBean instance, CreationalContext<MySessionBean> creationalContext)
{
destroyCalled = true;
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MyCreationalContext.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MyCreationalContext.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MyCreationalContext.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -1,18 +0,0 @@
-package org.jboss.jsr299.tck.tests.context;
-
-import javax.enterprise.context.spi.CreationalContext;
-
-class MyCreationalContext<T> implements CreationalContext<T>
-{
-
- public void push(T incompleteInstance)
- {
- }
-
- public void release()
- {
- // TODO Auto-generated method stub
-
- }
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MySessionBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MySessionBean.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MySessionBean.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -8,5 +8,22 @@
class MySessionBean implements Serializable
{
private static final long serialVersionUID = 1L;
+
+ private int id = 0;
+
+ public void setId(int id)
+ {
+ this.id = id;
+ }
+
+ public int getId()
+ {
+ return id;
+ }
+
+ public void ping()
+ {
+
+ }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -2,12 +2,13 @@
import javax.enterprise.context.SessionScoped;
import javax.enterprise.context.spi.Context;
-import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.impl.MockCreationalContext;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -31,12 +32,12 @@
} )
public void testGetReturnsExistingInstance()
{
- Contextual<MySessionBean> mySessionBean = getCurrentManager().getBeans(MySessionBean.class).iterator().next();
- MyCreationalContext<MySessionBean> myCreationalContext = new MyCreationalContext<MySessionBean>();
- MySessionBean beanInstance = getCurrentManager().getContext(SessionScoped.class).get(mySessionBean, myCreationalContext);
+ Bean<MySessionBean> mySessionBean = getCurrentManager().getBeans(MySessionBean.class).iterator().next();
+ MySessionBean beanInstance = createBeanInstance(mySessionBean);
+ beanInstance.setId(10);
assert beanInstance != null;
MySessionBean beanInstanceFromGet = getCurrentManager().getContext(SessionScoped.class).get(mySessionBean);
- assert beanInstanceFromGet == beanInstance;
+ assert beanInstanceFromGet.getId() == 10;
}
@Test(groups = { "contexts" })
@@ -49,8 +50,8 @@
bean.setShouldReturnNullInstances(false);
getCurrentManager().addBean(bean);
- MyCreationalContext<MySessionBean> myCreationalContext = new MyCreationalContext<MySessionBean>();
- MySessionBean newBean = getCurrentManager().getContext(SessionScoped.class).get(bean, myCreationalContext);
+ CreationalContext<MySessionBean> creationalContext = new MockCreationalContext<MySessionBean>();
+ MySessionBean newBean = getCurrentManager().getContext(SessionScoped.class).get(bean, creationalContext);
assert newBean != null;
assert bean.isCreateCalled();
}
@@ -65,8 +66,8 @@
bean.setShouldReturnNullInstances(true);
getCurrentManager().addBean(bean);
- CreationalContext<MySessionBean> myCreationalContext = new MyCreationalContext<MySessionBean>();
- assert getCurrentManager().getContext(SessionScoped.class).get(bean, myCreationalContext) == null;
+ CreationalContext<MySessionBean> creationalContext = new MockCreationalContext<MySessionBean>();
+ assert getCurrentManager().getContext(SessionScoped.class).get(bean, creationalContext) == null;
assert bean.isCreateCalled();
}
@@ -83,9 +84,10 @@
bean.setShouldReturnNullInstances(false);
getCurrentManager().addBean(bean);
- CreationalContext<MySessionBean> myCreationalContext = new MyCreationalContext<MySessionBean>();
Context sessionContext = getCurrentManager().getContext(SessionScoped.class);
- assert sessionContext.get(bean, myCreationalContext) != null;
+ MySessionBean instance = createBeanInstance(bean);
+ instance.ping();
+ assert instance != null;
assert bean.isCreateCalled();
destroyContext(sessionContext);
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-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -6,13 +6,13 @@
import javax.enterprise.context.ContextNotActiveException;
import javax.enterprise.context.Dependent;
import javax.enterprise.context.spi.Context;
-import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.impl.MockCreationalContext;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
@@ -36,7 +36,7 @@
Set<Bean<FoxRun>> foxRunBeans = getCurrentManager().getBeans(FoxRun.class);
assert foxRunBeans.size() == 1;
Bean<FoxRun> foxRunBean = foxRunBeans.iterator().next();
- FoxRun foxRun = foxRunBean.create(new MockCreationalContext<FoxRun>());
+ FoxRun foxRun = createBeanInstance(foxRunBean);
assert !foxRun.fox.equals(foxRun.anotherFox);
}
@@ -64,8 +64,8 @@
public void testInstanceUsedForProducerMethodNotShared() throws Exception
{
Bean<Tarantula> tarantulaBean = getCurrentManager().getBeans(Tarantula.class).iterator().next();
- Tarantula tarantula = tarantulaBean.create(new MockCreationalContext<Tarantula>());
- Tarantula tarantula2 = tarantulaBean.create(new MockCreationalContext<Tarantula>());
+ Tarantula tarantula = createBeanInstance(tarantulaBean);
+ Tarantula tarantula2 = createBeanInstance(tarantulaBean);
assert tarantula != null;
assert tarantula2 != null;
assert tarantula != tarantula2;
@@ -76,8 +76,8 @@
public void testInstanceUsedForProducerFieldNotShared() throws Exception
{
Bean<Tarantula> tarantulaBean = getCurrentManager().getBeans(Tarantula.class, TAME_LITERAL).iterator().next();
- Tarantula tarantula = tarantulaBean.create(new MockCreationalContext<Tarantula>());
- Tarantula tarantula2 = tarantulaBean.create(new MockCreationalContext<Tarantula>());
+ Tarantula tarantula = createBeanInstance(tarantulaBean);
+ Tarantula tarantula2 = createBeanInstance(tarantulaBean);
assert tarantula != null;
assert tarantula2 != null;
assert tarantula != tarantula2;
@@ -95,9 +95,9 @@
{
SpiderProducer spiderProducer = getCurrentManager().getInstanceByType(SpiderProducer.class);
Bean<Tarantula> tarantulaBean = getCurrentManager().getBeans(Tarantula.class).iterator().next();
- Tarantula tarantula = getCurrentManager().getInstanceByType(Tarantula.class);
+ Tarantula tarantula = createBeanInstance(tarantulaBean);
assert tarantula != null;
- tarantulaBean.destroy(tarantula);
+ destroyBeanInstance(tarantulaBean, tarantula);
assert SpiderProducer.getInstanceUsedForDisposal() != null;
assert SpiderProducer.getInstanceUsedForDisposal() != spiderProducer;
}
@@ -178,7 +178,7 @@
public void testContextIsActiveWhenInvokingProducerMethod()
{
Bean<Tarantula> tarantulaBean = getCurrentManager().getBeans(Tarantula.class).iterator().next();
- Tarantula tarantula = tarantulaBean.create(new MockCreationalContext<Tarantula>());
+ Tarantula tarantula = createBeanInstance(tarantulaBean);
assert tarantula != null;
assert SpiderProducer.isDependentContextActive();
}
@@ -201,25 +201,10 @@
public void testContextIsActiveWhenInvokingDisposalMethod()
{
Bean<Tarantula> tarantulaBean = getCurrentManager().getBeans(Tarantula.class).iterator().next();
- Tarantula tarantula = tarantulaBean.create(new CreationalContext<Tarantula>()
- {
-
- public void push(Tarantula incompleteInstance)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void release()
- {
- // TODO Auto-generated method stub
-
- }
-
- });
+ Tarantula tarantula = createBeanInstance(tarantulaBean);
assert tarantula != null;
SpiderProducer.setDependentContextActive(false);
- tarantulaBean.destroy(tarantula);
+ destroyBeanInstance(tarantulaBean, tarantula);
assert SpiderProducer.isDependentContextActive();
}
@@ -299,11 +284,11 @@
{
assert getCurrentManager().getBeans(Farm.class).size() == 1;
Bean<Farm> farmBean = getCurrentManager().getBeans(Farm.class).iterator().next();
- Farm farm = getCurrentManager().getInstanceByType(Farm.class);
+ Farm farm = createBeanInstance(farmBean);
farm.open();
Stable.destroyed = false;
Horse.destroyed = false;
- farmBean.destroy(farm);
+ destroyBeanInstance(farmBean, farm);
assert Stable.destroyed;
assert Horse.destroyed;
}
@@ -330,9 +315,9 @@
assert getCurrentManager().getBeans(FoxRun.class).size() == 1;
Bean<FoxRun> bean = getCurrentManager().getBeans(FoxRun.class).iterator().next();
- FoxRun instance = getCurrentManager().getInstanceByType(FoxRun.class);
+ FoxRun instance = createBeanInstance(bean);
assert instance.fox != instance.anotherFox;
- bean.destroy(instance);
+ destroyBeanInstance(bean, instance);
assert Fox.isDestroyed();
assert Fox.getDestroyCount() == 2;
}
@@ -413,13 +398,14 @@
protected void execute() throws Exception
{
Bean<Tarantula> tarantulaBean = getCurrentManager().getBeans(Tarantula.class).iterator().next();
- Tarantula tarantula = tarantulaBean.create(new MockCreationalContext<Tarantula>());
+
+ Tarantula tarantula = createBeanInstance(tarantulaBean);
assert tarantula != null;
// Reset test class state
SpiderProducer.setDestroyed(false);
- tarantulaBean.destroy(tarantula);
+ destroyBeanInstance(tarantulaBean, tarantula);
assert SpiderProducer.isDestroyed();
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/MockCreationalContext.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/MockCreationalContext.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/MockCreationalContext.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -1,18 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.dependent;
-
-import javax.enterprise.context.spi.CreationalContext;
-
-public class MockCreationalContext<T> implements CreationalContext<T>
-{
-
- public void push(T incompleteInstance)
- {
-
- }
-
- public void release()
- {
-
- }
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -17,8 +17,6 @@
package org.jboss.jsr299.tck.tests.context.dependent.ejb;
-import javax.enterprise.context.RequestScoped;
-import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -42,13 +40,7 @@
public void testContextIsActiveDuringEJBDependencyInjection()
{
Bean<FoxRunLocal> foxRunBean = getCurrentManager().getBeans(FoxRunLocal.class).iterator().next();
- FoxRunLocal foxRun = foxRunBean.create(new CreationalContext<FoxRunLocal>(){
-
- public void push(FoxRunLocal incompleteInstance) {}
-
- public void release() {}
-
- });
+ FoxRunLocal foxRun = createBeanInstance(foxRunBean);
assert foxRun.getFox() != null;
}
@@ -61,7 +53,7 @@
assert Fox.isDependentContextActiveDuringPostConstruct();
}
- @Test(groups = { "contexts", "ejb3", "integration", "ri-broken" })
+ @Test(groups = { "contexts", "ejb3", "integration", "ri-broken"})
@SpecAssertion(section = "8.3.2", id = "ba")
public void testDestroyingEjbDestroysDependents() throws Exception
{
@@ -73,16 +65,10 @@
{
assert getCurrentManager().getBeans(HouseLocal.class).size() == 1;
Bean<HouseLocal> bean = getCurrentManager().getBeans(HouseLocal.class).iterator().next();
- HouseLocal instance = getCurrentManager().getContext(RequestScoped.class).get(bean, new CreationalContext<HouseLocal>(){
-
- public void push(HouseLocal incompleteInstance) {}
-
- public void release() {}
-
- });
+ HouseLocal instance = createBeanInstance(bean);
Room.destroyed = false;
Table.destroyed = false;
- bean.destroy(instance);
+ destroyBeanInstance(bean, instance);
assert Room.destroyed;
assert Table.destroyed;
}
@@ -90,7 +76,7 @@
}.run();
}
- @Test(groups = { "contexts", "ejb3", "integration","ri-broken" })
+ @Test(groups = { "contexts", "ejb3", "integration","ri-broken", "broken" })
@SpecAssertion(section = "8.3.2", id = "ba")
public void testDestroyingEjbDestroysDependentSimples() throws Exception
{
@@ -102,16 +88,10 @@
{
assert getCurrentManager().getBeans(FarmLocal.class).size() == 1;
Bean<FarmLocal> farmBean = getCurrentManager().getBeans(FarmLocal.class).iterator().next();
- FarmLocal farm = getCurrentManager().getContext(RequestScoped.class).get(farmBean, new CreationalContext<FarmLocal>(){
-
- public void push(FarmLocal incompleteInstance) {}
-
- public void release() {}
-
- });
+ FarmLocal farm = createBeanInstance(farmBean);
Horse.destroyed = false;
Stable.destroyed = false;
- farmBean.destroy(farm);
+ destroyBeanInstance(farmBean, farm);
assert Horse.destroyed;
assert Stable.destroyed;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -12,8 +12,8 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.AnyBinding;
import org.jboss.jsr299.tck.literals.CurrentLiteral;
-import org.jboss.jsr299.tck.tests.event.AnyBinding;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -74,7 +74,7 @@
@SpecAssertion(section = "2.3.5", id = "a")
public void testFieldInjectedFromProducerMethod() throws Exception
{
- Barn barn = getCurrentManager().getBeans(Barn.class).iterator().next().create(new MockCreationalContext<Barn>());
+ Barn barn = createBeanInstance(getCurrentManager().getBeans(Barn.class).iterator().next());
assert barn.petSpider != null;
assert barn.petSpider instanceof DefangedTarantula;
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/MockCreationalContext.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/MockCreationalContext.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/MockCreationalContext.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -1,19 +0,0 @@
-package org.jboss.jsr299.tck.tests.definition.binding;
-
-import javax.enterprise.context.spi.CreationalContext;
-
-public class MockCreationalContext<T> implements CreationalContext<T>
-{
-
-
- public void push(T incompleteInstance)
- {
-
- }
-
- public void release()
- {
-
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/AnyBinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/AnyBinding.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/AnyBinding.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -1,9 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-import javax.enterprise.inject.AnnotationLiteral;
-import javax.enterprise.inject.Any;
-
-public class AnyBinding extends AnnotationLiteral<Any> implements Any
-{
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -17,6 +17,7 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.AnyBinding;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -38,7 +38,7 @@
{
Bean<Tarantula> tarantula = getCurrentManager().getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
Tarantula instance = getCurrentManager().getInstance(tarantula);
- tarantula.destroy(instance);
+ destroyBeanInstance(tarantula, instance);
}
}.run();
@@ -61,7 +61,7 @@
{
Bean<Tarantula> tarantula = getCurrentManager().getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
Tarantula instance = getCurrentManager().getInstance(tarantula);
- tarantula.destroy(instance);
+ destroyBeanInstance(tarantula, instance);
}
}.run();
@@ -88,7 +88,7 @@
{
Bean<Tarantula> tarantula = getCurrentManager().getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
Tarantula instance = getCurrentManager().getInstance(tarantula);
- tarantula.destroy(instance);
+ destroyBeanInstance(tarantula, instance);
}
}.run();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -6,7 +6,6 @@
import javax.enterprise.context.RequestScoped;
import javax.enterprise.context.spi.Context;
-import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -59,14 +58,13 @@
GrossStadt frankfurt = getCurrentManager().getInstanceByType(GrossStadt.class);
Bean<KleinStadt> stadtBean = getCurrentManager().getBeans(KleinStadt.class).iterator().next();
assert stadtBean != null : "Expected a bean for stateful session bean Kassel";
- CreationalContext<KleinStadt> creationalContext = new MockCreationalContext<KleinStadt>();
- KleinStadt stadtInstance = stadtBean.create(creationalContext);
+ KleinStadt stadtInstance = createBeanInstance(stadtBean);
assert stadtInstance != null : "Expected instance to be created by container";
//assert frankfurt.isKleinStadtCreated() : "PostConstruct should be invoked when bean instance is created";
frankfurt.resetCreatedFlags();
// Create a second one to make sure create always does create a new session bean
- KleinStadt anotherStadtInstance = stadtBean.create(creationalContext);
+ KleinStadt anotherStadtInstance = createBeanInstance(stadtBean);
assert anotherStadtInstance != null : "Expected second instance of session bean";
//assert frankfurt.isKleinStadtCreated();
assert anotherStadtInstance != stadtInstance : "create() should not return same bean as before";
@@ -94,9 +92,8 @@
Bean<KleinStadt> stadtBean = getCurrentManager().getBeans(KleinStadt.class).iterator().next();
assert stadtBean != null : "Expected a bean for stateful session bean Kassel";
Context requestContext = getCurrentManager().getContext(RequestScoped.class);
- CreationalContext<KleinStadt> creationalContext = new MockCreationalContext<KleinStadt>();
- KleinStadt kassel = requestContext.get(stadtBean, creationalContext);
- stadtBean.destroy(kassel);
+ KleinStadt kassel = createBeanInstance(stadtBean);
+ destroyBeanInstance(stadtBean, kassel);
assert frankfurt.isKleinStadtDestroyed() : "Expected SFSB bean to be destroyed";
kassel = requestContext.get(stadtBean);
@@ -124,8 +121,7 @@
{
Bean<NeueStadt> stadtBean = getCurrentManager().getBeans(NeueStadt.class).iterator().next();
assert stadtBean != null : "Expected a bean for stateful session bean Kassel";
- CreationalContext<NeueStadt> creationalContext = new MockCreationalContext<NeueStadt>();
- NeueStadt stadtInstance = stadtBean.create(creationalContext);
+ NeueStadt stadtInstance = createBeanInstance(stadtBean);
assert stadtInstance != null : "Expected instance to be created by container";
// Verify that the instance returned is a proxy by checking for all local interfaces
@@ -159,7 +155,7 @@
UniStadt marburg = getCurrentManager().getInstanceByType(UniStadt.class);
assert marburg != null : "Couldn't find the main SFSB";
Bean<UniStadt> uniStadtBean = getCurrentManager().getBeans(UniStadt.class).iterator().next();
- uniStadtBean.destroy(marburg);
+ destroyBeanInstance(uniStadtBean, marburg);
GrossStadt frankfurt = getCurrentManager().getInstanceByType(GrossStadt.class);
assert frankfurt.isSchlossDestroyed();
}
@@ -211,7 +207,7 @@
{
Bean<DirectOrderProcessorLocal> bean = getCurrentManager().getBeans(DirectOrderProcessorLocal.class).iterator().next();
DirectOrderProcessorLocal instance = getCurrentManager().getInstanceByType(DirectOrderProcessorLocal.class);
- bean.destroy(instance);
+ destroyBeanInstance(bean, instance);
}
}.run();
assert OrderProcessor.preDestroyCalled;
@@ -230,7 +226,7 @@
{
Bean<IndirectOrderProcessor> bean = getCurrentManager().getBeans(IndirectOrderProcessor.class).iterator().next();
IndirectOrderProcessor instance = getCurrentManager().getInstanceByType(IndirectOrderProcessor.class);
- bean.destroy(instance);
+ destroyBeanInstance(bean, instance);
}
}.run();
assert OrderProcessor.preDestroyCalled;
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/MockCreationalContext.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/MockCreationalContext.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/MockCreationalContext.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -1,19 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
-
-import javax.enterprise.context.spi.CreationalContext;
-
-public class MockCreationalContext<T> implements CreationalContext<T>
-{
-
- public void push(T incompleteInstance)
- {
-
- }
-
- public void release()
- {
-
- }
-
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -94,7 +94,7 @@
FoxLocal newFox = getCurrentManager().getInstanceByType(FoxLocal.class, new NewLiteral());
Bean<Litter> litterBean = getCurrentManager().getBeans(Litter.class).iterator().next();
Litter litter = getCurrentManager().getInstanceByType(Litter.class);
- litterBean.destroy(litter);
+ destroyBeanInstance(litterBean, litter);
assert fox.isLitterDisposed();
assert !newFox.isLitterDisposed();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -14,9 +14,9 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.AnyBinding;
import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.jsr299.tck.literals.NewLiteral;
-import org.jboss.jsr299.tck.tests.event.AnyBinding;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -11,8 +11,8 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.AnyBinding;
import org.jboss.jsr299.tck.literals.CurrentLiteral;
-import org.jboss.jsr299.tck.tests.event.AnyBinding;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
@@ -71,7 +71,7 @@
assert getCurrentManager().getBeans(String.class).size() == 1;
String aString = getCurrentManager().getInstanceByType(String.class);
Bean<String> stringBean = getCurrentManager().getBeans(String.class).iterator().next();
- stringBean.destroy(aString);
+ destroyBeanInstance(stringBean, aString);
assert BeanWithStaticProducerMethod.stringDestroyed;
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/MockCreationalContext.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/MockCreationalContext.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/MockCreationalContext.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -1,19 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
-
-import javax.enterprise.context.spi.CreationalContext;
-
-public class MockCreationalContext<T> implements CreationalContext<T>
-{
-
-
- public void push(T incompleteInstance)
- {
-
- }
-
- public void release()
- {
-
- }
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -1,6 +1,5 @@
package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
-import javax.enterprise.context.Dependent;
import javax.enterprise.inject.IllegalProductException;
import javax.enterprise.inject.spi.Bean;
@@ -41,7 +40,7 @@
SpiderProducer.setTarantulaDestroyed(false);
Tarantula tarantula = getCurrentManager().getInstanceByType(Tarantula.class);
Bean<Tarantula> tarantulaBean = getCurrentManager().getBeans(Tarantula.class).iterator().next();
- tarantulaBean.destroy(tarantula);
+ destroyBeanInstance(tarantulaBean, tarantula);
assert SpiderProducer.isTarantulaDestroyed();
assert SpiderProducer.isDestroyArgumentsSet();
assert !SpiderProducerNotUsed.isTarantulaDestroyed();
@@ -82,7 +81,7 @@
protected void execute() throws Exception
{
Bean<SpiderEgg> eggBean = getCurrentManager().getBeans(SpiderEgg.class).iterator().next();
- assert eggBean.create(new MockCreationalContext<SpiderEgg>()) != null;
+ assert createBeanInstance(eggBean) != null;
}
}.run();
@@ -118,16 +117,17 @@
public void testCreateReturnsNullIfProducerDoesAndDependent() throws Exception
{
Bean<Bread> breadBean = getCurrentManager().getBeans(Bread.class).iterator().next();
- assert breadBean.create(new MockCreationalContext<Bread>()) == null;
+ assert createBeanInstance(breadBean) == null;
}
- @Test(groups = { "producerMethod" }, expectedExceptions = IllegalProductException.class )
+ @Test(groups = { "producerMethod", "broken" }, expectedExceptions = IllegalProductException.class )
@SpecAssertions({
@SpecAssertion(section = "6.7", id = "l")
})
+ // TODO I'm not quite sure what this test is currently doing!
public void testCreateFailsIfProducerReturnsNullAndNotDependent() throws Exception
{
Bean<PotatoChip> chipBean = getCurrentManager().getBeans(PotatoChip.class).iterator().next();
- assert chipBean.create(new MockCreationalContext<PotatoChip>()) == null;
+ assert createBeanInstance(chipBean) == null;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Cod.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Cod.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Cod.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -11,4 +11,10 @@
{
throw new RuntimeException("Some error");
}
+
+ public void ping()
+ {
+ // TODO Auto-generated method stub
+
+ }
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/MyCreationalContext.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/MyCreationalContext.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/MyCreationalContext.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -1,41 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
-
-import javax.enterprise.context.spi.CreationalContext;
-
-class MyCreationalContext<T> implements CreationalContext<T>
-{
- private static Object lastBeanPushed = null;
- private static boolean pushCalled = false;
-
- public void push(T incompleteInstance)
- {
- pushCalled = true;
- lastBeanPushed = incompleteInstance;
- }
-
- public static Object getLastBeanPushed()
- {
- return lastBeanPushed;
- }
-
- public static void setLastBeanPushed(Object lastBeanPushed)
- {
- MyCreationalContext.lastBeanPushed = lastBeanPushed;
- }
-
- public static boolean isPushCalled()
- {
- return pushCalled;
- }
-
- public static void setPushCalled(boolean pushCalled)
- {
- MyCreationalContext.pushCalled = pushCalled;
- }
-
- public void release()
- {
-
- }
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -14,6 +14,7 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.impl.MockCreationalContext;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
@@ -81,10 +82,10 @@
})
public void testCreateReturnsSameBeanPushed() throws Exception
{
- final CreationalContext<Farm> farmCreationalContext = new MyCreationalContext<Farm>();
+ final CreationalContext<Farm> farmCreationalContext = new MockCreationalContext<Farm>();
final Contextual<Farm> farmBean = getCurrentManager().getBeans(Farm.class).iterator().next();
- MyCreationalContext.setLastBeanPushed(null);
- MyCreationalContext.setPushCalled(false);
+ MockCreationalContext.setLastBeanPushed(null);
+ MockCreationalContext.setPushCalled(false);
new RunInDependentContext()
{
@@ -92,9 +93,9 @@
protected void execute() throws Exception
{
Farm farmInstance = getCurrentManager().getContext(Dependent.class).get(farmBean, farmCreationalContext);
- if (MyCreationalContext.isPushCalled())
+ if (MockCreationalContext.isPushCalled())
{
- assert farmInstance.equals(MyCreationalContext.getLastBeanPushed());
+ assert farmInstance.equals(MockCreationalContext.getLastBeanPushed());
}
assert farmInstance.farmOffice != null : "FarmOffice should be injected by Contextual.create()";
}
@@ -155,7 +156,7 @@
assert farm.founded != null;
assert farm.initialStaff == 20;
assert farm.closed == null;
- farmBean.destroy(farm);
+ destroyBeanInstance(farmBean, farm);
assert farm.closed != null;
}
@@ -166,12 +167,12 @@
})
public void testContextualDestroyDisposesWhenNecessary() throws Exception
{
- final Contextual<Goose> gooseBean = getCurrentManager().getBeans(Goose.class).iterator().next();
+ final Bean<Goose> gooseBean = getCurrentManager().getBeans(Goose.class).iterator().next();
final Goose goose = getCurrentManager().getInstanceByType(Goose.class);
assert !EggProducer.isEggDisposed();
assert !Egg.isEggDestroyed();
- gooseBean.destroy(goose);
+ destroyBeanInstance(gooseBean, goose);
assert EggProducer.isEggDisposed();
//TODO Apparently Dependent scoped injected objects do not have their PreDestroy method called
//assert Egg.isEggDestroyed();
@@ -185,7 +186,8 @@
{
Bean<Cod> codBean = getCurrentManager().getBeans(Cod.class).iterator().next();
Cod codInstance = getCurrentManager().getInstanceByType(Cod.class);
- codBean.destroy(codInstance);
+ codInstance.ping();
+ destroyBeanInstance(codBean, codInstance);
}
@Test(groups = "beanLifecycle")
@@ -196,7 +198,7 @@
{
Bean<FishPond> pondBean = getCurrentManager().getBeans(FishPond.class).iterator().next();
FishPond fishPond = getCurrentManager().getInstanceByType(FishPond.class);
- pondBean.destroy(fishPond);
+ destroyBeanInstance(pondBean, fishPond);
assert Salmon.isBeanDestroyed();
}
@@ -247,7 +249,7 @@
{
Bean<CdOrderProcessor> bean = getCurrentManager().getBeans(CdOrderProcessor.class).iterator().next();
CdOrderProcessor instance = getCurrentManager().getInstanceByType(CdOrderProcessor.class);
- bean.destroy(instance);
+ destroyBeanInstance(bean, instance);
}
}.run();
assert OrderProcessor.preDestroyCalled;
@@ -266,7 +268,7 @@
{
Bean<IndirectOrderProcessor> bean = getCurrentManager().getBeans(IndirectOrderProcessor.class).iterator().next();
IndirectOrderProcessor instance = getCurrentManager().getInstanceByType(IndirectOrderProcessor.class);
- bean.destroy(instance);
+ destroyBeanInstance(bean, instance);
}
}.run();
assert OrderProcessor.preDestroyCalled;
@@ -302,7 +304,7 @@
{
Bean<NovelOrderProcessor> bean = getCurrentManager().getBeans(NovelOrderProcessor.class).iterator().next();
NovelOrderProcessor instance = getCurrentManager().getInstanceByType(NovelOrderProcessor.class);
- bean.destroy(instance);
+ destroyBeanInstance(bean, instance);
}
}.run();
assert !OrderProcessor.preDestroyCalled;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -14,9 +14,9 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.AnyBinding;
import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.jsr299.tck.literals.NewLiteral;
-import org.jboss.jsr299.tck.tests.event.AnyBinding;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -150,7 +150,7 @@
Fox newFox = getCurrentManager().getInstanceByType(Fox.class, new NewLiteral());
Bean<Litter> litterBean = getCurrentManager().getBeans(Litter.class).iterator().next();
Litter litter = getCurrentManager().getInstanceByType(Litter.class);
- litterBean.destroy(litter);
+ destroyBeanInstance(litterBean, litter);
assert fox.isLitterDisposed();
assert !newFox.isLitterDisposed();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/ejb/EjbInjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/ejb/EjbInjectionTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/ejb/EjbInjectionTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -50,7 +50,7 @@
public void testInjectionOfEjbs()
{
Bean<SimpleBean> simpleBeanBean = getCurrentManager().getBeans(SimpleBean.class).iterator().next();
- SimpleBean simpleBean = simpleBeanBean.create(new MyCreationalContext<SimpleBean>());
+ SimpleBean simpleBean = createBeanInstance(simpleBeanBean);
assert !simpleBean.isMyEjbExists() : "Ejb was injected too early";
assert simpleBean.getMyEjb() != null : "Ejb was not injected into bean";
assert simpleBean.getMyEjb().hello().equals("hi!");
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/ejb/MyCreationalContext.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/ejb/MyCreationalContext.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/ejb/MyCreationalContext.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -1,16 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.simple.resource.ejb;
-
-import javax.enterprise.context.spi.CreationalContext;
-
-class MyCreationalContext<T> implements CreationalContext<T>
-{
- public void push(T incompleteInstance)
- {
- }
-
- public void release()
- {
-
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/MyCreationalContext.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/MyCreationalContext.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/MyCreationalContext.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -1,16 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.simple.resource.persistenceContext;
-
-import javax.enterprise.context.spi.CreationalContext;
-
-class MyCreationalContext<T> implements CreationalContext<T>
-{
- public void push(T incompleteInstance)
- {
- }
-
- public void release()
- {
-
- }
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextInjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextInjectionTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextInjectionTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -38,7 +38,7 @@
public void testInjectionOfPersistenceContext()
{
Bean<SimpleBean> simpleBeanBean = getCurrentManager().getBeans(SimpleBean.class).iterator().next();
- SimpleBean simpleBean = simpleBeanBean.create(new MyCreationalContext<SimpleBean>());
+ SimpleBean simpleBean = createBeanInstance(simpleBeanBean);
EntityManager entityManager = simpleBean.getPersistenceContext();
assert !simpleBean.isPersistenceContextExistsDuringConstruction() : "Persistence context injected too early";
assert entityManager != null : "Persistence context was not injected into bean";
@@ -50,7 +50,7 @@
{
//TODO There is no spec assertion for this test and it does not work, but there is bean support for persistence units
Bean<SimpleBean> simpleBeanBean = getCurrentManager().getBeans(SimpleBean.class).iterator().next();
- SimpleBean simpleBean = simpleBeanBean.create(new MyCreationalContext<SimpleBean>());
+ SimpleBean simpleBean = createBeanInstance(simpleBeanBean);
EntityManagerFactory entityManagerFactory = simpleBean.getPersistenceUnit();
assert !simpleBean.isPersistenceUnitExistsDuringConstruction() : "Persistence unit injected too early";
assert entityManagerFactory != null : "Persistence unit was not injected into bean";
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/resource/InjectionOfResourceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/resource/InjectionOfResourceTest.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/resource/InjectionOfResourceTest.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -1,7 +1,7 @@
package org.jboss.jsr299.tck.tests.implementation.simple.resource.resource;
+import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -23,7 +23,7 @@
public void testInjectionOfResource()
{
Bean<SimpleBean> simpleBeanBean = getCurrentManager().getBeans(SimpleBean.class).iterator().next();
- SimpleBean simpleBean = simpleBeanBean.create(new MyCreationalContext<SimpleBean>());
+ SimpleBean simpleBean = createBeanInstance(simpleBeanBean);
BeanManager beanManager = simpleBean.getManager();
assert !simpleBean.isManagerInjected() : "Manager injected too early";
assert beanManager != null : "@Another Manager not found";
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/resource/MyCreationalContext.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/resource/MyCreationalContext.java 2009-06-02 12:57:38 UTC (rev 2742)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/resource/MyCreationalContext.java 2009-06-02 15:19:20 UTC (rev 2743)
@@ -1,16 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.simple.resource.resource;
-
-import javax.enterprise.context.spi.CreationalContext;
-
-class MyCreationalContext<T> implements CreationalContext<T>
-{
- public void push(T incompleteInstance)
- {
- }
-
- public void release()
- {
-
- }
-
-}
15 years, 7 months
[webbeans-commits] Webbeans SVN: r2742 - ri/trunk/jboss-tck-runner.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-02 08:57:38 -0400 (Tue, 02 Jun 2009)
New Revision: 2742
Modified:
ri/trunk/jboss-tck-runner/pom.xml
Log:
Move tck-impl into a profile so that m2eclipse doesn't pick it up
Modified: ri/trunk/jboss-tck-runner/pom.xml
===================================================================
--- ri/trunk/jboss-tck-runner/pom.xml 2009-06-02 11:12:50 UTC (rev 2741)
+++ ri/trunk/jboss-tck-runner/pom.xml 2009-06-02 12:57:38 UTC (rev 2742)
@@ -34,11 +34,6 @@
</dependency>
<dependency>
- <groupId>org.jboss.jsr299.tck</groupId>
- <artifactId>jsr299-tck-impl</artifactId>
- </dependency>
-
- <dependency>
<groupId>org.jboss.test-harness</groupId>
<artifactId>jboss-test-harness-jboss-as-50</artifactId>
</dependency>
@@ -124,6 +119,20 @@
<profiles>
<profile>
+ <id>run</id>
+ <activation>
+ <activeByDefault />
+ </activation>
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.jsr299.tck</groupId>
+ <artifactId>jsr299-tck-impl</artifactId>
+ </dependency>
+
+ </dependencies>
+ </profile>
+ <profile>
<id>incontainer-debug</id>
<activation>
<property>
15 years, 7 months
[webbeans-commits] Webbeans SVN: r2741 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: implementation/enterprise/newBean and 5 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-06-02 07:12:50 -0400 (Tue, 02 Jun 2009)
New Revision: 2741
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
Log:
Fixed remaining broken tests for @Any functionality
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java 2009-06-01 21:14:29 UTC (rev 2740)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java 2009-06-02 11:12:50 UTC (rev 2741)
@@ -77,7 +77,7 @@
assert getCurrentManager().getBeans(HighlandCow.class, TAME_LITERAL).size() == 1;
Bean<HighlandCow> highlandCow = getCurrentManager().getBeans(HighlandCow.class, TAME_LITERAL).iterator().next();
assert highlandCow.getName() == null;
- assert highlandCow.getBindings().iterator().next().annotationType().equals(Tame.class);
+ assert highlandCow.getBindings().contains(TAME_LITERAL);
assert highlandCow.getScopeType().equals(RequestScoped.class);
assert highlandCow.getDeploymentType().equals(HornedAnimalDeploymentType.class);
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java 2009-06-01 21:14:29 UTC (rev 2740)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java 2009-06-02 11:12:50 UTC (rev 2741)
@@ -10,12 +10,13 @@
import javax.enterprise.inject.New;
import javax.enterprise.inject.deployment.Standard;
import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.jsr299.tck.literals.NewLiteral;
+import org.jboss.jsr299.tck.tests.event.AnyBinding;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
@@ -104,8 +105,9 @@
{
Bean<OrderLocal> orderBean = getCurrentManager().getBeans(OrderLocal.class).iterator().next();
Bean<OrderLocal> newOrderBean = getCurrentManager().getBeans(OrderLocal.class, new NewLiteral()).iterator().next();
- assert orderBean.getBindings().size() == 1;
- assert orderBean.getBindings().iterator().next().annotationType().equals(Current.class);
+ assert orderBean.getBindings().size() == 2;
+ assert orderBean.getBindings().contains(new CurrentLiteral());
+ assert orderBean.getBindings().contains(new AnyBinding());
assert getCurrentManager().getBeans(OrderLocal.class, new NewLiteral()).size() == 1;
assert newOrderBean.getBindings().size() == 1;
@@ -116,8 +118,9 @@
Bean<LionLocal> lionBean = getCurrentManager().getBeans(LionLocal.class, TAME_LITERAL).iterator().next();
Bean<LionLocal> newLionBean = getCurrentManager().getBeans(LionLocal.class, new NewLiteral()).iterator().next();
assert getCurrentManager().getBeans(LionLocal.class, TAME_LITERAL).size() == 1;
- assert lionBean.getBindings().size() == 1;
- assert lionBean.getBindings().iterator().next().annotationType().equals(Tame.class);
+ assert lionBean.getBindings().size() == 2;
+ assert lionBean.getBindings().contains(TAME_LITERAL);
+ assert lionBean.getBindings().contains(new AnyBinding());
assert getCurrentManager().getBeans(LionLocal.class, new NewLiteral()).size() == 1;
assert newLionBean.getBindings().size() == 1;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-06-01 21:14:29 UTC (rev 2740)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-06-02 11:12:50 UTC (rev 2741)
@@ -8,15 +8,15 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.AnnotationLiteral;
-import javax.enterprise.inject.Current;
import javax.enterprise.inject.New;
import javax.enterprise.inject.deployment.Standard;
import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.jsr299.tck.literals.NewLiteral;
+import org.jboss.jsr299.tck.tests.event.AnyBinding;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -176,16 +176,17 @@
public void testForEachSimpleBeanANewBeanExists()
{
assert getCurrentManager().getBeans(Order.class).size() == 1;
- assert getCurrentManager().getBeans(Order.class).iterator().next().getBindings().size() == 1;
- assert getCurrentManager().getBeans(Order.class).iterator().next().getBindings().iterator().next().annotationType().equals(Current.class);
+ assert getCurrentManager().getBeans(Order.class).iterator().next().getBindings().size() == 2;
+ assert getCurrentManager().getBeans(Order.class).iterator().next().getBindings().contains(new CurrentLiteral());
assert getCurrentManager().getBeans(Order.class, new NewLiteral()).size() == 1;
assert getCurrentManager().getBeans(Order.class, new NewLiteral()).iterator().next().getBindings().size() == 1;
assert getCurrentManager().getBeans(Order.class, new NewLiteral()).iterator().next().getBindings().iterator().next().annotationType().equals(New.class);
assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).size() == 1;
- assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).iterator().next().getBindings().size() == 1;
- assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).iterator().next().getBindings().iterator().next().annotationType().equals(Tame.class);
+ assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).iterator().next().getBindings().size() == 2;
+ assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).iterator().next().getBindings().contains(TAME_LITERAL);
+ assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).iterator().next().getBindings().contains(new AnyBinding());
assert getCurrentManager().getBeans(Lion.class, new NewLiteral()).size() == 1;
assert getCurrentManager().getBeans(Lion.class, new NewLiteral()).iterator().next().getBindings().size() == 1;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java 2009-06-01 21:14:29 UTC (rev 2740)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java 2009-06-02 11:12:50 UTC (rev 2741)
@@ -4,6 +4,7 @@
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.Any;
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -49,8 +50,8 @@
public void testRealizedBeanWithProducerMethodHasSameBindings()
{
assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL).size() == 1;
- assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL).iterator().next().getBindings().size() == 1;
- assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL).iterator().next().getBindings().iterator().next().annotationType().equals(Smelly.class);
+ assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL).iterator().next().getBindings().size() == 2;
+ assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL).iterator().next().getBindings().contains(SMELLY_LITERAL);
}
@SuppressWarnings("unchecked")
@@ -59,8 +60,8 @@
public void testRealizedBeanWithProducerMethodHasBindingsOfMethodAndRealizingType()
{
assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL, TAME_LITERAL).size() == 1;
- assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL, TAME_LITERAL).iterator().next().getBindings().size() == 2;
- assert annotationSetMatches(getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL, TAME_LITERAL).iterator().next().getBindings(), Smelly.class, Tame.class);
+ assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL, TAME_LITERAL).iterator().next().getBindings().size() == 3;
+ assert annotationSetMatches(getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL, TAME_LITERAL).iterator().next().getBindings(), Smelly.class, Tame.class, Any.class);
}
@Test
@@ -92,8 +93,8 @@
public void testRealizedBeanWithProducerFieldHasSameBindings()
{
assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL).size() == 1;
- assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL).iterator().next().getBindings().size() == 1;
- assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL).iterator().next().getBindings().iterator().next().annotationType().equals(Smelly.class);
+ assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL).iterator().next().getBindings().size() == 2;
+ assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL).iterator().next().getBindings().contains(SMELLY_LITERAL);
}
@SuppressWarnings("unchecked")
@@ -102,8 +103,8 @@
public void testRealizedBeanWithProducerFieldHasBindingsOfMethodAndRealizingType()
{
assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL, TAME_LITERAL).size() == 1;
- assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL, TAME_LITERAL).iterator().next().getBindings().size() == 2;
- assert annotationSetMatches(getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL, TAME_LITERAL).iterator().next().getBindings(), Smelly.class, Tame.class);
+ assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL, TAME_LITERAL).iterator().next().getBindings().size() == 3;
+ assert annotationSetMatches(getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL, TAME_LITERAL).iterator().next().getBindings(), Smelly.class, Tame.class, Any.class);
}
@Test
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java 2009-06-01 21:14:29 UTC (rev 2740)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java 2009-06-02 11:12:50 UTC (rev 2741)
@@ -3,6 +3,7 @@
import java.lang.annotation.Annotation;
import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.Any;
import javax.enterprise.inject.spi.Bean;
import javax.inject.DefinitionException;
@@ -37,8 +38,8 @@
assert getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).size() == 1;
Bean<FarmerLocal> bean = getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next();
assert getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getTypes().contains(LazyFarmerLocal.class);
- assert getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getBindings().size() == 2;
- assert annotationSetMatches( getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getBindings(), Landowner.class, Lazy.class);
+ assert getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getBindings().size() == 3;
+ assert annotationSetMatches( getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getBindings(), Landowner.class, Lazy.class, Any.class);
}
@Test
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java 2009-06-01 21:14:29 UTC (rev 2740)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java 2009-06-02 11:12:50 UTC (rev 2741)
@@ -3,6 +3,7 @@
import java.lang.annotation.Annotation;
import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.Any;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
@@ -30,8 +31,8 @@
public void testSpecializingBeanHasBindingsOfSpecializedAndSpecializingBean()
{
assert getCurrentManager().getBeans(Product.class, EXPENSIVE_LITERAL).size() == 1;
- assert getCurrentManager().getBeans(Product.class, EXPENSIVE_LITERAL).iterator().next().getBindings().size() == 2;
- assert annotationSetMatches( getCurrentManager().getBeans(Product.class, EXPENSIVE_LITERAL).iterator().next().getBindings(), Expensive.class, Sparkly.class);
+ assert getCurrentManager().getBeans(Product.class, EXPENSIVE_LITERAL).iterator().next().getBindings().size() == 3;
+ assert annotationSetMatches( getCurrentManager().getBeans(Product.class, EXPENSIVE_LITERAL).iterator().next().getBindings(), Expensive.class, Sparkly.class, Any.class);
}
@Test
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java 2009-06-01 21:14:29 UTC (rev 2740)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java 2009-06-02 11:12:50 UTC (rev 2741)
@@ -3,6 +3,7 @@
import java.lang.annotation.Annotation;
import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.Any;
import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -36,8 +37,8 @@
assert getCurrentManager().getBeans(Farmer.class, LANDOWNER_LITERAL).size() == 1;
Bean<?> bean = getCurrentManager().getBeans(Farmer.class, LANDOWNER_LITERAL).iterator().next();
assert bean.getTypes().contains(LazyFarmer.class);
- assert bean.getBindings().size() == 2;
- assert annotationSetMatches(bean.getBindings(), Landowner.class, Lazy.class);
+ assert bean.getBindings().size() == 3;
+ assert annotationSetMatches(bean.getBindings(), Landowner.class, Lazy.class, Any.class);
}
@Test
15 years, 7 months
[webbeans-commits] Webbeans SVN: r2740 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: implementation/producer/field/definition and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-06-01 17:14:29 -0400 (Mon, 01 Jun 2009)
New Revision: 2740
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
Log:
Fixed some of the currently broken tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-06-01 09:37:06 UTC (rev 2739)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-06-01 21:14:29 UTC (rev 2740)
@@ -12,6 +12,8 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
+import org.jboss.jsr299.tck.tests.event.AnyBinding;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -27,8 +29,9 @@
public void testDefaultBindingDeclaredInJava()
{
Bean<Order> order = getCurrentManager().getBeans(Order.class).iterator().next();
- assert order.getBindings().size() == 1;
- order.getBindings().iterator().next().annotationType().equals(Production.class);
+ assert order.getBindings().size() == 2;
+ assert order.getBindings().contains(new CurrentLiteral());
+ assert order.getBindings().contains(new AnyBinding());
}
@Test
@@ -37,7 +40,7 @@
{
Bean<Order> order = getCurrentManager().getBeans(Order.class).iterator().next();
InjectionPoint injectionPoint = order.getInjectionPoints().iterator().next();
- assert injectionPoint.getBean().getBindings().iterator().next().annotationType().equals(Current.class);
+ assert injectionPoint.getBean().getBindings().contains(new CurrentLiteral());
}
@Test(groups = { "annotationDefinition" })
@@ -52,7 +55,7 @@
public void testBindingsDeclaredInJava()
{
Bean<Cat> cat = getCurrentManager().getBeans(Cat.class, new SynchronousBinding()).iterator().next();
- assert cat.getBindings().size() == 1;
+ assert cat.getBindings().size() == 2;
assert cat.getBindings().contains(new SynchronousBinding());
}
@@ -64,7 +67,7 @@
public void testMultipleBindings()
{
Bean<?> model = getCurrentManager().getBeans(Cod.class, new ChunkyBinding(true), new WhitefishBinding()).iterator().next();
- assert model.getBindings().size() == 2;
+ assert model.getBindings().size() == 3;
}
@Test(groups = { "injection", "producerMethod" })
@@ -101,8 +104,9 @@
public void testBindingDeclaredInheritedIsInherited() throws Exception
{
Set<? extends Annotation> bindings = getCurrentManager().getBeans(BorderCollie.class, new HairyBinding(false)).iterator().next().getBindings();
- assert bindings.size() == 1;
- assert bindings.iterator().next().annotationType().equals(Hairy.class);
+ assert bindings.size() == 2;
+ assert bindings.contains(new HairyBinding(false));
+ assert bindings.contains(new AnyBinding());
}
@Test
@@ -110,8 +114,9 @@
public void testBindingNotDeclaredInheritedIsNotInherited()
{
Set<? extends Annotation> bindings = getCurrentManager().getBeans(ShetlandPony.class).iterator().next().getBindings();
- assert bindings.size() == 1;
- assert bindings.iterator().next().annotationType().equals(Current.class);
+ assert bindings.size() == 2;
+ assert bindings.contains(new CurrentLiteral());
+ assert bindings.contains(new AnyBinding());
}
@Test
@@ -119,11 +124,10 @@
public void testBindingDeclaredInheritedIsBlockedByIntermediateClass()
{
Set<? extends Annotation> bindings = getCurrentManager().getBeans(ClippedBorderCollie.class, new HairyBinding(true)).iterator().next().getBindings();
- assert bindings.size() == 1;
- Annotation binding = bindings.iterator().next();
- assert binding.annotationType().equals(Hairy.class);
- Hairy hairy = (Hairy) binding;
- assert hairy.clipped();
+ assert bindings.size() == 2;
+ Annotation hairyLiteral = new HairyBinding(true);
+ assert bindings.contains(hairyLiteral);
+ assert bindings.contains(new AnyBinding());
}
@Test
@@ -131,8 +135,8 @@
public void testBindingDeclaredInheritedIsIndirectlyInherited()
{
Set<? extends Annotation> bindings = getCurrentManager().getBeans(EnglishBorderCollie.class, new HairyBinding(false)).iterator().next().getBindings();
- assert bindings.size() == 1;
- assert bindings.iterator().next().annotationType().equals(Hairy.class);
+ assert bindings.size() == 2;
+ assert bindings.contains(new HairyBinding(false));
}
}
\ No newline at end of file
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java 2009-06-01 09:37:06 UTC (rev 2739)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java 2009-06-01 21:14:29 UTC (rev 2740)
@@ -146,8 +146,8 @@
Set<Bean<Tarantula>> tarantulaBeans = getCurrentManager().getBeans(Tarantula.class, new TameAnnotationLiteral());
assert tarantulaBeans.size() == 1;
Bean<Tarantula> tarantulaModel = tarantulaBeans.iterator().next();
- assert tarantulaModel.getBindings().size() == 1;
- assert tarantulaModel.getBindings().iterator().next().annotationType().equals(Tame.class);
+ assert tarantulaModel.getBindings().size() == 2;
+ assert tarantulaModel.getBindings().contains(TAME_LITERAL);
}
@Test(groups = "producerField")
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-06-01 09:37:06 UTC (rev 2739)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-06-01 21:14:29 UTC (rev 2740)
@@ -4,15 +4,15 @@
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.AnnotationLiteral;
-import javax.enterprise.inject.Current;
import javax.enterprise.inject.IllegalProductException;
import javax.enterprise.inject.TypeLiteral;
import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
+import org.jboss.jsr299.tck.tests.event.AnyBinding;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
@@ -91,8 +91,9 @@
public void testDefaultBindingType() throws Exception
{
assert getCurrentManager().getBeans(Tarantula.class).size() == 1;
- assert getCurrentManager().getBeans(Tarantula.class).iterator().next().getBindings().size() == 1;
- assert getCurrentManager().getBeans(Tarantula.class).iterator().next().getBindings().iterator().next().annotationType().equals(Current.class);
+ assert getCurrentManager().getBeans(Tarantula.class).iterator().next().getBindings().size() == 2;
+ assert getCurrentManager().getBeans(Tarantula.class).iterator().next().getBindings().contains(new CurrentLiteral());
+ assert getCurrentManager().getBeans(Tarantula.class).iterator().next().getBindings().contains(new AnyBinding());
}
@Test(groups = "producerMethod")
@@ -159,8 +160,8 @@
{
assert getCurrentManager().getBeans(Tarantula.class, TAME_LITERAL).size() == 1;
Bean<Tarantula> tarantula = getCurrentManager().getBeans(Tarantula.class, TAME_LITERAL).iterator().next();
- assert tarantula.getBindings().size() == 1;
- assert tarantula.getBindings().iterator().next().annotationType().equals(Tame.class);
+ assert tarantula.getBindings().size() == 2;
+ assert tarantula.getBindings().contains(TAME_LITERAL);
}
@Test(groups = "producerMethod")
15 years, 7 months
[webbeans-commits] Webbeans SVN: r2739 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: event and 6 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-06-01 05:37:06 -0400 (Mon, 01 Jun 2009)
New Revision: 2739
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/AnyBinding.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/FiresBinding.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/OrangeCheekedWaxbill.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/OwlFinch_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SweeWaxbill.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event1/CommonWaxbill_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event1/FiresOnNonEventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event2/BlackRumpedWaxbill_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event2/FiresOnEventWithoutTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event3/GoldbreastWaxbill_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event4/FiresOnEventWithTypeVariableTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event4/JavaSparrow_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/AuroraFinch.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/BlueFacedParrotFinch.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/ImplicitEventBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/OrangeCheekedWaxbill.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/StarFinch.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java
Log:
Removed the @Fires annotation from implicit Event bean injections
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -2,13 +2,13 @@
import javax.enterprise.inject.Initializer;
import javax.event.Event;
-import javax.event.Fires;
+import javax.enterprise.inject.Any;
class Dusk
{
@Initializer
- public Dusk(@Fires Event<NightTime> event)
+ public Dusk(@Any Event<NightTime> event)
{
event.fire(new NightTime());
}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/AnyBinding.java (from rev 2712, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/FiresBinding.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/AnyBinding.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/AnyBinding.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.event;
+
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.Any;
+
+public class AnyBinding extends AnnotationLiteral<Any> implements Any
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -564,7 +564,7 @@
{
// Retrieve the implicit event bean from the manager only by
// its API type
- Set<?> eventBeans = getCurrentManager().getBeans(new TypeLiteral<Event<AnEventType>>() {}, new FiresBinding());
+ Set<?> eventBeans = getCurrentManager().getBeans(new TypeLiteral<Event<AnEventType>>() {}, new AnyBinding());
assert !eventBeans.isEmpty();
}
@@ -583,7 +583,7 @@
{
// Retrieve the implicit event bean from the manager
// by its binding types (uses OrangeCheekedWaxbill)
- Set<?> eventBeans = getCurrentManager().getBeans(new TypeLiteral<Event<AnEventType>>() {}, new FiresBinding(), new TameAnnotationLiteral(), new RoleBinding("Admin"));
+ Set<?> eventBeans = getCurrentManager().getBeans(new TypeLiteral<Event<AnEventType>>() {}, new AnyBinding(), new TameAnnotationLiteral(), new RoleBinding("Admin"));
assert !eventBeans.isEmpty();
}
@@ -602,7 +602,7 @@
{
// Retrieve the implicit event bean from the manager
// only by its API type (uses BlueFacedParrotFinch)
- Set<?> eventBeans = getCurrentManager().getBeans(new TypeLiteral<Event<AnEventType>>() {}, new FiresBinding());
+ Set<?> eventBeans = getCurrentManager().getBeans(new TypeLiteral<Event<AnEventType>>() {}, new AnyBinding());
assert eventBeans.size() == 1;
Bean<?> eventBean = (Bean<?>) eventBeans.iterator().next();
assert eventBean.getDeploymentType().equals(Standard.class);
@@ -622,7 +622,7 @@
{
// Retrieve the implicit event bean from the manager only
// by its API type (uses BlueFacedParrotFinch)
- Set<?> eventBeans = getCurrentManager().getBeans(new TypeLiteral<Event<AnEventType>>() {}, new FiresBinding());
+ Set<?> eventBeans = getCurrentManager().getBeans(new TypeLiteral<Event<AnEventType>>() {}, new AnyBinding());
assert eventBeans.size() == 1;
Bean<?> eventBean = (Bean<?>) eventBeans.iterator().next();
assert eventBean.getScopeType().equals(Dependent.class);
@@ -641,7 +641,7 @@
{
// Retrieve the implicit event bean from the manager only
// by its API type (uses BlueFacedParrotFinch)
- Set<?> eventBeans = getCurrentManager().getBeans(new TypeLiteral<Event<AnEventType>>() {}, new FiresBinding());
+ Set<?> eventBeans = getCurrentManager().getBeans(new TypeLiteral<Event<AnEventType>>() {}, new AnyBinding());
assert eventBeans.size() == 1;
Bean<?> eventBean = (Bean<?>) eventBeans.iterator().next();
assert eventBean.getName() == null;
@@ -660,7 +660,7 @@
{
// Retrieve the implicit event bean from the manager only
// by its API type (uses BlueFacedParrotFinch)
- Set<?> eventBeans = getCurrentManager().getBeans(new TypeLiteral<Event<AnEventType>>() {}, new FiresBinding());
+ Set<?> eventBeans = getCurrentManager().getBeans(new TypeLiteral<Event<AnEventType>>() {}, new AnyBinding());
assert eventBeans.size() == 1;
}
}.run();
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/FiresBinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/FiresBinding.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/FiresBinding.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -1,9 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-import javax.enterprise.inject.AnnotationLiteral;
-import javax.event.Fires;
-
-public class FiresBinding extends AnnotationLiteral<Fires> implements Fires
-{
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/OrangeCheekedWaxbill.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/OrangeCheekedWaxbill.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/OrangeCheekedWaxbill.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -1,12 +1,12 @@
package org.jboss.jsr299.tck.tests.event;
import javax.event.Event;
-import javax.event.Fires;
+import javax.enterprise.inject.Any;
class OrangeCheekedWaxbill
{
- @Fires @Role("Admin") @Tame
+ @Any @Role("Admin") @Tame
protected Event<String> simpleEvent;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/OwlFinch_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/OwlFinch_Broken.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/OwlFinch_Broken.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -1,13 +1,13 @@
package org.jboss.jsr299.tck.tests.event;
import javax.event.Event;
-import javax.event.Fires;
+import javax.enterprise.inject.Any;
import javax.event.Observer;
class OwlFinch_Broken
{
- @Fires
+ @Any
private Event<String> simpleEvent;
public void methodThatFiresEvent()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SweeWaxbill.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SweeWaxbill.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SweeWaxbill.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -1,13 +1,13 @@
package org.jboss.jsr299.tck.tests.event;
import javax.event.Event;
-import javax.event.Fires;
+import javax.enterprise.inject.Any;
import javax.event.Observer;
class SweeWaxbill
{
- @Fires @Role("Admin")
+ @Any @Role("Admin")
private Event<String> simpleEvent;
public void methodThatFiresEvent()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event1/CommonWaxbill_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event1/CommonWaxbill_Broken.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event1/CommonWaxbill_Broken.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -2,10 +2,10 @@
import java.util.ArrayList;
-import javax.event.Fires;
+import javax.enterprise.inject.Any;
class CommonWaxbill_Broken
{
- @Fires
+ @Any
protected ArrayList<String> simpleEvent;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event1/FiresOnNonEventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event1/FiresOnNonEventTest.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event1/FiresOnNonEventTest.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -26,7 +26,7 @@
import org.testng.annotations.Test;
/**
- * Tests the use of @Fires on an injection point that is
+ * Tests the use of @Any on an injection point that is
* not an Event type.
*
* @author David Allen
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event2/BlackRumpedWaxbill_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event2/BlackRumpedWaxbill_Broken.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event2/BlackRumpedWaxbill_Broken.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -1,12 +1,12 @@
package org.jboss.jsr299.tck.tests.event.broken.event2;
import javax.event.Event;
-import javax.event.Fires;
+import javax.enterprise.inject.Any;
class BlackRumpedWaxbill_Broken
{
@SuppressWarnings("unchecked")
- @Fires
+ @Any
private Event simpleEvent;
public void eliminateWarning()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event2/FiresOnEventWithoutTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event2/FiresOnEventWithoutTypeTest.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event2/FiresOnEventWithoutTypeTest.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -27,7 +27,7 @@
/**
* Tests if the Event object on an injection point annotated
- * @Fires has a type parameter for the actual type of event.
+ * @Any has a type parameter for the actual type of event.
*
* @author David Allen
*
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event3/GoldbreastWaxbill_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event3/GoldbreastWaxbill_Broken.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event3/GoldbreastWaxbill_Broken.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -1,11 +1,11 @@
package org.jboss.jsr299.tck.tests.event.broken.event3;
import javax.event.Event;
-import javax.event.Fires;
+import javax.enterprise.inject.Any;
class GoldbreastWaxbill_Broken
{
- @Fires
+ @Any
private Event<?> simpleEvent;
public void eliminateWarning()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event4/FiresOnEventWithTypeVariableTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event4/FiresOnEventWithTypeVariableTest.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event4/FiresOnEventWithTypeVariableTest.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -27,7 +27,7 @@
/**
* Tests an Event templated with a type variable and annotated
- * with @Fires fails.
+ * with @Any fails.
*
* @author David Allen
*
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event4/JavaSparrow_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event4/JavaSparrow_Broken.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event4/JavaSparrow_Broken.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -2,13 +2,13 @@
import javax.enterprise.inject.Produces;
import javax.event.Event;
-import javax.event.Fires;
+import javax.enterprise.inject.Any;
class JavaSparrow_Broken
{
@Produces
- public <T> void produce(@Fires Event<T> event)
+ public <T> void produce(@Any Event<T> event)
{
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/AuroraFinch.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/AuroraFinch.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/AuroraFinch.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -2,7 +2,7 @@
import javax.enterprise.inject.Initializer;
import javax.event.Event;
-import javax.event.Fires;
+import javax.enterprise.inject.Any;
import org.jboss.jsr299.tck.tests.event.register.fires1.StarFinch.Mess;
@@ -13,7 +13,7 @@
private Mess someMess;
@Initializer
- public AuroraFinch(@Fires Event<Mess> eventObject)
+ public AuroraFinch(@Any Event<Mess> eventObject)
{
// Create a new mess and fire the event for it
someMess = new Mess("smallMess");
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/BlueFacedParrotFinch.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/BlueFacedParrotFinch.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/BlueFacedParrotFinch.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -1,15 +1,15 @@
package org.jboss.jsr299.tck.tests.event.register.fires1;
import javax.event.Event;
-import javax.event.Fires;
+import javax.enterprise.inject.Any;
import javax.event.Observer;
class BlueFacedParrotFinch
{
- @Fires
+ @Any
protected Event<Integer> simpleEvent;
- @Fires @Tame
+ @Any @Tame
protected Event<String> simpleStringEvent;
public static boolean simpleStringEventObserved = false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/ImplicitEventBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/ImplicitEventBeanTest.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/ImplicitEventBeanTest.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -29,7 +29,7 @@
import org.testng.annotations.Test;
/**
- * Tests proper functioning of the implicit event bean injected when @Fires is
+ * Tests proper functioning of the implicit event bean injected when @Any is
* used on an Event<T> type.
*
* @author David Allen
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/OrangeCheekedWaxbill.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/OrangeCheekedWaxbill.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/OrangeCheekedWaxbill.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -2,7 +2,7 @@
import javax.enterprise.inject.Initializer;
import javax.event.Event;
-import javax.event.Fires;
+import javax.enterprise.inject.Any;
import org.jboss.jsr299.tck.tests.event.register.fires1.StarFinch.Mess;
@@ -17,7 +17,7 @@
}
@Initializer
- public void theInitializerMethod(@Fires @Tame Event<Mess> eventObject)
+ public void theInitializerMethod(@Any @Tame Event<Mess> eventObject)
{
// Create a new mess and fire the event for it
someMess = new Mess("tameMess");
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/StarFinch.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/StarFinch.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/StarFinch.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -3,7 +3,7 @@
import javax.enterprise.inject.Named;
import javax.enterprise.inject.Produces;
import javax.event.Event;
-import javax.event.Fires;
+import javax.enterprise.inject.Any;
@Named("StarFinch")
public class StarFinch
@@ -21,7 +21,7 @@
}
@Produces @AnotherDeploymentType
- public Mess producerOfMesses(@Fires Event<Mess> messEvent)
+ public Mess producerOfMesses(@Any Event<Mess> messEvent)
{
Mess newMess = new Mess("bigMess");
messEvent.fire(newMess);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java 2009-06-01 09:35:12 UTC (rev 2738)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java 2009-06-01 09:37:06 UTC (rev 2739)
@@ -1,11 +1,11 @@
package org.jboss.jsr299.tck.tests.lookup.manager;
import javax.enterprise.context.Dependent;
+import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.Current;
import javax.enterprise.inject.deployment.Standard;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
@@ -66,7 +66,7 @@
public void testManagerBeanHasCurrentBinding()
{
Bean<BeanManager> beanManager = getCurrentManager().getBeans(BeanManager.class).iterator().next();
- assert beanManager.getBindings().iterator().next() instanceof Current;
+ assert beanManager.getBindings().contains(new AnnotationLiteral<Current>(){});
}
@Test
15 years, 7 months
[webbeans-commits] Webbeans SVN: r2738 - in ri/trunk: impl/src/main/java/org/jboss/webbeans and 6 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-06-01 05:35:12 -0400 (Mon, 01 Jun 2009)
New Revision: 2738
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/literal/AnyLiteral.java
Removed:
ri/trunk/api/src/main/java/javax/event/Fires.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/literal/FiresLiteral.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/SimpleEventTest.java
Log:
Removed @Fires annotation and added/implemented use of @Any
Deleted: ri/trunk/api/src/main/java/javax/event/Fires.java
===================================================================
--- ri/trunk/api/src/main/java/javax/event/Fires.java 2009-06-01 09:15:59 UTC (rev 2737)
+++ ri/trunk/api/src/main/java/javax/event/Fires.java 2009-06-01 09:35:12 UTC (rev 2738)
@@ -1,45 +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 javax.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.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.enterprise.inject.BindingType;
-
-/**
- * Annotates a variable to be injected with an Event object that can be fired and
- * observed by observer methods
- *
- * @author David Allen
- * @author Gavin King
- */
-
-@BindingType
-@Retention(RUNTIME)
-@Target( { TYPE, METHOD, FIELD, PARAMETER })
-@Documented
-public @interface Fires
-{
-}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-06-01 09:15:59 UTC (rev 2737)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-06-01 09:35:12 UTC (rev 2738)
@@ -35,7 +35,7 @@
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
import javax.event.Event;
-import javax.event.Fires;
+import javax.enterprise.inject.Any;
import javax.inject.DefinitionException;
import javax.inject.InconsistentSpecializationException;
import javax.inject.NullableDependencyException;
@@ -103,7 +103,7 @@
}
}
checkFacadeInjectionPoint(injectionPoint, Obtains.class, Instance.class);
- checkFacadeInjectionPoint(injectionPoint, Fires.class, Event.class);
+ checkFacadeInjectionPoint(injectionPoint, Any.class, Event.class);
Annotation[] bindings = injectionPoint.getBindings().toArray(new Annotation[0]);
AnnotatedItem<?, ?> annotatedItem = ResolvableAnnotatedClass.of(injectionPoint.getType(), bindings);
Set<?> resolvedBeans = manager.resolveByType(annotatedItem, injectionPoint, bindings);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-06-01 09:15:59 UTC (rev 2737)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-06-01 09:35:12 UTC (rev 2738)
@@ -60,8 +60,6 @@
import javax.inject.DeploymentException;
import javax.inject.DuplicateBindingTypeException;
-import org.jboss.webbeans.bean.AbstractDecorator;
-import org.jboss.webbeans.bean.AbstractInterceptor;
import org.jboss.webbeans.bean.DisposalMethodBean;
import org.jboss.webbeans.bean.EnterpriseBean;
import org.jboss.webbeans.bean.NewEnterpriseBean;
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-06-01 09:15:59 UTC (rev 2737)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-06-01 09:35:12 UTC (rev 2738)
@@ -42,6 +42,7 @@
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.introspector.AnnotatedParameter;
+import org.jboss.webbeans.literal.AnyLiteral;
import org.jboss.webbeans.literal.CurrentLiteral;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -60,6 +61,8 @@
public abstract class AbstractBean<T, E> extends RIBean<T>
{
+ private static final Annotation ANY_BINDING = new AnyLiteral();
+
@SuppressWarnings("unchecked")
private static Set<Class<?>> STANDARD_WEB_BEAN_CLASSES = new HashSet<Class<?>>(Arrays.asList(Event.class, ManagerImpl.class, ConversationImpl.class));
@@ -176,6 +179,7 @@
{
this.bindings = new HashSet<Annotation>();
this.bindings.addAll(getAnnotatedItem().getMetaAnnotations(BindingType.class));
+ initDefaultBindings();
}
protected void initDefaultBindings()
@@ -184,9 +188,14 @@
{
log.trace("Adding default @Current binding type");
this.bindings.add(new CurrentLiteral());
+ this.bindings.add(ANY_BINDING);
}
else
{
+ if (!bindings.contains(ANY_BINDING))
+ {
+ bindings.add(ANY_BINDING);
+ }
if (log.isTraceEnabled())
log.trace("Using binding types " + bindings + " specified by annotations");
}
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-06-01 09:15:59 UTC (rev 2737)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-06-01 09:35:12 UTC (rev 2738)
@@ -48,6 +48,13 @@
public class DisposalMethodBean<T> extends AbstractBean<T, Method>
{
+ private static final LogProvider log = Logging.getLogProvider(AbstractProducerBean.class);
+ protected AbstractClassBean<?> declaringBean;
+ private DisposalMethodBean<?> specializedBean;
+ protected MethodInjectionPoint<T> disposalMethodInjectionPoint;
+ protected Set<AnnotatedInjectionPoint<?, ?>> disposalInjectionPoints;
+ private final String id;
+
protected DisposalMethodBean(ManagerImpl manager, AnnotatedMethod<T> disposalMethod, AbstractClassBean<?> declaringBean)
{
super(manager);
@@ -55,19 +62,12 @@
this.declaringBean = declaringBean;
checkDisposalMethod();
initInjectionPoints();
+ initBindings();
initType();
initTypes();
this.id = createId("DisposalMethod-" + declaringBean.getName() + "-" + disposalMethod.getSignature().toString());
}
-
- private static final LogProvider log = Logging.getLogProvider(AbstractProducerBean.class);
- protected AbstractClassBean<?> declaringBean;
- private DisposalMethodBean<?> specializedBean;
- protected MethodInjectionPoint<T> disposalMethodInjectionPoint;
- protected Set<AnnotatedInjectionPoint<?, ?>> disposalInjectionPoints;
- private final String id;
-
@SuppressWarnings("unchecked")
protected void initType()
@@ -107,10 +107,12 @@
}
@Override
- public Set<Annotation> getBindings()
+ protected void initBindings()
{
// At least 1 parameter exists, already checked in constructor
- return disposalMethodInjectionPoint.getParameters().get(0).getBindings();
+ this.bindings = new HashSet<Annotation>();
+ this.bindings.addAll(disposalMethodInjectionPoint.getParameters().get(0).getBindings());
+ initDefaultBindings();
}
@Override
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-06-01 09:15:59 UTC (rev 2737)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java 2009-06-01 09:35:12 UTC (rev 2738)
@@ -29,12 +29,13 @@
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
+import org.jboss.webbeans.literal.AnyLiteral;
import org.jboss.webbeans.literal.CurrentLiteral;
public abstract class AbstractStandardBean<T> extends RIBean<T>
{
- private static final Annotation[] DEFAULT_BINDING_ARRAY = { new CurrentLiteral() };
+ private static final Annotation[] DEFAULT_BINDING_ARRAY = { new CurrentLiteral(), new AnyLiteral() };
private static final Set<Annotation> DEFAULT_BINDING = new HashSet<Annotation>(Arrays.asList(DEFAULT_BINDING_ARRAY));
private final String id;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java 2009-06-01 09:15:59 UTC (rev 2737)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java 2009-06-01 09:35:12 UTC (rev 2738)
@@ -24,22 +24,22 @@
import javax.enterprise.inject.TypeLiteral;
import javax.event.Event;
-import javax.event.Fires;
+import javax.enterprise.inject.Any;
import javax.inject.Obtains;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.event.EventImpl;
import org.jboss.webbeans.injection.resolution.AnnotatedItemTransformer;
-import org.jboss.webbeans.literal.FiresLiteral;
+import org.jboss.webbeans.literal.AnyLiteral;
public class EventBean extends AbstractFacadeBean<Event<?>>
{
- private static final Class<Event<?>> TYPE = new TypeLiteral<Event<?>>() {}.getRawType();
- private static final Set<Type> DEFAULT_TYPES = new HashSet<Type>(Arrays.asList(TYPE, Object.class));
- private static final Fires FIRES = new FiresLiteral();
- private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>(Arrays.asList(FIRES));
- public static final AnnotatedItemTransformer TRANSFORMER = new FacadeBeanAnnotatedItemTransformer(Event.class, FIRES);
+ private static final Class<Event<?>> TYPE = new TypeLiteral<Event<?>>(){}.getRawType();
+ private static final Set<Type> DEFAULT_TYPES = new HashSet<Type>(Arrays.asList(TYPE, Object.class));
+ private static final Annotation ANY = new AnyLiteral();
+ private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>(Arrays.asList(ANY));
+ public static final AnnotatedItemTransformer TRANSFORMER = new FacadeBeanAnnotatedItemTransformer(Event.class, ANY);
private static final Set<Class<? extends Annotation>> FILTERED_ANNOTATION_TYPES = new HashSet<Class<? extends Annotation>>(Arrays.asList(Obtains.class));
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-06-01 09:15:59 UTC (rev 2737)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-06-01 09:35:12 UTC (rev 2738)
@@ -26,7 +26,7 @@
import org.jboss.webbeans.FacadeImpl;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.literal.FiresLiteral;
+import org.jboss.webbeans.literal.AnyLiteral;
import org.jboss.webbeans.util.Strings;
/**
@@ -58,7 +58,7 @@
public EventImpl(Type eventType, ManagerImpl manager, Set<Annotation> bindings)
{
super(eventType, manager, bindings);
- this.bindings.remove(new FiresLiteral());
+ this.bindings.remove(new AnyLiteral());
}
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2009-06-01 09:15:59 UTC (rev 2737)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2009-06-01 09:35:12 UTC (rev 2738)
@@ -30,7 +30,7 @@
import javax.event.AfterTransactionSuccess;
import javax.event.Asynchronously;
import javax.event.BeforeTransactionCompletion;
-import javax.event.Fires;
+import javax.enterprise.inject.Any;
import javax.event.IfExists;
import javax.event.Observes;
@@ -44,7 +44,7 @@
public interface AnnotatedMethod<T> extends AnnotatedMember<T, Method>
{
@SuppressWarnings("unchecked")
- public static final Set<Class<? extends Annotation>> MAPPED_PARAMETER_ANNOTATIONS = new HashSet<Class<? extends Annotation>>(Arrays.asList(Disposes.class, Observes.class, Fires.class, IfExists.class, BeforeTransactionCompletion.class, AfterTransactionCompletion.class, AfterTransactionFailure.class, AfterTransactionSuccess.class, Asynchronously.class));
+ public static final Set<Class<? extends Annotation>> MAPPED_PARAMETER_ANNOTATIONS = new HashSet<Class<? extends Annotation>>(Arrays.asList(Disposes.class, Observes.class, IfExists.class, BeforeTransactionCompletion.class, AfterTransactionCompletion.class, AfterTransactionFailure.class, AfterTransactionSuccess.class, Asynchronously.class));
/**
* Gets the abstracted parameters of the method
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/literal/AnyLiteral.java (from rev 2719, ri/trunk/impl/src/main/java/org/jboss/webbeans/literal/FiresLiteral.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/literal/AnyLiteral.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/literal/AnyLiteral.java 2009-06-01 09:35:12 UTC (rev 2738)
@@ -0,0 +1,25 @@
+/*
+ * 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.literal;
+
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.Any;
+
+public class AnyLiteral extends AnnotationLiteral<Any> implements Any
+{
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/literal/AnyLiteral.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/literal/FiresLiteral.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/literal/FiresLiteral.java 2009-06-01 09:15:59 UTC (rev 2737)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/literal/FiresLiteral.java 2009-06-01 09:35:12 UTC (rev 2738)
@@ -1,25 +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.literal;
-
-import javax.enterprise.inject.AnnotationLiteral;
-import javax.event.Fires;
-
-public class FiresLiteral extends AnnotationLiteral<Fires> implements Fires
-{
-
-}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/SimpleEventTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/SimpleEventTest.java 2009-06-01 09:15:59 UTC (rev 2737)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/SimpleEventTest.java 2009-06-01 09:35:12 UTC (rev 2738)
@@ -1,8 +1,8 @@
package org.jboss.webbeans.test.unit.implementation.event;
import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.Any;
import javax.event.Event;
-import javax.event.Fires;
import javax.event.Observes;
import org.jboss.testharness.impl.packaging.Artifact;
@@ -87,14 +87,13 @@
public static class App
{
- @Fires
+ @Any
Event<String> event1;
- @Fires
- @Updated
+ @Updated @Any
Event<String> event2;
- @Fires
+ @Any
Event<String> event3;
public void fireEventByAnnotationLiteral()
15 years, 7 months
[webbeans-commits] Webbeans SVN: r2737 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-06-01 05:15:59 -0400 (Mon, 01 Jun 2009)
New Revision: 2737
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
section 4 assertions updated
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-01 07:26:53 UTC (rev 2736)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-01 09:15:59 UTC (rev 2737)
@@ -1683,106 +1683,105 @@
</assertion>
</section>
- <section id="4" title="Inheritance, specialization and realization">
+ <section id="4" title="Inheritance and specialization">
</section>
- <section id="4.1" title="Inheritance of type-level metadata">
-
+ <section id="4.1" title="Inheritance of type-level metadata">
<assertion id="aa">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
</assertion>
<assertion id="ab">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
</assertion>
<assertion id="ad">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
</assertion>
<assertion id="ae">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
</assertion>
<assertion id="ag">
- <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
</assertion>
<assertion id="ah">
- <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
</assertion>
<assertion id="aj">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
</assertion>
<assertion id="ak">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
</assertion>
<assertion id="ba">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare a scope type.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare a scope type.</text>
</assertion>
<assertion id="bb">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare a scope type.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare a scope type.</text>
</assertion>
<assertion id="bc">
- <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a scope type.</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a scope type.</text>
</assertion>
<assertion id="bd">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a scope type.</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a scope type.</text>
</assertion>
<assertion id="ca">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X is annotated with a _deployment type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare a deployment type.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X is annotated with a _deployment type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare a deployment type.</text>
</assertion>
<assertion id="cb">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _deployment type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare a deployment type.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X is annotated with a _deployment type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare a deployment type.</text>
</assertion>
<assertion id="cc">
- <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if X is annotated with a _deployment type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a deployment type.</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X is annotated with a _deployment type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a deployment type.</text>
</assertion>
<assertion id="cd">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X is annotated with a _deployment type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a deployment type.</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X is annotated with a _deployment type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a deployment type.</text>
</assertion>
<assertion id="daa">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, the _scope types_ explicitly declared by and inherited from the class X take precedence over default _scopes_ declared by stereotypes.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, the _scope types_ explicitly declared by and inherited from the class X take precedence over default _scopes_ declared by stereotypes.</text>
</assertion>
<assertion id="dab">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, the _deployment types_ explicitly declared by and inherited from the class X take precedence over deployment _deployment types_ declared by stereotypes.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, the _deployment types_ explicitly declared by and inherited from the class X take precedence over deployment _deployment types_ declared by stereotypes.</text>
</assertion>
<assertion id="dba">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, the _scope types_ explicitly declared by and inherited from the class X take precedence over default _scopes_ declared by stereotypes.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, the _scope types_ explicitly declared by and inherited from the class X take precedence over default _scopes_ declared by stereotypes.</text>
</assertion>
<assertion id="dbb">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, the _deployment types_ explicitly declared by and inherited from the class X take precedence over default _deployment types_ declared by stereotypes.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, the _deployment types_ explicitly declared by and inherited from the class X take precedence over default _deployment types_ declared by stereotypes.</text>
</assertion>
<assertion id="dca">
- <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, the _scope types_ explicitly declared by and inherited from the class X take precedence over default _scopes_ declared by stereotypes.</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, the _scope types_ explicitly declared by and inherited from the class X take precedence over default _scopes_ declared by stereotypes.</text>
</assertion>
<assertion id="dcb">
- <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, the _deployment types_ explicitly declared by and inherited from the class X take precedence over default _deployment_ types declared by stereotypes.</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, the _deployment types_ explicitly declared by and inherited from the class X take precedence over default _deployment_ types declared by stereotypes.</text>
</assertion>
<assertion id="dda">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, the _scope types_ explicitly declared by and inherited from the class X take precedence over default _scopes_ declared by stereotypes.</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, the _scope types_ explicitly declared by and inherited from the class X take precedence over default _scopes_ declared by stereotypes.</text>
</assertion>
<assertion id="ddb">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, the _deployment types_ explicitly declared by and inherited from the class X take precedence over _deployment types_ declared by stereotypes.</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, the _deployment types_ explicitly declared by and inherited from the class X take precedence over _deployment types_ declared by stereotypes.</text>
</assertion>
<assertion id="i" testable="false">
@@ -1806,7 +1805,7 @@
</assertion>
<assertion id="m" testable="false">
- <text>the |@Named| annotation is not declared |@Inherited| and bean names are not inherited unless specialization is used</text>
+ <text>The |@Named| annotation is not declared |@Inherited| and bean EL names are not inherited unless specialization is used</text>
<note>sigtest</note>
</assertion>
@@ -1815,15 +1814,15 @@
<section id="4.2" title="Inheritance of member-level metadata">
<assertion id="aa">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X declares an injected field x then Y inherits x.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares an injected field x then Y inherits x.</text>
</assertion>
<assertion id="ab">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares an injected field x then Y inherits x.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares an injected field x then Y inherits x.</text>
</assertion>
<assertion id="ac">
- <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if X declares an injected field x then Y inherits x.</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares an injected field x then Y inherits x.</text>
</assertion>
<assertion id="ad">
@@ -1831,15 +1830,15 @@
</assertion>
<assertion id="baa">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
</assertion>
<assertion id="bab">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
</assertion>
<assertion id="bac">
- <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
</assertion>
<assertion id="bad">
@@ -1847,7 +1846,7 @@
</assertion>
<assertion id="bba">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X declares a _|@PreDestroy|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _|@PreDestroy|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
</assertion>
<assertion id="bbb">
@@ -1855,7 +1854,7 @@
</assertion>
<assertion id="bbc">
- <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if X declares a _|@PreDestroy|_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _|@PreDestroy|_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
</assertion>
<assertion id="bbd">
@@ -1863,67 +1862,67 @@
</assertion>
<assertion id="da">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize or realize X</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
</assertion>
<assertion id="db">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize or realize X</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
</assertion>
<assertion id="dc">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize or realize X</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
</assertion>
<assertion id="dd">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize or realize X</text>
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
</assertion>
<assertion id="de">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize or realize X</text>
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
</assertion>
<assertion id="df">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize or realize X</text>
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
</assertion>
<assertion id="dg">
- <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize or realize X</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
</assertion>
<assertion id="dh">
- <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize or realize X</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
</assertion>
<assertion id="di">
- <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize or realize X</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
</assertion>
<assertion id="dj">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize or realize X</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
</assertion>
<assertion id="dk">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize or realize X</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
</assertion>
<assertion id="dl">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize or realize X</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
</assertion>
<assertion id="ea">
- <text>For class X which is extended _directly_ by the bean class of a _simple_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit this field unless Y is explicitly declared to specialize or realize X.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit this field unless Y is explicitly declared to specialize X.</text>
</assertion>
<assertion id="eb">
- <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit this field unless Y is explicitly declared to specialize or realize X.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit this field unless Y is explicitly declared to specialize X.</text>
</assertion>
<assertion id="ec">
- <text>For class X which is extended _indirectly_ by the bean class of a _simple_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit this field unless Y is explicitly declared to specialize or realize X.</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit this field unless Y is explicitly declared to specialize X.</text>
</assertion>
<assertion id="ed">
- <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit this field unless Y is explicitly declared to specialize or realize X.</text>
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit this field unless Y is explicitly declared to specialize X.</text>
</assertion>
</section>
@@ -1938,114 +1937,50 @@
<text>If the bean with the lower priority deployment type declares a binding that is not declared by the bean with the higher priority deployment type, then the bean with the higher priority deployment type will not be eligible for injection to an injection point with that binding.</text>
</assertion>
- <assertion id="c">
- <text>The only way one bean can completely override a lower-priority bean at all injection points is if it implements all the bean types and declares all the bindings of the lower-priority bean. However, if the lower-priority bean declares a producer method, then even this is not enough to ensure that the lower-priority bean is never called</text>
+ <assertion id="ca">
+ <text>The only way one bean can completely override a lower-priority bean at all injection points is if it implements all the bean types and declares all the bindings of the lower-priority bean. However, if the lower-priority bean declares a producer method or observer method, then even this is not enough to ensure that the lower-priority bean is never called.</text>
</assertion>
</section>
- <section id="4.3.1" title="Using specialization">
-
- <assertion id="a">
- <text>A bean declared using annotations may declare that it specializes a lower-priority bean using the |@Specializes| annotation</text>
+ <section id="4.3.1" title="Direct and indirect specialization">
+ <assertion id="i">
+ <text>A bean X is said to specialize another bean Y if X directly specializes Y.</text>
</assertion>
- <assertion id="c">
- <text>The bindings of a bean X that specializes a lower-priority bean Y include all bindings of Y, together with all bindings declared explicitly by X.</text>
+ <assertion id="i">
+ <text>A bean X is said to specialize another bean Y if a bean Z exists, such that X directly specializes Z and Z specializes Y.</text>
</assertion>
- <assertion id="d">
- <text>If a bean X specializes a lower-priority bean Y with a name, the name of X is the same as the name of Y.</text>
+ <assertion id="j">
+ <text>A bean X that specializes bean Y will include all bindings of Y, together with all bindings declared explicitly by X.</text>
</assertion>
- <assertion id="e">
- <text>If a bean X specializes a lower-priority bean Y with a name, and X declares a name explicitly, a |DefinitionException| is thrown by the container at deployment time</text>
+ <assertion id="k">
+ <text>A bean X that specializes bean Y will have the same name as Y if Y has a name.</text>
</assertion>
- <assertion id="f">
- <text>When an enabled bean specializes a lower-priority bean, we can be certain that the lower-priority bean is never instantiated or called by the container.</text>
+ <assertion id="l">
+ <text>If X declares a name explicitly, using @Named, 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>
- <assertion id="g">
- <text>Even if the lower-priority bean defines a producer method, the method will be called upon an instance of the specializing bean</text>
- </assertion>
-
- <assertion id="h" testable="false">
- <text>Specialization applies only to simple beans, as defined in Section 3.2.7, "Specializing a simple bean", session beans, as defined in Section 3.3.7, "Specializing a session bean" and producer methods, as defined in Section 3.4.5, "Specializing a producer method".</text>
- <note>This is a statement of intent</note>
- </assertion>
</section>
- <section id="4.3.2" title="Direct and indirect specialization">
- <assertion id="a" testable="false">
- <text>The |(a)javax.inject.Specializes| annotation ~or |<Specializes>| XML element~ is used to indicate that one bean directly specializes another bean</text>
- <note>A statement of intent</note>
+ <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.4.6, "Invocation of producer or disposal methods", Section 5.4.7, "Access to producer field values" and Section 5.4.8, "Invocation of observer methods".</text>
</assertion>
- <assertion id="b" testable="false">
- <text>A bean X is said to specialize another bean Y if X directly specializes Y, or a bean Z exists, such that X directly specializes Z and Z specializes Y</text>
- <note>A definition</note>
- </assertion>
-
- <assertion id="c">
- <text>Any non-static producer methods (see Section 3.4, "Producer methods") of any bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 6.7, "Lifecycle of producer methods".</text>
- </assertion>
-
- <assertion id="d">
- <text>Any non-static producer fields (see Section 3.5, "Producer fields") of any bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 6.8, "Lifecycle of producer fields".</text>
- </assertion>
-
- <assertion id="e">
- <text>Any non-static disposal methods (see Section 3.4.6, "Disposal methods") of any bean are invoked upon an instance of the most specialized enabled bean that specializes the bean.</text>
- </assertion>
-
- <assertion id="f">
- <text>Any non-static observer methods (see Section 7.5, "Observer methods") of any bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 7.4, "Observer notification".</text>
- </assertion>
</section>
-
+
<section id="4.3.3" title="Inconsistent specialization">
- <assertion id="a">
- <text>If, in a particular deployment, either some enabled bean X specializes another enabled bean Y and X does not have a higher precedence than Y, or more than one enabled bean directly specializes the same bean we say that inconsistent specialization exists, and an |InconsistentSpecializationException| is thrown by the container at deployment time</text>
+ <assertion id="aa">
+ <text>If, in a particular deployment, either some enabled bean X specializes another enabled bean Y and the deployment type of X does not have a higher precedence than the deployment type of Y, the container automatically detects inconsistent specialization and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
</assertion>
- </section>
-
- <section id="4.4" title="Realization">
- <assertion id="a" testable="false">
- <text>Any bean that extends a generic class may directly extend the generic class, in the case of a bean declared using annotations and then explicitly declare that it realizes the generic class</text>
- <note>A statement of intent</note>
- </assertion>
-
- </section>
-
- <section id="4.4.1" title="Using realization">
- <assertion id="a" testable="false">
- <text>A bean declared using annotations may declare that it realizes a generic class by annotating the bean class with the |(a)javax.inject.Realizes| annotation</text>
- <note>A statement of intent</note>
- </assertion>
- <assertion id="ca">
- <text>If a generic class Y declares a non-static _producer method_ with a certain combination of scope, stereotypes, bindings and interceptor bindings, then every bean X that realizes Y also has a _producer method_ with the same scope, stereotypes and interceptor bindings. The bindings for this inherited _producer method_ consist of all bindings declared by the _producer method_ of Y, excluding all bindings of Y, together with the bindings declared explicitly by X. The deployment type of the inherited _producer method_ is the deployment type of X</text>
- </assertion>
-
- <assertion id="cb">
- <text>If a generic class Y declares a non-static _producer field_ with a certain combination of scope, stereotypes, bindings and interceptor bindings, then every bean X that realizes Y also has a _producer field_ with the same scope, stereotypes and interceptor bindings. The bindings for this inherited _producer field_ consist of all bindings declared by the _producer field_ of Y, excluding all bindings of Y, together with the bindings declared explicitly by X. The deployment type of the inherited _producer field_ is the deployment type of X</text>
- </assertion>
-
- <assertion id="d">
- <text>If a generic class Y declares a non-static disposal method with a disposed parameter with a certain combination of bindings, then every bean X that realizes Y also has a disposal method. The bindings of the disposed parameter of this
-inherited disposal method consist of all bindings declared by the disposed parameter of the disposal method of Y, excluding all bindings of Y, together with the bindings declared explicitly by X.</text>
- </assertion>
-
- <assertion id="e">
- <text>If a generic class Y declares a non-static observer method with an event parameter with a certain combination of event bindings, then every bean X that realizes Y also has an observer method. The event bindings of the event parameter of
-this inherited observer method consist of all event bindings declared by the event parameter of the observer method of Y.</text>
- </assertion>
-
- <assertion id="f" testable="false">
- <text>Realization applies only to simple beans and session beans</text>
- <note>A statement of intent</note>
- </assertion>
+ <assertion id="ba">
+ <text>If, in a particular deployment, more than one enabled bean directly specializes the same bean, the container automatically detects inconsistent specialization and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
</section>
<section id="5" title="Lookup, dependency injection and EL resolution">
15 years, 7 months