[webbeans-commits] Webbeans SVN: r2899 - in ri/trunk/tests/src: test/java/org/jboss/jsr299/tck/tests and 2 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Fri Jun 26 08:14:34 EDT 2009


Author: dallen6
Date: 2009-06-26 08:14:33 -0400 (Fri, 26 Jun 2009)
New Revision: 2899

Added:
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractCow.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractFarmHouse.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractHorse.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractKennel.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractStable.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AnotherDeploymentType.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Cow.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/CowDung.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Cuddly.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Dog.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Donkey.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Dung.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/FarmAnimalDeploymentType.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/FarmHouse.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Horse.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/HorseDung.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/LabradorKennel.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Smelly.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Stable.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Tame.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/TameCow.java
   ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/TameHorse.java
Modified:
   ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
Log:
Moved realization tests from TCK to webbeans-core-test

Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java	2009-06-26 11:43:37 UTC (rev 2898)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -8,6 +8,7 @@
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
 import java.net.URL;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Set;
@@ -93,6 +94,31 @@
    }
 
 
+   /**
+    * Checks if all annotations are in a given set of annotations
+    * 
+    * @param annotations The annotation set
+    * @param annotationTypes The annotations to match
+    * @return True if match, false otherwise
+    */
+   public boolean annotationSetMatches(Set<? extends Annotation> annotations, Class<? extends Annotation>... annotationTypes)
+   {
+      List<Class<? extends Annotation>> annotationTypeList = new ArrayList<Class<? extends Annotation>>();
+      annotationTypeList.addAll(Arrays.asList(annotationTypes));
+      for (Annotation annotation : annotations)
+      {
+         if (annotationTypeList.contains(annotation.annotationType()))
+         {
+            annotationTypeList.remove(annotation.annotationType());
+         }
+         else
+         {
+            return false;
+         }
+      }
+      return annotationTypeList.size() == 0;
+   }
+
    protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
    {
       return getDefaultDeploymentTypes();

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractCow.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractCow.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractCow.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Produces;
+
+abstract class AbstractCow
+{
+   
+   @Produces @RequestScoped @Smelly @FarmAnimalDeploymentType CowDung getDung()
+   {
+      return new CowDung();
+   }
+   
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractCow.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractFarmHouse.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractFarmHouse.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractFarmHouse.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+import javax.enterprise.event.Observes;
+
+abstract class AbstractFarmHouse
+{
+   
+   public void observeTameCows(@Observes @Tame Cow cow)
+   {
+      
+   }
+   
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractFarmHouse.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractHorse.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractHorse.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractHorse.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Produces;
+
+abstract class AbstractHorse
+{
+   
+   @Produces @Smelly @RequestScoped @FarmAnimalDeploymentType private HorseDung dung = new HorseDung();
+   
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractHorse.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractKennel.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractKennel.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractKennel.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+import javax.enterprise.inject.Produces;
+
+ at AnotherDeploymentType
+class AbstractKennel
+{
+ 
+   @Produces @Cuddly public Dog get()
+   {
+      return new Dog() {};
+   }
+   
+   
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractKennel.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractStable.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractStable.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractStable.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+import javax.enterprise.inject.Produces;
+
+ at AnotherDeploymentType
+abstract class AbstractStable
+{
+   
+   private @Produces @Cuddly Donkey donkey = new Donkey();
+   
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AbstractStable.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AnotherDeploymentType.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AnotherDeploymentType.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AnotherDeploymentType.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.deployment.DeploymentType;
+
+ at Target( { TYPE, METHOD })
+ at Retention(RUNTIME)
+ at Documented
+ at DeploymentType
+ at interface AnotherDeploymentType
+{
+
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/AnotherDeploymentType.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Cow.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Cow.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Cow.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+import org.jboss.webbeans.Realizes;
+
+ at Realizes @AnotherDeploymentType
+class Cow extends AbstractCow
+{
+   
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Cow.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/CowDung.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/CowDung.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/CowDung.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+class CowDung extends Dung
+{
+
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/CowDung.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Cuddly.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Cuddly.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Cuddly.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.stereotype.Stereotype;
+
+ at Stereotype
+ at Target( { TYPE, METHOD, FIELD })
+ at Retention(RUNTIME)
+ at RequestScoped
+ at interface Cuddly
+{
+
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Cuddly.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Dog.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Dog.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Dog.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+interface Dog
+{
+   
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Dog.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Donkey.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Donkey.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Donkey.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+class Donkey
+{
+   
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Donkey.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Dung.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Dung.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Dung.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+class Dung
+{
+   
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Dung.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/FarmAnimalDeploymentType.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/FarmAnimalDeploymentType.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/FarmAnimalDeploymentType.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.deployment.DeploymentType;
+
+ at Target( { TYPE, METHOD, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+ at DeploymentType
+ at interface FarmAnimalDeploymentType
+{
+
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/FarmAnimalDeploymentType.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/FarmHouse.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/FarmHouse.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/FarmHouse.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+import org.jboss.webbeans.Realizes;
+
+ at Smelly @Realizes
+class FarmHouse extends AbstractFarmHouse
+{
+   
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/FarmHouse.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Horse.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Horse.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Horse.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+import org.jboss.webbeans.Realizes;
+
+ at AnotherDeploymentType @Realizes
+class Horse extends AbstractHorse
+{
+   
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Horse.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/HorseDung.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/HorseDung.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/HorseDung.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+class HorseDung extends Dung
+{
+
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/HorseDung.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/LabradorKennel.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/LabradorKennel.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/LabradorKennel.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+import org.jboss.webbeans.Realizes;
+
+ at Realizes
+ at FarmAnimalDeploymentType
+class LabradorKennel extends AbstractKennel
+{
+   
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/LabradorKennel.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,128 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+import java.lang.annotation.Annotation;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.Any;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+/**
+ * 
+ * Spec version: PRD2
+ * 
+ */
+ at Artifact
+ at BeansXml("beans.xml")
+public class RealizationTest extends AbstractWebBeansTest
+{
+
+   private static Annotation SMELLY_LITERAL = new AnnotationLiteral<Smelly>()
+   {
+   };
+   private static Annotation TAME_LITERAL = new AnnotationLiteral<Tame>()
+   {
+   };
+
+   @Test
+   public void testRealizedBeanWithProducerMethodHasSameScope()
+   {
+      assert getBeans(CowDung.class, SMELLY_LITERAL).size() == 1;
+      assert getBeans(CowDung.class, SMELLY_LITERAL).iterator().next().getScopeType().equals(RequestScoped.class);
+   }
+
+   @Test
+   public void testRealizedBeanWithProducerMethodHasDeploymentTypeOfRealizingClass()
+   {
+      assert getBeans(CowDung.class, SMELLY_LITERAL).size() == 1;
+      assert getBeans(CowDung.class, SMELLY_LITERAL).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+   }
+
+   @Test
+   public void testRealizedBeanWithProducerMethodHasSameBindings()
+   {
+      assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL).size() == 1;
+      assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL).iterator().next().getBindings().size() == 2;
+      assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL).iterator().next().getBindings().contains(SMELLY_LITERAL);
+   }
+
+   @SuppressWarnings("unchecked")
+   @Test
+   public void testRealizedBeanWithProducerMethodHasBindingsOfMethodAndRealizingType()
+   {
+      assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL, TAME_LITERAL).size() == 1;
+      assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL, TAME_LITERAL).iterator().next().getBindings().size() == 3;
+      assert annotationSetMatches(getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL, TAME_LITERAL).iterator().next().getBindings(), Smelly.class, Tame.class, Any.class);
+   }
+
+   @Test
+   public void testRealizedBeanWithProducerMethodHasSameStereotypes()
+   {
+      assert getBeans(Dog.class).size() == 1;
+      assert getBeans(Dog.class).iterator().next().getScopeType().equals(RequestScoped.class);
+   }
+
+   @Test
+   public void testRealizedBeanWithProducerFieldHasSameScope()
+   {
+      assert getBeans(HorseDung.class, SMELLY_LITERAL).size() == 1;
+      assert getBeans(HorseDung.class, SMELLY_LITERAL).iterator().next().getScopeType().equals(RequestScoped.class);
+   }
+
+   @Test
+   public void testRealizedBeanWithProducerFieldHasDeploymentTypeOfRealizingClass()
+   {
+      assert getBeans(HorseDung.class, SMELLY_LITERAL).size() == 1;
+      assert getBeans(HorseDung.class, SMELLY_LITERAL).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+   }
+
+   @Test
+   public void testRealizedBeanWithProducerFieldHasSameBindings()
+   {
+      assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL).size() == 1;
+      assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL).iterator().next().getBindings().size() == 2;
+      assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL).iterator().next().getBindings().contains(SMELLY_LITERAL);
+   }
+
+   @SuppressWarnings("unchecked")
+   @Test
+   public void testRealizedBeanWithProducerFieldHasBindingsOfMethodAndRealizingType()
+   {
+      assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL, TAME_LITERAL).size() == 1;
+      assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL, TAME_LITERAL).iterator().next().getBindings().size() == 3;
+      assert annotationSetMatches(getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL, TAME_LITERAL).iterator().next().getBindings(), Smelly.class, Tame.class, Any.class);
+   }
+
+   @Test
+   public void testRealizedBeanWithProducerFieldHasSameStereotypes()
+   {
+      assert getBeans(Donkey.class).size() == 1;
+      assert getBeans(Donkey.class).iterator().next().getScopeType().equals(RequestScoped.class);
+   }
+
+   @Test(groups = "stub")
+   public void testDisposalMethodInherited()
+   {
+      assert false;
+   }
+
+   @Test(groups = "stub")
+   public void testRealizedDisposalMethodHasBindingsOfMethodAndRealizingType()
+   {
+      assert false;
+   }
+
+   @Test
+   public void testObserverMethodInheritedAndHasSameBindings()
+   {
+      assert getCurrentManager().resolveObservers(new Cow(), new AnnotationLiteral<Tame>()
+      {
+      }).size() == 1;
+      assert getCurrentManager().resolveObservers(new Cow(), SMELLY_LITERAL).size() == 0;
+   }
+
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Smelly.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Smelly.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Smelly.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+ at Target( { TYPE, METHOD, PARAMETER, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+ at BindingType
+ at interface Smelly
+{
+
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Smelly.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Stable.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Stable.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Stable.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+import org.jboss.webbeans.Realizes;
+
+ at Realizes @FarmAnimalDeploymentType
+class Stable extends AbstractStable
+{
+   
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Stable.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Tame.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Tame.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Tame.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+ at Target( { TYPE, METHOD, PARAMETER, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+ at BindingType
+ at interface Tame
+{
+
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/Tame.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/TameCow.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/TameCow.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/TameCow.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+import org.jboss.webbeans.Realizes;
+
+ at Realizes @Tame
+class TameCow extends AbstractCow
+{
+   
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/TameCow.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/TameHorse.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/TameHorse.java	                        (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/TameHorse.java	2009-06-26 12:14:33 UTC (rev 2899)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.inheritance.realization;
+
+import org.jboss.webbeans.Realizes;
+
+ at Realizes @Tame
+class TameHorse extends AbstractHorse
+{
+   
+}


Property changes on: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/inheritance/realization/TameHorse.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain




More information about the weld-commits mailing list