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

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Wed Feb 11 05:44:19 EST 2009


Author: shane.bryzak at jboss.com
Date: 2009-02-11 05:44:19 -0500 (Wed, 11 Feb 2009)
New Revision: 1481

Modified:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/DeploymentTypeDefinitionTest.java
   tck/trunk/impl/tck-audit.xml
Log:
more assertion mappings

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/DeploymentTypeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/DeploymentTypeDefinitionTest.java	2009-02-11 01:57:42 UTC (rev 1480)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/DeploymentTypeDefinitionTest.java	2009-02-11 10:44:19 UTC (rev 1481)
@@ -34,65 +34,48 @@
       return deploymentTypes;
    }
 
-   /**
-    * No bean may be declared with the (@Standard-bean) deployment type unless
-    * explicitly required by this specification.
-    */
    @Test(groups = { "deploymentType" }, expectedExceptions = DefinitionException.class)
-   @SpecAssertion(section = "2.5.1", id = "unknown")
+   @SpecAssertion(section = "2.5.1", id = "b")
    public void testNonBuiltInComponentUsesStandard()
    {
       deployBeans(Gazelle_Broken.class);
    }
 
    /**
-    * A deployment type is a Java annotation defined as @Target({TYPE, METHOD,
-    * FIELD}) and @Retention(RUNTIME).
     * 
     * TODO This text is not really a testable assertion
     */
    @Test(groups = { "underInvestigation", "annotationDefinition", "deploymentType" })
-   @SpecAssertion(section = "2.5.2", id = "unknown")
+   @SpecAssertion(section = "2.5.2", id = "a")
    public void testDeploymentTypeHasCorrectTarget()
    {
       assert false;
    }
 
    /**
-    * A deployment type is a Java annotation defined as @Target({TYPE, METHOD,
-    * FIELD}) and @Retention(RUNTIME).
     * 
     * TODO This text is not really a testable assertion
     */
    @Test(groups = { "underInvestigation", "annotationDefinition", "deploymentType" })
-   @SpecAssertion(section = "2.5.2", id = "unknown")
+   @SpecAssertion(section = "2.5.2", id = "b")
    public void testDeploymentTypeHasCorrectRetention()
    {
       assert false;
    }
 
    /**
-    * All de- ployment types must also specify the @javax.inject.DeploymentType
-    * meta-annotation.
     * 
     * TODO This text is not really a testable assertion
     */
    @Test(groups = { "underInvestigation", "annotationDefinition", "deploymentType" })
-   @SpecAssertion(section = "2.5.2", id = "unknown")
+   @SpecAssertion(section = "2.5.2", id = "c")
    public void testDeploymentTypeDeclaresDeploymentTypeAnnotation()
    {
       assert false;
    }
 
-   /**
-    * By default, if no deployment type annotation is explicitly specified, a
-    * producer method or field inherits the deployment type of the bean in which
-    * it is defined.
-    * 
-    * @throws Exception
-    */
    @Test(groups = { "deploymentType" })
-   @SpecAssertion(section = "2.5.3", id = "unknown")
+   @SpecAssertion(section = "2.5.3", id = "c")
    public void testDeploymentTypeInhertitedFromDeclaringBean() throws Exception
    {
       deployBeans(SpiderProducer.class);
@@ -101,14 +84,12 @@
    }
 
    /**
-    * When a bean is declared in beans.xml, the deployment type may be specified
-    * using a tag with the annotation type name:
     * 
     * TODO Section 2.5.4 does not claim that XML overrides Java for deployment
     * types
     */
    @Test(groups = { "stub", "webbeansxml", "deploymentType" })
-   @SpecAssertion(section = "2.5.4", id = "unknown")
+   @SpecAssertion(section = "2.5.4", id = "a")
    public void testXmlDeploymentTypeElement()
    {
       // Map<Class<? extends Annotation>, Annotation>
@@ -128,16 +109,8 @@
       assert false;
    }
 
-   /**
-    * The default deployment type for a bean which does not explicitly declare a
-    * deployment type depends upon its declared stereotypes:
-    * 
-    * • If a bean does not declare any stereotype with a declared default
-    * deployment type, then the default deployment type is (@Production-bean).
-    * 
-    */
    @Test(groups = { "webbeansxml", "deploymentType" })
-   @SpecAssertion(section = "2.5.5", id = "unknown")
+   @SpecAssertion(section = "2.5.5", id = "a")
    public void testDefaultDeploymentType()
    {
       deployBeans(BlackWidow.class);
@@ -145,13 +118,8 @@
       assert bean.getDeploymentType().equals(Production.class);
    }
 
-   /**
-    * • Otherwise, the default deployment type for the bean is the
-    * highest-precedence default deployment type declared by any stereotype
-    * declared by the bean.
-    */
    @Test(groups = { "deploymentType" })
-   @SpecAssertion(section = "2.5.5", id = "unknown")
+   @SpecAssertion(section = "2.5.5", id = "b")
    public void testHighestPrecedenceDeploymentTypeFromStereotype()
    {
       deployBeans(Rhinoceros.class);
@@ -159,25 +127,16 @@
       assert bean.getDeploymentType().equals(HornedAnimalDeploymentType.class);
    }
 
-   /**
-    * If the deployment type is enabled, an instance of the bean may be obtained
-    * by lookup, injection or EL resolution. Otherwise, the bean is never
-    * instantiated by the container.
-    */
    @Test(groups = { "beanLifecycle", "deploymentType" }, expectedExceptions = UnsatisfiedDependencyException.class)
-   @SpecAssertion(section = "2.5.6", id = "unknown")
+   @SpecAssertion(section = "2.5.6", id = "a")
    public void testBeanWithDisabledDeploymentTypeNotInstantiated()
    {
       deployBeans(RedSnapper.class);
       manager.getInstanceByType(RedSnapper.class);
    }
 
-   /**
-    * If more than one deployment type is specified in XML, a
-    * DefinitionException is thrown by the container at deployment time.
-    */
    @Test(groups = { "stub", "webbeansxml", "deploymentType" }, expectedExceptions = DeploymentException.class)
-   @SpecAssertion(section = "2.5.4", id = "unknown")
+   @SpecAssertion(section = "2.5.4", id = "b")
    public void testMultipleDeployElementsCannotBeDefined()
    {
 
@@ -188,7 +147,9 @@
     * type declared by stereotypes are ignored.
     */
    @Test(groups = { "deploymentType" })
-   @SpecAssertions( { @SpecAssertion(section = "2.5.5", id = "unknown"), @SpecAssertion(section = "2.7.2", id = "unknown"), @SpecAssertion(section = "4.1", id = "unknown") })
+   @SpecAssertions( { @SpecAssertion(section = "2.5.5", id = "unknown"), 
+      @SpecAssertion(section = "2.7.2", id = "unknown"), 
+      @SpecAssertion(section = "4.1", id = "d") })
    public void testWebBeanDeploymentTypeOverridesStereotype()
    {
       deployBeans(Reindeer.class);
@@ -196,58 +157,32 @@
       assert bean.getDeploymentType().equals(Production.class);
    }
 
-   /**
-    * If X is annotated with a deployment type Z then Y inherits the annotation
-    * if and only if Z declares the @Inherited meta-annotation and neither Y nor
-    * any intermediate class that is a subclass of X and a superclass of Y
-    * declares a deployment type.
-    * 
-    * @throws Exception
-    */
    @Test(groups = { "deploymentType" })
-   @SpecAssertion(section = "4.1", id = "unknown")
+   @SpecAssertion(section = "4.1", id = "c")
    public void testDeploymentTypeDeclaredInheritedIsInherited() throws Exception
    {
       deployBeans(BorderCollie.class);
       assert manager.resolveByType(BorderCollie.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
    }
 
-   /**
-    * If X is annotated with a deployment type Z then Y inherits the annotation
-    * if and only if Z declares the @Inherited meta-annotation and neither Y nor
-    * any intermediate class that is a subclass of X and a superclass of Y
-    * declares a deployment type.
-    */
    @Test(groups = { "deploymentType" })
-   @SpecAssertion(section = "4.1", id = "unknown")
+   @SpecAssertion(section = "4.1", id = "c")
    public void testDeploymentTypeNotDeclaredInheritedIsNotInherited()
    {
       deployBeans(ShetlandPony.class);
       assert manager.resolveByType(ShetlandPony.class).iterator().next().getDeploymentType().equals(Production.class);
    }
 
-   /**
-    * If X is annotated with a deployment type Z then Y inherits the annotation
-    * if and only if Z declares the @Inherited meta-annotation and neither Y nor
-    * any intermediate class that is a subclass of X and a superclass of Y
-    * declares a deployment type.
-    */
    @Test(groups = { "deploymentType" })
-   @SpecAssertion(section = "4.1", id = "unknown")
+   @SpecAssertion(section = "4.1", id = "c")
    public void testDeploymentTypeDeclaredInheritedIsBlockedByIntermediateDeploymentTypeNotMarkedInherited()
    {
       deployBeans(GoldenRetriever.class);
       assert manager.resolveByType(GoldenRetriever.class).iterator().next().getDeploymentType().equals(Production.class);
    }
 
-   /**
-    * If X is annotated with a deployment type Z then Y inherits the annotation
-    * if and only if Z declares the @Inherited meta-annotation and neither Y nor
-    * any intermediate class that is a subclass of X and a superclass of Y
-    * declares a deployment type.
-    */
    @Test(groups = { "deploymentType" })
-   @SpecAssertion(section = "4.1", id = "unknown")
+   @SpecAssertion(section = "4.1", id = "c")
    public void testDeploymentTypeDeclaredInheritedIsBlockedByIntermediateDeploymentTypeMarkedInherited()
    {
       deployBeans(GoldenLabrador.class);

Modified: tck/trunk/impl/tck-audit.xml
===================================================================
--- tck/trunk/impl/tck-audit.xml	2009-02-11 01:57:42 UTC (rev 1480)
+++ tck/trunk/impl/tck-audit.xml	2009-02-11 10:44:19 UTC (rev 1481)
@@ -165,6 +165,117 @@
       <text>When the bindings of a parameter are specified using XML, any binding annotations of the parameter are ignored</text>
     </assertion>
   </section>
+  
+  <section id="2.4" title="Scopes">
+  
+    <assertion id="a">
+      <text>All beans have a scope</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>A scope type is represented by an annotation type.</text>
+    </assertion>
+    
+    <assertion id="c">
+      <text>The set of scope types is extensible</text>
+    </assertion>
+    
+  </section>
+  
+  <section id="2.5.1" title="Built-in deployment types">
+  
+    <assertion id="a">
+      <text>All standard beans defined by this specification, and provided by the container, are defined using the @Standard deployment type</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>No bean may be declared with the @Standard deployment type unless explicitly required by this specification</text>
+    </assertion>
+    
+    <assertion id="c">
+      <text>Application beans may be defined using the @Production deployment type</text>
+    </assertion>
+  
+  </section>    
+  
+  <section id="2.5.2" title="Defining new deployment types">
+  
+    <assertion id="a">
+      <text>A deployment type is a Java annotation defined as @Target({TYPE, METHOD, FIELD})</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>A deployment type is a Java annotation defined with @Retention(RUNTIME)</text>
+    </assertion>
+    
+    <assertion id="c">
+      <text>All deployment types must also specify the @javax.inject.DeploymentType meta-annotation.</text>
+    </assertion>
+    
+    <assertion id="d">
+      <text>Applications and third-party frameworks may define their own deployment types</text>
+    </assertion>
+  
+  </section>
+  
+  <section id="2.5.3" title="Declaring the deployment type of a bean using annotations">
+  
+    <assertion id="a">
+      <text>The deployment type of the bean is declared by annotating the bean class or producer method or field</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>An bean class or producer method or field may specify at most one deployment type. If multiple deployment type annotations are specified, a DefinitionException is thrown by the container at deployment time.</text>
+    </assertion>
+    
+    <assertion id="c">
+      <text>By default, if no deployment type annotation is explicitly specified, a producer method or field inherits the deployment type of the bean in which it is defined.</text>
+    </assertion>
+    
+    <assertion id="d">
+      <text>a deployment type may be specified using a stereotype annotation, as defined in Section 2.7.2, "Declaring the stereotypes for a bean using annotations".</text>
+    </assertion>
+  
+  </section>
+  
+  <section id="2.5.4" title="Declaring the deployment type of a bean using XML">
+    <assertion id="a">
+      <text>When a bean is declared in beans.xml, the deployment type may be specified using a tag with the annotation type name</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>If more than one deployment type is specified in XML, a DefinitionException is thrown by the container at deployment time</text>
+    </assertion>
+    
+    <assertion id="c">
+      <text>A deployment type may be specified using a stereotype declared in XML, as defined in Section 2.7.3, "Declaring the stereotypes for a bean using XML".</text>
+    </assertion>
+  </section>
+  
+  <section id="2.5.5" title="Default deployment type">
+    
+    <assertion id="a">
+      <text>The default deployment type for a bean which does not explicitly declare a deployment type depends upon its declared stereotypes - if a bean does not declare any stereotype with a declared default deployment type, then the default deployment type is
+ at Production</text>
+    </assertion>
+    
+    <assertion id="b">
+      <text>Otherwise, the default deployment type for the bean is the highest-precedence default deployment type declared by any stereotype declared by the bean</text>
+      <note>This assertion relates to assertion 2.5.5.b</note>
+    </assertion>
+    
+    <assertion id="c">
+      <text>If a bean explicitly declares a deployment type, any default deployment type declared by stereotypes are ignored.</text>
+    </assertion>
+  </section>
+  
+  <section id="2.5.6" title="Enabled deployment types">
+  
+    <assertion id="a">
+      <text>Beans declared with a deployment type that is not enabled are not available to the resolution algorithms defined in Chapter 5, Lookup, dependency injection and EL resolution.</text>
+    </assertion>
+  
+  </section>
 
   <section id="3" title="Bean Implementation">
   




More information about the weld-commits mailing list