[webbeans-commits] Webbeans SVN: r1623 - tck/trunk/impl/src/main/resources.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Sat Feb 21 17:51:48 EST 2009


Author: shane.bryzak at jboss.com
Date: 2009-02-21 17:51:48 -0500 (Sat, 21 Feb 2009)
New Revision: 1623

Modified:
   tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
chapter 6 assertions

Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml	2009-02-21 21:10:30 UTC (rev 1622)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml	2009-02-21 22:51:48 UTC (rev 1623)
@@ -3073,9 +3073,495 @@
   </section>
   
   <section id="6" title="Bean lifecycle">
+    <assertion id="a">
+      <text>To create a contextual instance of a session bean, the container creates an EJB local object reference</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>To create a contextual instance of a producer method bean, the container calls the producer method</text>
+    </assertion>
+    
+    <assertion id="c">
+      <text>To create a contextual instance of a producer field bean, the container retrieves the current value of the field</text>
+    </assertion>
+    
+    <assertion id="d">
+      <text>To create a contextual instance of a simple bean, the container calls the bean constructor</text>
+    </assertion>
+    
+    <assertion id="e">
+      <text>To destroy a contextual instance of a stateful session bean, the container removes the EJB instance</text>
+    </assertion>
+    
+    <assertion id="f">
+      <text>To destroy a contextual instance of a producer method bean, the container calls the disposal method, if any</text>
+    </assertion>
+    
+    <assertion id="g">
+      <text>When the container injects a dependency and there is no existing instance of the bean cached by the context object for the bean scope, the context object automatically creates a new contextual instance of the bean</text>
+    </assertion>
+    
+    <assertion id="h">
+      <text>When the container resolves an EL name and there is no existing instance of the bean cached by the context object for the bean scope, the context object automatically creates a new contextual instance of the bean</text>
+    </assertion>
+    
+    <assertion id="i">
+      <text>When a context is destroyed, the context object automatically destroys any instances associated with that context</text>
+    </assertion>
+    
+    <assertion id="j">
+      <text>To create and destroy contextual instances, the context object calls operations defined by the interface Contextual</text>
+    </assertion>
+  </section>
   
+  <section id="6.1" title="The Contextual interface">
+    <assertion id="a">
+      <text>The interface javax.context.CreationalContext provides an operation that allows the create() method to register an incompletely initialized contextual instance with the container.  A contextual instance is considered incompletely initialized until the create() method returns the instance</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>If Contextual.create() calls CreationalContext.push(), it must also return the instance passed to push()</text>
+    </assertion>
+    
+    <assertion id="c">
+      <text>The implementation of Contextual is not required to call CreationalContext.push()</text>
+    </assertion>
   </section>
   
+  <section id="6.2" title="Creation">
+    <assertion id="a">
+      <text>The Contextual.create() method obtains an instance of the bean</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>The Contextual.create() method creates the interceptor stacks and binds them to the instance</text>
+    </assertion>
+    
+    <assertion id="c">
+      <text>The Contextual.create() method creates the decorator stacks and binds them to the instance</text>
+    </assertion>
+    
+    <assertion id="d">
+      <text>The Contextual.create() method injects any dependencies</text>
+    </assertion>
+    
+    <assertion id="e">
+      <text>The Contextual.create() method sets any initial field values defined in XML</text>
+    </assertion>
+    
+    <assertion id="f">
+      <text>The Contextual.create() method calls the @PostConstruct method, if necessary</text>
+    </assertion>
+    
+    <assertion id="g">
+      <text>If any exception occurs while creating an instance, the exception is rethrown by the create() method</text>
+    </assertion>
+    
+    <assertion id="h">
+      <text>If a checked exception occurs while creating an instance, it is wrapped and rethrown as an (unchecked) CreationException</text>
+    </assertion>
+  </section>
+  
+  <section id="6.3" title="Destruction">
+    <assertion id="a">
+      <text>The Contextual.destroy() method calls the disposal method, if necessary</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>The Contextual.destroy() method calls the @PreDestroy method, if necessary</text>
+    </assertion>
+    
+    <assertion id="c">
+      <text>The Contextual.destroy() method destroys all dependent objects of the instance, as defined in Section 8.3.2, "Dependent object destruction"</text>
+    </assertion>
+    
+    <assertion id="d">
+      <text>If any exception occurs while destroying an instance, the exception is caught by the destroy() method</text>
+    </assertion>
+    
+    <assertion id="e">
+      <text>If the application invokes a contextual instance after it has been destroyed, the behavior is undefined</text>
+    </assertion>
+  </section>
+  
+  <section id="6.4" title="Lifecycle of simple beans">
+    <assertion id="a">
+      <text>When the create() method of the Bean object that represents a simple bean is called, the container first calls the bean constructor to obtain an instance of the bean. For each constructor parameter, the container passes the object returned by Manager.getInstanceToInject(). The container is permitted to return an instance of a container-generated subclass of the bean class, allowing interceptor and decorator bindings</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>When the create() method of the Bean object that represents a simple bean is called, after the bean constructor is called the container next initializes the values of any attributes annotated @EJB</text>
+    </assertion>
+    
+    <assertion id="c">
+      <text>When the create() method of the Bean object that represents a simple bean is called, after the bean constructor is called the container next initializes the values of any attributes annotated @PersistenceContext</text>
+    </assertion>
+    
+    <assertion id="d">
+      <text>When the create() method of the Bean object that represents a simple bean is called, after the bean constructor is called the container next initializes the values of any attributes annotated @Resource</text>
+    </assertion>
+    
+    <assertion id="e">
+      <text>When the create() method of the Bean object that represents a simple bean is called, after the @EJB, @PersistenceContext and @Resource attributes are initialized the container initializes the values of all injected fields. For each injected field, the container sets the value to the object returned by Manager.getInstanceToInject().</text>
+    </assertion>
+    
+    <assertion id="f">
+      <text>When the create() method of the Bean object that represents a simple bean is called, after injected fields are initialized the container initializes the values of any fields with initial values specified in XML, as defined in Section 9.5.5, "Field initial value declarations".</text>
+    </assertion>
+    
+    <assertion id="g">
+      <text>When the create() method of the Bean object that represents a simple bean is called, after the values of fields with initial values specified in XML are initialized the container calls all initializer methods. For each initializer method parameter, the container passes the object
+returned by Manager.getInstanceToInject()</text>
+    </assertion>
+    
+    <assertion id="h">
+      <text>When the create() method of the Bean object that represents a simple bean is called, after all initializer methods are called the container builds the interceptor stacks for the instance as defined in Section A.3.10 "Interceptor stack creation"</text>
+    </assertion>
+    
+    <assertion id="i">
+      <text>When the create() method of the Bean object that represents a simple bean is called, after all initializer methods are called the container builds the decorator stacks for the instance as defined in Section A.5.8 "Decorator stack creation"</text>
+    </assertion>
+    
+    <assertion id="j">
+      <text>When the create() method of the Bean object that represents a simple bean is called, after the interceptor and decorator stacks are built the container calls the @PostConstruct method, if any</text>
+    </assertion>
+    
+    <assertion id="k">
+      <text>When the destroy() method of a Bean object is called, the container calls the @PreDestroy method, if any</text>
+    </assertion>
+    
+    <assertion id="l">
+      <text>When the destroy() method of a Bean object is called, after the container calls the @PreDestroy method, it finally destroys dependent objects</text>
+    </assertion>
+  </section>
+  
+  <section id="6.5" title="Lifecycle of stateful session beans">
+    <assertion id="a">
+      <text>When the create() method of a Bean object that represents a stateful session bean that is called, the container creates and returns a session bean proxy, as defined in Section 3.3.9, "Session bean proxies".</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>When the destroy() method of a Bean object is called, the container removes the stateful session bean. The @PreDestroy callback must be invoked by the container</text>
+    </assertion>
+    
+    <assertion id="c">
+      <text>If the underlying EJB was already removed by direct invocation of a remove method by the application, the container ignores the instance</text>
+    </assertion>
+  </section>
+  
+  <section id="6.6" title="Lifecycle of stateless session and singleton beans">
+    <assertion id="a">
+      <text>When the create() method of a Bean object that represents a stateless session or singleton session bean is called, the container creates and returns a session bean proxy, as defined in Section 3.3.9, "Session bean proxies".</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>When the destroy() method of a Bean object is called, the container simply discards the proxy and all underlying EJB local object references</text>
+    </assertion>
+  </section>
+  
+  <section id="6.7" title="Lifecycle of producer methods">
+    <assertion id="a">
+      <text>Any Java object may be returned by a producer method. It is not required that the returned object be an instance of another bean</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>If an object returned by a producer method is not an instance of another bean, the container will not provide injection of other beans</text>
+    </assertion>
+    
+    <assertion id="c">
+      <text>If an object returned by a producer method is not an instance of another bean, the container will not provide lifecycle callbacks</text>
+    </assertion>
+    
+    <assertion id="d">
+      <text>If an object returned by a producer method is not an instance of another bean, the container will not provide method and lifecycle interception</text>
+    </assertion>
+    
+    <assertion id="e">
+      <text>When the create() method of a Bean object that represents a producer method is called, the container must invoke the producer method, passing the object returned by  Manager.getInstanceToInject() to each parameter</text>
+    </assertion>
+    
+    <assertion id="f">
+      <text>If a producer method is static, the container must invoke the method</text>
+    </assertion>
+    
+    <assertion id="g">
+      <text>If a producer method is not static, the container must obtain the Bean object for the most specialized bean that specializes the bean which declares the producer method</text>
+    </assertion>
+    
+    <assertion id="h">
+      <text>If a producer method is not static, after obtaining the most specialized Bean object the container must obtain an instance of the most specialized bean, by calling Manager.getInstance(), passing the Bean object representing the bean</text>
+    </assertion>
+    
+    <assertion id="i">
+      <text>If a producer method is not static, after obtaining an instance of the most specialized bean the container must invoke the producer method upon this instance</text>
+    </assertion>
+    
+    <assertion id="j">
+      <text>The return value of the producer method, after method interception completes, is the new contextual instance to be returned by Bean.create()</text>
+    </assertion>
+    
+    <assertion id="k">
+      <text>If the producer method returns a null value and the producer method bean has the scope @Dependent, the create() method returns a null value</text>
+    </assertion>
+    
+    <assertion id="l">
+      <text>If the producer method returns a null value, and the scope of the producer method is not @Dependent, the create() method throws an IllegalProductException</text>
+    </assertion>
+    
+    <assertion id="m">
+      <text>When the destroy() method is called, and if there is a disposal method for this producer method, the container must invoke the disposal method, passing the instance given to destroy() to the disposed parameter, and the object returned by Manager.getInstanceToInject() to each of the other parameters</text>
+    </assertion>
+    
+    <assertion id="n">
+      <text>If a disposal method is static, the container must invoke the method</text>
+    </assertion>
+    
+    <assertion id="o">
+      <text>If a disposal method is non-static, the container must obtain the Bean object for the most specialized bean that specializes the bean which declares the disposal method</text>
+    </assertion>
+    
+    <assertion id="p">
+      <text>If a disposal method is non-static, after obtaining the Bean object for the most specialized bean, the container must obtain an instance of the most specialized bean, by calling Manager.getInstance(), passing the Bean object representing the bean</text>
+    </assertion>
+    
+    <assertion id="q">
+      <text>If a disposal method is non-static, after obtaining the instance of the most specialized bean the container must invoke the disposal method upon this instance</text>
+    </assertion>
+    
+    <assertion id="r">
+      <text>Finally, the container destroys dependent objects</text>
+    </assertion>
+  </section>
+  
+  <section id="6.8" title="Lifecycle of producer fields">
+    <assertion id="a">
+      <text>Any Java object may be the value of a producer field</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>It is not required that the returned object of a producer field be an instance of another bean</text>
+    </assertion>
+    
+    <assertion id="c">
+      <text>If the object returned by a producer field is not an instance of another bean, the container will not provide injection of other beans</text>
+    </assertion>
+    
+    <assertion id="d">
+      <text>If the object returned by a producer field is not an instance of another bean, the container will not provide lifecycle callbacks</text>
+    </assertion>
+    
+    <assertion id="e">
+      <text>If the object returned by a producer field is not an instance of another bean, the container will not provide method interception</text>
+    </assertion>
+    
+    <assertion id="f">
+      <text>If the object returned by a producer field is not an instance of another bean, the container will not provide lifecycle interception</text>
+    </assertion>
+    
+    <assertion id="g">
+      <text>When the create() method of a Bean object that represents a producer field is called, the container must access the producer field to obtain the current value of the field</text>
+    </assertion>
+    
+    <assertion id="h">
+      <text>If a producer field is static, the container must access the field value</text>
+    </assertion>
+    
+    <assertion id="i">
+      <text>If a producer field is non-static, the container must obtain the Bean object for the most specialized bean that specializes the bean which declares the producer field</text>
+    </assertion>
+    
+    <assertion id="j">
+      <text>If a producer field is non-static, after obtaining the Bean object for the most specialized bean the container must obtain an instance of the most specialized bean, by calling Manager.getInstance(), passing the Bean object representing the bean</text>
+    </assertion>
+    
+    <assertion id="k">
+      <text>If a producer field is non-static, after obtaining an instance of the most specialized bean, the container must access the field value of this instance</text>
+    </assertion>
+    
+    <assertion id="l">
+      <text>The value of the producer field is the new contextual instance to be returned by Bean.create()</text>
+    </assertion>
+    
+    <assertion id="m">
+      <text>If the producer field contains a null value and the producer field bean has the scope @Dependent, the create() method returns a null value</text>
+    </assertion>
+    
+    <assertion id="n">
+      <text>If the producer field contains a null value, and the scope of the producer method is not @Dependent, the create() method throws an IllegalProductException</text>
+    </assertion>
+  </section>
+  
+  <section id="6.9" title="Lifecycle of resources">
+    <assertion id="a" testable="false">
+      <text>An instance of a resource is a proxy object, provided by the container, that implements the declared bean type, delegating the actual implementation of the methods directly to the underlying Java EE resource, entity manager, entity manager factory, EJB remote object or web service referenc</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>A resource proxy object is a dependent object of the object it is injected into</text>
+    </assertion>
+    
+    <assertion id="c">
+      <text>Resource proxy objects are serializable</text>
+    </assertion>
+    
+    <assertion id="d">
+      <text>When the create() method of a Bean object that represents a JMS resource is called, the container creates and returns a proxy object that implements the bean type of the resource</text>
+    </assertion>
+    
+    <assertion id="e">
+      <text>The methods of this proxy object delegate to the underlying implementation, which is obtained using the metadata provided in the resource declaration</text>
+    </assertion>
+    
+    <assertion id="f">
+      <text>A Java EE resource is obtained using the JNDI name or mapped name specified by &lt;Resource&gt;</text>
+    </assertion>
+    
+    <assertion id="g">
+      <text>A persistence context is obtained using the persistence unit name specified by &lt;PersistenceContext&gt;</text>
+    </assertion>
+    
+    <assertion id="h">
+      <text>A persistence unit is obtained using the persistence unit name specified by &lt;PersistenceUnit&gt;</text>
+    </assertion>
+    
+    <assertion id="i">
+      <text>A remote EJB is obtained using the JNDI name, mapped name or EJB link specified by &lt;EJB&gt;</text>
+    </assertion>
+    
+    <assertion id="j">
+      <text>A web service is obtained using the JNDI name or mapped name specified by &lt;WebServiceRef&gt;</text>
+    </assertion>
+    
+    <assertion id="k">
+      <text>When the destroy() method is called, the container discards the proxy object</text>
+    </assertion>
+  </section>
+  
+  <section id="6.10" title="Lifecycle of JMS resources">
+    <assertion id="a" testable="false">
+      <text>An instance of a JMS resource is a proxy object, provided by the container, that implements all the bean types defined in Section 3.7, "JMS resources", delegating the actual implementation of these methods directly to the underlying JMS objects</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>A JMS resource proxy object is a dependent object of the object it is injected into</text>
+    </assertion>
+    
+    <assertion id="c">
+      <text>JMS resource proxy objects are serializable</text>
+    </assertion>
+    
+    <assertion id="d">
+      <text>When the create() method of a Bean object that represents a JMS resource is called, the container creates and returns a proxy object that implements all the bean types of the JMS resource</text>
+    </assertion>
+    
+    <assertion id="e">
+      <text>The methods of this proxy object delegate to JMS objects obtained as needed using the metadata provided by the JMS resource declaration and using standard JMS APIs</text>
+    </assertion>
+    
+    <assertion id="f">
+      <text>The Destination is obtained using the JNDI name or mapped name specified by &lt;Resource&gt;</text>
+    </assertion>
+    
+    <assertion id="g">
+      <text>The appropriate ConnectionFactory for the topic or queue is obtained automatically</text>
+    </assertion>
+    
+    <assertion id="h">
+      <text>The Connection is obtained by calling QueueConnectionFactory.createQueueConnection() or TopicConnectionFactory.createTopicConnection()</text>
+    </assertion>
+    
+    <assertion id="i" testable="false">
+      <text>The container is permitted to share a connection between multiple proxy objects</text>
+    </assertion>
+    
+    <assertion id="j">
+      <text>The Session object is obtained by calling QueueConnection.createQueueSession() or TopicConnection.createTopicSession()</text>
+    </assertion>
+    
+    <assertion id="k">
+      <text>The MessageProducer object is obtained by calling QueueSession.createSender() or TopicSession.createPublisher()</text>
+    </assertion>
+    
+    <assertion id="l">
+      <text>The MessageConsumer object is obtained by calling QueueSession.createReceiver() or TopicSession.createSubscriber()</text>
+    </assertion>
+    
+    <assertion id="m">
+      <text>When the destroy() method is called, the container must ensure that all JMS objects created by the proxy object are destroyed by calling close() if necessary</text>
+    </assertion>
+    
+    <assertion id="n">
+      <text>The Connection is destroyed by calling Connection.close() if necessary</text>
+    </assertion>
+    
+    <assertion id="o">
+      <text>If the connection is being shared between multiple proxy objects, the container is not required to close the connection when the proxy is destroyed</text>
+    </assertion>
+    
+    <assertion id="p">
+      <text>The Session object is destroyed by calling Session.close()</text>
+    </assertion>
+    
+    <assertion id="q">
+      <text>The MessageProducer object is destroyed by calling MessageProducer.close()</text>
+    </assertion>
+    
+    <assertion id="r">
+      <text>The MessageConsumer object is destroyed by calling MessageConsumer.close()</text>
+    </assertion>
+    
+    <assertion id="s">
+      <text>The close() method of a JMS resource proxy object always throws an UnsupportedOperationException</text>
+    </assertion>
+    
+  </section>
+  
+  <section id="6.11" title="Lifecycle of EJBs">
+    <assertion id="a">
+      <text>When the EJB container creates a new instance of an EJB, after Java EE injection has been performed and before the @PostConstruct callback occurs the container must initialize the values of all injected fields .  For each injected field, the container sets the value to the
+object returned by Manager.getInstanceToInject()</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>When the EJB container creates a new instance of an EJB, after Java EE injection has been performed and before the @PostConstruct callback occurs the container must initialize the values of any fields with initial values specified in XML, as defined in Section 9.5.5, "Field initial value declarations"</text>
+    </assertion>
+    
+    <assertion id="c">
+      <text>When the EJB container creates a new instance of an EJB, after Java EE injection has been performed and before the @PostConstruct callback occurs the container calls all initializer methods. For each initializer method parameter, the container passes the object returned by Manager.getInstanceToInject()</text>
+    </assertion>
+    
+    <assertion id="d">
+      <text>When the EJB container creates a new instance of an EJB, after Java EE injection has been performed and before the @PostConstruct callback occurs the container builds the interceptor stacks for the instance as defined in Section A.3.10, "Interceptor stack creation" and Section A.5.8, "Decorator stack creation" and binds them to the instance</text>
+    </assertion>
+    
+    <assertion id="e">
+      <text>When the EJB container creates a new instance of an EJB, after Java EE injection has been performed and before the @PostConstruct callback occurs the container builds the decorator stacks for the instance as defined in Section A.3.10, "Interceptor stack creation" and Section A.5.8, "Decorator stack creation" and binds them to the instance</text>
+    </assertion>
+    
+    <assertion id="f">
+      <text>When the EJB container removes an instance of an EJB, the container destroys all dependent objects, after the @PreDestroy callback completes</text>
+    </assertion>
+  </section>
+  
+  <section id="6.12" title="Lifecycle of servlets">
+    <assertion id="a">
+      <text>When the servlet container creates a new instance of a servlet, the container initializes the values of all injected fields. For each injected field, the container sets the value to the object returned by Manager.getInstanceToInject()</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>When the servlet container creates a new instance of a servlet, the container calls all initializer methods. For each initializer method parameter, the container passes the object
+returned by Manager.getInstanceToInject()</text>
+    </assertion>
+    
+    <assertion id="c">
+      <text>When the servlet container destroys a servlet, the container destroys all dependent objects</text>
+    </assertion>
+    
+    <assertion id="d" testable="false">
+      <text>In a Java EE 5 environment, the container is not required to support injected fields or initializer methods of servlets</text>
+    </assertion>
+  </section>
+  
   <section id="7" title="Events">
   
   </section>




More information about the weld-commits mailing list