[webbeans-commits] Webbeans SVN: r1627 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck: unit/implementation/producer/field and 1 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Sat Feb 21 18:36:21 EST 2009


Author: shane.bryzak at jboss.com
Date: 2009-02-21 18:36:21 -0500 (Sat, 21 Feb 2009)
New Revision: 1627

Modified:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/implementation/enterprise/EnterpriseBeanLifecycleTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/producer/field/ProducerFieldLifecycleTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/simple/SimpleBeanLifecycleTest.java
Log:
mapped chapter 6 assertions

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/implementation/enterprise/EnterpriseBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/implementation/enterprise/EnterpriseBeanLifecycleTest.java	2009-02-21 23:20:03 UTC (rev 1626)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/implementation/enterprise/EnterpriseBeanLifecycleTest.java	2009-02-21 23:36:21 UTC (rev 1627)
@@ -1,6 +1,7 @@
 package org.jboss.jsr299.tck.integration.implementation.enterprise;
 
 import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
 import org.jboss.jsr299.tck.AbstractDeclarativeTest;
 import org.testng.annotations.Test;
 
@@ -33,12 +34,8 @@
       assert false;
    }
 
-   /**
-    * When the destroy() method is called, the container removes the stateful
-    * session bean. The @PreDestroy callback must be invoked by the container.
-    */
    @Test(groups = { "enterpriseBeans", "clientProxy", "lifecycle", "integration", "stub" })
-   @SpecAssertion(section = "6.5", id = "unknown")
+   @SpecAssertion(section = "6.5", id = "b")
    public void testDestroyMethodCalled() throws Exception
    {
       // GoodDoggie.destructorCalled = false;
@@ -62,84 +59,50 @@
       assert false;
    }
 
-   /**
-    * If the underlying EJB was already removed by direct invocation of a remove
-    * method by the application, the container ig- nores the instance.
-    */
    @Test(groups = { "enterpriseBeans", "lifecycle", "integration", "stub" })
-   @SpecAssertion(section = "6.5", id = "unknown")
+   @SpecAssertion(section = "6.5", id = "c")
    public void testRemovedEjbIgnored()
    {
       assert false;
    }
 
-   /**
-    * First, 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().
-    */
    @Test(groups = { "enterpriseBeans", "lifecycle", "integration", "stub" })
-   @SpecAssertion(section = "6.11", id = "unknown")
+   @SpecAssertion(section = "6.11", id = "a")
    public void testFieldInjectionsOnNonContextualEjbs()
    {
       assert false;
    }
 
-   /**
-    * Next, if the EJB instance is a contextual instance of a bean, 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".
-    */
    @Test(groups = { "enterpriseBeans", "lifecycle", "integration", "stub" })
-   @SpecAssertion(section = "6.11", id = "unknown")
+   @SpecAssertion(section = "6.11", id = "b")
    public void testInitXMLDefinedValuesOnWebWeanEnterpriseBeans()
    {
       assert false;
    }
 
-   /**
-    * Next, the container calls all initializer methods. For each initializer
-    * method parameter, the container passes the object returned by
-    * Manager.getInstanceToInject().
-    */
    @Test(groups = { "enterpriseBeans", "lifecycle", "integration", "stub" })
-   @SpecAssertion(section = "6.11", id = "unknown")
+   @SpecAssertion(section = "6.11", id = "c")
    public void testInitializerMethodsCalledWithCurrentParameterValues()
    {
       assert false;
    }
 
-   /**
-    * Finally, the container builds the interceptor and 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.
-    */
    @Test(groups = { "enterpriseBeans", "lifecycle", "interceptors", "stub" })
-   @SpecAssertion(section = "6.11", id = "unknown")
+   @SpecAssertion(section = "6.11", id = "d")
    public void testInterceptorStackIsBuilt()
    {
       assert false;
    }
 
-   /**
-    * Finally, the container builds the interceptor and 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.
-    */
    @Test(groups = { "enterpriseBeans", "lifecycle", "decorators", "stub" })
-   @SpecAssertion(section = "6.11", id = "unknown")
+   @SpecAssertion(section = "6.11", id = "e")
    public void testDecoratorStackIsBuilt()
    {
       assert false;
    }
 
-   /**
-    * When the EJB container removes an instance of an EJB, the container
-    * destroys all dependent objects, after the @PreDestroy callback completes.
-    */
    @Test(groups = { "enterpriseBeans", "lifecycle", "stub" })
-   @SpecAssertion(section = "6.11", id = "unknown")
+   @SpecAssertion(section = "6.11", id = "f")
    public void testDependentObjectsDestroyed()
    {
       assert false;

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/producer/field/ProducerFieldLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/producer/field/ProducerFieldLifecycleTest.java	2009-02-21 23:20:03 UTC (rev 1626)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/producer/field/ProducerFieldLifecycleTest.java	2009-02-21 23:36:21 UTC (rev 1627)
@@ -34,16 +34,8 @@
       return Collections.unmodifiableList(Arrays.asList(Standard.class, Production.class, AnotherDeploymentType.class, HighestDeploymentType.class));
    }
 
-   /**
-    * 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.
-    * 
-    * • If the producer method is static, the container must access the field
-    * value.
-    */
    @Test(groups = { "producerField" })
-   @SpecAssertion(section = "6.8", id = "unknown")
+   @SpecAssertion(section = "6.8", id = "h")
    public void testProducerStaticFieldBean()
    {
       deployBeans(StaticTarantulaProducer.class, TarantulaConsumer.class);
@@ -59,29 +51,11 @@
       };
    }
 
-   /**
-    * 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.
-    * 
-    * • Otherwise, if the producer method is non-static, the container must:
-    * 
-    * • obtain the Bean object for the most specialized bean that specializes
-    * the bean which declares the producer field, and then
-    * 
-    * • obtain an instance of the most specialized bean, by calling
-    * Manager.getInstance(), passing the Bean object rep- resenting the bean,
-    * and
-    * 
-    * • access the field value of this instance.
-    * 
-    * The value of the producer field is the new contextual instance to be
-    * returned by Bean.create().
-    * 
-    * @throws Exception
-    */
    @Test(groups = { "producerField" })
-   @SpecAssertion(section = "6.8", id = "unknown")
+   @SpecAssertions({
+     @SpecAssertion(section = "6.8", id = "k"),
+     @SpecAssertion(section = "6.8", id = "l")
+   })
    public void testProducerFieldBeanCreate() throws Exception
    {
       deployBeans(BlackWidowProducer.class, BlackWidowConsumer.class);
@@ -97,7 +71,7 @@
    }
 
    @Test(groups = { "producerField", "specialization" })
-   @SpecAssertion(section = "6.8", id = "unknown")
+   @SpecAssertion(section = "6.8", id = "j")
    public void testSpecializedBeanAlwaysUsed() throws Exception
    {
       deployBeans(TarantulaProducer.class, SpecializedTarantulaProducer.class, TarantulaConsumer.class);
@@ -113,16 +87,10 @@
       }.run();
    }
 
-   /**
-    * If the producer field contains a null value and the producer field bean
-    * has the scope @Dependent, the create() method re- turns a null value.
-    * 
-    * @throws Exception
-    */
    @Test(groups = { "producerField" })
    @SpecAssertions({
       @SpecAssertion(section = "3.5", id = "d"),
-      @SpecAssertion(section = "6.8", id = "unknown")
+      @SpecAssertion(section = "6.8", id = "m")
     })    
    public void testProducerFieldReturnsNullIsDependent() throws Exception
    {
@@ -138,17 +106,10 @@
       }.run();
    }
 
-   /**
-    * Otherwise, if the producer field contains a null value, and the scope of
-    * the producer method is not @Dependent, the create() method throws an
-    * IllegalProductException. 
-    * 
-    * @throws Exception
-    */
    @Test(groups = { "producerField" }, expectedExceptions = IllegalProductException.class)  
    @SpecAssertions({
      @SpecAssertion(section = "3.5", id = "e"),
-     @SpecAssertion(section = "6.8", id = "unknown")
+     @SpecAssertion(section = "6.8", id = "n")
    })   
    public void testProducerFieldReturnsNullIsNotDependent() throws Exception
    {

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/simple/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/simple/SimpleBeanLifecycleTest.java	2009-02-21 23:20:03 UTC (rev 1626)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/simple/SimpleBeanLifecycleTest.java	2009-02-21 23:36:21 UTC (rev 1627)
@@ -82,7 +82,7 @@
 
    @Test(groups = "beanLifecycle")
    @SpecAssertions({
-      @SpecAssertion(section = "6.2", id = "unknown"),
+      @SpecAssertion(section = "6.2", id = "a"),
       @SpecAssertion(section="2", id="g"),
       @SpecAssertion(section="2.2", id="f"),
       @SpecAssertion(section="3.2.6", id="a")
@@ -93,78 +93,43 @@
       assert bean.create(new MockCreationalContext<RedSnapper>()) instanceof RedSnapper;
    }
 
-   /**
-    * The create() method performs the following tasks:
-    * 
-    * • creates the interceptor and decorator stacks and binds them to the
-    * instance,
-    */
    @Test(groups = { "stub", "beanLifecycle", "interceptors" })
-   @SpecAssertion(section = "6.2", id = "unknown")
+   @SpecAssertion(section = "6.2", id = "b")
    public void testCreateBindsInterceptorStack()
    {
       assert false;
    }
 
-   /**
-    * The create() method performs the following tasks:
-    * 
-    * • creates the interceptor and decorator stacks and binds them to the
-    * instance, JSR-299 Revised Public Review Draft 57 Bean lifecycle
-    */
    @Test(groups = { "stub", "beanLifecycle", "decorators" })
-   @SpecAssertion(section = "6.2", id = "unknown")
+   @SpecAssertion(section = "6.2", id = "c")
    public void testCreateBindsDecoratorStack()
    {
       assert false;
    }
 
-   /**
-    * Next, the container initializes the values of any attributes annotated
-    * 
-    * @EJB, @PersistenceContext or @Resource, as defined in the Common
-    *       Annotations for the Java Platform, JPA and EJB specifications.
-    */
    @Test(groups = { "stub", "beanLifecycle", "commonAnnotations", "integration" })
-   @SpecAssertion(section = "6.4", id = "unknown")
+   @SpecAssertion(section = "6.4", id = "b")
    public void testCreateInjectsEjb()
    {
       assert false;
    }
 
-   /**
-    * Next, the container initializes the values of any attributes annotated
-    * 
-    * @EJB, @PersistenceContext or @Resource, as defined in the Common
-    *       Annotations for the Java Platform, JPA and EJB specifications.
-    */
    @Test(groups = { "stub", "beanLifecycle", "commonAnnotations", "integration" })
-   @SpecAssertion(section = "6.4", id = "unknown")
+   @SpecAssertion(section = "6.4", id = "c")
    public void testCreateInjectsPersistenceContext()
    {
       assert false;
    }
 
-   /**
-    * Next, the container initializes the values of any attributes annotated
-    * 
-    * @EJB, @PersistenceContext or @Resource, as defined in the Common
-    *       Annotations for the Java Platform, JPA and EJB specifications.
-    */
    @Test(groups = { "stub", "beanLifecycle", "commonAnnotations", "integration" })
-   @SpecAssertion(section = "6.4", id = "unknown")
+   @SpecAssertion(section = "6.4", id = "d")
    public void testCreateInjectsResource()
    {
       assert false;
    }
 
-   /**
-    * Next, 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().
-    */
    @Test(groups = "injection")
-   @SpecAssertion(section = "6.4", id = "unknown")
+   @SpecAssertion(section = "6.4", id = "e")
    public void testCreateInjectsFieldsDeclaredInJava()
    {
       Bean<TunaFarm> tunaFarmBean = createSimpleBean(TunaFarm.class);
@@ -174,17 +139,11 @@
       assert tunaFarm.tuna != null;
    }
 
-   /**
-    * The create() method performs the following tasks:
-    * 
-    * • calls the @PostConstruct method, if necessary.
-    * 
-    * The destroy() method performs the following tasks:
-    * 
-    * • calls the @PreDestroy method, if necessary, and
-    */
    @Test(groups = { "beanLifecycle", "lifecycleCallbacks" })
-   @SpecAssertion(section = "6.3", id = "unknown")
+   @SpecAssertions({
+     @SpecAssertion(section = "6.2", id = "f"),
+     @SpecAssertion(section = "6.3", id = "b")
+   })
    public void testPostConstructPreDestroy() throws Exception
    {
       Bean<FarmOffice> farmOfficeBean = createSimpleBean(FarmOffice.class);
@@ -315,7 +274,7 @@
    }
 
    @Test(expectedExceptions = CreationException.class)
-   @SpecAssertion(section = "6.5", id = "unknown")
+   @SpecAssertion(section = "6.2", id = "h")
    public void testCreationExceptionWrapsCheckedExceptionThrownFromCreate() throws Exception
    {
       deployBeans(Lorry_Broken.class);
@@ -331,7 +290,7 @@
    }
 
    @Test(expectedExceptions = FooException.class)
-   @SpecAssertion(section = "6.5", id = "unknown")
+   @SpecAssertion(section = "6.2", id = "g")
    public void testUncheckedExceptionThrownFromCreateNotWrapped() throws Exception
    {
       deployBeans(Van_Broken.class);




More information about the weld-commits mailing list