Author: shane.bryzak(a)jboss.com
Date: 2009-06-08 21:29:25 -0400 (Mon, 08 Jun 2009)
New Revision: 2795
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
updated chapter 10 assertions, fixed invalid xml
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-08 22:16:53 UTC (rev 2794)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-09 01:29:25 UTC (rev 2795)
@@ -95,8 +95,7 @@
<assertion id="m">
<text>If an injection point type is a type variable, 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>
</section>
<section id="2.2.2" title="Typecasting between bean types">
@@ -369,7 +368,7 @@
</section>
- <section id="2.5.5" title="Default deployment type">
+ <section id="2.5.4" title="Default deployment type">
<assertion id="a0">
<text>If a producer method does not declare any stereotype with a declared
default deployment type, then the default deployment type is the deployment type of the
bean that declares the producer method or field.</text>
@@ -457,7 +456,7 @@
</assertion>
</section>
- <section id="2.6.4" title="Beans with no EL name">
+ <section id="2.6.3" title="Beans with no EL name">
<assertion id="a">
<text>If |@Named| is not specified, by neither the bean nor its stereotypes,
a bean has no EL name</text>
@@ -553,7 +552,7 @@
</assertion>
</section>
- <section id="2.7.1.5" title="Stereotypes with additional
stereotypes">
+ <section id="2.7.1.4" title="Stereotypes with additional
stereotypes">
<assertion id="a">
<text>A stereotype may declare other stereotypes</text>
</assertion>
@@ -611,7 +610,6 @@
<text>The built-in stereotype |(a)javax.enterprise.inject.Model| is intended
for use with beans that define the model layer of an MVC web application architecture such
as JSF</text>
<note>Tested by API signature test</note>
</assertion>
-
</section>
<section id="3" title="Bean Implementation">
@@ -628,8 +626,7 @@
</assertion>
</section>
- <section id="3.2" title="Managed beans">
-
+ <section id="3.2" title="Managed beans">
<assertion id="f0">
<text>If the bean class of a managed bean is annotated with both the
|@Interceptor| and |@Decorator| stereotypes, 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>
@@ -645,12 +642,10 @@
<assertion id="g">
<text>If the managed bean class is a parameterized type, it must have scope
|@Dependent|. If a managed bean with a parameterized bean class declares any scope other
than |@Dependent|, 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>
</section>
<section id="3.2.1" title="Which Java classes are managed
beans?">
-
<assertion id="b">
<text>A top-level Java class is not a managed bean if it is a non-static
inner class</text>
</assertion>
@@ -678,8 +673,7 @@
<assertion id="q">
<text>A top-level Java class is only a managed bean if it has an appropriate
constructor - a constructor annotated |@Initializer|</text>
- </assertion>
-
+ </assertion>
</section>
<section id="3.2.2" title="Bean types of a managed bean">
@@ -718,12 +712,10 @@
</assertion>
</section>
- <section id="3.2.4" title="Bean constructors">
-
+ <section id="3.2.4" title="Bean constructors">
<assertion id="a">
<text>When the container instantiates a managed bean, it calls the bean
constructor. The bean constructor is a constructor of the bean class</text>
- </assertion>
-
+ </assertion>
</section>
<section id="3.2.4.1" title="Declaring a bean constructor">
@@ -746,12 +738,10 @@
<assertion id="ea">
<text>If a bean constructor has a parameter annotated |@Observes|, 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>
</section>
- <section id="3.2.4.2" title="Bean constructor parameters">
-
+ <section id="3.2.4.2" title="Bean constructor parameters">
<assertion id="b">
<text>A bean constructor may have any number of parameters.</text>
</assertion>
@@ -769,7 +759,6 @@
<assertion id="da">
<text>If the bean class of X does not directly extend the bean class of
another managed bean, the container automatically detects the problem and treats it as a
definition error, as defined in Section 12.4, "Problems detected automatically by the
container".</text>
</assertion>
-
</section>
<section id="3.2.6" title="Default name for a managed bean">
@@ -815,8 +804,7 @@
<assertion id="i">
<text>If the session bean class is a parameterized type, it must have scope
|@Dependent|. If a session bean with a parameterized bean class declares any scope other
than |@Dependent|, 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>
</section>
<section id="3.3.1" title="EJB remove methods of session
beans">
@@ -838,12 +826,10 @@
<assertion id="dba">
<text>If the application directly calls an EJB remove method of an instance
of a session bean that is a stateful session bean and has scope |@Dependent| then the
container ignores the instance instead of destroying it when |Contextual.destroy()| is
called, as defined in Section 6.5, "Lifecycle of stateful session
beans"</text>
- </assertion>
-
+ </assertion>
</section>
- <section id="3.3.2" title="Bean types of a session bean">
-
+ <section id="3.3.2" title="Bean types of a session bean">
<assertion id="aa">
<text>The set of bean types for a session bean contains all local interfaces
of the bean and their superinterfaces.</text>
</assertion>
@@ -895,6 +881,7 @@
<assertion id="aa">
<text>If a bean class of a session bean X is annotated |@Specializes|, then
the bean class of X must directly extend the bean class of another session bean Y. Then X
directly specializes Y, as defined in Section 4.3
"Specialization".</text>
+ </assertion>
<assertion id="da">
<text>If the bean class of X does not directly extend the bean class of
another session bean, the container automatically detects the problem and treats it as a
definition error, as defined in Section 12.4, "Problems detected automatically by the
container".</text>
@@ -907,7 +894,6 @@
<assertion id="f">
<text>Session bean X that specializes session bean Y must support a
bean-class local view if Y supports a bean-class local view</text>
</assertion>
-
</section>
<section id="3.3.5" title="Default name for a session bean">
@@ -968,8 +954,7 @@
</assertion>
</section>
- <section id="3.4.1" title="Bean types of a producer method">
-
+ <section id="3.4.1" title="Bean types of a producer method">
<assertion id="a">
<text>If the return type of a producer method is an interface, the set of
bean types contains the return type, all interfaces it extends directly or indirectly and
|java.lang.Object|</text>
</assertion>
@@ -1026,8 +1011,7 @@
</assertion>
</section>
- <section id="3.4.3" title="Producer method parameters">
-
+ <section id="3.4.3" title="Producer method parameters">
<assertion id="b">
<text>A producer method may have any number of parameters.</text>
</assertion>
@@ -1052,8 +1036,7 @@
</assertion>
</section>
- <section id="3.4.5" title="Disposal methods">
-
+ <section id="3.4.5" title="Disposal methods">
<assertion id="a">
<text>A disposal method must be a method of a managed bean class or session
bean class.</text>
</assertion>
@@ -1075,8 +1058,7 @@
</assertion>
</section>
- <section id="3.4.6" title="Disposed parameter of a disposal
method">
-
+ <section id="3.4.6" title="Disposed parameter of a disposal
method">
<assertion id="a">
<text>Each disposal method must have exactly one disposed parameter, of the
same type as the corresponding producer method return type</text>
</assertion>
@@ -1090,8 +1072,7 @@
</assertion>
</section>
- <section id="3.4.7" title="Declaring a disposal method">
-
+ <section id="3.4.7" title="Declaring a disposal method">
<assertion id="a">
<text>A disposal method may be declared by annotating a parameter
|(a)javax.enterprise.inject.Disposes|. That parameter is the disposed
parameter</text>
</assertion>
@@ -1121,15 +1102,13 @@
</assertion>
</section>
- <section id="3.4.8" title="Disposal method parameters">
-
+ <section id="3.4.8" title="Disposal method parameters">
<assertion id="a">
- <text>In addition to the disposed parameter, a disposal method may declare
additional parameters, which may also specify bindings. These additional parameters are
injection points.</text>
+ <text>In addition to the disposed parameter, a disposal method may declare
additional parameters, which may also specify bindings. These additional parameters are
injection points.</text>
</assertion>
</section>
- <section id="3.4.9" title="Disposal method resolution">
-
+ <section id="3.4.9" title="Disposal method resolution">
<assertion id="aa">
<text>When searching for disposal methods for a producer method, the
container searches for disposal methods which are declared by the same bean class as the
producer method, and for which the disposed parameter resolves to the producer method,
according to the typesafe resolution algorithm defined in Section 5.1, "Typesafe
resolution algorithm".</text>
</assertion>
@@ -1143,15 +1122,13 @@
</assertion>
</section>
- <section id="3.4.10" title="Default name for a producer
method">
-
+ <section id="3.4.10" title="Default name for a producer
method">
<assertion id="a">
<text>The default name for a producer method is the method name, unless the
method follows the JavaBeans property getter naming convention, in which case the default
name is the JavaBeans property name</text>
</assertion>
</section>
- <section id="3.5" title="Producer fields">
-
+ <section id="3.5" title="Producer fields">
<assertion id="a">
<text>A producer field must be a field of a managed bean class or session
bean class</text>
</assertion>
@@ -1198,8 +1175,7 @@
</assertion>
</section>
- <section id="3.5.1" title="Bean types of a producer field">
-
+ <section id="3.5.1" title="Bean types of a producer field">
<assertion id="a">
<text>The bean types of a producer field depend upon the field type. If the
field type is an interface, the set of bean types contains the field type, all interfaces
it extends directly or indirectly and java.lang.Object</text>
</assertion>
@@ -1213,8 +1189,7 @@
</assertion>
</section>
- <section id="3.5.2" title="Declaring a producer field using
annotations">
-
+ <section id="3.5.2" title="Declaring a producer field using
annotations">
<assertion id="a">
<text>A producer field may be declared by annotating a field with the
|(a)javax.enterprise.inject.Produces| annotation</text>
</assertion>
@@ -1246,8 +1221,7 @@
</assertion>
</section>
- <section id="3.6" title="Resources">
-
+ <section id="3.6" title="Resources">
<assertion id="k">
<text>A resource always has scope |@Dependent|</text>
</assertion>
@@ -1255,11 +1229,9 @@
<assertion id="l">
<text>A resource may not declare a bean EL name</text>
</assertion>
-
</section>
- <section id="3.6.1" title="Declaring a resource">
-
+ <section id="3.6.1" title="Declaring a resource">
<assertion id="aa">
<text>A resource may be declared by specifying a Java EE component
environment injection annotation as part of a producer field declaration.</text>
</assertion>
@@ -1307,8 +1279,7 @@
</assertion>
</section>
- <section id="3.7" title="Message destinations">
-
+ <section id="3.7" title="Message destinations">
<assertion id="b">
<text>JMS queue resources must allow the direct injection of the
|Queue|</text>
</assertion>
@@ -1459,12 +1430,10 @@
<assertion id="am">
<text>A JMS |TopicPublisher| resource may not declare a bean
name</text>
- </assertion>
-
+ </assertion>
</section>
- <section id="3.7.1" title="Bean types of a message
destination">
-
+ <section id="3.7.1" title="Bean types of a message
destination">
<assertion id="a">
<text>For message destination that represent a queue, the bean types are
|Queue|, |QueueConnection|, |QueueSession| and |QueueSender|</text>
</assertion>
@@ -1478,8 +1447,7 @@
</assertion>
</section>
- <section id="3.7.2" title="Declaring a message destination">
-
+ <section id="3.7.2" title="Declaring a message destination">
<assertion id="d">
<text>A message destination may be declared by specifying a |@Resource|
annotation as part of a producer field declaration of type |Topic| or
|Queue|.</text>
</assertion>
@@ -1493,8 +1461,7 @@
</assertion>
</section>
- <section id="3.8" title="Injected fields">
-
+ <section id="3.8" title="Injected fields">
<assertion id="aa">
<text>An injected field is a non-static~, non-final~ field of a bean
class.</text>
</assertion>
@@ -1517,12 +1484,10 @@
<assertion id="h">
<text>If a field is a producer field, it is not an injected
field</text>
- </assertion>
-
+ </assertion>
</section>
- <section id="3.8.1" title="Declaring an injected field">
-
+ <section id="3.8.1" title="Declaring an injected field">
<assertion id="a">
<text>An injected field may be declared by annotating the field with any
binding type</text>
</assertion>
@@ -1557,6 +1522,7 @@
<text>The application may call initializer methods directly, but then no
parameters will be passed to the method by the container</text>
<note>This is a statement of intent</note>
</assertion>
+ </section>
<section id="3.9.1" title="Declaring an initializer method">
<assertion id="a">
@@ -2457,7 +2423,7 @@
<section id="5.5.2" title="The built-in Instance">
<assertion id="a">
- <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>
+ <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">
@@ -3264,10 +3230,10 @@
</assertion>
</section>
- <section id="6.9" title="Lifecycle of resources">
+ <section id="7.7" title="Lifecycle of resources">
<assertion id="l">
<text>When the |create()| method of a |Bean| object that represents a
resource is called, the container creates and returns a container-
-specific internal reference to the Java EE component environment resource, entity
manager, entity manager factory, remote EJB instance or web service reference. This
reference is not directly exposed to the application./text>
+specific internal reference to the Java EE component environment resource, entity
manager, entity manager factory, remote EJB instance or web service reference. This
reference is not directly exposed to the application.</text>
</assertion>
<assertion id="m">
@@ -3506,7 +3472,7 @@
<section id="9.1" title="Interceptor binding types">
<assertion id="a">
- <text>An interceptor binding type is a Java annotation defined as
|@Target({TYPE, METHOD})| or |@Target(TYPE)| and |(a)Retention(RUNTIME)|./text>
+ <text>An interceptor binding type is a Java annotation defined as
|@Target({TYPE, METHOD})| or |@Target(TYPE)| and |(a)Retention(RUNTIME)|.</text>
</assertion>
<assertion id="b">
@@ -3622,7 +3588,7 @@
<assertion id="b">
<text>For a method, the bean interceptor bindings include the interceptor
bindings declared by the bean at the class level, including
-interceptor bindings declared as meta-annotations of other interceptor bindings,
recursively, and of stereotypes, together with all interceptor bindings declared at the
method level, including interceptor bindings declared as meta-annotations of other
interceptor bindings, recursively./text>
+interceptor bindings declared as meta-annotations of other interceptor bindings,
recursively, and of stereotypes, together with all interceptor bindings declared at the
method level, including interceptor bindings declared as meta-annotations of other
interceptor bindings, recursively.</text>
</assertion>
<assertion id="c">
@@ -3664,18 +3630,14 @@
</section>
- <section id="7.1" title="Event types and binding types">
+ <section id="10.1" title="Event types and binding types">
- <assertion id="a">
- <text>An event object is an instance of a concrete Java class with no [type
variables] or wildcards</text>
+ <assertion id="aa">
+ <text>An event object is an instance of a concrete Java class with no type
variables.</text>
</assertion>
- <assertion id="b">
- <text>An event object is an instance of a concrete Java class with no type
variables or [wildcards]</text>
- </assertion>
-
<assertion id="c">
- <text>The event types of the event include all superclasses and interfaces of
the class of the event object</text>
+ <text>The event types of the event include all superclasses and interfaces of
the runtime class of the event object.</text>
</assertion>
<assertion id="d">
@@ -3691,129 +3653,145 @@
</assertion>
<assertion id="g">
- <text>All event binding types must specify the |(a)javax.inject.BindingType|
meta-annotation</text>
+ <text>All event binding types must specify the
|(a)javax.enterprise.inject.BindingType| meta-annotation</text>
</assertion>
+ <assertion id="i">
+ <text>Every event has the binding |(a)javax.enterprise.inject.Any|, even if it
does not explicitly declare this binding.</text>
+ </assertion>
+ </section>
+
+ <section id="10.2" title="Observer resolution algorithm">
<assertion id="h">
- <text>An event consumer will be notified of an event if the observed event
type it specifies is one of the event types of the event, and if all the observed event
bindings it specifies are event bindings of the event</text>
+ <text>An event consumer will be notified of an event if the observed event
type it specifies is one of the event types of the event, and if all the observed event
bindings it specifies are event bindings of the event.</text>
</assertion>
+
+ <assertion id="j">
+ <text>If the runtime type of the event object contains a type variable, the
container must throw an |IllegalArgumentException|.</text>
+ </assertion>
+ </section>
+ <section id="10.2.1" title="Event binding types with
members">
+ <assertion id="a">
+ <text>The binding type for an |Event| binding may have annotation
members</text>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>The container uses |equals()| to compare event binding type member
values</text>
+ <note>Since only primitive types are allowed, the call to equals() cannot be
checked</note>
+ </assertion>
</section>
- <section id="7.2" title="Firing an event via the Manager
interface">
-
+ <section id="10.2.2" title="Multiple event bindings">
<assertion id="a">
- <text>The |Manager| interface provides the |fireEvent()| method for firing
events</text>
+ <text>An event parameter may have multiple bindings</text>
</assertion>
<assertion id="b">
- <text>If the type of the event object passed to |fireEvent()| contains [type
variables] or wildcards, an |IllegalArgumentException| is thrown</text>
+ <text>An observer method will only be notified if all the observed event
bindings are specified when the event is fired</text>
</assertion>
<assertion id="c">
- <text>If the type of the event object passed to |fireEvent()| contains type
variables or [wildcards], an |IllegalArgumentException| is thrown</text>
+ <text>Other, less specific, observers will also be notified of events with
multiple event bindings</text>
</assertion>
-
- <assertion id="d">
- <text>If an instance of an annotation that is not a binding type is passed to
|fireEvent()|, an |IllegalArgumentException| is thrown. (Not in PRD2, but should appear in
next revision)</text>
- </assertion>
-
+ </section>
+
+ <section id="10.3" title="The Observer interface">
+ <assertion id="a">
+ <text>Observers of events implement the |javax.enterprise.event.Observer|
interface.</text>
+ </assertion>
</section>
- <section id="7.3" title="Observing events via the Observer
interface">
+ <section id="10.4" title="Firing events">
<assertion id="a">
- <text>Observers of events implement the |javax.event.Observer|
interface</text>
+ <text>Beans fire events via an instance of the |javax.enterprise.event.Event|
interface, which may be injected.</text>
</assertion>
<assertion id="b">
- <text>An observer instance may be registered with the container by calling
|Manager.addObserver()|</text>
+ <text>The method |fire()| accepts an event object.</text>
</assertion>
<assertion id="c">
- <text>In the signature of |Manager.addObserver()|, the first parameter is the
observer object, the second parameter is the observed event type, and the remaining
parameters are optional observed event bindings</text>
+ <text>Any combination of bindings may be specified at the injection
point.</text>
</assertion>
<assertion id="d">
- <text>The observer is notified when an event object that is assignable to the
observed event type is raised with the observed event bindings</text>
+ <text>Or, the application may specify bindings dynamically.</text>
</assertion>
<assertion id="e">
- <text>An observer instance may be deregistered by calling
|Manager.removeObserver()|</text>
+ <text>The |observe()| method registers an observer.</text>
+ </assertion>
+ </section>
+
+ <section id="10.4.1" title="The Event interface">
+ <assertion id="c">
+ <text>The |Event| interface provides a method for firing events of a specific
type</text>
</assertion>
- <assertion id="f">
- <text>If the observed event type passed to ~|addObserver()|~ or
|removeObserver()| contains ~type variables~ or wildcards, an |IllegalArgumentException|
is thrown</text>
+ <assertion id="d">
+ <text>The |Event| interface provides a method for registering observers for
events of the same type.</text>
</assertion>
- <assertion id="g">
- <text>If the observed event type passed to ~|addObserver()|~ or
|removeObserver()| contains type variables or ~wildcards~, an |IllegalArgumentException|
is thrown</text>
+ <assertion id="ea">
+ <text>The |select()| method of the provided implementation of |Event |returns
a child |Event| for a subtype of the event type and additional event bindings. If no
subtype is given, the event type is the same as the parent.</text>
</assertion>
- <assertion id="h">
- <text>If the observed event type passed to |addObserver()| or
~|removeObserver()|~ contains ~type variables~ or wildcards, an |IllegalArgumentException|
is thrown</text>
+ <assertion id="eb">
+ <text>If two instances of the same binding type are passed to |select()|, a
|DuplicateBindingTypeException| is thrown.</text>
</assertion>
- <assertion id="i">
- <text>If the observed event type passed to |addObserver()| or
~|removeObserver()|~ contains type variables or ~wildcards~, an |IllegalArgumentException|
is thrown</text>
+ <assertion id="ec">
+ <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="j">
- <text>If two instances of the same binding type are passed to
~|addObserver()|~ or |removeObserver()|, a |DuplicateBindingTypeException| is
thrown</text>
+ <assertion id="ed">
+ <text>The |fire()| method of the provided implementation of |Event| must call
|BeanManager.fireEvent()|, passing the event type and bindings specified at the injection
point. A child |Event| passes the event subtype and additional bindings, along with the
bindings of its parent.</text>
</assertion>
- <assertion id="k">
- <text>If two instances of the same binding type are passed to |addObserver()|
or ~|removeObserver()|~, a |DuplicateBindingTypeException| is thrown</text>
+ <assertion id="ee">
+ <text>The |observe()| method of the provided implementation of |Event| must
call |BeanManager.addObserver()|, passing the given observer object along with the event
type and bindings specified at the injection point. A child |Event| passes the event
subtype and additional bindings, along with the bindings of its parent.</text>
</assertion>
-
- <assertion id="l">
- <text>If an instance of an annotation that is not a binding type is passed to
~|addObserver()|~ or |removeObserver()|, an |IllegalArgumentException| is
thrown</text>
- </assertion>
+ </section>
- <assertion id="m">
- <text>If an instance of an annotation that is not a binding type is passed to
|addObserver()| or ~|removeObserver()|~, an |IllegalArgumentException| is
thrown</text>
+ <section id="10.4.2" title="The built-in Event">
+ <assertion id="a">
+ <text>The container must provide a built-in bean with
|Event<X>| for every legal observed event type X in its set of bean
types.</text>
</assertion>
- </section>
-
- <section id="7.4" title="Observer notification">
-
- <assertion id="a" testable="false">
- <text>When an event is fired by the application the container must determine
the observers for that event by calling |Manager.resolveObservers()|, passing the event
object and all event bindings</text>
- <note>This is not testable</note>
- </assertion>
<assertion id="b">
- <text>When an event is fired by the application the container must, for each
observer, call the |notify()| method of the Observer interface, passing the event
object</text>
+ <text>The container must provide a built-in bean with every event binding
type in its set of binding types.</text>
</assertion>
<assertion id="c">
- <text>If an observer throws an exception, the exception aborts processing of
the event. No other observers of that event will be called. The |fireEvent()| method
rethrows the exception</text>
+ <text>The container must provide a built-in bean with deployment type
|(a)Standard|.</text>
</assertion>
<assertion id="d">
- <text>Any observer called before completion of a transaction may call
|setRollbackOnly()| to force a transaction rollback</text>
+ <text>The container must provide a built-in bean with scope
|(a)Dependent|.</text>
</assertion>
<assertion id="e">
- <text>An observer may not directly ~initiate~, commit or rollback JTA
transactions</text>
+ <text>The container must provide a built-in bean with no bean EL
name.</text>
</assertion>
-
+
<assertion id="f">
- <text>An observer may not directly initiate, ~commit~ or rollback JTA
transactions</text>
+ <text>The container must provide a built-in bean with an implementation
provided automatically by the container.</text>
</assertion>
-
+
<assertion id="g">
- <text>An observer may not directly initiate, commit or ~rollback~ JTA
transactions</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>
-
- <section id="7.5" title="Observer methods">
+ <section id="10.5" title="Observer methods">
<assertion id="a">
<text>An observer method is an observer defined via annotations, instead of
by explicitly implementing the Observer interface. Unlike regular observers, observer
methods are automatically discovered and registered by the container</text>
</assertion>
<assertion id="b">
- <text>An observer method must be a method of a simple bean class or session
bean class</text>
+ <text>An observer method must be a method of a managed bean class or session
bean class</text>
</assertion>
<assertion id="c">
@@ -3821,7 +3799,7 @@
</assertion>
<assertion id="d">
- <text>If the bean is a session bean, the observer method must be a business
method of the EJB or a static method of the bean class</text>
+ <text>If the bean is a session bean, the observer method must be either a
business method of the EJB or a static method of the bean class</text>
</assertion>
<assertion id="e">
@@ -3833,72 +3811,59 @@
</assertion>
</section>
- <section id="7.5.1" title="Event parameter of an observer
method">
+ <section id="10.5.1" title="Event parameter of an observer
method">
<assertion id="a">
<text>Each observer method must have exactly one event parameter, of the same
type as the event type it observes. When searching for observer methods for an event, the
container considers the type and bindings of the event parameter</text>
</assertion>
<assertion id="b">
<text>If the event parameter does not explicitly declare any binding, the
observer method observes events with no binding</text>
- </assertion>
-
- <assertion id="c">
- <text>If the type of the event parameter contains type variables or
wildcards, a |DefinitionException| is thrown by the container at deployment
time</text>
- </assertion>
+ </assertion>
</section>
- <section id="7.5.2" title="Declaring an observer method using
annotations">
+ <section id="10.5.2" title="Declaring an observer method">
<assertion id="a">
- <text>A observer method may be declared using annotations by annotating a
parameter |(a)javax.event.Observes|. That parameter is the event parameter.</text>
+ <text>An observer method may be declared by annotating a parameter
|(a)javax.enterprise.event.Observes|. That parameter is the event parameter. The declared
type of the parameter is the observed event type.</text>
</assertion>
<assertion id="b">
- <text>If a method has more than one parameter annotated |@Observes|, a
|DefinitionException| is thrown by the container at deployment time</text>
+ <text>If a method has more than one parameter annotated |@Observes|, 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="c">
- <text>If an observer method is annotated |@Produces| a |DefinitionException|
is thrown by the container at deployment time</text>
+ <text>Observed event bindings may be declared by annotating the event
parameter.</text>
</assertion>
<assertion id="d">
- <text>If an observer method is annotated |@Initializer| a
|DefinitionException| is thrown by the container at deployment time</text>
+ <text>If an observer method is annotated |@Produces| 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="e">
- <text>If an observer method has a parameter annotated |@Disposes|, a
|DefinitionException| is thrown by the container at deployment time</text>
+ <text>If an observer method is annotated |@Initializer| 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="f">
- <text>If a non-static method of a session bean class has a parameter
annotated |@Observes|, and the method is not a business method of the EJB, a
|DefinitionException| is thrown by the container at deployment time</text>
+ <text>If an observer method is has a parameter annotated |@Disposes|, 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>The event parameter may declare bindings</text>
- </assertion>
+ <text>If a non-static method of a session bean class has a parameter
annotated |@Observes|, and the method is not a business method of the EJB, 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="7.5.3" title="Declaring an observer method using
XML">
-
- </section>
-
- <section id="7.5.4" title="Observer method parameters">
+ <section id="10.5.3" title="Observer method parameters">
<assertion id="a">
- <text>In addition to the event parameter, observer methods may declare
additional parameters, which may declare bindings. The container calls the method
|Manager.getInstanceToInject()| defined in Section 5.7.1, "Resolving
dependencies" to determine a value for each parameter of an observer method and calls
the observer method with those parameter values</text>
+ <text>In addition to the event parameter, observer methods may declare
additional parameters, which may declare bindings. These additional parameters are
injection points.</text>
</assertion>
</section>
- <section id="7.5.5" title="Conditional observer methods">
+ <section id="10.5.4" title="Conditional observer methods">
<assertion id="a">
- <text>Conditional observer methods are observer methods which are notified of
an event only if an instance of the bean that defines the observer method already exists
in the current context</text>
+ <text>A conditional observer method may be declared by annotating the event
parameter with the |(a)javax.enterprise.event.IfExists| annotation.</text>
</assertion>
-
- <assertion id="b">
- <text>A conditional observer methods may be declared by annotating the event
parameter with the |(a)javax.event.IfExists| annotation</text>
- </assertion>
-
</section>
- <section id="7.5.6" title="Transactional observer methods">
+ <section id="10.5.5" title="Transactional observer methods">
<assertion id="a">
<text>Transactional observer methods are observer methods which receive event
notifications during the before or after completion phase of the transaction in which the
event was fired. If no transaction is in progress when the event is fired, they are
notified at the same time as other observers</text>
</assertion>
@@ -3919,57 +3884,70 @@
<text>An after failure observer method is called during the after completion
phase of the transaction, only when the transaction fails</text>
</assertion>
- <assertion id="g">
- <text>A transactional observer method may be declared by annotating the event
parameter of the observer method or ~in XML by a child element of the
|<Observes>| element~</text>
+ <assertion id="ga">
+ <text>A transactional observer method may be declared by annotating the event
parameter of the observer method with one of the four following annotations defined in the
package |javax.enterprise.event|.</text>
</assertion>
- <assertion id="h">
- <text>The |(a)javax.event.BeforeTransactionCompletion| annotation or
|<BeforeTransactionCompletion>| element specifies that the observer method
is a before completion observer method</text>
+ <assertion id="ha">
+ <text>The |@BeforeTransactionCompletion| annotation specifies that the
observer method is a before completion observer method.</text>
</assertion>
- <assertion id="i">
- <text>The |(a)javax.event.AfterTransactionCompletion| annotation or
|<AfterTransactionCompletion>| element specifies that the observer method is
an after completion observer method</text>
+ <assertion id="ia">
+ <text>The |@AfterTransactionCompletion| annotation specifies that the
observer method is an after completion observer method.</text>
</assertion>
- <assertion id="j">
- <text>The |(a)javax.event.AfterTransactionSuccess| annotation or
|<AfterTransactionSuccess>| element specifies that the observer method is an
after success observer method</text>
+ <assertion id="ja">
+ <text>The |@AfterTransactionSuccess| annotation specifies that the observer
method is an after success observer method.</text>
</assertion>
- <assertion id="k">
- <text>The |(a)javax.event.AfterTransactionFailure| annotation or
|<AfterTransactionFailure>| element specifies that the observer method is an
after failure observer method</text>
+ <assertion id="ka">
+ <text>The |@AfterTransactionFailure| annotation specifies that the observer
method is an after failure observer method.</text>
</assertion>
- <assertion id="l">
- <text>A transactional observer method may not specify more than one of the
four types. If a transactional observer method specifies more than one of the four types,
a |DefinitionException| is thrown by the container at deployment time</text>
+ <assertion id="la">
+ <text>A transactional observer method may not specify more than one of the
four types. If a transactional observer method specifies more than one of the four types,
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="10.5.6" title="Asynchronous observer methods">
+ <assertion id="a">
+ <text>An asynchronous observer method may be declared by annotating the event
parameter of the observer method |(a)javax.enterprise.event.Asynchronously|.</text>
</assertion>
+
+ <assertion id="b">
+ <text>An asynchronous observer method may also be a transactional observer
method. However, it may not be a before completion observer method or a conditional
observer method. If an asynchronous observer method is specified as a before completion or
conditional observer method, 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="7.5.7" title="Asynchronous observer methods">
+ <section id="10.6" title="Observer notification">
+ <assertion id="a">
+ <text>When an event is fired by the application, the container must determine
the observers for that event according to the observer resolution algorithm, then for each
observer, call the |notify()| method of the |Observer| interface, passing the event
object.</text>
+ </assertion>
<assertion id="b">
- <text>An asynchronous observer method may be declared by annotating the event
parameter of the observer method |(a)javax.event.Asynchronously| or ~in XML by a child
|<Asynchronously>| element of the |<Observes>|
element~</text>
+ <text>The order in which observers are called in not defined, and so portable
applications should not rely upon the order in which observers are called.</text>
</assertion>
<assertion id="c">
- <text>An asynchronous observer method may also be a transactional observer
method</text>
+ <text>Observers may throw exceptions. If an observer throws an exception, the
exception aborts processing of the event. No other observers of that event will be called.
The |fireEvent()| method rethrows the exception.</text>
</assertion>
<assertion id="d">
- <text>If an asynchronous observer method is also a transactional observer
method, it ~may not be a before completion observer method~ or a conditional observer
method. If an asynchronous observer method is specified as a before completion or
conditional observer method, a |DefinitionException| is thrown by the container at
deployment time</text>
+ <text>Any observer called before completion of a transaction may call
setRollbackOnly() to force a transaction rollback.</text>
</assertion>
<assertion id="e">
- <text>If an asynchronous observer method is also a transactional observer
method, it may not be a before completion observer method or a ~conditional observer
method~. If an asynchronous observer method is specified as a before completion or
conditional observer method, a |DefinitionException| is thrown by the container at
deployment time</text>
+ <text>An observer may not directly initiate, commit or rollback JTA
transactions.</text>
</assertion>
</section>
- <section id="7.5.8" title="Observer object for an observer
method">
- <assertion id="a">
- <text>For every observer method of an enabled bean, the container is
responsible for providing and registering an appropriate implementation of the Observer
interface, that delegates event notifications to the observer method</text>
+ <section id="10.6.1" title="Observer method notification">
+ <assertion id="aa">
+ <text>For every observer method of an enabled bean, the container is
responsible for providing and registering an implementation of the |Observer| interface,
that delegates event notifications to the observer method, by calling the observer method
as defined in Section 5.4.8, "Invocation of observer methods".</text>
</assertion>
<assertion id="b">
- <text>The |notify()| method of the |Observer| implementation for an observer
method either invokes the observer method ~immediately~, or asynchronously, or registers
the observer method for later invocation during the transaction completion phase, using a
JTA Synchronization</text>
+ <text>The |notify()| method of the |Observer| implementation for an observer
method either invokes the observer method ~immediately~, or asynchronously, or registers
the observer method for later invocation during the transaction completion phase, using a
JTA Synchronization.</text>
</assertion>
<assertion id="c">
@@ -4000,31 +3978,7 @@
<text>The container is not required to guarantee delivery of asynchronous
events in the case of a server shutdown or failure</text>
<note>This is just a note about the lack of an assertion, and therefore is
not testable.</note>
</assertion>
-
- <assertion id="j">
- <text>To invoke an observer method, the container must pass the event object
to the event parameter and the object returned by |Manager.getInstanceToInject()| to each
of the other parameters</text>
- </assertion>
-
- <assertion id="k">
- <text>If the observer method is static, the container must invoke the
method</text>
- </assertion>
-
- <assertion id="l">
- <text>If the observer method is non-static, the container must obtain the
|Bean| object for the most specialized bean that specializes the bean which declares the
observer method</text>
- </assertion>
-
- <assertion id="m">
- <text>Placeholder for path 2</text>
- </assertion>
-
- <assertion id="n">
- <text>Placeholder for path 3</text>
- </assertion>
-
- <assertion id="o">
- <text>Placeholder for path 4 etc</text>
- </assertion>
-
+
<assertion id="p" testable="false">
<text>If the observer is a transactional or asynchronous observer method, any
exception is caught and logged by the container</text>
<note>Cannot be tested as they are not under our control</note>
@@ -4037,13 +3991,9 @@
<assertion id="r">
<text>If the exception is a checked exception, it is wrapped and rethrown as
an (unchecked) |ObserverException|</text>
</assertion>
-
- <assertion id="s">
- <text>The observer object is registered by calling |Manager.addObserver()|,
passing the event parameter type as the observed event type, and the bindings of the event
parameter as the observed event bindings</text>
- </assertion>
</section>
- <section id="7.5.9" title="Observer invocation context">
+ <section id="10.6.2" title="Observer method invocation
context">
<assertion id="a">
<text>If the observer method is an asynchronous observer method, it is called
with no active transaction, no client security context and with a new request context that
is destroyed when the observer method returns. The application context is also
active</text>
</assertion>
@@ -4062,702 +4012,44 @@
<assertion id="e">
<text>The transaction and security contexts for a business method of a
session bean also depend upon the transaction attribute and |@RunAs| descriptor, if
any</text>
- </assertion>
+ </assertion>
</section>
-
- <section id="7.6" title="The Event interface">
- <assertion id="a">
- <text>An instance of the |javax.event.Event| interface may be injected via
use of the |(a)javax.event.Fires| binding</text>
- </assertion>
- <assertion id="b">
- <text>Additional bindings may be specified at the injection point for
|javax.event.Event|</text>
- </assertion>
-
- <assertion id="c">
- <text>The |Event| interface provides a method for firing events of a specific
type</text>
- </assertion>
-
- <assertion id="d">
- <text>The |Event| interface provides a method for registering observers for
events of the same type</text>
- </assertion>
-
- <assertion id="e">
- <text>The first parameter of the |fire()| method is the event object. The
remaining parameters are event bindings</text>
- </assertion>
-
- <assertion id="f">
- <text>The first parameter of the |observe()| method is the observer object.
The remaining parameters are the observed event bindings</text>
- </assertion>
-
- <assertion id="g">
- <text>If two instances of the same binding type are passed to |fire()| or
|observes()|, a |DuplicateBindingTypeException| is thrown</text>
- </assertion>
-
- <assertion id="h">
- <text>If an instance of an annotation that is not a binding type is passed to
|fire()| or |observes()|, an |IllegalArgumentException| is thrown</text>
- </assertion>
-
- <assertion id="i">
- <text>The |@Fires| annotation or |<Fires>| element may be
applied to any injection point of type |Event|, where an actual type parameter is
specified</text>
- </assertion>
-
- <assertion id="j">
- <text>If the type of the injection point is not of type |Event| a
|DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="k">
- <text>If the type of the injection point has no actual type parameter
specified a |DefinitionException| is thrown by the container at deployment
time</text>
- </assertion>
-
- <assertion id="l">
- <text>If the type of the injection point parameter contains a type variable a
|DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="m">
- <text>If the type of the injection point parameter contains a wildcard a
|DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="n">
- <text>Whenever the |@Fires| annotation appears at an injection point, an
implicit bean exists with exactly the bean type and bindings that appear at the injection
point</text>
- </assertion>
-
- <assertion id="o">
- <text>Whenever the |@Fires| annotation appears at an injection point, an
implicit bean exists with deployment type |@Standard|,</text>
- </assertion>
-
- <assertion id="p">
- <text>Whenever the |@Fires| annotation appears at an injection point, an
implicit bean exists with |@Dependent| scope</text>
- </assertion>
-
- <assertion id="q">
- <text>Whenever the |@Fires| annotation appears at an injection point, an
implicit bean exists with no bean name</text>
- </assertion>
-
- <assertion id="r">
- <text>Whenever the |@Fires| annotation appears at an injection point, an
implicit bean exists with an implementation provided automatically by the
container</text>
- </assertion>
-
- <assertion id="s">
- <text>The |fire()| method of the provided implementation of |Event| must call
|Manager.fireEvent()|, passing the event object passed to |Event.fire()|, all bindings
declared at the injection point (except |@Fires|), and all bindings passed to
|Event.fire()|</text>
- </assertion>
-
- <assertion id="t">
- <text>The application may fire events by calling the |fire()|
method</text>
- </assertion>
-
- <assertion id="u">
- <text>The |observe()| method of the provided implementation of |Event| must
call |Manager.addObserver()|, passing the observer object passed to |Event.observe()|, all
bindings declared at the injection point (except |@Fires|), and all bindings passed to
|Event.observer()|</text>
- </assertion>
-
- <assertion id="v">
- <text>The application may register observers by calling the |observe()|
method</text>
- </assertion>
- </section>
-
- <section id="7.7" title="Observer resolution">
+ <section id="10.7" title="JMS event mappings">
<assertion id="a">
- <text>The method |Manager.resolveObservers()| resolves observers for an event
- the first parameter of |resolveObservers()| is the event object. The remaining
parameters are event bindings</text>
+ <text>An event type may be mapped to a JMS topic.</text>
</assertion>
<assertion id="b">
- <text>If the type of the event object passed to |resolveObservers()| contains
type variables, an |IllegalArgumentException| is thrown</text>
+ <text>An event mapping is a special kind of observer method that is declared
by an interface.</text>
</assertion>
<assertion id="c">
- <text>If the type of the event object passed to |resolveObservers()| contains
wildcards, an |IllegalArgumentException| is thrown</text>
+ <text>The event parameter specifies the mapped event type and
bindings.</text>
</assertion>
<assertion id="d">
- <text>If two instances of the same binding type are passed to
|resolveObservers()|, a |DuplicateBindingTypeException| is thrown</text>
+ <text>Every message destination representing a topic that any injected
parameter resolves to is a mapped topic.</text>
</assertion>
<assertion id="e">
- <text>If an instance of an annotation that is not a binding type is passed to
|resolveObservers()|, an |IllegalArgumentException| is thrown</text>
+ <text>An event mapping may be specified as a member of any
interface.</text>
</assertion>
<assertion id="f">
- <text>When searching for observers for an event, the event object must be
assignable to the observed event type, taking type parameters into
consideration</text>
+ <text>All observers of mapped event types must be asynchronous observer
methods. If an observer for a mapped event type is not an asynchronous observer method,
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="g">
- <text>When searching for observers for an event, for each observed event
binding, (a) an instance of the binding type must have been passed to |fireEvent()| and
(b) any member values of the binding type must match the member values of the instance
passed to |fireEvent()|</text>
+ <text>For every event mapping, the container must send a message containing
the serialized event and its event bindings to every mapped topic whenever an event with
the mapped event type and bindings is fired, and monitor every mapped topic for messages
containing events of that mapped event type and bindings and notify all local observers
whenever a message containing an event is received. Thus, events with the mapped event
type and bindings are distributed to other processes which have the same event
mapping.</text>
</assertion>
</section>
-
- <section id="7.7.1" title="Event binding types with
members">
- <assertion id="a">
- <text>The binding type for an |Event| binding may have annotation
members</text>
- </assertion>
-
- <assertion id="b" testable="false">
- <text>The container uses |equals()| to compare event binding type member
values</text>
- <note>Since only primitive types are allowed, the call to equals() cannot be
checked</note>
- </assertion>
- </section>
-
- <section id="7.7.2" title="Multiple event bindings">
- <assertion id="a">
- <text>An event parameter may have multiple bindings</text>
- </assertion>
-
- <assertion id="b">
- <text>An observer method will only be notified if all the observed event
bindings are specified when the event is fired</text>
- </assertion>
-
- <assertion id="c">
- <text>Other, less specific, observers will also be notified of events with
multiple event bindings</text>
- </assertion>
- </section>
-
- <section id="7.8" title="JMS event mappings">
- <assertion id="a">
- <text>An event type may be mapped to a JMS resource that represents a
topic</text>
- </assertion>
-
- <assertion id="b">
- <text>Multiple event types may be mapped to the same topic</text>
- </assertion>
-
- <assertion id="c">
- <text>All observers of mapped event types must be asynchronous observer
methods. If an observer for a mapped event type is not an asynchronous observer method, a
|DeploymentException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>When an event type is mapped to a topic, the container must send a
message containing the serialized event and its event bindings to the topic whenever an
event with that type is fired</text>
- </assertion>
-
- <assertion id="e">
- <text>When an event type is mapped to a topic, the container must listen for
messages containing events of that type sent to the topic, and notify all observers of the
event type whenever a message containing an event of that type is received</text>
- </assertion>
-
- <assertion id="f">
- <text>Events of a mapped event type are distributed to other processes which
have the same event type mapped to the same topic</text>
- </assertion>
- </section>
-
- <section id="8" title="Scopes and contexts">
-
- </section>
-
-
- <section id="8.3.1" title="Dependent objects">
- <assertion id="a" testable="false">
- <text>A bean, EJB or servlet may obtain an instance of a bean with scope
|@Dependent| via dependency injection or by calling |Manager.getInstance()|,
|Manager.getInstanceByType()| or |Instance.get()| when the |@Dependent| scope is
active</text>
- <note>A statement of intent</note>
- </assertion>
-
- </section>
-
- <section id="8.4" title="Passivating scopes and
serialization">
- <assertion id="a">
- <text>The container must validate that every bean declared with a passivating
scope truly is serializable - EJB local objects are serializable. Therefore, a session
bean may declare any passivating scope</text>
- </assertion>
-
- <assertion id="b">
- <text>Simple beans are not required to be serializable. If a simple bean
declares a passivating scope, and the bean class is not serializable, a
|DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="cc">
- <text>If a ~producer method or ~field declares a passivating scope and
returns a non-serializable object at runtime, an |IllegalProductException| is thrown by
the container</text>
- </assertion>
-
- <assertion id="cd">
- <text>If a producer method~ or field~ declares a passivating scope and
returns a non-serializable object at runtime, an |IllegalProductException| is thrown by
the container</text>
- </assertion>
-
- <assertion id="ca">
- <text>Check a producer method which declares a passivating scope and returns
a serializable product works</text>
- <note>Sanity test</note>
- </assertion>
-
- <assertion id="cb">
- <text>Check a producer method which declares a passivating scope and returns
a primitive product works</text>
- <note>Sanity test</note>
- </assertion>
-
- <assertion id="d" testable="false">
- <text>The built-in session and conversation scopes are
passivating</text>
- <note>This is an API signature test</note>
- </assertion>
-
- <assertion id="e" testable="false">
- <text>No other built-in scope besides session and conversation scopes are
passivating</text>
- <note>This is an API signature test</note>
- </assertion>
-
- <assertion id="f">
- <text>A contextual instance of a bean may be serialized when the bean
declares a passivating scope, and context passivation occurs</text>
- </assertion>
-
- <assertion id="g">
- <text>A contextual instance of a bean may be serialized when the bean is an
EJB stateful session bean, and it is passivated by the EJB container</text>
- </assertion>
-
- <assertion id="h" testable="false">
- <text>In either case of assertion f or g above, any non-transient field that
holds a reference to another bean must be serialized along with the bean that is being
serialized. Therefore, the reference must be to a serializable type</text>
- <note>An explanation</note>
- </assertion>
-
- <assertion id="i">
- <text>Any reference to a bean which declares a normal scope is
serializable</text>
- </assertion>
-
- <assertion id="j">
- <text>EJB local objects are serializable, therefore, any reference to a
session bean of scope |@Dependent| is serializable</text>
- </assertion>
-
- <assertion id="k">
- <text>If a simple bean of scope |@Dependent| and a nonserializable bean class
is injected into a stateful session bean an |UnserializableDependencyException| must be
thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="l">
- <text>If a simple bean of scope |@Dependent| and a nonserializable bean class
is injected into a non-transient field an |UnserializableDependencyException| must be
thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="m">
- <text>If a simple bean of scope |@Dependent| and a nonserializable bean class
is injected into a bean constructor parameter of a bean which declares a passivating
scope, an |UnserializableDependencyException| must be thrown by the container at
deployment time</text>
- </assertion>
-
- <assertion id="n">
- <text>If a simple bean of scope |@Dependent| and a nonserializable bean class
is injected into an initializer method parameter of a bean which declares a passivating
scope, an |UnserializableDependencyException| must be thrown by the container at
deployment time</text>
- </assertion>
-
- <assertion id="o">
- <text>If a simple bean of scope |@Dependent| and a nonserializable bean class
is injected into a parameter of a producer method which declares a passivating scope, an
|UnserializableDependencyException| must be thrown by the container at deployment
time</text>
- </assertion>
-
- <assertion id="p">
- <text>If a producer method or field of scope |@Dependent| returns a
non-serializable object for injection into a stateful session bean, an
|IllegalProductException| is thrown by the container</text>
- </assertion>
-
- <assertion id="q">
- <text>If a producer method or field of scope |@Dependent| returns a
non-serializable object for injection into a non-transient field an
|IllegalProductException| is thrown by the container</text>
- </assertion>
-
- <assertion id="r">
- <text>If a producer method or field of scope |@Dependent| returns a
non-serializable object for injection into a bean constructor parameter of a bean which
declares a passivating scope, an |IllegalProductException| is thrown by the
container</text>
- </assertion>
-
- <assertion id="s">
- <text>If a producer method or field of scope |@Dependent| returns a
non-serializable object for injection into an initializer method parameter of a bean which
declares a passivating scope, an |IllegalProductException| is thrown by the
container</text>
- </assertion>
-
- <assertion id="t">
- <text>If a producer method or field of scope |@Dependent| returns a
non-serializable object for injection into a parameter of a producer method which declares
a passivating scope, an |IllegalProductException| is thrown by the container</text>
- </assertion>
-
- <assertion id="u">
- <text>The container must guarantee that JMS resource proxy objects are
serializable</text>
- </assertion>
-
- <assertion id="v">
- <text>The method |Bean.isSerializable()| may be used to detect if a bean is
serializable</text>
- </assertion>
- </section>
-
- <section id="8.5" title="Context management for built-in
scopes">
-
- <assertion id="a">
- <text>The container provides an implementation of the |Context| interface for
each of the built-in scopes</text>
- </assertion>
-
- <assertion id="b">
- <text>For each of the built-in normal scopes, contexts propagate across any
Java method call, including invocation of EJB local business methods</text>
- </assertion>
-
- <assertion id="c">
- <text>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</text>
- </assertion>
-
- </section>
-
- <section id="8.5.1" title="Request context lifecycle">
-
- <assertion id="a">
- <text>The request scope is active during the |service()| method of any
servlet in the web application</text>
- </assertion>
-
- <assertion id="b">
- <text>The request scope is active during the |doFilter()| method of any
servlet filter</text>
- </assertion>
-
- <assertion id="c">
- <text>The request context is destroyed at the end of the servlet request,
after the |service()| method and all |doFilter()| methods return</text>
- </assertion>
-
- <assertion id="d">
- <text>The request scope is active during any Java EE web service
invocation</text>
- </assertion>
-
- <assertion id="e">
- <text>The request context is destroyed after a web service invocation
completes</text>
- </assertion>
-
- <assertion id="f">
- <text>The request scope is active during any asynchronous observer method
notification</text>
- </assertion>
-
- <assertion id="g">
- <text>The request context is destroyed after a asynchronous observer method
notification completes</text>
- </assertion>
-
- <assertion id="h">
- <text>The request scope is active during any remote method invocation of any
EJB</text>
- </assertion>
-
- <assertion id="i">
- <text>The request scope is active during any call to an EJB timeout
method</text>
- <note>Only applicable in EJB 3.1 environments</note>
- </assertion>
-
- <assertion id="j">
- <text>The request scope is active during message delivery to any EJB
message-driven bean</text>
- </assertion>
-
- <assertion id="k">
- <text>The request context is destroyed after the remote EJB method invocation
completes</text>
- </assertion>
-
- <assertion id="l">
- <text>The request context is destroyed after the invocation of an EJB timeout
method</text>
- <note>Only applicable in EJB 3.1 environments</note>
- </assertion>
-
- <assertion id="m">
- <text>The request context is destroyed after message delivery to an EJB
message-drive bean completes</text>
- </assertion>
- </section>
-
- <section id="8.5.2" title="Session context lifecycle">
-
- <assertion id="a">
- <text>The session scope is active during the |service()| method of any
servlet in the web application</text>
- </assertion>
-
- <assertion id="b">
- <text>The session scope is active during the |doFilter()| method of any
servlet filter</text>
- </assertion>
-
- <assertion id="c">
- <text>The session context is shared between all servlet requests that occur
in the same HTTP servlet session</text>
- </assertion>
-
- <assertion id="d">
- <text>The session context is destroyed when the HTTPSession is
invalidated</text>
- </assertion>
-
- <assertion id="e">
- <text>The session context is destroyed when the HTTPSession times
out</text>
- </assertion>
- </section>
-
- <section id="8.5.3" title="Application context lifecycle">
-
- <assertion id="a">
- <text>The application scope is active during the |service()| method of any
servlet in the web application</text>
- </assertion>
-
- <assertion id="b">
- <text>The application scope is active during the |doFilter()| method of any
servlet filter</text>
- </assertion>
-
- <assertion id="c">
- <text>The application scope is active during any Java EE web service
invocation</text>
- </assertion>
-
- <assertion id="d">
- <text>The application scope is active during any asynchronous observer method
notification</text>
- </assertion>
-
- <assertion id="e">
- <text>The application scope is active during any remote method invocation of
any EJB</text>
- </assertion>
-
- <assertion id="f">
- <text>The application scope is active during any call to an EJB timeout
method</text>
- </assertion>
-
- <assertion id="g">
- <text>The application scope is active during message delivery to any EJB
message-driven bean</text>
- </assertion>
-
- <assertion id="h">
- <text>The application context is shared between all servlet requests that
execute within the same application</text>
- </assertion>
-
- <assertion id="i">
- <text>The application context is shared between all asynchronous observer
method notifications that execute within the same application</text>
- </assertion>
-
- <assertion id="j">
- <text>The application context is shared between all web service invocations
that execute within the same application</text>
- </assertion>
-
- <assertion id="k">
- <text>The application context is shared between all EJB remote method
invocations that execute within the same application</text>
- </assertion>
-
- <assertion id="l">
- <text>The application context is shared between all EJB timeouts that execute
within the same application</text>
- </assertion>
-
- <assertion id="m">
- <text>The application context is shared between all message deliveries to
message driven beans that execute within the same application</text>
- </assertion>
-
- <assertion id="n">
- <text>The application context is destroyed when the application is
undeployed</text>
- </assertion>
- </section>
-
- <section id="8.6" title="Context management for custom
scopes">
-
- <assertion id="a">
- <text>A custom implementation of |Context| may be associated with any scope
type at any point in the execution of the application, by calling
|Manager.addContext()|</text>
- </assertion>
-
- <assertion id="b">
- <text>Every time |Manager.getInstance()| is called, for example, during
instance or EL name resolution, the container must call |Manager.getContext()| to retrieve
an active context object associated with the bean scope</text>
- </assertion>
-
- <assertion id="c">
- <text>If no active context object exists for the given scope type,
|Manager.getContext()| must throw a |ContextNotActiveException|</text>
- </assertion>
-
- <assertion id="d">
- <text>If more than one active context object exists for the given scope type,
|Manager.getContext()| must throw an |IllegalStateException|</text>
- </assertion>
- </section>
-
- <section id="9" title="XML based metadata">
-
- <assertion id="b">
- <text>Multiple namespaces are accommodated, each representing a Java
package</text>
- </assertion>
-
- <assertion id="c">
- <text>XML elements belonging to these namespaces represent Java types, fields
and methods</text>
- </assertion>
-
- <assertion id="d">
- <text>Each namespace may declare an XML schema</text>
- </assertion>
-
- <assertion id="e">
- <text>If a |beans.xml| file contains any XML element without a declared
namespace, a |DefinitionException| is thrown by the container at deployment
time</text>
- </assertion>
-
- </section>
-
- <section id="9.1" title="XML namespace for a Java package">
- <assertion id="a">
- <text>Every Java package has a corresponding XML namespace. The namespace URN
consists of the package name, with the prefix |urn:java:|</text>
- </assertion>
-
- <assertion id="b">
- <text>Each namespace may, optionally, have a schema</text>
- </assertion>
-
- <assertion id="c">
- <text>An XML element belonging to such a namespace represents a Java type in
the corresponding Java package, or a method or field of a type in that
package</text>
- </assertion>
-
- <assertion id="d">
- <text>If there is a Java type in the package with the same name as the XML
element, the XML element can be interpreted to represent that Java type</text>
- </assertion>
-
- <assertion id="e">
- <text>Type parameters may be specified by child elements of the element that
represents the type</text>
- </assertion>
-
- <assertion id="f">
- <text>Members of a type may be specified by child elements of the element
that represents the type, in the same namespace as the element that represents the
type</text>
- </assertion>
-
- </section>
-
- <section id="9.2" title="XML namespace aggregating multiple
packages">
- <assertion id="a">
- <text>Alternatively, a namespace may represent several Java packages. Such a
namespace must have a URN consisting of the prefix |urn:java:| followed by a
period-separated list of valid Java identifiers</text>
- </assertion>
-
- <assertion id="b">
- <text>The list of packages for such a namespace must be defined in a
classpath resource named namespace in the path named by the identifier list</text>
- </assertion>
-
- <assertion id="c">
- <text>The format of the file is a list of packages, separated by
whitespace</text>
- </assertion>
-
- <assertion id="d">
- <text>An XML element belonging to such a namespace represents a Java type in
one of the listed packages, or a method or field of a type in one of the listed
packages</text>
- </assertion>
-
- <assertion id="e">
- <text>If there are multiple packages containing a Java type with the same
name as the XML element, a |DefinitionException| is thrown by the container at deployment
time</text>
- </assertion>
-
- <assertion id="f">
- <text>If there is exactly one Java type in the listed packages with the same
name as the XML element, the XML element can be interpreted to represent that Java
type</text>
- </assertion>
- </section>
-
- <section id="9.2.1" title="The Java EE namespace">
- <assertion id="a">
- <text>The Java EE namespace |urn:java:ee| represents the following packages:
|java.lang|, |java.util|, |javax.annotation|, |javax.inject|, |javax.context|,
|javax.interceptor|, |javax.decorator|, |javax.event|, |javax.ejb|, |javax.persistence|,
|javax.xml.ws|, |javax.jms|, and |javax.sql|</text>
- </assertion>
-
- <assertion id="b" testable="false">
- <text>Several elements in the |urn:java:ee| namespace do not represent Java
types</text>
- <note>Intent</note>
- </assertion>
-
- <assertion id="c" testable="false">
- <text>The root |<Beans>| element, together with the
|<Deploy>|, |<Interceptors>| and |<Decorators>|
elements belong to the namespace |urn:java:ee| and do not represent Java types nor members
of Java types</text>
- <note>Intent</note>
- </assertion>
-
- <assertion id="d">
- <text>Java array types may be represented by an |<Array>|
element in the namespace |urn:java:ee|, with a child element representing the element
type</text>
- </assertion>
-
- <assertion id="e">
- <text>Primitive types may be represented by the XML element that represents
the corresponding wrapper type in |java.lang|, since primitive and wrapper types are
considered identical for the purposes of typesafe resolution, and assignable for the
purposes of injection</text>
- </assertion>
- </section>
-
- <section id="9.3" title="Standard schema location for a
namespace">
- <assertion id="a">
- <text>The container must validate all namespaces for which schemas are
available in the classpath</text>
- </assertion>
-
- <assertion id="b">
- <text>The container searches for a schema for each namespace in the classpath
directory corresponding to the namespace</text>
- </assertion>
-
- <assertion id="c">
- <text>The schema must be named schema.xsd</text>
- </assertion>
- </section>
-
- <section id="9.4" title="Stereotype, binding type and interceptor
binding type declarations">
- <assertion id="a">
- <text>An XML element that appears as a direct child of the root
|<Beans>| element is interpreted as a binding type declaration if it has a
direct child |<BindingType>| element in the Java EE namespace, as defined in
Section 2.3.2, "Defining new binding types"</text>
- </assertion>
-
- <assertion id="b">
- <text>An XML element that appears as a direct child of the root
|<Beans>| element is interpreted as an interceptor binding type if it has a
direct child |<InterceptorBindingType>| element in the Java EE namespace, as
defined in Section A.3.4, "Interceptor bindings"</text>
- </assertion>
-
- <assertion id="c">
- <text>An XML element that appears as a direct child of the root
|<Beans>| element is interpreted as a stereotype declaration if it has a
direct child |<Stereotype>| element in the Java EE namespace, as defined in
Section 2.7.1, "Defining new stereotypes"</text>
- </assertion>
-
- <assertion id="d">
- <text>The XML element is interpreted as a Java type. If no such Java type
exists in the classpath, a |DefinitionException| is thrown by the container at deployment
time. If the type is not an annotation type, a |DefinitionException| is thrown by the
container at deployment time</text>
- </assertion>
-
- <assertion id="e">
- <text>If the annotation type is already declared as a binding type using
annotations, the annotations are ignored by the container and the XML-based declaration is
used</text>
- </assertion>
-
- <assertion id="f">
- <text>If the annotation type is already declared as an interceptor binding
type using annotations, the annotations are ignored by the container and the XML-based
declaration is used</text>
- </assertion>
-
- <assertion id="g">
- <text>If the annotation type is already declared as a stereotype using
annotations, the annotations are ignored by the container and the XML-based declaration is
used</text>
- </assertion>
-
- <assertion id="h">
- <text>If a certain annotation type is declared more than once as a binding
type, interceptor binding type or stereotype using XML, a |DeploymentException| is thrown
by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="9.4.1" title="Child elements of a stereotype
declaration">
- <assertion id="a">
- <text>Every direct child element of a stereotype declaration is interpreted
as a Java type</text>
- </assertion>
-
- <assertion id="b">
- <text>If no such Java type exists in the classpath, a |DefinitionException|
is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="c">
- <text>If the type is not an annotation type, a |DefinitionException| is
thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>If the annotation type is a scope type, the default scope of the
stereotype was declared</text>
- </assertion>
-
- <assertion id="e">
- <text>If the annotation type is a deployment type, the default scope of the
stereotype was declared</text>
- </assertion>
-
- <assertion id="f">
- <text>If the annotation type is a interceptor binding type, an interceptor
binding of the stereotype was declared</text>
- </assertion>
-
- <assertion id="g">
- <text>If the annotation type is |javax.annotation.Named|, a stereotype with
name defaulting was declared</text>
- </assertion>
-
- <assertion id="h">
- <text>Otherwise, a |DefinitionException| is thrown by the container at
deployment time</text>
- </assertion>
- </section>
-
- <section id="9.4.2" title="Child elements of an interceptor binding
type declaration">
- <assertion id="a">
- <text>Every direct child element of an interceptor binding type declaration
is interpreted as a Java type</text>
- </assertion>
-
- <assertion id="b">
- <text>If no such Java type exists in the classpath, a |DefinitionException|
is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="c">
- <text>If the type is not an annotation type, a |DefinitionException| is
thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>If the annotation type is an interceptor binding type, an inherited
interceptor binding was declared, as defined in Section A.3.4.1, "Interceptor binding
types with additional interceptor bindings"</text>
- </assertion>
-
- <assertion id="e">
- <text>If the annotation type is not an interceptor binding type, a
|DefinitionException| is thrown by the container at deployment time</text>
- </assertion>
-
- </section>
-
- <section id="9.12" title="Deployment declarations">
- <assertion id="a">
- <text>The |<Deploy>|, |<Interceptors>| and
|<Decorators>| elements in the Java EE namespace determine which beans,
interceptors and decorators are enabled in a particular deployment</text>
- </assertion>
- </section>
-
- <section id="9.12.1" title="The <Deploy>
declaration">
- <assertion id="a">
- <text>Each direct child element of a |<Deploy>| element is
interpreted as the declaring an enabled deployment type, as specified in Section 2.5.6,
"Enabled deployment types"</text>
- </assertion>
-
- <assertion id="b">
- <text>Each child element is interpreted as a Java annotation type. If no such
Java type exists in the classpath, a |DefinitionException| is thrown by the container at
deployment time. If the type is not a deployment type, a |DefinitionException| is thrown
by the container at deployment time.</text>
- </assertion>
-
- <assertion id="c">
- <text>If the same deployment type is declared more than once, a
|DefinitionException| is thrown by the container at deployment time.</text>
- </assertion>
- </section>
-
+
<section id="11" title="Packaging and Deployment">
</section>
- <section id="11.1" title="Deployment lifecycle">
-
+ <section id="11.1" title="Deployment lifecycle">
<assertion id="a">
<text>First, the container performs bean discovery and registers |Bean| and
|Observer| objects for the discovered beans. The container detects definition errors by
validating the bean classes and metadata, throwing a |DeploymentException| and aborting
deployment of the application if any definition errors exist, as defined in Section 10.1,
"Definition errors".</text>
<note>Test that beans and observers are registered and definition exceptions
occur before @Initialized, and that this causes the app deployment to fail</note>
@@ -4785,8 +4077,7 @@
</section>
- <section id="11.2" title="Bean discovery">
-
+ <section id="11.2" title="Bean discovery">
<assertion id="a" implied="true">
<text>When bean discovery occurs, the container considers any |beans.xml|
file in any metadata directory of the application classpath (standalone WAR)</text>
</assertion>