Weld SVN: r4331 - in api/trunk/cdi/src/main/java/javax: enterprise/inject and 1 other directory.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-10-26 13:06:29 -0400 (Mon, 26 Oct 2009)
New Revision: 4331
Modified:
api/trunk/cdi/src/main/java/javax/decorator/package-info.java
api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java
Log:
improve interceptors/decorators
Modified: api/trunk/cdi/src/main/java/javax/decorator/package-info.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/decorator/package-info.java 2009-10-26 16:34:48 UTC (rev 4330)
+++ api/trunk/cdi/src/main/java/javax/decorator/package-info.java 2009-10-26 17:06:29 UTC (rev 4331)
@@ -38,10 +38,7 @@
*
* <p>All decorators have a
* {@linkplain javax.decorator.Decorates delegate injection point}.
- * The decorator applies to any bean that is eligible for injection
- * to the delegate injection point.</p>
- *
- * <p>A delegate injection point is an injection point of the bean
+ * A delegate injection point is an injection point of the bean
* class annotated {@link javax.decorator.Decorates @Decorates}.</p>
*
* <p>The type of the delegate injection point must implement or
@@ -58,6 +55,15 @@
* ordering. Decorators which occur earlier in the list are called
* first.</p>
*
+ * <p>A decorator is bound to a bean if:</p>
+ *
+ * <ul>
+ * <li>The bean is {@linkplain javax.enterprise.inject eligible for injection}
+ * to the delegate injection point of the decorator.</li>
+ * <li>The decorator is enabled in the bean deployment archive of
+ * the bean.</li>
+ * </ul>
+ *
* @see javax.decorator.Decorator
* @see javax.decorator.Decorates
*
Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java 2009-10-26 16:34:48 UTC (rev 4330)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java 2009-10-26 17:06:29 UTC (rev 4331)
@@ -141,10 +141,19 @@
*
* <h3>Interceptor bindings</h3>
*
- * <p>Interceptor bindings may be used to associate interceptors with any
- * managed bean that is not itself an interceptor or decorator or with any
- * EJB session or message-driven bean.</p>
+ * <p>{@linkplain javax.interceptor Interceptors} may be bound to any managed
+ * bean that is not itself an interceptor or decorator or to any EJB session
+ * or message-driven bean. An interceptor that is annotated
+ * {@link javax.interceptor.Interceptor @Interceptor} may be identified
+ * by its interceptor bindings.</p>
*
+ * <pre>
+ * @Transactional @Interceptor
+ * public class TransactionInterceptor {
+ * @AroundInvoke public Object manageTransaction(InvocationContext ctx) { ... }
+ * }
+ * </pre>
+ *
* <p>An interceptor binding type is a Java annotation annotated
* {@link javax.interceptor.InterceptorBinding @InterceptorBinding}.
* An interceptor binding of a bean may be declared by annotating the bean
@@ -363,11 +372,29 @@
* <p>If an EL name resolves to more than one bean, the container attempts to resolve
* the ambiguity by eliminating all beans which are not alternatives.</p>
*
+ * <h3>Enabled interceptors</h3>
+ *
+ * <p>By default, a bean deployment archive has no enabled interceptors. An
+ * interceptor must be explicitly enabled by listing its bean class under the
+ * <tt><interceptors></tt> element of the <tt>beans.xml</tt> file of the
+ * bean deployment archive. The order of the interceptor declarations determines
+ * the interceptor ordering. Interceptors which occur earlier in the list are
+ * called first.</p>
+ *
+ * <p>An interceptor is bound to a bean if:</p>
+ *
+ * <ul>
+ * <li>The bean has all the interceptor bindings of the interceptor.</li>
+ * <li>The interceptor is enabled in the bean deployment archive of
+ * the bean.</li>
+ * </ul>
+ *
* @see javax.enterprise.context
+ * @see javax.inject
+ * @see javax.interceptor
+ * @see javax.decorator
+ *
* @see javax.enterprise.inject.Produces
- * @see javax.inject.Named
- * @see javax.inject.Qualifier
- * @see javax.interceptor.InterceptorBinding
* @see javax.enterprise.inject.Alternative
*
*/
15 years, 1 month
Weld SVN: r4330 - api/trunk/cdi/src/main/java/javax/enterprise/inject.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-10-26 12:34:48 -0400 (Mon, 26 Oct 2009)
New Revision: 4330
Modified:
api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java
Log:
properly doc injection and name res
Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java 2009-10-26 16:33:53 UTC (rev 4329)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java 2009-10-26 16:34:48 UTC (rev 4330)
@@ -92,14 +92,10 @@
* }
* </pre>
*
- * <p>A bean may only be injected to an injection point if</p>
+ * <p>If a bean does not explicitly declare a qualifier other than
+ * {@link javax.inject.Named @Named}, the bean has the qualifier
+ * {@link javax.enterprise.inject.Default @Default}.</p>
*
- * <ul>
- * <li>the type of the injection point is one of the bean types of the
- * bean, and</li>
- * <li>the bean has all the qualifiers of the injection point.</li>
- * </ul>
- *
* <h3>Scope</h3>
*
* <p>All beans have a {@linkplain javax.enterprise.context scope}. The
@@ -121,6 +117,10 @@
* <p>A bean class or producer method or field may specify at most one
* scope type annotation.</p>
*
+ * <p>If the bean does not explicitly declare a scope or a stereotype
+ * with a default scope, the scope defaults to
+ * {@link javax.enterprise.context.Dependent @Dependent}.</p>
+ *
* <h3>Bean EL name</h3>
*
* <p>A bean may have a bean EL name. A bean with an EL name may be referred
@@ -300,10 +300,9 @@
*
* <p>Otherwise, the bean is said to be disabled.</p>
*
- * <h3>Eligible dependencies</h3>
+ * <h3>Dependency injection</h3>
*
- * <p>A bean is eligible for injection into a given class if it satisfies the
- * following conditions:</p>
+ * <p>A bean is eligible for injection into a given class if:</p>
*
* <ul>
* <li>The bean is enabled.</li>
@@ -315,8 +314,24 @@
* of the Java EE platform and Java Servlet specifications.</li>
* </ul>
*
- * <h3>Unproxyable bean types</h3>
+ * <p>A bean is eligible for injection into a given injection point if:</p>
*
+ * <ul>
+ * <li>The bean has a bean type that matches the type of the injection point. For
+ * this purpose, primitive types are considered to match their corresponding wrapper
+ * types in {@link java.lang} and array types are considered to match only if their
+ * element types are identical.</li>
+ * <li>The bean has all the qualifiers of the injection point. If the injection point
+ * does not explicitly declare a qualifier, it has the default qualifier
+ * {@link javax.enterprise.inject.Default @Default}.</li>
+ * <li>The bean is eligible for injection into the class that declares the injection
+ * point.</li>
+ * </ul>
+ *
+ * <p>If more than one bean is eligible for injection to the injection point, the
+ * container attempts to resolve the ambiguity by eliminating all beans which are
+ * not alternatives.</p>
+ *
* <p>Certain legal bean types cannot be proxied by the container:</p>
*
* <ul>
@@ -327,13 +342,33 @@
* </ul>
*
* <p>An injection point whose declared type cannot be proxied by the
- * container must not resolve to a bean with a normal scope.</p>
+ * container must not resolve to a bean with a
+ * {@linkplain javax.enterprise.context normal scope}.</p>
*
+ * <h3>EL name resolution</h3>
+ *
+ * <p>EL names are resolved when Unified EL expressions are evaluated. An EL name
+ * resolves to a bean if:</p>
+ *
+ * <ul>
+ * <li>The bean has the given EL name.</li>
+ * <li>The bean is enabled.</li>
+ * <li>The bean is either not an alternative, or is a selected alternative of the
+ * war containing the JSP or JSF page with the EL expression.</li>
+ * <li>The bean class is required to be accessible to classes in the war containing
+ * the JSP or JSF page with the EL expression, according to the class loading
+ * requirements of the Java EE platform and Java Servlet specifications.</li>
+ * </ul>
+ *
+ * <p>If an EL name resolves to more than one bean, the container attempts to resolve
+ * the ambiguity by eliminating all beans which are not alternatives.</p>
+ *
* @see javax.enterprise.context
* @see javax.enterprise.inject.Produces
* @see javax.inject.Named
* @see javax.inject.Qualifier
* @see javax.interceptor.InterceptorBinding
+ * @see javax.enterprise.inject.Alternative
*
*/
package javax.enterprise.inject;
\ No newline at end of file
15 years, 1 month
Weld SVN: r4329 - in api/trunk/cdi/src/main/java/javax/enterprise: inject and 1 other directory.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-10-26 12:33:53 -0400 (Mon, 26 Oct 2009)
New Revision: 4329
Modified:
api/trunk/cdi/src/main/java/javax/enterprise/event/Observes.java
api/trunk/cdi/src/main/java/javax/enterprise/inject/Disposes.java
api/trunk/cdi/src/main/java/javax/enterprise/inject/Produces.java
Log:
inheritance
Modified: api/trunk/cdi/src/main/java/javax/enterprise/event/Observes.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/event/Observes.java 2009-10-26 15:45:31 UTC (rev 4328)
+++ api/trunk/cdi/src/main/java/javax/enterprise/event/Observes.java 2009-10-26 16:33:53 UTC (rev 4329)
@@ -51,6 +51,8 @@
*
* <p>A bean may declare multiple observer methods.</p>
*
+ * <p>Observer methods are inherited by bean subclasses.</p>
+ *
* @author Gavin King
* @author Pete Muir
* @author David Allen
Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/Disposes.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/Disposes.java 2009-10-26 15:45:31 UTC (rev 4328)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/Disposes.java 2009-10-26 16:33:53 UTC (rev 4329)
@@ -69,6 +69,8 @@
* container must call it when destroying any instance
* returned by any of these producer methods.</p>
*
+ * <p>Disposer methods are not inherited by bean subclasses.</p>
+ *
* @see javax.enterprise.inject.Produces @Produces
*
* @author Gavin King
Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/Produces.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/Produces.java 2009-10-26 15:45:31 UTC (rev 4328)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/Produces.java 2009-10-26 16:33:53 UTC (rev 4329)
@@ -75,8 +75,10 @@
* a parameterized type with a type variable, it must have scope
* {@link javax.enterprise.context.Dependent @Dependent}.</p>
*
- * <p>A bean may declare multiple producer methods or fields.</p>
+ * <p>A bean may declare multiple producer methods or fields.</p>
*
+ * <p>Producer methods and fields are not inherited by bean subclasses.</p>
+ *
* <p>Interceptors and decorators may not declare producer methods
* or fields.</p>
*
15 years, 1 month
Weld SVN: r4328 - api/trunk/cdi/src/main/java/javax/enterprise/context.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-10-26 11:45:31 -0400 (Mon, 26 Oct 2009)
New Revision: 4328
Modified:
api/trunk/cdi/src/main/java/javax/enterprise/context/package-info.java
Log:
minor
Modified: api/trunk/cdi/src/main/java/javax/enterprise/context/package-info.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/context/package-info.java 2009-10-26 15:39:04 UTC (rev 4327)
+++ api/trunk/cdi/src/main/java/javax/enterprise/context/package-info.java 2009-10-26 15:45:31 UTC (rev 4328)
@@ -83,8 +83,8 @@
* reference for a bean are valid only for a certain period of time. The
* application should not invoke a method of an invalid reference.</p>
*
- * <p>The validity of a contextual reference depends upon whether the
- * scope of the injected bean is a normal scope or a pseudo-scope:</p>
+ * <p>The validity of a contextual reference for a bean depends upon
+ * whether the scope of the bean is a normal scope or a pseudo-scope:</p>
*
* <ul>
* <li>Any reference to a bean with a normal scope is valid as long as
15 years, 1 month
Weld SVN: r4327 - api/trunk/cdi/src/main/java/javax/enterprise/context.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-10-26 11:39:04 -0400 (Mon, 26 Oct 2009)
New Revision: 4327
Modified:
api/trunk/cdi/src/main/java/javax/enterprise/context/package-info.java
Log:
simplify
Modified: api/trunk/cdi/src/main/java/javax/enterprise/context/package-info.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/context/package-info.java 2009-10-26 14:15:55 UTC (rev 4326)
+++ api/trunk/cdi/src/main/java/javax/enterprise/context/package-info.java 2009-10-26 15:39:04 UTC (rev 4327)
@@ -45,42 +45,31 @@
* example, a third-party web application framework might provide a
* conversation context object for the built-in conversation scope.</p>
*
- * <p>For each of the built-in normal scopes, contexts propagate across
- * any Java method call, including invocation of EJB local business methods.
- * The built-in contexts do not propagate across remote method invocations
- * or to asynchronous processes such as JMS message listeners or EJB timer
- * service timeouts.</p>
+ * <p>The context associated with a built-in scope propagates across
+ * local, synchronous Java method calls, including invocation of EJB
+ * local business methods. The context does not propagate across remote
+ * method invocations or to asynchronous processes such as JMS message
+ * listeners or EJB timer service timeouts.</p>
*
* <h3>Normal scopes and pseudo-scopes</h3>
*
- * <p>Most scopes are <em>normal scopes</em>. The
- * {@linkplain javax.enterprise.context.spi.Context context object} for
- * a normal scope type is a mapping from each contextual type with that
- * scope to an instance of that contextual type. There may be no more than
- * one mapped instance per contextual type per thread. The set of all
- * mapped instances of contextual types with a certain scope for a
- * certain thread is called the <em>context</em> for that scope associated
- * with that thread.</p>
- *
- * <p>A context may be associated with one or more threads. A context
- * with a certain scope is said to <em>propagate</em> from one point in the
- * execution of the program to another when the set of mapped instances
- * of contextual types with that scope is preserved.</p>
- *
- * <p>The context associated with the current thread is called the
- * <em>current context</em> for the scope. The mapped instance of a
- * contextual type associated with a current context is called the
- * <em>current instance</em> of the contextual type.<p>
- *
- * <p>Any scope that is not a normal scope is called a <em>pseudo-scope</em>.
+ * <p>Most scopes are <em>normal scopes</em>. Normal scopes are declared
+ * using {@link javax.enterprise.context.NormalScope @NormalScope}.
+ * If a bean has a normal scope, every client executing in a certain
+ * thread sees the same contextual instance of the bean. This instance is
+ * called the <em>current instance</em> of the bean. The operation
+ * {@link javax.enterprise.context.spi.Context#get(Contextual)} of the
+ * context object for a normal scope type always returns the current
+ * instance of the given bean.</p>
+ *
+ * <p>Any scope that is not a normal scope is called a <em>pseudo-scope</em>.
+ * Pseudo-scopes are declared using {@link javax.inject.Scope @Scope}.
* The concept of a current instance is not well-defined in the case of
- * a pseudo-scope.</p>
+ * a pseudo-scope. Different clients executing in the same thread may
+ * see different instances of the bean. In the extreme case of the
+ * {@link javax.enterprise.context.Dependent @Dependent} pseudo-scope,
+ * every client has its own private instance of the bean.</p>
*
- * <p>All normal scopes must be explicitly declared
- * {@link javax.enterprise.context.NormalScope @NormalScope}. All
- * pseudo-scopes must be explicitly declared
- * {@link javax.inject.Scope @Scope}.</p>
- *
* <p>All built-in scopes are normal scopes, except for the
* {@link javax.enterprise.context.Dependent @Dependent} and
* {@link javax.inject.Singleton @Singleton} pseudo-scopes.</p>
15 years, 1 month
Weld SVN: r4326 - in api/trunk/cdi/src/main/java/javax/enterprise: inject and 1 other directory.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-10-26 10:15:55 -0400 (Mon, 26 Oct 2009)
New Revision: 4326
Modified:
api/trunk/cdi/src/main/java/javax/enterprise/context/package-info.java
api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java
Log:
links
Modified: api/trunk/cdi/src/main/java/javax/enterprise/context/package-info.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/context/package-info.java 2009-10-26 14:09:59 UTC (rev 4325)
+++ api/trunk/cdi/src/main/java/javax/enterprise/context/package-info.java 2009-10-26 14:15:55 UTC (rev 4326)
@@ -2,10 +2,12 @@
* <p>Annotations and interfaces relating to scopes and contexts.</p>
*
* <p>A scope type is a Java annotation annotated
- * {@link javax.inject.Scope @Scope}.</p>
+ * {@link javax.inject.Scope @Scope} or
+ * {@link javax.enterprise.context.NormalScope @NormalScope}.</p>
*
- * <p>Associated with every scope type is a context object. The
- * context object determines the lifecycle and visibility of
+ * <p>Associated with every scope type is a
+ * {@linkplain javax.enterprise.context.spi.Context context object}.
+ * The context object determines the lifecycle and visibility of
* instances of all {@linkplain javax.enterprise.inject beans} with
* that scope. In particular, the context object defines:</p>
*
Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java 2009-10-26 14:09:59 UTC (rev 4325)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java 2009-10-26 14:15:55 UTC (rev 4326)
@@ -107,7 +107,8 @@
* instances of the bean are visible to instances of other beans.</p>
*
* <p>A scope type is a Java annotation annotated
- * {@link javax.inject.Scope @Scope}.
+ * {@link javax.inject.Scope @Scope} or
+ * {@link javax.enterprise.context.NormalScope @NormalScope}.
* The scope of a bean is defined by annotating the bean class or producer
* method or field with a scope type or with a stereotype that declares a
* default scope.</p>
@@ -328,8 +329,8 @@
* <p>An injection point whose declared type cannot be proxied by the
* container must not resolve to a bean with a normal scope.</p>
*
+ * @see javax.enterprise.context
* @see javax.enterprise.inject.Produces
- * @see javax.inject.Scope
* @see javax.inject.Named
* @see javax.inject.Qualifier
* @see javax.interceptor.InterceptorBinding
15 years, 1 month
Weld SVN: r4325 - api/trunk/cdi/src/main/java/javax/enterprise/context.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-10-26 10:09:59 -0400 (Mon, 26 Oct 2009)
New Revision: 4325
Modified:
api/trunk/cdi/src/main/java/javax/enterprise/context/package-info.java
Log:
less scary
Modified: api/trunk/cdi/src/main/java/javax/enterprise/context/package-info.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/context/package-info.java 2009-10-26 14:03:12 UTC (rev 4324)
+++ api/trunk/cdi/src/main/java/javax/enterprise/context/package-info.java 2009-10-26 14:09:59 UTC (rev 4325)
@@ -51,37 +51,29 @@
*
* <h3>Normal scopes and pseudo-scopes</h3>
*
- * <p>Most scopes are normal scopes. The context object for a normal
- * scope type is a mapping from each contextual type with that scope
- * to an instance of that contextual type. There may be no more than
+ * <p>Most scopes are <em>normal scopes</em>. The
+ * {@linkplain javax.enterprise.context.spi.Context context object} for
+ * a normal scope type is a mapping from each contextual type with that
+ * scope to an instance of that contextual type. There may be no more than
* one mapped instance per contextual type per thread. The set of all
* mapped instances of contextual types with a certain scope for a
- * certain thread is called the context for that scope associated with
- * that thread.</p>
+ * certain thread is called the <em>context</em> for that scope associated
+ * with that thread.</p>
*
* <p>A context may be associated with one or more threads. A context
- * with a certain scope is said to propagate from one point in the
+ * with a certain scope is said to <em>propagate</em> from one point in the
* execution of the program to another when the set of mapped instances
* of contextual types with that scope is preserved.</p>
*
* <p>The context associated with the current thread is called the
- * current context for the scope. The mapped instance of a contextual
- * type associated with a current context is called the current instance
- * of the contextual type.<p>
+ * <em>current context</em> for the scope. The mapped instance of a
+ * contextual type associated with a current context is called the
+ * <em>current instance</em> of the contextual type.<p>
*
- * <p>Contexts with normal scopes must obey the following rule:</p>
+ * <p>Any scope that is not a normal scope is called a <em>pseudo-scope</em>.
+ * The concept of a current instance is not well-defined in the case of
+ * a pseudo-scope.</p>
*
- * <p><em>Suppose beans A, B and Z all have normal scopes. Suppose A
- * has an injection point x, and B has an injection point y. Suppose
- * further that both x and y resolve to bean Z according to the rules
- * of typesafe resolution. If a is the current instance of A, and b
- * is the current instance of B, then both a.x and b.y refer to the
- * same instance of Z. This instance is the current instance of Z.</em></p>
- *
- * <p>Any scope that is not a normal scope is called a pseudo-scope.
- * The concept of a current instance is not well-defined in the case
- * of a pseudo-scope.</p>
- *
* <p>All normal scopes must be explicitly declared
* {@link javax.enterprise.context.NormalScope @NormalScope}. All
* pseudo-scopes must be explicitly declared
15 years, 1 month
Weld SVN: r4324 - api/trunk/cdi/src/main/java/javax/enterprise/context.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-10-26 10:03:12 -0400 (Mon, 26 Oct 2009)
New Revision: 4324
Modified:
api/trunk/cdi/src/main/java/javax/enterprise/context/NormalScope.java
Log:
def passivating scope
Modified: api/trunk/cdi/src/main/java/javax/enterprise/context/NormalScope.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/context/NormalScope.java 2009-10-26 09:46:00 UTC (rev 4323)
+++ api/trunk/cdi/src/main/java/javax/enterprise/context/NormalScope.java 2009-10-26 14:03:12 UTC (rev 4324)
@@ -29,8 +29,9 @@
*
* @author Gavin King
* @author Pete Muir
+ *
+ * @see javax.inject.Scope @Scope is used to declare pseudo-scopes.
*/
-
@Target(ANNOTATION_TYPE)
@Retention(RUNTIME)
@Documented
@@ -38,8 +39,14 @@
{
/**
- * @return true if this is a passivating scope type (if beans with
- * this scope type must be serializable)
+ * <p>Determines whether the normal scope type is a passivating scope.</p>
+ *
+ * <p>A bean is called passivation capable if the container is able to
+ * temporarily transfer the state of any idle instance to secondary
+ * storage. A passivating scope requires that beans with the scope are
+ * passivation capable.</p>
+ *
+ * @return <tt>true</tt> if the scope type is a passivating scope type
*/
boolean passivating() default false;
15 years, 1 month
Weld SVN: r4323 - cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el.
by weld-commits@lists.jboss.org
Author: jharting
Date: 2009-10-26 05:46:00 -0400 (Mon, 26 Oct 2009)
New Revision: 4323
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java
Log:
Matched test to assertion
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java 2009-10-26 09:02:32 UTC (rev 4322)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java 2009-10-26 09:46:00 UTC (rev 4323)
@@ -32,8 +32,8 @@
public class ResolutionByNameTest extends AbstractJSR299Test
{
- //@Test
- //@SpecAssertion(section="5.8", id="c") removed from spec
+ @Test
+ @SpecAssertion(section="6.4.3", id="a")
public void testQualifiedNameLookup()
{
assert getCurrentConfiguration().getEl().evaluateValueExpression("#{(game.value == 'foo' and game.value == 'foo') ? game.value == 'foo' : false}", Boolean.class);
15 years, 1 month
Weld SVN: r4322 - in cdi-tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/lookup/injection and 5 other directories.
by weld-commits@lists.jboss.org
Author: jharting
Date: 2009-10-26 05:02:32 -0400 (Mon, 26 Oct 2009)
New Revision: 4322
Removed:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/BeanWithFinalBoundField_Broken.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/BeanWithStaticBoundField_Broken.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/Tuna.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/TunaFarm.java
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/Farm.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/FarmInterceptor.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/InjectedSessionBean.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/InjectedSessionBeanLocal.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/MegaPoorHenHouse.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/MegaPoorHenHouseLocal.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/PoorHenHouse.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/SessionBeanInjectionTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/Farm.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/InjectionIntoNonContextualComponentTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TagLibraryListener.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TestFilter.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TestListener.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TestServlet.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TestTagHandler.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/InjectionIntoWebServiceEndPointTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/SheepWSEndPoint.java
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ManagedBeanTestPage.jsp
cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml
Log:
Tests for Chapter 5
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -33,7 +33,7 @@
@SpecAssertion(section = "3.9", id = "g"),
@SpecAssertion(section = "3.9.1", id = "a"),
@SpecAssertion(section = "3.9.2", id = "aa"),
- @SpecAssertion(section = "5.6.4", id = "ab"),
+ @SpecAssertion(section = "5.6.4", id = "ad"),
@SpecAssertion(section = "3.10", id = "a")
})
public void testMultipleInitializerMethodsAreCalled()
Deleted: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/BeanWithFinalBoundField_Broken.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/BeanWithFinalBoundField_Broken.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/BeanWithFinalBoundField_Broken.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -1,9 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.injection;
-
-
-class BeanWithFinalBoundField_Broken
-{
-
- /*@Current*/ public final Tuna tuna = null;
-
-}
Deleted: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/BeanWithStaticBoundField_Broken.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/BeanWithStaticBoundField_Broken.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/BeanWithStaticBoundField_Broken.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -1,9 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.injection;
-
-
-class BeanWithStaticBoundField_Broken
-{
-
- /*@Current*/ public static Tuna tuna;
-
-}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -2,6 +2,7 @@
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
@@ -23,7 +24,11 @@
}
@Test
- @SpecAssertion(section = "5.3", id = "kc")
+ @SpecAssertions({
+ @SpecAssertion(section = "5.3", id = "kc"),
+ @SpecAssertion(section = "5.6", id = "b"),
+ @SpecAssertion(section = "5.6.4", id = "ac")
+ })
public void testInjectionOfNamedBean()
{
WolfPack wolfPack = getInstanceByType(WolfPack.class);
Deleted: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/Tuna.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/Tuna.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/Tuna.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -1,14 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.injection;
-
-import javax.enterprise.context.RequestScoped;
-
-@RequestScoped
-class Tuna
-{
-
- public String getName()
- {
- return "Ophir";
- }
-
-}
Deleted: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/TunaFarm.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/TunaFarm.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/TunaFarm.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -1,15 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.injection;
-
-import javax.inject.Inject;
-
-class TunaFarm
-{
-
- @SuppressWarnings("unused")
- @Inject
- public Tuna tuna;
-
- public Tuna notInjectedTuna = new Tuna();
-
-
-}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/Farm.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/Farm.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/Farm.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -8,26 +8,28 @@
@Stateless
public class Farm implements FarmLocal
{
- @Inject private Sheep sheepField;
-
- private boolean initializerCalled;
+ @Inject
+ private Sheep sheepField;
+
+ private boolean initializerCalledAfterInjection = false;
private boolean injectionPerformedCorrectly = false;
-
- @Inject private void initialize(Sheep sheep)
+
+ @Inject
+ public void initialize(Sheep sheep)
{
- assert sheepField != null;
- initializerCalled = true;
+ initializerCalledAfterInjection = (sheepField != null) && (sheep != null);
}
@Interceptors(FarmInterceptor.class)
- public int getAnimalCount() {
+ public int getAnimalCount()
+ {
return 1;
}
-
+
@PostConstruct
- public void postConstruct() {
- assert initializerCalled;
- injectionPerformedCorrectly = true;
+ public void postConstruct()
+ {
+ injectionPerformedCorrectly = initializerCalledAfterInjection;
}
public boolean isInjectionPerformedCorrectly()
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/FarmInterceptor.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/FarmInterceptor.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/FarmInterceptor.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -9,14 +9,24 @@
@Inject
private Sheep sheep;
+ private boolean initializerCalled = false;
+ @Inject
+ public void initialize(Sheep sheep)
+ {
+ initializerCalled = sheep != null;
+ }
+
@AroundInvoke
public Object intercept(InvocationContext invocation) throws Exception
{
- if (sheep == null)
+ if ((sheep != null) && initializerCalled)
{
+ return (Integer) invocation.proceed() + 1;
+ }
+ else
+ {
throw new RuntimeException("Sheep not injected.");
}
- return (Integer)invocation.proceed() + 1;
}
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/InjectedSessionBean.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/InjectedSessionBean.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/InjectedSessionBean.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -2,15 +2,27 @@
import javax.ejb.EJB;
import javax.ejb.Stateless;
+import javax.inject.Inject;
@Stateless
public class InjectedSessionBean implements InjectedSessionBeanLocal
{
@EJB
private FarmLocal farm;
+ private boolean initializerCalledAfterResourceInjection = false;
public FarmLocal getFarm()
{
return farm;
}
+
+ @Inject
+ public void initialize() {
+ initializerCalledAfterResourceInjection = farm != null;
+ }
+
+ public boolean isInitializerCalledAfterResourceInjection()
+ {
+ return initializerCalledAfterResourceInjection;
+ }
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/InjectedSessionBeanLocal.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/InjectedSessionBeanLocal.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/InjectedSessionBeanLocal.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -6,4 +6,5 @@
public interface InjectedSessionBeanLocal
{
FarmLocal getFarm();
+ boolean isInitializerCalledAfterResourceInjection();
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/MegaPoorHenHouse.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/MegaPoorHenHouse.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/MegaPoorHenHouse.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -1,12 +1,30 @@
package org.jboss.jsr299.tck.tests.lookup.injection.enterprise;
+import javax.annotation.PostConstruct;
import javax.ejb.Stateless;
@Stateless
public class MegaPoorHenHouse extends PoorHenHouse implements MegaPoorHenHouseLocal
{
+ private boolean postConstructCalledAfterSuperclassInitializer = false;
+
public Fox getFox()
{
return fox;
}
+
+ @PostConstruct
+ public void postConstruct() {
+ postConstructCalledAfterSuperclassInitializer = initializerCalledAfterSuperclassInjection;
+ }
+
+ public boolean isPostConstructCalledAfterSuperclassInitializer()
+ {
+ return postConstructCalledAfterSuperclassInitializer;
+ }
+
+ public boolean isInitializerCalledAfterSuperclassInjection()
+ {
+ return initializerCalledAfterSuperclassInjection;
+ }
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/MegaPoorHenHouseLocal.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/MegaPoorHenHouseLocal.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/MegaPoorHenHouseLocal.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -6,4 +6,6 @@
public interface MegaPoorHenHouseLocal
{
Fox getFox();
+ boolean isPostConstructCalledAfterSuperclassInitializer();
+ boolean isInitializerCalledAfterSuperclassInjection();
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/PoorHenHouse.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/PoorHenHouse.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/PoorHenHouse.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -1,6 +1,18 @@
package org.jboss.jsr299.tck.tests.lookup.injection.enterprise;
+import javax.inject.Inject;
+
class PoorHenHouse extends HenHouse
{
+ protected boolean initializerCalledAfterSuperclassInjection = false;
+
+ @Inject
+ public void initialize() {
+ initializerCalledAfterSuperclassInjection = fox != null;
+ }
+ public boolean isInitializerCalledAfterSuperclassInjection()
+ {
+ return initializerCalledAfterSuperclassInjection;
+ }
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/SessionBeanInjectionTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/SessionBeanInjectionTest.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/SessionBeanInjectionTest.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -60,7 +60,8 @@
@Test(groups = "jboss-as-broken")
@SpecAssertions({
@SpecAssertion(section = "5.6", id = "ed"),
- @SpecAssertion(section = "5.6.4", id = "ao")
+ @SpecAssertion(section = "5.6.4", id = "ao"),
+ @SpecAssertion(section = "5.6.4", id = "ap")
})
//JBAS-7046
public void testInjectionOnEJBInterceptor()
@@ -87,5 +88,24 @@
MegaPoorHenHouseLocal henHouse = getInstanceByType(MegaPoorHenHouseLocal.class);
assert henHouse.getFox() != null;
assert henHouse.getFox().getName().equals("gavin");
- }
+ }
+
+ @Test
+ @SpecAssertion(section = "5.6.4", id = "bb")
+ public void testInitializerCalledAfterFieldInjectionOfSuperclass() {
+ MegaPoorHenHouseLocal house = getInstanceByType(MegaPoorHenHouseLocal.class);
+ assert house.isInitializerCalledAfterSuperclassInjection();
+ }
+
+ @Test
+ @SpecAssertion(section = "5.6.4", id = "bf")
+ public void testPostConstructCalledAfterInitializerOfSuperclass() {
+ assert getInstanceByType(MegaPoorHenHouseLocal.class).isPostConstructCalledAfterSuperclassInitializer();
+ }
+
+ @Test
+ @SpecAssertion(section = "5.6.4", id = "bc")
+ public void testInitializerCalledAfterResourceInjection() {
+ assert getInstanceByType(InjectedSessionBeanLocal.class).isInitializerCalledAfterResourceInjection();
+ }
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/Farm.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/Farm.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/Farm.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -23,7 +23,18 @@
{
@Inject
private Sheep sheep;
+ private boolean initializerCalled = false;
+ @Inject
+ public void initialize(Sheep sheep) {
+ initializerCalled = sheep != null;
+ }
+
+ public boolean isInitializerCalled()
+ {
+ return initializerCalled;
+ }
+
public boolean isSheepInjected() {
return sheep != null;
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/InjectionIntoNonContextualComponentTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/InjectionIntoNonContextualComponentTest.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/InjectionIntoNonContextualComponentTest.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -51,8 +51,20 @@
{
WebClient webClient = new WebClient();
webClient.setThrowExceptionOnFailingStatusCode(true);
- webClient.getPage(getContextPath() + "Test/Servlet");
+ webClient.getPage(getContextPath() + "Test/Servlet?test=injection");
}
+
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section = "5.6.4", id = "af"),
+ @SpecAssertion(section = "5.6.4", id = "bm")
+ })
+ public void testServletInitializerMethodCalled() throws Exception
+ {
+ WebClient webClient = new WebClient();
+ webClient.setThrowExceptionOnFailingStatusCode(true);
+ webClient.getPage(getContextPath() + "Test/Servlet?test=initializer");
+ }
@Test
@SpecAssertions( {
@@ -64,8 +76,20 @@
{
WebClient webClient = new WebClient();
webClient.setThrowExceptionOnFailingStatusCode(true);
- webClient.getPage(getContextPath() + "TestFilter");
+ webClient.getPage(getContextPath() + "TestFilter?test=injection");
}
+
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section = "5.6.4", id = "ah"),
+ @SpecAssertion(section = "5.6.4", id = "bp")
+ })
+ public void testFilterInitializerMethodCalled() throws Exception
+ {
+ WebClient webClient = new WebClient();
+ webClient.setThrowExceptionOnFailingStatusCode(true);
+ webClient.getPage(getContextPath() + "TestFilter?test=initializer");
+ }
@Test
@SpecAssertions({
@@ -76,13 +100,23 @@
{
WebClient webClient = new WebClient();
webClient.setThrowExceptionOnFailingStatusCode(true);
- webClient.getPage(getContextPath() + "Test/ServletListener");
+ webClient.getPage(getContextPath() + "Test/ServletListener?test=injection");
}
+
+ @Test
+ @SpecAssertion(section = "5.6.4", id = "aj")
+ public void testServletListenerInitializerMethodCalled() throws Exception
+ {
+ WebClient webClient = new WebClient();
+ webClient.setThrowExceptionOnFailingStatusCode(true);
+ webClient.getPage(getContextPath() + "Test/ServletListener?test=initializer");
+ }
@Test
@SpecAssertions({
@SpecAssertion(section = "5.6", id = "eb"),
- @SpecAssertion(section = "5.6.4", id = "am")
+ @SpecAssertion(section = "5.6.4", id = "am"),
+ @SpecAssertion(section = "5.6.4", id = "an")
})
public void testInjectionIntoTagHandler() throws Exception
{
@@ -90,7 +124,8 @@
webClient.setThrowExceptionOnFailingStatusCode(false);
WebResponse response = webClient.getPage(getContextPath() + "TagPage.jsp").getWebResponse();
assert response.getStatusCode() == 200;
- assert response.getContentAsString().contains(TestTagHandler.SUCCESS);
+ assert response.getContentAsString().contains(TestTagHandler.INJECTION_SUCCESS);
+ assert response.getContentAsString().contains(TestTagHandler.INITIALIZER_SUCCESS);
}
@Test
@@ -102,19 +137,30 @@
{
WebClient webClient = new WebClient();
webClient.setThrowExceptionOnFailingStatusCode(true);
- webClient.getPage(getContextPath() + "Test/TagLibraryListener");
+ webClient.getPage(getContextPath() + "Test/TagLibraryListener?test=injection");
}
@Test
+ @SpecAssertion(section = "5.6.4", id="at")
+ public void testTagLibraryListenerInitializerMethodCalled() throws Exception
+ {
+ WebClient webClient = new WebClient();
+ webClient.setThrowExceptionOnFailingStatusCode(true);
+ webClient.getPage(getContextPath() + "Test/TagLibraryListener?test=initializer");
+ }
+
+ @Test
@SpecAssertions({
+ @SpecAssertion(section = "5.6", id = "d"),
@SpecAssertion(section = "5.6.4", id = "au"),
- @SpecAssertion(section = "5.6", id = "d")
+ @SpecAssertion(section = "5.6.4", id = "av")
})
public void testInjectionIntoJSFManagedBean() throws Exception
{
WebClient webclient = new WebClient();
webclient.setThrowExceptionOnFailingStatusCode(true);
String content = webclient.getPage(getContextPath() + "ManagedBeanTestPage.jsf").getWebResponse().getContentAsString();
- assert content.contains("It works");
+ assert content.contains("Injection works");
+ assert content.contains("Initializer works");
}
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TagLibraryListener.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TagLibraryListener.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TagLibraryListener.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -8,6 +8,12 @@
{
@Inject
private Sheep sheep;
+ private boolean initializerCalled = false;
+
+ @Inject
+ public void initialize(Sheep sheep) {
+ initializerCalled = sheep != null;
+ }
public void contextDestroyed(ServletContextEvent sce)
{
@@ -16,5 +22,6 @@
public void contextInitialized(ServletContextEvent sce)
{
sce.getServletContext().setAttribute("tag.library.listener.injected", sheep != null);
+ sce.getServletContext().setAttribute("tag.library.listener.initializer.called", initializerCalled);
}
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TestFilter.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TestFilter.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TestFilter.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -17,7 +17,14 @@
@Inject
private Sheep sheep;
private boolean injectionPerformedCorrectly = false;
+ private boolean initializerCalled = false;
+ private boolean initCalledAfterInitializer = false;
+ @Inject
+ public void initialize(Sheep sheep) {
+ initializerCalled = sheep != null;
+ }
+
public void destroy()
{
}
@@ -25,11 +32,21 @@
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
{
HttpServletResponse resp = (HttpServletResponse) response;
- resp.setStatus(injectionPerformedCorrectly ? 200 : 500);
+
+ if (request.getParameter("test").equals("injection")) {
+ // Return 200 if injection into Filter occurred, 500 otherwise
+ resp.setStatus(injectionPerformedCorrectly ? 200 : 500);
+ } else if (request.getParameter("test").equals("initializer")) {
+ // Return 200 if initializer was called, 500 otherwise
+ resp.setStatus(initCalledAfterInitializer ? 200 : 500);
+ } else {
+ resp.setStatus(404);
+ }
}
public void init(FilterConfig filterConfig) throws ServletException
{
injectionPerformedCorrectly = sheep != null;
+ initCalledAfterInitializer = initializerCalled;
}
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TestListener.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TestListener.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TestListener.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -8,7 +8,13 @@
{
@Inject
private Sheep sheep;
-
+ private boolean initializerCalled = false;
+
+ @Inject
+ public void initialize(Sheep sheep) {
+ initializerCalled = sheep != null;
+ }
+
public void contextDestroyed(ServletContextEvent sce)
{
}
@@ -16,5 +22,6 @@
public void contextInitialized(ServletContextEvent sce)
{
sce.getServletContext().setAttribute("listener.injected", sheep != null);
+ sce.getServletContext().setAttribute("listener.initializer.called", initializerCalled);
}
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TestServlet.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TestServlet.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TestServlet.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -14,8 +14,15 @@
@Inject
private Sheep sheep;
private boolean injectionPerformedCorrectly = false;
+ private boolean initializerCalled = false;
+ private boolean initCalledAfterInitializer = false;
private static final long serialVersionUID = -7672096092047821010L;
+
+ @Inject
+ public void initialize(Sheep sheep) {
+ initializerCalled = sheep != null;
+ }
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
@@ -32,26 +39,50 @@
}
private void testServlet(HttpServletRequest req, HttpServletResponse resp) {
- // Return 200 if injection into Servlet occurred, 500 otherwise
- resp.setStatus(injectionPerformedCorrectly ? 200 : 500);
+ if (req.getParameter("test").equals("injection")) {
+ // Return 200 if injection into Servlet occurred, 500 otherwise
+ resp.setStatus(injectionPerformedCorrectly ? 200 : 500);
+ } else if (req.getParameter("test").equals("initializer")) {
+ // Return 200 if the initializer was called, 500 otherwise
+ resp.setStatus(initCalledAfterInitializer ? 200 : 500);
+ } else {
+ resp.setStatus(404);
+ }
}
private void testListener(HttpServletRequest req, HttpServletResponse resp) {
- // Return 200 if injection into Listener occurred, 500 otherwise
- boolean result = (Boolean) req.getSession().getServletContext().getAttribute("listener.injected");
- resp.setStatus((result) ? 200 : 500);
+ if (req.getParameter("test").equals("injection")) {
+ // Return 200 if injection into Listener occurred, 500 otherwise
+ boolean result = (Boolean) req.getSession().getServletContext().getAttribute("listener.injected");
+ resp.setStatus((result) ? 200 : 500);
+ } else if (req.getParameter("test").equals("initializer")) {
+ // Return 200 if the initializer was called, 500 otherwise
+ boolean result = (Boolean) req.getSession().getServletContext().getAttribute("listener.initializer.called");
+ resp.setStatus((result) ? 200 : 500);
+ } else {
+ resp.setStatus(404);
+ }
}
private void testTagLibraryListener(HttpServletRequest req, HttpServletResponse resp) {
- // Return 200 if injection into TagLibrary Listener occurred, 500 otherwise
- boolean result = (Boolean) req.getSession().getServletContext().getAttribute("tag.library.listener.injected");
- resp.setStatus((result) ? 200 : 500);
+ if (req.getParameter("test").equals("injection")) {
+ // Return 200 if injection into TagLibrary Listener occurred, 500 otherwise
+ boolean result = (Boolean) req.getSession().getServletContext().getAttribute("tag.library.listener.injected");
+ resp.setStatus((result) ? 200 : 500);
+ } else if (req.getParameter("test").equals("initializer")) {
+ // Return 200 if the initializer was called, 500 otherwise
+ boolean result = (Boolean) req.getSession().getServletContext().getAttribute("tag.library.listener.initializer.called");
+ resp.setStatus((result) ? 200 : 500);
+ } else {
+ resp.setStatus(404);
+ }
}
@Override
public void init() throws ServletException
{
injectionPerformedCorrectly = sheep != null;
+ initCalledAfterInitializer = initializerCalled;
}
@Override
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TestTagHandler.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TestTagHandler.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/TestTagHandler.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -11,22 +11,28 @@
public class TestTagHandler extends SimpleTagSupport
{
private static final long serialVersionUID = -3048065065359948044L;
- public static final String SUCCESS = "It works.";
- public static final String FAILURE = "It is broken.";
+ public static final String INJECTION_SUCCESS = "Injection works.";
+ public static final String INITIALIZER_SUCCESS = "Initializer works.";
@Inject
private Sheep sheep;
+ private boolean initializerCalled = false;
+ @Inject
+ public void initialize(Sheep sheep) {
+ initializerCalled = sheep != null;
+ }
+
@Override
public void doTag() throws JspException, IOException
{
- if (sheep == null)
+ if (sheep != null)
{
- getJspContext().getOut().write(FAILURE);
+ getJspContext().getOut().write(INJECTION_SUCCESS);
}
- else
+ if (initializerCalled)
{
- getJspContext().getOut().write(SUCCESS);
+ getJspContext().getOut().append(INITIALIZER_SUCCESS);
}
}
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/InjectionIntoWebServiceEndPointTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/InjectionIntoWebServiceEndPointTest.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/InjectionIntoWebServiceEndPointTest.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -20,6 +20,7 @@
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.IntegrationTest;
@@ -37,7 +38,11 @@
SheepWSEndPointService service;
@Test(groups = "jboss-as-broken")
- @SpecAssertion(section = "5.6", id = "ee")
+ @SpecAssertions({
+ @SpecAssertion(section = "5.6", id = "ee"),
+ @SpecAssertion(section = "5.6.4", id = "aq"),
+ @SpecAssertion(section = "5.6.4", id = "ar")
+ })
// JBAS-7046
public void testInjectionIntoWebServiceEndpoint() throws Exception
{
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/SheepWSEndPoint.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/SheepWSEndPoint.java 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ws/SheepWSEndPoint.java 2009-10-26 09:02:32 UTC (rev 4322)
@@ -9,9 +9,15 @@
{
@Inject
private Sheep sheep;
+ private boolean initializerCalled = false;
+ @Inject
+ public void initialize(Sheep sheep) {
+ initializerCalled = sheep != null;
+ }
+
@WebMethod
public boolean isSheepInjected() {
- return (sheep != null);
+ return (sheep != null) && initializerCalled;
}
}
Modified: cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ManagedBeanTestPage.jsp
===================================================================
--- cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ManagedBeanTestPage.jsp 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/non/contextual/ManagedBeanTestPage.jsp 2009-10-26 09:02:32 UTC (rev 4322)
@@ -7,7 +7,8 @@
<body>
<f:view>
<h1>
- <h:outputText value="#{farm.sheepInjected ? 'It works' : 'It is broken'}"/>
+ <h:outputText value="#{farm.sheepInjected ? 'Injection works' : 'Injection is broken'}"/>
+ <h:outputText value="#{farm.initializerCalled ? 'Initializer works' : 'Initializer is broken'}"/>
</h1>
</f:view>
</body>
Modified: cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml
===================================================================
--- cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml 2009-10-26 04:59:00 UTC (rev 4321)
+++ cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml 2009-10-26 09:02:32 UTC (rev 4322)
@@ -2244,17 +2244,9 @@
<text>An annotation member may be excluded from consideration using the |@NonBinding| annotation.</text>
</assertion>
- <group>
+ <assertion id="c" testable="false">
<text>Array-valued or annotation-valued members of a qualifier type must be annotated |@NonBinding| in a portable application. If an array-valued or annotation-valued member of a binding type is not annotated |@NonBinding|, non-portable behavior results.</text>
-
- <assertion id="d">
- <text>Test with an array-valued member.</text>
- </assertion>
-
- <assertion id="e">
- <text>Test with an annotation-valued member.</text>
- </assertion>
- </group>
+ </assertion>
</section>
<section id="5.3.6" title="Multiple qualifiers">
15 years, 1 month