[webbeans-commits] Webbeans SVN: r2024 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/definition/stereotype and 1 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Mon Mar 16 01:57:51 EDT 2009


Author: shane.bryzak at jboss.com
Date: 2009-03-16 01:57:51 -0400 (Mon, 16 Mar 2009)
New Revision: 2024

Added:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/Goat.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/Goat.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/NonStereotype.java
Modified:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java
   tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
marked more assertions untestable, implemented 2.7.1.b, 2.5.3.i

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java	2009-03-16 05:18:54 UTC (rev 2023)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java	2009-03-16 05:57:51 UTC (rev 2024)
@@ -46,7 +46,7 @@
 
    @Test(groups = { "deploymentType" })
    @SpecAssertion(section = "2.5.3", id = "c")
-   public void testDeploymentTypeInhertitedFromDeclaringBean() throws Exception
+   public void testDeploymentTypeInheritedFromDeclaringBean() throws Exception
    {
       assert getCurrentManager().resolveByType(BlackWidow.class).size() == 1;
       Bean<BlackWidow> blackWidowSpiderModel = getCurrentManager().resolveByType(BlackWidow.class).iterator().next();
@@ -108,6 +108,15 @@
       Bean<Reindeer> bean = getCurrentManager().resolveByType(Reindeer.class).iterator().next();
       assert bean.getDeploymentType().equals(Production.class);
    }
+   
+   @Test
+   @SpecAssertion(section = "2.5.3", id = "i")   
+   public void testDeploymentTypeMayBeSpecifiedByStereotype()
+   {
+      assert getCurrentManager().resolveByType(Goat.class).size() == 1;
+      Bean<Goat> bean = getCurrentManager().resolveByType(Goat.class).iterator().next();
+      assert bean.getDeploymentType().equals(HornedAnimalDeploymentType.class);
+   }
 
    @Test(groups = { "deploymentType" })
    @SpecAssertion(section = "4.1", id = "ca")

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/Goat.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/Goat.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/Goat.java	2009-03-16 05:57:51 UTC (rev 2024)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.definition.deployment;
+
+ at HornedMammalStereotype
+class Goat implements Animal
+{
+
+}

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/Goat.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/Goat.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/Goat.java	2009-03-16 05:57:51 UTC (rev 2024)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.definition.stereotype;
+
+ at NonStereotype
+class Goat
+{
+
+}

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/NonStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/NonStereotype.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/NonStereotype.java	2009-03-16 05:57:51 UTC (rev 2024)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.definition.stereotype;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+ at Target( { TYPE })
+ at Retention(RUNTIME)
+ at HornedAnimalDeploymentType
+ at interface NonStereotype
+{
+
+}

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java	2009-03-16 05:18:54 UTC (rev 2023)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java	2009-03-16 05:57:51 UTC (rev 2024)
@@ -24,34 +24,15 @@
 @Artifact
 @BeansXml("beans.xml")
 public class StereotypeDefinitionTest extends AbstractJSR299Test
-{
-   
+{   
    private static final Annotation TAME_LITERAL = new AnnotationLiteral<Tame>() {};
 
-   /**
-    * TODO Difficult to test since all user defined stereotypes are not known
-    * here
-    * 
-    * PLM - agreed, as the spec doesn't say what exception to throw. Probably this won't be tested
-    */
-   @Test(groups = { "stub", "annotationDefinition" })
-   @SpecAssertion(section = "2.7.1", id = "aa")
-   public void testHasCorrectTarget()
-   {
-      assert false;
-   }
-
-   /**
-    * TODO If the stereotype does not have a stereotype annotation, then it
-    * isn't one and is difficult to test
-    * 
-    * PLM - just test that a stereotype which doesn't have the annotation isn't used as such
-    */
-   @Test(groups = { "stub", "annotationDefinition" })
+   @Test(groups = { "annotationDefinition" })
    @SpecAssertion(section = "2.7.1", id = "b")
    public void testHasStereotypeAnnotation()
    {
-      assert false;
+      Bean<Goat> bean = getCurrentManager().resolveByType(Goat.class).iterator().next();
+      assert !bean.getDeploymentType().equals(HornedAnimalDeploymentType.class);
    }
 
    @Test

Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml	2009-03-16 05:18:54 UTC (rev 2023)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml	2009-03-16 05:57:51 UTC (rev 2024)
@@ -538,19 +538,19 @@
   </section>
   
   <section id="2.7.1" title="Defining new stereotypes">
-    <assertion id="aa">
+    <assertion id="aa" testable="false">
       <text>A beans stereotype is a Java annotation defined as @Target({TYPE, METHOD, FIELD})~, @Target(TYPE), @Target(METHOD), @Target(FIELD) or @Target({METHOD, FIELD}) and @Retention(RUNTIME)~</text>
     </assertion>
     
-    <assertion id="ab">
+    <assertion id="ab" testable="false">
       <text>A beans stereotype is a Java annotation defined as ~@Target({TYPE, METHOD, FIELD}),~ @Target(TYPE)~, @Target(METHOD), @Target(FIELD) or @Target({METHOD, FIELD}) and @Retention(RUNTIME)~</text>
     </assertion>
     
-    <assertion id="ac">
+    <assertion id="ac" testable="false">
       <text>A beans stereotype is a Java annotation defined as ~@Target({TYPE, METHOD, FIELD}), @Target(TYPE), @Target(METHOD), ~@Target(FIELD) ~or @Target({METHOD, FIELD}) and @Retention(RUNTIME)~</text>
     </assertion>
     
-    <assertion id="ad">
+    <assertion id="ad" testable="false">
       <text>A beans stereotype is a Java annotation defined as ~@Target({TYPE, METHOD, FIELD}), @Target(TYPE), @Target(METHOD), @Target(FIELD) or~ @Target({METHOD, FIELD})~ and @Retention(RUNTIME)~</text>
     </assertion>
     




More information about the weld-commits mailing list