[webbeans-commits] Webbeans SVN: r2741 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: implementation/enterprise/newBean and 5 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Tue Jun 2 07:12:51 EDT 2009


Author: dallen6
Date: 2009-06-02 07:12:50 -0400 (Tue, 02 Jun 2009)
New Revision: 2741

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/implementation/enterprise/newBean/NewEnterpriseBeanTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
Log:
Fixed remaining broken tests for @Any functionality

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-06-01 21:14:29 UTC (rev 2740)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java	2009-06-02 11:12:50 UTC (rev 2741)
@@ -77,7 +77,7 @@
       assert getCurrentManager().getBeans(HighlandCow.class, TAME_LITERAL).size() == 1; 
       Bean<HighlandCow> highlandCow = getCurrentManager().getBeans(HighlandCow.class, TAME_LITERAL).iterator().next();
       assert highlandCow.getName() == null;
-      assert highlandCow.getBindings().iterator().next().annotationType().equals(Tame.class);
+      assert highlandCow.getBindings().contains(TAME_LITERAL);
       assert highlandCow.getScopeType().equals(RequestScoped.class);
       assert highlandCow.getDeploymentType().equals(HornedAnimalDeploymentType.class);
    }

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java	2009-06-01 21:14:29 UTC (rev 2740)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java	2009-06-02 11:12:50 UTC (rev 2741)
@@ -10,12 +10,13 @@
 import javax.enterprise.inject.New;
 import javax.enterprise.inject.deployment.Standard;
 import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.Bean;
 
 import org.hibernate.tck.annotations.SpecAssertion;
 import org.hibernate.tck.annotations.SpecAssertions;
 import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
 import org.jboss.jsr299.tck.literals.NewLiteral;
+import org.jboss.jsr299.tck.tests.event.AnyBinding;
 import org.jboss.testharness.impl.packaging.Artifact;
 import org.jboss.testharness.impl.packaging.Packaging;
 import org.jboss.testharness.impl.packaging.PackagingType;
@@ -104,8 +105,9 @@
    {
       Bean<OrderLocal> orderBean = getCurrentManager().getBeans(OrderLocal.class).iterator().next();
       Bean<OrderLocal> newOrderBean = getCurrentManager().getBeans(OrderLocal.class, new NewLiteral()).iterator().next();
-      assert orderBean.getBindings().size() == 1;
-      assert orderBean.getBindings().iterator().next().annotationType().equals(Current.class);
+      assert orderBean.getBindings().size() == 2;
+      assert orderBean.getBindings().contains(new CurrentLiteral());
+      assert orderBean.getBindings().contains(new AnyBinding());
       
       assert getCurrentManager().getBeans(OrderLocal.class, new NewLiteral()).size() == 1;
       assert newOrderBean.getBindings().size() == 1;
@@ -116,8 +118,9 @@
       Bean<LionLocal> lionBean = getCurrentManager().getBeans(LionLocal.class, TAME_LITERAL).iterator().next();
       Bean<LionLocal> newLionBean = getCurrentManager().getBeans(LionLocal.class, new NewLiteral()).iterator().next();
       assert getCurrentManager().getBeans(LionLocal.class, TAME_LITERAL).size() == 1;
-      assert lionBean.getBindings().size() == 1;
-      assert lionBean.getBindings().iterator().next().annotationType().equals(Tame.class);
+      assert lionBean.getBindings().size() == 2;
+      assert lionBean.getBindings().contains(TAME_LITERAL);
+      assert lionBean.getBindings().contains(new AnyBinding());
       
       assert getCurrentManager().getBeans(LionLocal.class, new NewLiteral()).size() == 1;
       assert newLionBean.getBindings().size() == 1;

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java	2009-06-01 21:14:29 UTC (rev 2740)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java	2009-06-02 11:12:50 UTC (rev 2741)
@@ -8,15 +8,15 @@
 import javax.enterprise.context.Dependent;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.inject.AnnotationLiteral;
-import javax.enterprise.inject.Current;
 import javax.enterprise.inject.New;
 import javax.enterprise.inject.deployment.Standard;
 import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.Bean;
 
 import org.hibernate.tck.annotations.SpecAssertion;
 import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
 import org.jboss.jsr299.tck.literals.NewLiteral;
+import org.jboss.jsr299.tck.tests.event.AnyBinding;
 import org.jboss.testharness.impl.packaging.Artifact;
 import org.testng.annotations.Test;
 
@@ -176,16 +176,17 @@
    public void testForEachSimpleBeanANewBeanExists()
    {
       assert getCurrentManager().getBeans(Order.class).size() == 1;
-      assert getCurrentManager().getBeans(Order.class).iterator().next().getBindings().size() == 1;
-      assert getCurrentManager().getBeans(Order.class).iterator().next().getBindings().iterator().next().annotationType().equals(Current.class);
+      assert getCurrentManager().getBeans(Order.class).iterator().next().getBindings().size() == 2;
+      assert getCurrentManager().getBeans(Order.class).iterator().next().getBindings().contains(new CurrentLiteral());
 
       assert getCurrentManager().getBeans(Order.class, new NewLiteral()).size() == 1;
       assert getCurrentManager().getBeans(Order.class, new NewLiteral()).iterator().next().getBindings().size() == 1;
       assert getCurrentManager().getBeans(Order.class, new NewLiteral()).iterator().next().getBindings().iterator().next().annotationType().equals(New.class);
 
       assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).size() == 1;
-      assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).iterator().next().getBindings().size() == 1;
-      assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).iterator().next().getBindings().iterator().next().annotationType().equals(Tame.class);
+      assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).iterator().next().getBindings().size() == 2;
+      assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).iterator().next().getBindings().contains(TAME_LITERAL);
+      assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).iterator().next().getBindings().contains(new AnyBinding());
 
       assert getCurrentManager().getBeans(Lion.class, new NewLiteral()).size() == 1;
       assert getCurrentManager().getBeans(Lion.class, new NewLiteral()).iterator().next().getBindings().size() == 1;

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java	2009-06-01 21:14:29 UTC (rev 2740)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java	2009-06-02 11:12:50 UTC (rev 2741)
@@ -4,6 +4,7 @@
 
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.Any;
 
 import org.hibernate.tck.annotations.SpecAssertion;
 import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -49,8 +50,8 @@
    public void testRealizedBeanWithProducerMethodHasSameBindings()
    {
       assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL).size() == 1;
-      assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL).iterator().next().getBindings().size() == 1;
-      assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL).iterator().next().getBindings().iterator().next().annotationType().equals(Smelly.class);
+      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")
@@ -59,8 +60,8 @@
    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() == 2;
-      assert annotationSetMatches(getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL, TAME_LITERAL).iterator().next().getBindings(), Smelly.class, Tame.class);
+      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
@@ -92,8 +93,8 @@
    public void testRealizedBeanWithProducerFieldHasSameBindings()
    {
       assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL).size() == 1;
-      assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL).iterator().next().getBindings().size() == 1;
-      assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL).iterator().next().getBindings().iterator().next().annotationType().equals(Smelly.class);
+      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")
@@ -102,8 +103,8 @@
    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() == 2;
-      assert annotationSetMatches(getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL, TAME_LITERAL).iterator().next().getBindings(), Smelly.class, Tame.class);
+      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

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java	2009-06-01 21:14:29 UTC (rev 2740)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java	2009-06-02 11:12:50 UTC (rev 2741)
@@ -3,6 +3,7 @@
 import java.lang.annotation.Annotation;
 
 import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.Any;
 import javax.enterprise.inject.spi.Bean;
 import javax.inject.DefinitionException;
 
@@ -37,8 +38,8 @@
       assert getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).size() == 1;
       Bean<FarmerLocal> bean = getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next();
       assert getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getTypes().contains(LazyFarmerLocal.class);
-      assert getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getBindings().size() == 2;
-      assert annotationSetMatches( getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getBindings(), Landowner.class, Lazy.class);
+      assert getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getBindings().size() == 3;
+      assert annotationSetMatches( getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getBindings(), Landowner.class, Lazy.class, Any.class);
    }
    
    @Test

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java	2009-06-01 21:14:29 UTC (rev 2740)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java	2009-06-02 11:12:50 UTC (rev 2741)
@@ -3,6 +3,7 @@
 import java.lang.annotation.Annotation;
 
 import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.Any;
 
 import org.hibernate.tck.annotations.SpecAssertion;
 import org.hibernate.tck.annotations.SpecAssertions;
@@ -30,8 +31,8 @@
    public void testSpecializingBeanHasBindingsOfSpecializedAndSpecializingBean()
    {
       assert getCurrentManager().getBeans(Product.class, EXPENSIVE_LITERAL).size() == 1;
-      assert getCurrentManager().getBeans(Product.class, EXPENSIVE_LITERAL).iterator().next().getBindings().size() == 2;
-      assert annotationSetMatches( getCurrentManager().getBeans(Product.class, EXPENSIVE_LITERAL).iterator().next().getBindings(), Expensive.class, Sparkly.class);
+      assert getCurrentManager().getBeans(Product.class, EXPENSIVE_LITERAL).iterator().next().getBindings().size() == 3;
+      assert annotationSetMatches( getCurrentManager().getBeans(Product.class, EXPENSIVE_LITERAL).iterator().next().getBindings(), Expensive.class, Sparkly.class, Any.class);
    }
    
    @Test

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java	2009-06-01 21:14:29 UTC (rev 2740)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java	2009-06-02 11:12:50 UTC (rev 2741)
@@ -3,6 +3,7 @@
 import java.lang.annotation.Annotation;
 
 import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.Any;
 import javax.enterprise.inject.spi.Bean;
 
 import org.hibernate.tck.annotations.SpecAssertion;
@@ -36,8 +37,8 @@
       assert getCurrentManager().getBeans(Farmer.class, LANDOWNER_LITERAL).size() == 1;
       Bean<?> bean = getCurrentManager().getBeans(Farmer.class, LANDOWNER_LITERAL).iterator().next();
       assert bean.getTypes().contains(LazyFarmer.class);
-      assert bean.getBindings().size() == 2;
-      assert annotationSetMatches(bean.getBindings(), Landowner.class, Lazy.class);
+      assert bean.getBindings().size() == 3;
+      assert annotationSetMatches(bean.getBindings(), Landowner.class, Lazy.class, Any.class);
    }
 
    @Test




More information about the weld-commits mailing list