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

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Mon Feb 16 16:40:33 EST 2009


Author: dallen6
Date: 2009-02-16 16:40:32 -0500 (Mon, 16 Feb 2009)
New Revision: 1550

Modified:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/GoldenRetriever.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/NewEnterpriseBeanTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/initializer/InitializerMethodTest.java
   tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Few more tests and id's assigned.

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/GoldenRetriever.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/GoldenRetriever.java	2009-02-16 19:57:40 UTC (rev 1549)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/GoldenRetriever.java	2009-02-16 21:40:32 UTC (rev 1550)
@@ -3,6 +3,7 @@
 import javax.context.RequestScoped;
 import javax.ejb.Remove;
 import javax.ejb.Stateful;
+import javax.event.Observes;
 import javax.inject.Disposes;
 
 @Stateful
@@ -13,5 +14,9 @@
    public void bye(@Disposes Object something) {
       
    }
-   
+
+   public void anObserverMethod(@Observes String event)
+   {
+      
+   }
 }

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/NewEnterpriseBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/NewEnterpriseBeanTest.java	2009-02-16 19:57:40 UTC (rev 1549)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/NewEnterpriseBeanTest.java	2009-02-16 21:40:32 UTC (rev 1550)
@@ -104,8 +104,10 @@
     * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
     *            stereotypes, and such that � the implementation class is the
     *            declared type of the injection point.
+    *            
+    * TODO It is difficult to prove if a bean has any stereotypes
     */
-   @Test(groups = { "stub", "new" })
+   @Test(groups = { "stub", "new", "underInvestigation" })
    @SpecAssertion(section = "3.3.6", id = "unknown")
    public void testNewBeanHasNoStereotypes()
    {
@@ -120,7 +122,7 @@
     * Section 3.3.2, �Which EJBs are enterprise Web Beans?�, then the Web Bean
     * is an enterprise Web Bean.
     */
-   @Test(groups = { "new", "stub" })
+   @Test(groups = { "new", "stub", "ejb3" })
    @SpecAssertion(section = "3.3.6", id = "unknown")
    public void testNewBeanIsEnterpriseWebBeanIfParameterTypeIsEnterpriseWebBean()
    {
@@ -138,12 +140,11 @@
     * types declared by annotations that appear on the implementation class, and
     * � has no decorators.
     */
-   @Test(groups = { "new", "stub" })
-   @SpecAssertion(section = "3.3.6", id = "unknown")
-   public void testNewBeanHasSameInitializerMethodsAsWrappedBean()
-   {
-      assert false;
-   }
+//   @Test(groups = { "new", "stub" })
+//   public void testNewBeanHasSameInitializerMethodsAsWrappedBean()
+//   {
+//      assert false;
+//   }
 
    /**
     * Furthermore, this Web Bean: � has the same Web Bean constructor,
@@ -156,12 +157,11 @@
     * types declared by annotations that appear on the implementation class, and
     * � has no decorators.
     */
-   @Test(groups = { "new", "stub" })
-   @SpecAssertion(section = "3.3.6", id = "unknown")
-   public void testNewBeanHasSameInjectedFieldsAsWrappedBean()
-   {
-      assert false;
-   }
+//   @Test(groups = { "new", "stub" })
+//   public void testNewBeanHasSameInjectedFieldsAsWrappedBean()
+//   {
+//      assert false;
+//   }
    
    /**
     * Furthermore, this Web Bean: � has the same Web Bean constructor,
@@ -174,11 +174,13 @@
     * types declared by annotations that appear on the implementation class, and
     * � has no decorators.
     */
-   @Test(groups = {"new", "stub" })
-   @SpecAssertion(section = "3.3.6", id = "unknown")
+   @Test(groups = {"new" })
+   @SpecAssertion(section = "3.3.6", id = "i")
    public void testNewBeanHasNoObservers()
    {
-      assert false;
+      deployBeans(GoldenRetriever.class);
+      // Should just be 1 observer from bean, not new bean
+      assert getCurrentManager().resolveObservers("event").size() == 1;
    }
 
    /**
@@ -191,9 +193,11 @@
     * defined using annotations�that is, it has all the interceptor binding
     * types declared by annotations that appear on the implementation class, and
     * � has no decorators.
+    * 
+    * TODO There is no way to prove that a new bean has no producer fields
     */
-   @Test(groups = { "new", "stub" })
-   @SpecAssertion(section = "3.3.6", id = "unknown")
+   @Test(groups = { "new", "stub", "underInvestigation" })
+   @SpecAssertion(section = "3.3.6", id = "k")
    public void testNewBeanHasNoProducerFields()
    {
       assert false;
@@ -209,8 +213,10 @@
     * defined using annotations�that is, it has all the interceptor binding
     * types declared by annotations that appear on the implementation class, and
     * � has no decorators.
+    * 
+    * TODO There really is no way to prove that a @New bean has no producers
     */
-   @Test(groups = { "new", "stub" })
+   @Test(groups = { "new", "stub", "underInvestigation" })
    @SpecAssertion(section = "3.3.6", id = "unknown")
    public void testNewBeanHasNoProducerMethods()
    {
@@ -228,7 +234,7 @@
     * types declared by annotations that appear on the implementation class, and
     * � has no decorators.
     */
-   @Test(groups = { "new", "stub" })
+   @Test(groups = { "new", "stub", "disposal" })
    @SpecAssertion(section = "3.3.6", id = "unknown")
    public void testNewBeanHasNoDisposalMethods()
    {
@@ -246,7 +252,7 @@
     * types declared by annotations that appear on the implementation class, and
     * � has no decorators.
     */
-   @Test(groups = { "stub", "new" })
+   @Test(groups = { "stub", "new", "interceptors" })
    @SpecAssertion(section = "3.3.6", id = "unknown")
    public void testNewBeanHasSameInterceptorMethodsAsWrappedBean()
    {
@@ -357,21 +363,22 @@
     * enterprise Web Bean implementation class, a DefinitionException is thrown
     * by the container at deployment time.
     */
-   @Test(groups = { "stub", "new" }, expectedExceptions = DefinitionException.class)
-   @SpecAssertion(section = "3.3.6", id = "unknown")
-   public void testNewAnnotationCannotBeAppliedToNonWebBeanImplementationClass()
-   {
-      assert false;
-   }
+//   @Test(groups = { "stub", "new" }, expectedExceptions = DefinitionException.class)
+//   public void testNewAnnotationCannotBeAppliedToNonWebBeanImplementationClass()
+//   {
+//      assert false;
+//   }
 
    /**
     * No Web Bean defined using annotations or XML may explicitly declare @New
     * as a binding type
     */
-   @Test(groups = { "stub", "new" }, expectedExceptions = DefinitionException.class)
+   @Test(groups = { "stub", "new", "webbeansxml" }, expectedExceptions = DefinitionException.class)
    @SpecAssertion(section = "3.3.6", id = "unknown")
    public void testNewAnnotationCannotBeExplicitlyDeclared()
    {
+      // This only needs to be tested with XML since the annotation itself
+      // does not target types.
       assert false;
    }
    

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/initializer/InitializerMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/initializer/InitializerMethodTest.java	2009-02-16 19:57:40 UTC (rev 1549)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/initializer/InitializerMethodTest.java	2009-02-16 21:40:32 UTC (rev 1550)
@@ -17,35 +17,35 @@
 {
 
    @Test(expectedExceptions = DefinitionException.class, groups = "initializerMethod")
-   @SpecAssertion(section = "3.8", id = "unknown")
+   @SpecAssertion(section = "3.9", id = "a")
    public void testStaticInitializerMethodNotAllowed()
    {
       createSimpleBean(Dottrel.class);
    }
 
-   @Test(groups = { "stub", "initializerMethod", "servlet" })
-   @SpecAssertion(section = "3.9", id = "unknown")
+   @Test(groups = { "stub", "initializerMethod", "servlet", "integration" })
+   @SpecAssertion(section = "3.9", id = "d")
    public void testInitializerMethodCalledOnServlet()
    {
       assert false;
    }
 
    @Test(groups = { "stub", "initializerMethod", "ejb3", "integration" })
-   @SpecAssertion(section = "3.9", id = "unknown")
+   @SpecAssertion(section = "3.9", id = "d")
    public void testInitializerMethodCalledOnEJBSessionBean()
    {
       assert false;
    }
 
-   @Test(groups = { "stub", "initializerMethod", "ejb3" })
-   @SpecAssertion(section = "3.9", id = "unknown")
+   @Test(groups = { "stub", "initializerMethod", "ejb3", "integration" })
+   @SpecAssertion(section = "3.9", id = "d")
    public void testInitializerMethodCalledOnEJBMDB()
    {
       assert false;
    }
 
-   @Test(groups = { "stub", "initializerMethod", "ejb3", "singletons" })
-   @SpecAssertion(section = "3.9", id = "unknown")
+   @Test(groups = { "stub", "initializerMethod", "ejb3", "singletons", "integration" })
+   @SpecAssertion(section = "3.9", id = "d")
    public void testInitializerMethodCalledOnEJBSingleton()
    {
       assert false;
@@ -55,7 +55,7 @@
     * If the bean is a session bean, the initializer method is not required to
     * be a business method of the session bean
     */
-   @Test(groups = { "stub", "initializerMethod", "ejb3" })
+   @Test(groups = { "initializerMethod", "ejb3" })
    @SpecAssertion(section = "3.9", id = "c")
    public void testInitializerMethodNotABusinessMethod()
    {
@@ -63,14 +63,16 @@
    }
 
    @Test(groups = { "stub", "initializerMethod", "interceptors" })
-   @SpecAssertion(section = "3.9", id = "unknown")
+   @SpecAssertion(section = "3.9", id = "f")
    public void testMethodInterceptorNotCalledOnInitializerMethod()
    {
       assert false;
    }
 
    @Test(groups = { "initializerMethod" })
-   @SpecAssertions( { @SpecAssertion(section = "3.9", id = "unknown"), @SpecAssertion(section = "5.3", id = "unknown"), @SpecAssertion(section = "3.9.2", id = "unknown"), @SpecAssertion(section = "3.9.3", id = "unknown") })
+   @SpecAssertions( { 
+      @SpecAssertion(section = "3.9", id = "g"), 
+      @SpecAssertion(section = "5.3", id = "b") })
    public void testMultipleInitializerMethodsAreCalled()
    {
       getCurrentManager().addBean(createSimpleBean(Fox.class));
@@ -83,42 +85,42 @@
    }
 
    @Test(groups = "initializerMethod", expectedExceptions = DefinitionException.class)
-   @SpecAssertions( { @SpecAssertion(section = "3.9.1", id = "unknown"), @SpecAssertion(section = "3.4.2", id = "unknown") })
+   @SpecAssertions( { @SpecAssertion(section = "3.9.1", id = "b"), @SpecAssertion(section = "3.4.2", id = "c") })
    public void testInitializerMethodAnnotatedProduces()
    {
       createSimpleBean(Pheasant.class);
    }
 
    @Test(groups = "initializerMethod", expectedExceptions = DefinitionException.class)
-   @SpecAssertion(section = "3.9.1", id = "unknown")
+   @SpecAssertion(section = "3.9.1", id = "c")
    public void testInitializerMethodHasParameterAnnotatedDisposes()
    {
       createSimpleBean(Capercaillie.class);
    }
 
    @Test(groups = "initializerMethod", expectedExceptions = DefinitionException.class)
-   @SpecAssertion(section = "3.9.1", id = "unknown")
+   @SpecAssertion(section = "3.9.1", id = "d")
    public void testInitializerMethodHasParameterAnnotatedObserves()
    {
       createSimpleBean(Grouse.class);
    }
 
    @Test(groups = { "stub", "initializerMethod", "webbeansxml" })
-   @SpecAssertion(section = "3.9.2", id = "unknown")
+   @SpecAssertion(section = "3.9.2", id = "a")
    public void testInitializerMethodDeclaredInXml()
    {
       assert false;
    }
 
    @Test(groups = { "stub", "initializerMethod", "webbeansxml" })
-   @SpecAssertion(section = "3.9.2", id = "unknown")
+   @SpecAssertion(section = "3.9.2", id = "b")
    public void testInitializerMethodDeclaredInXmlIgnoresBindingAnnotationsInJava()
    {
       assert false;
    }
 
    @Test(groups = { "stub", "initializerMethod", "webbeansxml" }, expectedExceptions = DefinitionException.class)
-   @SpecAssertion(section = "3.9.2", id = "unknown")
+   @SpecAssertion(section = "3.9.2", id = "c")
    public void testInitializerMethodDeclaredInXmlDoesNotExist()
    {
       assert false;

Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml	2009-02-16 19:57:40 UTC (rev 1549)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml	2009-02-16 21:40:32 UTC (rev 1550)
@@ -842,8 +842,23 @@
     
     <assertion id="i">
       <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has no observer methods, producer methods or fields or disposal methods</text>
+Additionally, for each such session bean, a second bean exists which has no observer methods</text>
     </assertion>    
+    
+    <assertion id="j">
+      <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such session bean, a second bean exists which has no producer methods</text>
+    </assertion>    
+    
+    <assertion id="k">
+      <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such session bean, a second bean exists which has no producer fields</text>
+    </assertion>    
+    
+    <assertion id="l">
+      <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such session bean, a second bean exists which has no disposal methods</text>
+    </assertion>    
   </section>
   
   <section id="3.3.7" title="Specializing a session bean">




More information about the weld-commits mailing list