[webbeans-commits] Webbeans SVN: r1591 - in tck/trunk/impl/src/main: resources and 1 other directory.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Wed Feb 18 20:11:29 EST 2009


Author: pete.muir at jboss.org
Date: 2009-02-18 20:11:29 -0500 (Wed, 18 Feb 2009)
New Revision: 1591

Modified:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/simple/NewSimpleBeanTest.java
   tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
assertions for new simple beans

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/simple/NewSimpleBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/simple/NewSimpleBeanTest.java	2009-02-19 01:03:15 UTC (rev 1590)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/simple/NewSimpleBeanTest.java	2009-02-19 01:11:29 UTC (rev 1591)
@@ -13,8 +13,8 @@
 import javax.inject.Standard;
 import javax.inject.manager.Bean;
 
-import org.jboss.jsr299.tck.AbstractDeclarativeTest;
 import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractDeclarativeTest;
 import org.jboss.jsr299.tck.literals.NewLiteral;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
@@ -42,293 +42,65 @@
       newSimpleBean = beans.iterator().next();
    }
 
-   /**
-    * Additionally, for each such simple bean, a second simple bean exists
-    * which:
-    * 
-    * • has the same bean class,
-    * 
-    * • has the same bean constructor, initializer methods and injected fields
-    * defined by annotations, and
-    * 
-    * • has the same interceptor bindings defined by annotations.
-    * 
-    * However, this second bean:
-    * 
-    * • has scope @Dependent,
-    * 
-    * • has deployment type @Standard,
-    * 
-    * • has @javax.inject.New as the only binding,
-    * 
-    * • has no bean name,
-    * 
-    * • has no stereotypes, and
-    * 
-    * • has no observer methods, producer methods or fields or disposal methods.
-    */
    @Test(groups = { "new" })
-   @SpecAssertion(section = "3.2.5", id = "unknown")
+   @SpecAssertion(section = "3.2.5", id = "d")
    public void testNewBeanIsDependentScoped()
    {
       assert Dependent.class.equals(newSimpleBean.getScopeType());
    }
 
-   /**
-    * Additionally, for each such simple bean, a second simple bean exists
-    * which:
-    * 
-    * • has the same bean class,
-    * 
-    * • has the same bean constructor, initializer methods and injected fields
-    * defined by annotations, and
-    * 
-    * • has the same interceptor bindings defined by annotations.
-    * 
-    * However, this second bean:
-    * 
-    * • has scope @Dependent,
-    * 
-    * • has deployment type @Standard,
-    * 
-    * • has @javax.inject.New as the only binding,
-    * 
-    * • has no bean name,
-    * 
-    * • has no stereotypes, and
-    * 
-    * • has no observer methods, producer methods or fields or disposal methods.
-    */
    @Test(groups = { "new" })
-   @SpecAssertion(section = "3.2.5", id = "unknown")
+   @SpecAssertion(section = "3.2.5", id = "e")
    public void testNewBeanIsOfStandardDeploymentType()
    {
       assert Standard.class.equals(newSimpleBean.getDeploymentType());
    }
 
-   /**
-    * Additionally, for each such simple bean, a second simple bean exists
-    * which:
-    * 
-    * • has the same bean class,
-    * 
-    * • has the same bean constructor, initializer methods and injected fields
-    * defined by annotations, and
-    * 
-    * • has the same interceptor bindings defined by annotations.
-    * 
-    * However, this second bean:
-    * 
-    * • has scope @Dependent,
-    * 
-    * • has deployment type @Standard,
-    * 
-    * • has @javax.inject.New as the only binding,
-    * 
-    * • has no bean name,
-    * 
-    * • has no stereotypes, and
-    * 
-    * • has no observer methods, producer methods or fields or disposal methods.
-    */
    @Test(groups = { "new" })
-   @SpecAssertion(section = "3.2.5", id = "unknown")
+   @SpecAssertion(section = "3.2.5", id = "f")
    public void testNewBeanHasOnlyNewBinding()
    {
       assert newSimpleBean.getBindings().size() == 1;
       assert newSimpleBean.getBindings().iterator().next().annotationType().equals(new NewLiteral().annotationType());
    }
 
-   /**
-    * Additionally, for each such simple bean, a second simple bean exists
-    * which:
-    * 
-    * • has the same bean class,
-    * 
-    * • has the same bean constructor, initializer methods and injected fields
-    * defined by annotations, and
-    * 
-    * • has the same interceptor bindings defined by annotations.
-    * 
-    * However, this second bean:
-    * 
-    * • has scope @Dependent,
-    * 
-    * • has deployment type @Standard,
-    * 
-    * • has @javax.inject.New as the only binding,
-    * 
-    * • has no bean name,
-    * 
-    * • has no stereotypes, and
-    * 
-    * • has no observer methods, producer methods or fields or disposal methods.
-    */
    @Test(groups = { "new" })
-   @SpecAssertion(section = "3.2.5", id = "unknown")
+   @SpecAssertion(section = "3.2.5", id = "g")
    public void testNewBeanHasNoWebBeanName()
    {
       assert newSimpleBean.getName() == null;
    }
 
-   /**
-    * Additionally, for each such simple bean, a second simple bean exists
-    * which:
-    * 
-    * • has the same bean class,
-    * 
-    * • has the same bean constructor, initializer methods and injected fields
-    * defined by annotations, and
-    * 
-    * • has the same interceptor bindings defined by annotations.
-    * 
-    * However, this second bean:
-    * 
-    * • has scope @Dependent,
-    * 
-    * • has deployment type @Standard,
-    * 
-    * • has @javax.inject.New as the only binding,
-    * 
-    * • has no bean name,
-    * 
-    * • has no stereotypes, and
-    * 
-    * • has no observer methods, producer methods or fields or disposal methods.
-    * TODO API does not provide a way to see what stereotypes are applied on a bean
-    */
-   @Test(groups = { "underInvestigation", "new" })
-   @SpecAssertion(section = "3.2.5", id = "unknown")
+   @Test(groups = { "stub", "new" })
+   @SpecAssertion(section = "3.2.5", id = "h")
    public void testNewBeanHasNoStereotypes()
    {
       assert false;
    }
 
-   /**
-    * Additionally, for each such simple bean, a second simple bean exists
-    * which:
-    * 
-    * • has the same bean class,
-    * 
-    * • has the same bean constructor, initializer methods and injected fields
-    * defined by annotations, and
-    * 
-    * • has the same interceptor bindings defined by annotations.
-    * 
-    * However, this second bean:
-    * 
-    * • has scope @Dependent,
-    * 
-    * • has deployment type @Standard,
-    * 
-    * • has @javax.inject.New as the only binding,
-    * 
-    * • has no bean name,
-    * 
-    * • has no stereotypes, and
-    * 
-    * • has no observer methods, producer methods or fields or disposal methods.
-    */
-   @Test(groups = { "new", "underInvestigation" })
-   @SpecAssertion(section = "3.2.5", id = "unknown")
+   @Test(groups = { "new", "stub" })
+   @SpecAssertion(section = "3.2.5", id = "i")
    public void testNewBeanHasNoObservers()
    {
       assert false;
    }
 
-   /**
-    * Additionally, for each such simple bean, a second simple bean exists
-    * which:
-    * 
-    * • has the same bean class,
-    * 
-    * • has the same bean constructor, initializer methods and injected fields
-    * defined by annotations, and
-    * 
-    * • has the same interceptor bindings defined by annotations.
-    * 
-    * However, this second bean:
-    * 
-    * • has scope @Dependent,
-    * 
-    * • has deployment type @Standard,
-    * 
-    * • has @javax.inject.New as the only binding,
-    * 
-    * • has no bean name,
-    * 
-    * • has no stereotypes, and
-    * 
-    * • has no observer methods, producer methods or fields or disposal methods.
-    * TODO The API does not provide any way to see producer fields from the new bean
-    */
-   @Test(groups = { "new", "underInvestigation" })
-   @SpecAssertion(section = "3.2.5", id = "unknown")
+   @Test(groups = { "new", "stub" })
+   @SpecAssertion(section = "3.2.5", id = "k")
    public void testNewBeanHasNoProducerFields()
    {
       assert false;
    }
 
-   /**
-    * Additionally, for each such simple bean, a second simple bean exists
-    * which:
-    * 
-    * • has the same bean class,
-    * 
-    * • has the same bean constructor, initializer methods and injected fields
-    * defined by annotations, and
-    * 
-    * • has the same interceptor bindings defined by annotations.
-    * 
-    * However, this second bean:
-    * 
-    * • has scope @Dependent,
-    * 
-    * • has deployment type @Standard,
-    * 
-    * • has @javax.inject.New as the only binding,
-    * 
-    * • has no bean name,
-    * 
-    * • has no stereotypes, and
-    * 
-    * • has no observer methods, producer methods or fields or disposal methods.
-    */
-   @Test(groups = { "new", "underInvestigation" })
-   @SpecAssertion(section = "3.2.5", id = "unknown")
+   @Test(groups = { "new", "stub" })
+   @SpecAssertion(section = "3.2.5", id = "j")
    public void testNewBeanHasNoProducerMethods()
    {
       assert false;
    }
 
-   /**
-    * Additionally, for each such simple bean, a second simple bean exists
-    * which:
-    * 
-    * • has the same bean class,
-    * 
-    * • has the same bean constructor, initializer methods and injected fields
-    * defined by annotations, and
-    * 
-    * • has the same interceptor bindings defined by annotations.
-    * 
-    * However, this second bean:
-    * 
-    * • has scope @Dependent,
-    * 
-    * • has deployment type @Standard,
-    * 
-    * • has @javax.inject.New as the only binding,
-    * 
-    * • has no bean name,
-    * 
-    * • has no stereotypes, and
-    * 
-    * • has no observer methods, producer methods or fields or disposal methods.
-    * TODO API does not provide a way to detect if disposal methods exist on a bean
-    */
    @Test(groups = { "new", "underInvestigation" })
-   @SpecAssertion(section = "3.2.5", id = "unknown")
+   @SpecAssertion(section = "3.2.5", id = "l")
    public void testNewBeanHasNoDisposalMethods()
    {
       // Class<?> type =
@@ -338,72 +110,14 @@
       assert false;
    }
 
-   /**
-    * Additionally, for each such simple bean, a second simple bean exists
-    * which:
-    * 
-    * • has the same bean class,
-    * 
-    * • has the same bean constructor, initializer methods and injected fields
-    * defined by annotations, and
-    * 
-    * • has the same interceptor bindings defined by annotations.
-    * 
-    * However, this second bean:
-    * 
-    * • has scope @Dependent,
-    * 
-    * • has deployment type @Standard,
-    * 
-    * • has @javax.inject.New as the only binding,
-    * 
-    * • has no bean name,
-    * 
-    * • has no stereotypes, and
-    * 
-    * • has no observer methods, producer methods or fields or disposal methods.
-    */
    @Test(groups = { "stub", "new" })
-   @SpecAssertion(section = "3.2.5", id = "unknown")
+   @SpecAssertion(section = "3.2.5", id = "c")
    public void testNewBeanHasSameInterceptorMethodsAsWrappedBean()
    {
       assert false;
    }
 
    /**
-    * Additionally, for each such simple bean, a second simple bean exists
-    * which:
-    * 
-    * • has the same bean class,
-    * 
-    * • has the same bean constructor, initializer methods and injected fields
-    * defined by annotations, and
-    * 
-    * • has the same interceptor bindings defined by annotations.
-    * 
-    * However, this second bean:
-    * 
-    * • has scope @Dependent,
-    * 
-    * • has deployment type @Standard,
-    * 
-    * • has @javax.inject.New as the only binding,
-    * 
-    * • has no bean name,
-    * 
-    * • has no stereotypes, and
-    * 
-    * • has no observer methods, producer methods or fields or disposal methods.
-    */
-   @Test(groups = { "new", "broken" })
-   @SpecAssertion(section = "3.2.5", id = "unknown")
-   public void testNewBeanHasNoDecorators()
-   {
-      Annotation[] bindingTypes = newSimpleBean.getBindings().toArray(new Annotation[0]);
-      assert getCurrentManager().resolveDecorators(newSimpleBean.getTypes(), bindingTypes).isEmpty();
-   }
-
-   /**
     * The @New annotation or <New> element may be applied to any field of a Web
     * Bean implementation class or to any parameter of a producer method,
     * initializer method, disposal method or Web Bean constructor where the type
@@ -519,7 +233,7 @@
    }
 
    @Test
-   @SpecAssertion(section = "3.2.5", id = "unknown")
+   @SpecAssertion(section = "3.2.5", id = "a")
    public void testForEachSimpleBeanANewBeanExists()
    {
       deployBeans(Order.class, Lion.class);

Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml	2009-02-19 01:03:15 UTC (rev 1590)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml	2009-02-19 01:11:29 UTC (rev 1591)
@@ -694,9 +694,12 @@
     <assertion id="cb">
       <text>A top-level Java class is not a simple bean if it is an interface</text>
     </assertion>
-    <assertion id="d">
-      <text>A top-level Java class is only a simple bean if it is annotated @Decorator.</text>
+    <assertion id="da">
+      <text>A top-level abstract Java class is a simple bean if it is annotated @Decorator.</text>
     </assertion>
+    <assertion id="db">
+      <text>A top-level interface Java class is a simple bean if it is annotated @Decorator.</text>
+    </assertion>
     <assertion id="e">
       <text>A top-level Java class is not a simple bean if it is annotated with the JPA @Entity annotation</text>
     </assertion>
@@ -804,10 +807,18 @@
       <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
 Additionally, for each such simple bean, a second simple bean exists which has the same bean class</text>
     </assertion>
-    <assertion id="b">
+    <assertion id="ba">
       <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such simple bean, a second simple bean exists which has the same bean constructor, initializer methods and injected fields defined by annotations</text>
+Additionally, for each such simple bean, a second simple bean exists which has the same bean constructor defined by annotations</text>
     </assertion>
+    <assertion id="bb">
+      <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such simple bean, a second simple bean exists which has the same bean initializer methods defined by annotations</text>
+    </assertion>
+    <assertion id="bc">
+      <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such simple bean, a second simple bean exists which has the same defined by annotations</text>
+    </assertion>
     <assertion id="c">
       <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
 Additionally, for each such simple bean, a second simple bean exists which has the same interceptor bindings defined by annotations</text>
@@ -834,8 +845,20 @@
     </assertion>
     <assertion id="i">
       <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such simple bean, a second simple bean exists which has no observer methods, producer methods or fields or disposal methods</text>
+Additionally, for each such simple bean, a second simple bean exists which has no observer methods</text>
     </assertion>
+    <assertion id="j">
+      <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such simple bean, a second simple bean exists which has no producer methods</text>
+    </assertion>
+    <assertion id="k">
+      <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such simple bean, a second simple bean exists which has no producer fields</text>
+   <assertion id="l">
+      <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such simple bean, a second simple bean exists which has no disposal methods</text>
+    </assertion>
+    </assertion>
   </section>
   
   <section id="3.2.6" title="Bean constructors">




More information about the weld-commits mailing list