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

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Sun Dec 7 10:43:14 EST 2008


Author: pete.muir at jboss.org
Date: 2008-12-07 10:43:13 -0500 (Sun, 07 Dec 2008)
New Revision: 435

Added:
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Grayling.java
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Minnow.java
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Pollock.java
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Scallop.java
Modified:
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/CommonWebBeanTest.java
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeploymentTypeTest.java
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameTest.java
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanModelTest.java
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ScopeTypeTest.java
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypesTest.java
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Spider.java
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SpiderProducer.java
Log:
Start to update to 20081206

Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java	2008-12-07 15:27:01 UTC (rev 434)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java	2008-12-07 15:43:13 UTC (rev 435)
@@ -31,7 +31,6 @@
 import javax.webbeans.DeploymentType;
 import javax.webbeans.Event;
 import javax.webbeans.Named;
-import javax.webbeans.Production;
 import javax.webbeans.ScopeType;
 import javax.webbeans.Specializes;
 import javax.webbeans.Standard;
@@ -230,10 +229,12 @@
          }
       }
 
-      this.deploymentType = Production.class;
+      this.deploymentType = getDefaultDeploymentType();
       log.trace("Using default @Production deployment type");
       return;
    }
+   
+   protected abstract Class<? extends Annotation> getDefaultDeploymentType();
 
    /**
     * Initializes the injection points

Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java	2008-12-07 15:27:01 UTC (rev 434)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java	2008-12-07 15:43:13 UTC (rev 435)
@@ -17,6 +17,7 @@
 
 package org.jboss.webbeans.bean;
 
+import java.lang.annotation.Annotation;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -28,6 +29,7 @@
 import javax.webbeans.Observable;
 import javax.webbeans.Observes;
 import javax.webbeans.Produces;
+import javax.webbeans.Production;
 
 import org.jboss.webbeans.ManagerImpl;
 import org.jboss.webbeans.introspector.AnnotatedClass;
@@ -287,4 +289,10 @@
       buffer.append(Strings.collectionToString("Producer methods: ", getProducerMethods()));
       return buffer.toString();
    }
+   
+   @Override
+   protected Class<? extends Annotation> getDefaultDeploymentType()
+   {
+      return Production.class;
+   }
 }

Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java	2008-12-07 15:27:01 UTC (rev 434)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java	2008-12-07 15:43:13 UTC (rev 435)
@@ -17,12 +17,14 @@
 
 package org.jboss.webbeans.bean;
 
+import java.lang.annotation.Annotation;
 import java.lang.reflect.Field;
 import java.lang.reflect.Type;
 
 import javax.webbeans.DefinitionException;
 import javax.webbeans.Dependent;
 import javax.webbeans.Event;
+import javax.webbeans.Production;
 import javax.webbeans.Standard;
 
 import org.jboss.webbeans.ManagerImpl;
@@ -131,5 +133,11 @@
       Class<T> eventType = (Class<T>) annotatedItem.getType().getTypeParameters()[0].getClass();
 	  return new EventImpl<T>(manager, eventType, annotatedItem.getBindingTypesAsArray());
    }
+   
+   @Override
+   protected Class<? extends Annotation> getDefaultDeploymentType()
+   {
+      return Production.class;
+   }
 
 }

Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java	2008-12-07 15:27:01 UTC (rev 434)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java	2008-12-07 15:43:13 UTC (rev 435)
@@ -124,17 +124,10 @@
       }
    }
    
-   /**
-    * Initializes the deployment type
-    */
    @Override
-   protected void initDeploymentType()
+   protected Class<? extends Annotation> getDefaultDeploymentType()
    {
-      super.initDeploymentType();
-      if (getDeploymentType() == null)
-      {
-         deploymentType = declaringBean.getDeploymentType();
-      }
+      return deploymentType = declaringBean.getDeploymentType();
    }
    
    /**

Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/CommonWebBeanTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/CommonWebBeanTest.java	2008-12-07 15:27:01 UTC (rev 434)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/CommonWebBeanTest.java	2008-12-07 15:43:13 UTC (rev 435)
@@ -10,9 +10,14 @@
 import javax.webbeans.manager.Bean;
 
 import org.jboss.webbeans.bean.SimpleBean;
+import org.jboss.webbeans.test.beans.Animal;
+import org.jboss.webbeans.test.beans.DeadlyAnimal;
+import org.jboss.webbeans.test.beans.DeadlySpider;
+import org.jboss.webbeans.test.beans.FinalTuna;
 import org.jboss.webbeans.test.beans.RedSnapper;
 import org.jboss.webbeans.test.beans.Spider;
 import org.jboss.webbeans.test.beans.SpiderProducer;
+import org.jboss.webbeans.test.beans.Tarantula;
 import org.testng.annotations.Test;
 
 /**
@@ -21,6 +26,7 @@
  * @author Pete Muir
  *
  */
+ at SpecVersion("20081206")
 public class CommonWebBeanTest extends AbstractTest 
 {
 
@@ -54,7 +60,7 @@
 		assert model.getDeploymentType().equals(Production.class);
 	}
 	
-	@Test(groups="producerMethod") @SpecAssertion(section="4.2")
+	@Test(groups="producerMethod") @SpecAssertion(section="5.2")
    public void testIsNullable() throws Exception
    {
 	   SimpleBean<SpiderProducer> spiderProducerBean = createSimpleBean(SpiderProducer.class);
@@ -67,4 +73,24 @@
       assert spiderBean.isNullable();
    }
 	
+   
+   @Test @SpecAssertion(section={"3.2.2", "2.2"})
+   public void testApiTypes()
+   {
+      Bean<Tarantula> bean = createSimpleBean(Tarantula.class);
+      assert bean.getTypes().size() == 6;
+      assert bean.getTypes().contains(Tarantula.class);
+      assert bean.getTypes().contains(Spider.class);
+      assert bean.getTypes().contains(Animal.class);
+      assert bean.getTypes().contains(Object.class);
+      assert bean.getTypes().contains(DeadlySpider.class);
+      assert bean.getTypes().contains(DeadlyAnimal.class);
+   }
+   
+   @Test @SpecAssertion(section="2.2")
+   public void testFinalApiType()
+   {
+      createSimpleBean(FinalTuna.class);
+   }
+	
 }

Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeploymentTypeTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeploymentTypeTest.java	2008-12-07 15:27:01 UTC (rev 434)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeploymentTypeTest.java	2008-12-07 15:43:13 UTC (rev 435)
@@ -1,7 +1,10 @@
 package org.jboss.webbeans.test;
 
+import static org.jboss.webbeans.util.BeanFactory.createProducerMethodBean;
 import static org.jboss.webbeans.util.BeanFactory.createSimpleBean;
 
+import java.lang.reflect.Method;
+
 import javax.webbeans.DefinitionException;
 import javax.webbeans.DeploymentException;
 import javax.webbeans.Production;
@@ -9,16 +12,20 @@
 import javax.webbeans.UnsatisfiedDependencyException;
 import javax.webbeans.manager.Bean;
 
+import org.jboss.webbeans.bean.ProducerMethodBean;
+import org.jboss.webbeans.bean.SimpleBean;
 import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
 import org.jboss.webbeans.test.annotations.HornedAnimalDeploymentType;
+import org.jboss.webbeans.test.beans.BlackWidow;
 import org.jboss.webbeans.test.beans.RedSnapper;
 import org.jboss.webbeans.test.beans.Reindeer;
 import org.jboss.webbeans.test.beans.Rhinoceros;
+import org.jboss.webbeans.test.beans.SpiderProducer;
 import org.jboss.webbeans.test.beans.broken.BeanWithTooManyDeploymentTypes;
 import org.jboss.webbeans.test.beans.broken.Gazelle;
 import org.testng.annotations.Test;
 
- at SpecVersion("PDR")
+ at SpecVersion("20081206")
 public class DeploymentTypeTest extends AbstractTest
 {
    
@@ -52,6 +59,16 @@
       createSimpleBean(BeanWithTooManyDeploymentTypes.class);
    }
    
+   @Test @SpecAssertion(section="2.5.3")
+   public void testDeploymentTypeInhertitedFromDeclaringBean() throws Exception
+   {
+      SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
+      manager.addBean(bean);
+      Method method = SpiderProducer.class.getMethod("produceBlackWidow");
+      ProducerMethodBean<BlackWidow> blackWidowSpiderModel = createProducerMethodBean(BlackWidow.class, method, bean);
+      assert blackWidowSpiderModel.getDeploymentType().equals(AnotherDeploymentType.class);
+   }
+   
    @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="2.5.4")
    public void testXmlDeploymentTypeOverridesJava()
    {
@@ -91,17 +108,6 @@
       assert bean.getDeploymentType().equals(HornedAnimalDeploymentType.class);
    }
    
-   @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="2.5.5")
-   public void testDeploymentTypeSpecifiedAndStereotyped()
-   {
-      //Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
-      //annotations.put(FishStereotype.class, new FishStereotypeAnnotationLiteral());
-      //AnnotatedClass<SeaBass> annotatedItem = new SimpleAnnotatedClass<SeaBass>(SeaBass.class, annotations);
-      //SimpleBean<SeaBass> trout = createSimpleBean(SeaBass.class, annotatedItem, manager);
-      //assert trout.getScopeType().equals(RequestScoped.class);
-       assert false;
-   }
-   
    @Test(groups="beanLifecycle", expectedExceptions=UnsatisfiedDependencyException.class) @SpecAssertion(section="2.5.6")
    public void testBeanWithDisabledDeploymentTypeNotInstantiated()
    {
@@ -143,7 +149,7 @@
       
    }
    
-   @Test @SpecAssertion(section="2.7.2")
+   @Test @SpecAssertion(section={"2.5.5", "2.7.2"})
    public void testWebBeanDeploymentTypeOverridesStereotype()
    {
       Bean<Reindeer> bean = createSimpleBean(Reindeer.class);

Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameTest.java	2008-12-07 15:27:01 UTC (rev 434)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameTest.java	2008-12-07 15:43:13 UTC (rev 435)
@@ -6,16 +6,17 @@
 
 import org.jboss.webbeans.bean.SimpleBean;
 import org.jboss.webbeans.test.beans.Haddock;
+import org.jboss.webbeans.test.beans.Minnow;
 import org.jboss.webbeans.test.beans.Moose;
 import org.jboss.webbeans.test.beans.RedSnapper;
 import org.jboss.webbeans.test.beans.SeaBass;
 import org.testng.annotations.Test;
 
- at SpecVersion("PDR")
+ at SpecVersion("20081206")
 public class NameTest extends AbstractTest
 {
 
-   @Test(groups={"stub", "el"}, expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.6")
+   @Test(groups="stub", expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.6")
    public void testInvalidElIdentifierUsedAsWebBeanName()
    {
       assert false;
@@ -127,15 +128,11 @@
       assert model.getName() == null;
    }
    
-   @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="2.6.4")
+   @Test @SpecAssertion(section="2.6.4")
    public void testNotNamedInStereotype()
    {
-      /*Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
-      annotations.put(RiverFishStereotype.class, new RiverFishStereotypeAnnotationLiteral());
-      AnnotatedClass<SeaBass> annotatedItem = new SimpleAnnotatedClass<SeaBass>(SeaBass.class, annotations);*/
-      //SimpleBean<SeaBass> model = createSimpleBean(SeaBass.class, annotatedItem, manager);
-      //assert model.getName() == null;
-      assert false;
+      SimpleBean<Minnow> model = createSimpleBean(Minnow.class);
+      assert model.getName() == null;
    }
    
 }

Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanModelTest.java	2008-12-07 15:27:01 UTC (rev 434)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanModelTest.java	2008-12-07 15:43:13 UTC (rev 435)
@@ -7,6 +7,7 @@
 
 import javax.webbeans.Current;
 import javax.webbeans.DefinitionException;
+import javax.webbeans.Production;
 import javax.webbeans.RequestScoped;
 
 import org.jboss.webbeans.bean.ProducerMethodBean;
@@ -140,7 +141,7 @@
       assert intModel.getTypes().contains(Object.class);
    }
    
-   @Test(groups="producerMethod") @SpecAssertion(section="3.4.1")
+   @Test(groups="producerMethod") @SpecAssertion(section={"3.4.1", "2.2"})
    public void testApiTypeForArrayTypeReturn() throws Exception
    {
       SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
@@ -182,7 +183,7 @@
       manager.addBean(bean);
       Method method = SpiderProducer.class.getMethod("getLadybirdSpider");
       ProducerMethodBean<LadybirdSpider> ladybirdSpiderModel = createProducerMethodBean(LadybirdSpider.class, method, bean);
-      assert ladybirdSpiderModel.getDeploymentType().equals(AnotherDeploymentType.class);
+      assert ladybirdSpiderModel.getDeploymentType().equals(Production.class);
    }
    
    @Test(groups="producerMethod") @SpecAssertion(section="3.4.2")
@@ -292,7 +293,7 @@
       assert false;
    }
    
-   @Test(groups="producerMethod") @SpecAssertion(section={"2.7.2", "3.4.2"})
+   @Test(groups="producerMethod") @SpecAssertion(section={"2.7.2", "3.4.2", "2.2"})
    public void testStereotype() throws Exception
    {
       SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);

Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java	2008-12-07 15:27:01 UTC (rev 434)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java	2008-12-07 15:43:13 UTC (rev 435)
@@ -280,7 +280,7 @@
       assert manager.resolveByType(Tuna.class, new CurrentAnnotationLiteral()).size() == 0;
    }
    
-   @Test(groups="resolution") @SpecAssertion(section="4.9.2")
+   @Test(groups="resolution") @SpecAssertion(section={"4.9.2", "2.2"})
    public void testResolveObject() throws Exception
    {
       Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);

Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ScopeTypeTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ScopeTypeTest.java	2008-12-07 15:27:01 UTC (rev 434)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ScopeTypeTest.java	2008-12-07 15:43:13 UTC (rev 435)
@@ -2,6 +2,7 @@
 
 import static org.jboss.webbeans.util.BeanFactory.createSimpleBean;
 
+import javax.webbeans.ApplicationScoped;
 import javax.webbeans.DefinitionException;
 import javax.webbeans.Dependent;
 import javax.webbeans.RequestScoped;
@@ -10,13 +11,17 @@
 import org.jboss.webbeans.bean.SimpleBean;
 import org.jboss.webbeans.test.annotations.AnotherScopeType;
 import org.jboss.webbeans.test.beans.BeanWithTooManyScopeTypes;
+import org.jboss.webbeans.test.beans.Grayling;
+import org.jboss.webbeans.test.beans.Minnow;
 import org.jboss.webbeans.test.beans.Mullet;
 import org.jboss.webbeans.test.beans.Order;
+import org.jboss.webbeans.test.beans.Pollock;
 import org.jboss.webbeans.test.beans.RedSnapper;
 import org.jboss.webbeans.test.beans.SeaBass;
+import org.jboss.webbeans.test.beans.broken.Scallop;
 import org.testng.annotations.Test;
 
- at SpecVersion("PDR")
+ at SpecVersion("20081206")
 public class ScopeTypeTest extends AbstractTest
 {
    
@@ -109,47 +114,31 @@
       assert order.getScopeType().equals(Dependent.class);
    }
    
-   @Test(groups={"stub", "webbeansxml"})@SpecAssertion(section={"2.4.5", "2.7.2"})
+   @Test @SpecAssertion(section={"2.4.5", "2.7.2"})
    public void testScopeSpecifiedAndStereotyped()
    {
-      //Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
-      //annotations.put(FishStereotype.class, new FishStereotypeAnnotationLiteral());
-      //AnnotatedClass<SeaBass> annotatedItem = new SimpleAnnotatedClass<SeaBass>(SeaBass.class, annotations);
-      //SimpleBean<SeaBass> trout = createSimpleBean(SeaBass.class, annotatedItem, manager);
-      //assert trout.getScopeType().equals(RequestScoped.class);
-      assert false;
+      Bean<Minnow> minnow = createSimpleBean(Minnow.class);
+      assert minnow.getScopeType().equals(RequestScoped.class);
    }
    
-   @Test(groups={"webbeansxml", "stub"}) @SpecAssertion(section="2.4.5")
+   @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.4.5")
    public void testMutipleIncompatibleScopeStereotypes()
    {
-      assert false;
+      createSimpleBean(Scallop.class);
    }
    
-   @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="2.4.5")
+   @Test @SpecAssertion(section="2.4.5")
    public void testMutipleIncompatibleScopeStereotypesWithScopeSpecified()
    {
-      /*Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
-      annotations.put(FishStereotype.class, new FishStereotypeAnnotationLiteral());
-      annotations.put(AnimalStereotype.class, new AnimalStereotypeAnnotationLiteral());
-      AnnotatedClass<SeaBass> annotatedItem = new SimpleAnnotatedClass<SeaBass>(SeaBass.class, annotations);*/
-      
-      //SimpleBean<SeaBass> trout = createSimpleBean(SeaBass.class, annotatedItem, manager);
-      //assert trout.getScopeType().equals(RequestScoped.class);
-      assert false;
+      Bean<Pollock> pollock = createSimpleBean(Pollock.class);
+      assert pollock.getScopeType().equals(Dependent.class);
    }
    
-   @Test(groups={"stub", "webbeansxml"})@SpecAssertion(section="2.4.5")
+   @Test @SpecAssertion(section="2.4.5")
    public void testMutipleCompatibleScopeStereotypes()
    {
-      /*Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
-      annotations.put(FishStereotype.class, new FishStereotypeAnnotationLiteral());
-      annotations.put(RiverFishStereotype.class, new RiverFishStereotypeAnnotationLiteral());
-      AnnotatedClass<Haddock> annotatedItem = new SimpleAnnotatedClass<Haddock>(Haddock.class, annotations);*/
-      
-      //SimpleBean<Haddock> haddock = createSimpleBean(Haddock.class, annotatedItem, manager);
-      //assert haddock.getScopeType().equals(ApplicationScoped.class);
-      assert false;
+      Bean<Grayling> grayling = createSimpleBean(Grayling.class);
+      assert grayling.getScopeType().equals(ApplicationScoped.class);
    }
    
    @Test @SpecAssertion(section="2.7.2")

Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java	2008-12-07 15:27:01 UTC (rev 434)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java	2008-12-07 15:43:13 UTC (rev 435)
@@ -10,7 +10,6 @@
 import javax.webbeans.AnnotationLiteral;
 import javax.webbeans.DefinitionException;
 import javax.webbeans.NonexistentConstructorException;
-import javax.webbeans.manager.Bean;
 
 import org.jboss.webbeans.bean.SimpleBean;
 import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
@@ -18,16 +17,11 @@
 import org.jboss.webbeans.introspector.AnnotatedParameter;
 import org.jboss.webbeans.test.annotations.HeavyDuty;
 import org.jboss.webbeans.test.annotations.Motorized;
-import org.jboss.webbeans.test.beans.Animal;
 import org.jboss.webbeans.test.beans.Cow;
-import org.jboss.webbeans.test.beans.DeadlyAnimal;
-import org.jboss.webbeans.test.beans.DeadlySpider;
 import org.jboss.webbeans.test.beans.Donkey;
 import org.jboss.webbeans.test.beans.Duck;
 import org.jboss.webbeans.test.beans.Order;
 import org.jboss.webbeans.test.beans.Sheep;
-import org.jboss.webbeans.test.beans.Spider;
-import org.jboss.webbeans.test.beans.Tarantula;
 import org.jboss.webbeans.test.beans.Tractor;
 import org.jboss.webbeans.test.beans.Turkey;
 import org.jboss.webbeans.test.beans.broken.Goose;
@@ -80,19 +74,6 @@
       
    }
    
-   @Test @SpecAssertion(section="3.2.2")
-   public void testApiTypes()
-   {
-      Bean<Tarantula> bean = createSimpleBean(Tarantula.class);
-      assert bean.getTypes().size() == 6;
-      assert bean.getTypes().contains(Tarantula.class);
-      assert bean.getTypes().contains(Spider.class);
-      assert bean.getTypes().contains(Animal.class);
-      assert bean.getTypes().contains(Object.class);
-      assert bean.getTypes().contains(DeadlySpider.class);
-      assert bean.getTypes().contains(DeadlyAnimal.class);
-   }
-   
    @Test(groups={"stub", "producerMethod", "webbeansxml"}) @SpecAssertion(section="3.2.4")
    public void testBeanDeclaredInXmlIgnoresProducerMethodDeclaredInJava()
    {

Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypesTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypesTest.java	2008-12-07 15:27:01 UTC (rev 434)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypesTest.java	2008-12-07 15:43:13 UTC (rev 435)
@@ -27,7 +27,7 @@
 import org.jboss.webbeans.test.beans.broken.Carp;
 import org.testng.annotations.Test;
 
- at SpecVersion("PDR")
+ at SpecVersion("20081206")
 public class StereotypesTest extends AbstractTest
 {
 	
@@ -90,46 +90,46 @@
       assert animalStereotype.getDefaultDeploymentType() == null;
    }
    
-   @Test @SpecAssertion(section="2.7.1")
+   @Test @SpecAssertion(section="2.7.1.1")
    public void testStereotypeWithScopeType()
    {
 	   StereotypeModel<AnimalStereotype> animalStereotype = new StereotypeModel<AnimalStereotype>(AnimalStereotype.class);
 	   assert animalStereotype.getDefaultScopeType().annotationType().equals(RequestScoped.class);
    }
    
-   @Test @SpecAssertion(section="2.7.1")
+   @Test @SpecAssertion(section="2.7.1.1")
    public void testStereotypeWithoutScopeType()
    {
 	   StereotypeModel<HornedMammalStereotype> animalStereotype = new StereotypeModel<HornedMammalStereotype>(HornedMammalStereotype.class);
 	   assert animalStereotype.getDefaultScopeType() == null;
    }
    
-   @Test @SpecAssertion(section="2.7.1")
+   @Test @SpecAssertion(section="2.7.1.2")
    public void testStereotypeWithoutInterceptors()
    {
       StereotypeModel<AnimalStereotype> animalStereotype = new StereotypeModel<AnimalStereotype>(AnimalStereotype.class);
       assert animalStereotype.getInterceptorBindings().size() == 0;
    }
    
-   @Test(groups={"stub", "interceptors"}) @SpecAssertion(section="2.7.1")
+   @Test(groups={"stub", "interceptors"}) @SpecAssertion(section="2.7.1.2")
    public void testStereotypeWithInterceptors()
    {
       assert false;
    }
    
-   @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.7.1")
+   @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.7.1.1")
    public void testStereotypeWithTooManyScopeTypes()
    {
       new StereotypeModel<StereotypeWithTooManyScopeTypes>(StereotypeWithTooManyScopeTypes.class);
    }
    
-   @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.7.1")
+   @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.7.1.1")
    public void testStereotypeWithTooManyDeploymentTypes()
    {
       new StereotypeModel<StereotypeWithTooManyDeploymentTypes>(StereotypeWithTooManyDeploymentTypes.class);
    }
    
-   @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.7.1")
+   @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.7.1.3")
    public void testStereotypeWithNonEmptyNamed()
    {
       new StereotypeModel<StereotypeWithNonEmptyNamed>(StereotypeWithNonEmptyNamed.class);
@@ -186,28 +186,30 @@
       
    }
    
-   @Test at SpecAssertion(section="2.7.4")
+   @Test at SpecAssertion(section={"2.7.1.4", "2.7.4"})
    public void testRequiredTypeIsImplemented()
    {
          createSimpleBean(HighlandCow.class);
    }
    
-   @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.7.4")
+   @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section={"2.7.1.4", "2.7.4"})
    public void testRequiredTypeIsNotImplemented()
    {
       createSimpleBean(Chair.class);      
    }
    
-   @Test @SpecAssertion(section="2.7.4")
+   @Test @SpecAssertion(section={"2.7.1.4", "2.7.4"})
    public void testScopeIsSupported()
    {
       createSimpleBean(Goldfish.class);
    }
    
-   @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.7.4")
+   @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section={"2.7.1.4", "2.7.4"})
    public void testScopeIsNotSupported()
    {
       createSimpleBean(Carp.class);    
    }
    
+   // TODO Stereotype inheritance tests
+   
 }

Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Grayling.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Grayling.java	                        (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Grayling.java	2008-12-07 15:43:13 UTC (rev 435)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.test.beans;
+
+import org.jboss.webbeans.test.annotations.FishStereotype;
+import org.jboss.webbeans.test.annotations.RiverFishStereotype;
+
+
+ at RiverFishStereotype
+ at FishStereotype
+public class Grayling implements Animal
+{
+   
+}


Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Grayling.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Minnow.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Minnow.java	                        (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Minnow.java	2008-12-07 15:43:13 UTC (rev 435)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.RequestScoped;
+
+import org.jboss.webbeans.test.annotations.RiverFishStereotype;
+
+ at RiverFishStereotype
+ at RequestScoped
+public class Minnow implements Animal
+{
+   
+}


Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Minnow.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Pollock.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Pollock.java	                        (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Pollock.java	2008-12-07 15:43:13 UTC (rev 435)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Dependent;
+
+import org.jboss.webbeans.test.annotations.AnimalStereotype;
+import org.jboss.webbeans.test.annotations.FishStereotype;
+
+ at AnimalStereotype
+ at FishStereotype
+ at Dependent
+public class Pollock implements Animal
+{
+   
+}


Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Pollock.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Spider.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Spider.java	2008-12-07 15:27:01 UTC (rev 434)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Spider.java	2008-12-07 15:43:13 UTC (rev 435)
@@ -3,4 +3,9 @@
 public class Spider implements Animal
 {
 
+   public final void layEggs()
+   {
+      
+   }
+   
 }

Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SpiderProducer.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SpiderProducer.java	2008-12-07 15:27:01 UTC (rev 434)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SpiderProducer.java	2008-12-07 15:43:13 UTC (rev 435)
@@ -3,6 +3,7 @@
 import javax.webbeans.Dependent;
 import javax.webbeans.Named;
 import javax.webbeans.Produces;
+import javax.webbeans.Production;
 import javax.webbeans.RequestScoped;
 
 import org.jboss.webbeans.test.annotations.AnimalStereotype;
@@ -40,7 +41,7 @@
       return new DaddyLongLegs();
    }
    
-   @Produces @Named @AnotherDeploymentType public LadybirdSpider getLadybirdSpider()
+   @Produces @Named @Production public LadybirdSpider getLadybirdSpider()
    {
       return new LadybirdSpider();
    }

Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Scallop.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Scallop.java	                        (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Scallop.java	2008-12-07 15:43:13 UTC (rev 435)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.beans.broken;
+
+import org.jboss.webbeans.test.annotations.AnimalStereotype;
+import org.jboss.webbeans.test.annotations.FishStereotype;
+
+ at AnimalStereotype
+ at FishStereotype
+public class Scallop
+{
+   
+}


Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Scallop.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain




More information about the weld-commits mailing list