[webbeans-commits] Webbeans SVN: r1484 - in tck/trunk/impl: src/main/java/org/jboss/jsr299/tck/unit/definition/name and 1 other directory.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Wed Feb 11 07:29:48 EST 2009


Author: shane.bryzak at jboss.com
Date: 2009-02-11 07:29:48 -0500 (Wed, 11 Feb 2009)
New Revision: 1484

Modified:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/name/NameDefinitionTest.java
   tck/trunk/impl/tck-audit.xml
Log:
map assertions for naming tests

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/name/NameDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/name/NameDefinitionTest.java	2009-02-11 11:54:02 UTC (rev 1483)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/name/NameDefinitionTest.java	2009-02-11 12:29:48 UTC (rev 1484)
@@ -28,13 +28,13 @@
    }
    
    @Test(groups="stub", expectedExceptions=DefinitionException.class) 
-   @SpecAssertion(section="2.6", id = "unknown")
+   @SpecAssertion(section="2.6", id = "a")
    public void testInvalidElIdentifierUsedAsWebBeanName()
    {
       assert false;
    }
    
-   @Test @SpecAssertion(section="2.6.1", id = "unknown")
+   @Test @SpecAssertion(section="2.6.1", id = "a")
    public void testNonDefaultNamed()
    {
       Bean<Moose> moose = createSimpleBean(Moose.class);
@@ -42,7 +42,7 @@
    }
    
    @Test(groups={"stub", "webbeansxml"}) 
-   @SpecAssertion(section="2.6.2", id = "unknown")
+   @SpecAssertion(section="2.6.2", id = "a")
    public void testNonDefaultXmlNamed()
    {
       /*Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
@@ -83,8 +83,8 @@
    
    @Test(groups={"stub", "webbeansxml"}) 
    @SpecAssertions({
-      @SpecAssertion(section="2.6.2", id = "unknown"),
-      @SpecAssertion(section = "2.6.3",id = "unknown")
+      @SpecAssertion(section="2.6.2", id = "b"),
+      @SpecAssertion(section = "2.6.3",id = "b")
    })
    public void testJavaNamedUsedWhenNoXmlSpecified()
    {
@@ -98,7 +98,7 @@
    
    @Test 
    @SpecAssertions({
-      @SpecAssertion(section= "2.6.3", id = "unknown"),
+      @SpecAssertion(section= "2.6.3", id = "a"),
       @SpecAssertion(section = "3.2.7", id = "unknown")
    })
    public void testDefaultNamed()
@@ -109,7 +109,7 @@
    }
    
    @Test(groups={"stub", "webbeansxml"}) 
-   @SpecAssertion(section="2.6.3", id = "unknown")
+   @SpecAssertion(section="2.6.3", id = "b")
    public void testDefaultXmlNamed()
    {
       /*Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
@@ -131,8 +131,8 @@
    
    @Test 
    @SpecAssertions({
-      @SpecAssertion(section = "2.6.3", id = "unknown"), 
-      @SpecAssertion(section = "2.7", id = "unknown")
+      @SpecAssertion(section = "2.6.3", id = "c"), 
+      @SpecAssertion(section = "2.7", id = "a")
    })
    public void testSterotypeDefaultsName()
    {
@@ -140,21 +140,21 @@
       assert model.getName().equals("redSnapper");
    }
    
-   @Test @SpecAssertion(section="2.6.4", id = "unknown")
+   @Test @SpecAssertion(section="2.6.4", id = "a")
    public void testNotNamedInJava()
    {
       Bean<SeaBass> model = createSimpleBean(SeaBass.class);
       assert model.getName() == null;
    }
    
-   @Test @SpecAssertion(section="2.6.4", id = "unknown")
+   @Test @SpecAssertion(section="2.6.4", id = "a")
    public void testNotNamedInXml()
    {
       Bean<SeaBass> model = createSimpleBean(SeaBass.class);
       assert model.getName() == null;
    }
    
-   @Test @SpecAssertion(section="2.6.4", id = "unknown")
+   @Test @SpecAssertion(section="2.6.4", id = "a")
    public void testNotNamedInStereotype()
    {
       Bean<Minnow> model = createSimpleBean(Minnow.class);

Modified: tck/trunk/impl/tck-audit.xml
===================================================================
--- tck/trunk/impl/tck-audit.xml	2009-02-11 11:54:02 UTC (rev 1483)
+++ tck/trunk/impl/tck-audit.xml	2009-02-11 12:29:48 UTC (rev 1484)
@@ -276,6 +276,69 @@
     </assertion>
   
   </section>
+  
+  <section id="2.6" title="Bean names">
+  
+    <assertion id="a">
+      <text>A valid bean name is a period-separated list of valid EL identifiers</text>
+    </assertion>
+  </section>
+  
+  <section id="2.6.1" title="Declaring the bean name using annotations">
+  
+    <assertion id="a">
+      <text>To specify the name of a bean, the @javax.annotation.Named annotation is applied to the bean class or producer method or field.</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>If the @Named annotation does not specify the value member, the default name is assumed</text>
+    </assertion>
+  </section>
+  
+  <section id="2.6.2" title="Declaring the bean name using XML">
+    
+    <assertion id="a">
+      <text>If the bean is declared in beans.xml, the name may be specified using &lt;Named&gt;</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>If the &lt;Named&gt; element is empty, the default name is assumed</text>
+    </assertion>
+  </section>
+  
+  <section id="2.6.3" title="Default bean names">
+  
+    <assertion id="a">
+      <text>A default name must be assigned by the container when a bean class or producer method or field of a bean defined using annotations declares a @Named annotation and no name is explicitly specified by the value member</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>A default name must be assigned by the container when an empty &lt;Named&gt; element is specified by a bean defined in XML</text>
+    </assertion>
+    
+    <assertion id="c">
+      <text>A default name must be assigned by the container when a bean declares a stereotype that declares an empty @Named annotation, and the bean does not explicitly specify a name.</text>
+    </assertion>
+  </section>
+  
+  <section id="2.6.4" title="Beans with no name">
+  
+    <assertion id="a">
+      <text>If neither &lt;Named&gt; nor @Named is specified, by the bean or its stereotypes, a bean has no name</text>
+    </assertion>
+  </section>
+  
+  <section id="2.7" title="Stereotypes">
+  
+    <assertion id="a">
+      <text>A stereotype may also specify that all beans with the stereotype have defaulted bean names</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>A bean may declare zero, one or multiple stereotypes</text>
+    </assertion>
+  
+  </section>
 
   <section id="3" title="Bean Implementation">
   




More information about the weld-commits mailing list