[webbeans-commits] Webbeans SVN: r154 - in ri/trunk/webbeans-ri: src/main/java/org/jboss/webbeans/model/bean and 5 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Sat Oct 25 19:13:22 EDT 2008
Author: pete.muir at jboss.org
Date: 2008-10-25 19:13:22 -0400 (Sat, 25 Oct 2008)
New Revision: 154
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/APITypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ApiTypeTest.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/annotations/AnotherScopeType.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Mullet.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Gazelle.java
Removed:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/APITypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContainerTest.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractBeanModel.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.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/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/TypeSafeResolutionTest.java
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/broken/PlaiceFarm.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/util/Util.java
ri/trunk/webbeans-ri/testng.xml
Log:
Update Tests to PDR for sections 2.1 - 2.6 inclusive
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractBeanModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractBeanModel.java 2008-10-25 20:38:12 UTC (rev 153)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/bean/AbstractBeanModel.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -8,11 +8,13 @@
import java.util.logging.Logger;
import javax.webbeans.BindingType;
+import javax.webbeans.DefinitionException;
import javax.webbeans.Dependent;
import javax.webbeans.DeploymentType;
import javax.webbeans.Named;
import javax.webbeans.Production;
import javax.webbeans.ScopeType;
+import javax.webbeans.Standard;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
@@ -76,7 +78,7 @@
protected Set<Class<?>> getTypeHierachy(Class<?> clazz)
{
Set<Class<?>> classes = new HashSet<Class<?>>();
- if (!(clazz == null || clazz == Object.class))
+ if (clazz != null)
{
classes.add(clazz);
classes.addAll(getTypeHierachy(clazz.getSuperclass()));
@@ -128,7 +130,7 @@
Set<Annotation> xmlScopes = getXmlAnnotatedItem().getAnnotations(ScopeType.class);
if (xmlScopes.size() > 1)
{
- throw new RuntimeException("At most one scope may be specified in XML");
+ throw new DefinitionException("At most one scope may be specified in XML");
}
if (xmlScopes.size() == 1)
@@ -141,7 +143,7 @@
Set<Annotation> scopes = getAnnotatedItem().getAnnotations(ScopeType.class);
if (scopes.size() > 1)
{
- throw new RuntimeException("At most one scope may be specified");
+ throw new DefinitionException("At most one scope may be specified");
}
if (scopes.size() == 1)
@@ -226,7 +228,7 @@
if (deploymentTypes.size() > 1)
{
- throw new RuntimeException("At most one deployment type may be specified (" + deploymentTypes + " are specified) on " + getAnnotatedItem().getDelegate());
+ throw new DefinitionException("At most one deployment type may be specified (" + deploymentTypes + " are specified) on " + getAnnotatedItem().getDelegate());
}
if (deploymentTypes.size() == 1)
{
@@ -256,6 +258,11 @@
{
throw new RuntimeException("type: " + getType() + " must specify a deployment type");
}
+
+ if (deploymentType.equals(Standard.class))
+ {
+ throw new DefinitionException();
+ }
}
public static Class<? extends Annotation> getDeploymentType(List<Class<? extends Annotation>> enabledDeploymentTypes, Map<Class<? extends Annotation>, Annotation> possibleDeploymentTypes)
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/APITypeTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/APITypeTest.java 2008-10-25 20:38:12 UTC (rev 153)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/APITypeTest.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -1,13 +0,0 @@
-package org.jboss.webbeans.test;
-
-import org.testng.annotations.Test;
-
-public class APITypeTest {
-
- @Test @SpecAssertion(section="2.2")
- public void testParameterizedApiType()
- {
- assert false;
- }
-
-}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/APITypeTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/APITypeTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/APITypeTest.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.test;
+
+import static org.jboss.webbeans.test.util.Util.createSimpleModel;
+
+import org.jboss.webbeans.model.bean.BeanModel;
+import org.jboss.webbeans.test.beans.Bear;
+import org.testng.annotations.Test;
+
+ at SpecVersion("PDR")
+public class ApiTypeTest extends AbstractTest
+{
+
+ @Test @SpecAssertion(section="2.2")
+ public void testApiTypeContainsObject()
+ {
+ BeanModel<?, ?> model = createSimpleModel(Bear.class, manager);
+ assert model.getApiTypes().contains(Object.class);
+ }
+
+}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ApiTypeTest.java (from rev 151, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/APITypeTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ApiTypeTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ApiTypeTest.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.test;
+
+import static org.jboss.webbeans.test.util.Util.createSimpleModel;
+
+import org.jboss.webbeans.model.bean.BeanModel;
+import org.jboss.webbeans.test.beans.Bear;
+import org.testng.annotations.Test;
+
+ at SpecVersion("PDR")
+public class ApiTypeTest extends AbstractTest
+{
+
+ @Test @SpecAssertion(section="2.2")
+ public void testApiTypeContainsObject()
+ {
+ BeanModel<?, ?> model = createSimpleModel(Bear.class, manager);
+ assert model.getApiTypes().contains(Object.class);
+ }
+
+}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java 2008-10-25 20:38:12 UTC (rev 153)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -1,26 +1,34 @@
package org.jboss.webbeans.test;
import static org.jboss.webbeans.test.util.Util.createSimpleModel;
-import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedType;
import java.lang.annotation.Annotation;
import java.util.HashMap;
import java.util.Map;
+import javax.webbeans.AnnotationLiteral;
import javax.webbeans.Current;
+import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
+import org.jboss.webbeans.injectable.InjectableField;
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
+import org.jboss.webbeans.model.bean.BeanModel;
import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.annotations.Asynchronous;
import org.jboss.webbeans.test.annotations.Synchronous;
import org.jboss.webbeans.test.beans.Antelope;
import org.jboss.webbeans.test.beans.Cat;
+import org.jboss.webbeans.test.beans.Cod;
import org.jboss.webbeans.test.beans.Order;
+import org.jboss.webbeans.test.beans.Tuna;
+import org.jboss.webbeans.test.beans.broken.PlaiceFarm;
import org.jboss.webbeans.test.bindings.AsynchronousAnnotationLiteral;
import org.jboss.webbeans.util.Reflections;
import org.testng.annotations.Test;
+ at SpecVersion("PDR")
public class BindingTypeTest extends AbstractTest
{
@@ -34,24 +42,27 @@
}
@Test(groups="injection") @SpecAssertion(section="2.3.1")
- public void testDefaultBindingTypeAssumedAtInjectionPoint()
+ public void testDefaultBindingTypeAssumedAtInjectionPoint() throws Exception
{
- assert false;
+ // This is like defining a field in XML
+ InjectableField<Tuna> tunaField = new InjectableField<Tuna>(PlaiceFarm.class.getDeclaredField("tuna"));
+ assert tunaField.getBindingTypes().size() == 1;
+ assert tunaField.getBindingTypes().contains(new CurrentAnnotationLiteral());
}
- @Test @SpecAssertion(section="2.3.2")
+ @Test(groups="annotationDefinition") @SpecAssertion(section="2.3.2")
public void testBindingTypeHasCorrectTarget()
{
assert false;
}
- @Test @SpecAssertion(section="2.3.2")
+ @Test(groups="annotationDefinition") @SpecAssertion(section="2.3.2")
public void testBindingTypeHasCorrectRetention()
{
assert false;
}
- @Test @SpecAssertion(section="2.3.2")
+ @Test(groups="annotationDefinition") @SpecAssertion(section="2.3.2")
public void testBindingTypeDeclaresBindingTypeAnnotation()
{
assert false;
@@ -69,7 +80,8 @@
@Test @SpecAssertion(section="2.3.3")
public void testMultipleBindingTypes()
{
- assert false;
+ BeanModel<?, ?> model = createSimpleModel(Cod.class, manager);
+ assert model.getBindingTypes().size() == 2;
}
@SuppressWarnings("unchecked")
@@ -80,47 +92,59 @@
annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
AnnotatedType annotatedItem = new SimpleAnnotatedType(Antelope.class, annotations);
- SimpleBeanModel<Antelope> antelope = new SimpleBeanModel<Antelope>(getEmptyAnnotatedItem(Antelope.class), annotatedItem, manager);
+ SimpleBeanModel<Antelope> antelope = new SimpleBeanModel<Antelope>(getEmptyAnnotatedType(Antelope.class), annotatedItem, manager);
assert Reflections.annotationSetMatches(antelope.getBindingTypes(), Asynchronous.class);
}
- @SuppressWarnings("unchecked")
@Test @SpecAssertion(section="2.3.4")
public void testXmlBindingTypeOverridesAndIgnoresJava()
{
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
- AnnotatedType annotatedItem = new SimpleAnnotatedType(Cat.class, annotations);
+ AnnotatedType<Cat> annotatedItem = new SimpleAnnotatedType<Cat>(Cat.class, annotations);
- SimpleBeanModel<Cat> cat = new SimpleBeanModel<Cat>(new SimpleAnnotatedType(Cat.class), annotatedItem, manager);
+ SimpleBeanModel<Cat> cat = createSimpleModel(Cat.class, annotatedItem, manager);
assert cat.getBindingTypes().size() == 1;
- assert Reflections.annotationSetMatches(cat.getBindingTypes(), Asynchronous.class);
+ assert cat.getBindingTypes().contains(new AnnotationLiteral<Asynchronous>() {});
}
@Test @SpecAssertion(section="2.3.4")
public void testNoBindingTypesDeclaredInXml()
{
- assert false;
+ Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
+ AnnotatedType<Cat> annotatedItem = new SimpleAnnotatedType<Cat>(Cat.class, annotations);
+
+ SimpleBeanModel<Cat> cat = createSimpleModel(Cat.class, annotatedItem, manager);
+ assert cat.getBindingTypes().size() == 1;
+ assert cat.getBindingTypes().contains(new AnnotationLiteral<Synchronous>() {});
}
@Test @SpecAssertion(section={"2.3.4", "2.3.1"})
public void testDefaultBindingTypeDeclaredInXml()
{
- assert false;
+ BeanModel<?, ?> model = createSimpleModel(Tuna.class, manager);
+ assert model.getBindingTypes().size() == 1;
+ assert model.getBindingTypes().contains(new CurrentAnnotationLiteral());
}
- @Test(groups="injection") @SpecAssertion(section="2.3.5")
+ @Test(groups="injection")
public void testFieldsWithBindingAnnotationsAreInjected()
{
assert false;
}
@Test(groups="injection") @SpecAssertion(section="2.3.5")
- public void testFieldMissingBindingTypeIsNotInjected()
+ public void testAllBindTypesMustMatch()
{
assert false;
}
+ @Test(groups="injection")
+ public void testFieldMissingBindingAnnotationsAreNotInjected()
+ {
+ assert false;
+ }
+
@Test(groups="injection") @SpecAssertion(section="2.3.5")
public void testFieldInjectedFromProducerMethod()
{
@@ -139,7 +163,7 @@
assert false;
}
- @Test(groups="injection") @SpecAssertion(section="2.3.6")
+ @Test(groups="injection")
public void testMethodWithBindingAnnotationsOnParametersAreInjected()
{
assert false;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java 2008-10-25 20:38:12 UTC (rev 153)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -1,6 +1,6 @@
package org.jboss.webbeans.test;
-import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedType;
import javax.webbeans.Current;
@@ -26,7 +26,7 @@
@Test
public void testImplicitConstructor()
{
- SimpleConstructor<Order> constructor = new SimpleBeanModel<Order>(new SimpleAnnotatedType<Order>(Order.class), getEmptyAnnotatedItem(Order.class), manager).getConstructor();
+ SimpleConstructor<Order> constructor = new SimpleBeanModel<Order>(new SimpleAnnotatedType<Order>(Order.class), getEmptyAnnotatedType(Order.class), manager).getConstructor();
assert constructor.getAnnotatedItem().getDelegate().getDeclaringClass().equals(Order.class);
assert constructor.getAnnotatedItem().getDelegate().getParameterTypes().length == 0;
assert constructor.getParameters().size() == 0;
@@ -36,7 +36,7 @@
@Test
public void testSingleConstructor()
{
- SimpleConstructor<Donkey> constructor = new SimpleBeanModel<Donkey>(new SimpleAnnotatedType<Donkey>(Donkey.class), getEmptyAnnotatedItem(Donkey.class), manager).getConstructor();
+ SimpleConstructor<Donkey> constructor = new SimpleBeanModel<Donkey>(new SimpleAnnotatedType<Donkey>(Donkey.class), getEmptyAnnotatedType(Donkey.class), manager).getConstructor();
assert constructor.getAnnotatedItem().getDelegate().getDeclaringClass().equals(Donkey.class);
assert constructor.getAnnotatedItem().getDelegate().getParameterTypes().length == 1;
assert constructor.getAnnotatedItem().getDelegate().getParameterTypes()[0].equals(String.class);
@@ -50,7 +50,7 @@
@Test
public void testInitializerAnnotatedConstructor()
{
- SimpleConstructor<Sheep> constructor = new SimpleBeanModel<Sheep>(new SimpleAnnotatedType<Sheep>(Sheep.class), getEmptyAnnotatedItem(Sheep.class), manager).getConstructor();
+ SimpleConstructor<Sheep> constructor = new SimpleBeanModel<Sheep>(new SimpleAnnotatedType<Sheep>(Sheep.class), getEmptyAnnotatedType(Sheep.class), manager).getConstructor();
assert constructor.getAnnotatedItem().getDelegate().getDeclaringClass().equals(Sheep.class);
assert constructor.getAnnotatedItem().getDelegate().getParameterTypes().length == 2;
assert constructor.getAnnotatedItem().getDelegate().getParameterTypes()[0].equals(String.class);
@@ -68,7 +68,7 @@
@Test
public void testBindingTypeAnnotatedConstructor()
{
- SimpleConstructor<Duck> constructor = new SimpleBeanModel<Duck>(new SimpleAnnotatedType<Duck>(Duck.class), getEmptyAnnotatedItem(Duck.class), manager).getConstructor();
+ SimpleConstructor<Duck> constructor = new SimpleBeanModel<Duck>(new SimpleAnnotatedType<Duck>(Duck.class), getEmptyAnnotatedType(Duck.class), manager).getConstructor();
assert constructor.getAnnotatedItem().getDelegate().getDeclaringClass().equals(Duck.class);
assert constructor.getAnnotatedItem().getDelegate().getParameterTypes().length == 2;
assert constructor.getAnnotatedItem().getDelegate().getParameterTypes()[0].equals(String.class);
@@ -88,7 +88,7 @@
boolean exception = false;
try
{
- new SimpleBeanModel<Chicken>(new SimpleAnnotatedType<Chicken>(Chicken.class), getEmptyAnnotatedItem(Chicken.class), manager);
+ new SimpleBeanModel<Chicken>(new SimpleAnnotatedType<Chicken>(Chicken.class), getEmptyAnnotatedType(Chicken.class), manager);
}
catch (Exception e)
{
@@ -104,7 +104,7 @@
boolean exception = false;
try
{
- new SimpleBeanModel<Turkey>(new SimpleAnnotatedType<Turkey>(Turkey.class), getEmptyAnnotatedItem(Turkey.class), manager);
+ new SimpleBeanModel<Turkey>(new SimpleAnnotatedType<Turkey>(Turkey.class), getEmptyAnnotatedType(Turkey.class), manager);
}
catch (Exception e)
{
@@ -120,7 +120,7 @@
boolean exception = false;
try
{
- new SimpleBeanModel<Goat>(new SimpleAnnotatedType<Goat>(Goat.class), getEmptyAnnotatedItem(Goat.class), manager);
+ new SimpleBeanModel<Goat>(new SimpleAnnotatedType<Goat>(Goat.class), getEmptyAnnotatedType(Goat.class), manager);
}
catch (Exception e)
{
@@ -136,7 +136,7 @@
boolean exception = false;
try
{
- new SimpleBeanModel<Goose>(new SimpleAnnotatedType<Goose>(Goose.class), getEmptyAnnotatedItem(Goose.class), manager);
+ new SimpleBeanModel<Goose>(new SimpleAnnotatedType<Goose>(Goose.class), getEmptyAnnotatedType(Goose.class), manager);
}
catch (Exception e)
{
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContainerTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContainerTest.java 2008-10-25 20:38:12 UTC (rev 153)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContainerTest.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -1,52 +0,0 @@
-package org.jboss.webbeans.test;
-
-import java.lang.annotation.Annotation;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.webbeans.DeploymentException;
-import javax.webbeans.Production;
-import javax.webbeans.Standard;
-
-import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
-import org.jboss.webbeans.test.annotations.HornedAnimalDeploymentType;
-import org.jboss.webbeans.test.mock.MockManagerImpl;
-import org.testng.annotations.Test;
-
-public class ContainerTest extends AbstractTest
-{
-
- @Test
- public void testDefaultEnabledDeploymentTypes()
- {
- ManagerImpl container = new MockManagerImpl(null);
- assert container.getEnabledDeploymentTypes().size() == 2;
- assert container.getEnabledDeploymentTypes().get(0).equals(Standard.class);
- assert container.getEnabledDeploymentTypes().get(1).equals(Production.class);
- }
-
- @Test
- public void testCustomDeploymentTypes()
- {
- List<Class<? extends Annotation>> enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
- enabledDeploymentTypes.add(Standard.class);
- enabledDeploymentTypes.add(AnotherDeploymentType.class);
- enabledDeploymentTypes.add(HornedAnimalDeploymentType.class);
- ManagerImpl container = new MockManagerImpl(enabledDeploymentTypes);
- assert container.getEnabledDeploymentTypes().size() == 3;
- assert container.getEnabledDeploymentTypes().get(0).equals(Standard.class);
- assert container.getEnabledDeploymentTypes().get(1).equals(AnotherDeploymentType.class);
- assert container.getEnabledDeploymentTypes().get(2).equals(HornedAnimalDeploymentType.class);
- }
-
- @Test(expectedExceptions=DeploymentException.class)
- public void testStandardMustBeDeclared()
- {
- List<Class<? extends Annotation>> enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
- enabledDeploymentTypes.add(AnotherDeploymentType.class);
- enabledDeploymentTypes.add(HornedAnimalDeploymentType.class);
- new MockManagerImpl(enabledDeploymentTypes);
- }
-
-}
Added: 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 (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeploymentTypeTest.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -0,0 +1,157 @@
+package org.jboss.webbeans.test;
+
+import static org.jboss.webbeans.test.util.Util.createSimpleWebBean;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedType;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.webbeans.DefinitionException;
+import javax.webbeans.DeploymentException;
+import javax.webbeans.Production;
+import javax.webbeans.RequestScoped;
+import javax.webbeans.Standard;
+
+import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.introspector.AnnotatedType;
+import org.jboss.webbeans.introspector.SimpleAnnotatedType;
+import org.jboss.webbeans.model.bean.SimpleBeanModel;
+import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
+import org.jboss.webbeans.test.annotations.FishStereotype;
+import org.jboss.webbeans.test.annotations.HornedAnimalDeploymentType;
+import org.jboss.webbeans.test.beans.Antelope;
+import org.jboss.webbeans.test.beans.SeaBass;
+import org.jboss.webbeans.test.beans.Tuna;
+import org.jboss.webbeans.test.beans.broken.BeanWithTooManyDeploymentTypes;
+import org.jboss.webbeans.test.beans.broken.Gazelle;
+import org.jboss.webbeans.test.bindings.AnotherDeploymentTypeAnnotationLiteral;
+import org.jboss.webbeans.test.bindings.FishStereotypeAnnotationLiteral;
+import org.jboss.webbeans.test.mock.MockManagerImpl;
+import org.testng.annotations.Test;
+
+ at SpecVersion("PDR")
+public class DeploymentTypeTest extends AbstractTest
+{
+
+ @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.5.1")
+ public void testNonBuiltInComponentUsesStandard()
+ {
+ createSimpleWebBean(Gazelle.class, manager);
+ }
+
+ @Test(groups="annotationDefinition") @SpecAssertion(section="2.5.2")
+ public void testDeploymentTypeHasCorrectTarget()
+ {
+ assert false;
+ }
+
+ @Test(groups="annotationDefinition") @SpecAssertion(section="2.5.2")
+ public void testDeploymentTypeHasCorrectRetention()
+ {
+ assert false;
+ }
+
+ @Test(groups="annotationDefinition") @SpecAssertion(section="2.5.2")
+ public void testDeploymentTypeDeclaresScopeTypeAnnotation()
+ {
+ assert false;
+ }
+
+ @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.5.3")
+ public void testTooManyDeploymentTypes()
+ {
+ new SimpleBeanModel<BeanWithTooManyDeploymentTypes>(new SimpleAnnotatedType<BeanWithTooManyDeploymentTypes>(BeanWithTooManyDeploymentTypes.class), getEmptyAnnotatedType(BeanWithTooManyDeploymentTypes.class), manager);
+ }
+
+ @Test @SpecAssertion(section="2.5.4")
+ public void testXmlDeploymentTypeOverridesJava()
+ {
+ Map<Class<? extends Annotation>, Annotation> xmlDefinedDeploymentTypeAnnotations = new HashMap<Class<? extends Annotation>, Annotation>();
+ xmlDefinedDeploymentTypeAnnotations.put(AnotherDeploymentType.class, new AnotherDeploymentTypeAnnotationLiteral());
+ AnnotatedType<BeanWithTooManyDeploymentTypes> xmlDefinedDeploymentTypeAnnotatedItem = new SimpleAnnotatedType<BeanWithTooManyDeploymentTypes>(BeanWithTooManyDeploymentTypes.class, xmlDefinedDeploymentTypeAnnotations);
+
+ SimpleBeanModel<BeanWithTooManyDeploymentTypes> model = new SimpleBeanModel<BeanWithTooManyDeploymentTypes>(new SimpleAnnotatedType<BeanWithTooManyDeploymentTypes>(BeanWithTooManyDeploymentTypes.class), xmlDefinedDeploymentTypeAnnotatedItem, manager);
+ assert model.getDeploymentType().equals(AnotherDeploymentType.class);
+ }
+
+
+
+ @Test @SpecAssertion(section="2.5.4")
+ public void testXmlRespectsJavaDeploymentType()
+ {
+ AnnotatedType<Tuna> annotatedItem = new SimpleAnnotatedType<Tuna>(Tuna.class, new HashMap<Class<? extends Annotation>, Annotation>());
+ SimpleBeanModel<Tuna> tuna = new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), annotatedItem, manager);
+ assert tuna.getDeploymentType().equals(AnotherDeploymentType.class);
+ }
+
+ @Test @SpecAssertion(section="2.5.5")
+ public void testXmlDefaultDeploymentType()
+ {
+ AnnotatedType<Antelope> antelopeAnnotatedItem = new SimpleAnnotatedType<Antelope>(Antelope.class, new HashMap<Class<? extends Annotation>, Annotation>());
+ SimpleBeanModel<Antelope> antelope = new SimpleBeanModel<Antelope>(getEmptyAnnotatedType(Antelope.class), antelopeAnnotatedItem, manager);
+ assert antelope.getDeploymentType().equals(Production.class);
+ }
+
+ @Test @SpecAssertion(section="2.5.5")
+ public void testHighestPrecedenceDeploymentTypeFromStereotype()
+ {
+ assert false;
+ }
+
+ @Test @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());
+ AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
+ SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
+ assert trout.getScopeType().equals(RequestScoped.class);
+ }
+
+ @Test @SpecAssertion(section="2.5.6")
+ public void testBeanWithDisabledDeploymentTypeNotInstantiated()
+ {
+ assert false;
+ }
+
+ @Test @SpecAssertion(section={"2.5.6", "2.5.7"})
+ public void testDefaultEnabledDeploymentTypes()
+ {
+ ManagerImpl container = new MockManagerImpl(null);
+ assert container.getEnabledDeploymentTypes().size() == 2;
+ assert container.getEnabledDeploymentTypes().get(0).equals(Standard.class);
+ assert container.getEnabledDeploymentTypes().get(1).equals(Production.class);
+ }
+
+ @Test @SpecAssertion(section={"2.5.6", "2.5.7"})
+ public void testCustomDeploymentTypes()
+ {
+ List<Class<? extends Annotation>> enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
+ enabledDeploymentTypes.add(Standard.class);
+ enabledDeploymentTypes.add(AnotherDeploymentType.class);
+ enabledDeploymentTypes.add(HornedAnimalDeploymentType.class);
+ ManagerImpl container = new MockManagerImpl(enabledDeploymentTypes);
+ assert container.getEnabledDeploymentTypes().size() == 3;
+ assert container.getEnabledDeploymentTypes().get(0).equals(Standard.class);
+ assert container.getEnabledDeploymentTypes().get(1).equals(AnotherDeploymentType.class);
+ assert container.getEnabledDeploymentTypes().get(2).equals(HornedAnimalDeploymentType.class);
+ }
+
+ @Test(expectedExceptions=DeploymentException.class) @SpecAssertion(section="2.5.6")
+ public void testStandardMustBeDeclared()
+ {
+ List<Class<? extends Annotation>> enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
+ enabledDeploymentTypes.add(AnotherDeploymentType.class);
+ enabledDeploymentTypes.add(HornedAnimalDeploymentType.class);
+ new MockManagerImpl(enabledDeploymentTypes);
+ }
+
+ @Test(groups="webbeansxml", expectedExceptions=DeploymentException.class) @SpecAssertion(section="2.5.6")
+ public void testMultipleDeployElementsCannotBeDefined()
+ {
+
+ }
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeploymentTypeTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanModelTest.java 2008-10-25 20:38:12 UTC (rev 153)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseBeanModelTest.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -1,6 +1,6 @@
package org.jboss.webbeans.test;
-import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedType;
import java.lang.annotation.Annotation;
import java.util.HashMap;
@@ -40,7 +40,7 @@
@Test
public void testStateless()
{
- EnterpriseBeanModel<Lion> lion = new EnterpriseBeanModel<Lion>(new SimpleAnnotatedType<Lion>(Lion.class), getEmptyAnnotatedItem(Lion.class), manager);
+ EnterpriseBeanModel<Lion> lion = new EnterpriseBeanModel<Lion>(new SimpleAnnotatedType<Lion>(Lion.class), getEmptyAnnotatedType(Lion.class), manager);
assert lion.getScopeType().equals(Dependent.class);
Reflections.annotationSetMatches(lion.getBindingTypes(), Current.class);
assert lion.getName().equals("lion");
@@ -64,7 +64,7 @@
boolean exception = false;
try
{
- new EnterpriseBeanModel<Bear>(new SimpleAnnotatedType<Bear>(Bear.class), getEmptyAnnotatedItem(Bear.class), manager);
+ new EnterpriseBeanModel<Bear>(new SimpleAnnotatedType<Bear>(Bear.class), getEmptyAnnotatedType(Bear.class), manager);
}
catch (Exception e)
{
@@ -90,7 +90,7 @@
public void testStateful()
{
- AbstractEnterpriseBeanModel<Tiger> tiger = new EnterpriseBeanModel<Tiger>(new SimpleAnnotatedType(Tiger.class), getEmptyAnnotatedItem(Tiger.class), manager);
+ AbstractEnterpriseBeanModel<Tiger> tiger = new EnterpriseBeanModel<Tiger>(new SimpleAnnotatedType(Tiger.class), getEmptyAnnotatedType(Tiger.class), manager);
Reflections.annotationSetMatches(tiger.getBindingTypes(), Synchronous.class);
assert tiger.getRemoveMethod().getAnnotatedItem().getDelegate().getName().equals("remove");
assert tiger.getName() == null;
@@ -101,7 +101,7 @@
public void testMultipleRemoveMethodsWithDestroys()
{
- AbstractEnterpriseBeanModel<Elephant> elephant = new EnterpriseBeanModel<Elephant>(new SimpleAnnotatedType(Elephant.class), getEmptyAnnotatedItem(Elephant.class), manager);
+ AbstractEnterpriseBeanModel<Elephant> elephant = new EnterpriseBeanModel<Elephant>(new SimpleAnnotatedType(Elephant.class), getEmptyAnnotatedType(Elephant.class), manager);
assert elephant.getRemoveMethod().getAnnotatedItem().getDelegate().getName().equals("remove2");
}
@@ -112,7 +112,7 @@
boolean exception = false;
try
{
- new EnterpriseBeanModel<Puma>(new SimpleAnnotatedType(Puma.class), getEmptyAnnotatedItem(Puma.class), manager);
+ new EnterpriseBeanModel<Puma>(new SimpleAnnotatedType(Puma.class), getEmptyAnnotatedType(Puma.class), manager);
}
catch (Exception e)
{
@@ -128,7 +128,7 @@
boolean exception = false;
try
{
- new EnterpriseBeanModel<Cougar>(new SimpleAnnotatedType(Cougar.class), getEmptyAnnotatedItem(Cougar.class), manager);
+ new EnterpriseBeanModel<Cougar>(new SimpleAnnotatedType(Cougar.class), getEmptyAnnotatedType(Cougar.class), manager);
}
catch (Exception e)
{
@@ -144,7 +144,7 @@
boolean exception = false;
try
{
- new EnterpriseBeanModel<Cheetah>(new SimpleAnnotatedType(Cheetah.class), getEmptyAnnotatedItem(Cheetah.class), manager);
+ new EnterpriseBeanModel<Cheetah>(new SimpleAnnotatedType(Cheetah.class), getEmptyAnnotatedType(Cheetah.class), manager);
}
catch (Exception e)
{
@@ -158,7 +158,7 @@
public void testRemoveMethodWithDefaultBinding()
{
- AbstractEnterpriseBeanModel<Panther> panther = new EnterpriseBeanModel<Panther>(new SimpleAnnotatedType<Panther>(Panther.class), getEmptyAnnotatedItem(Panther.class), manager);
+ AbstractEnterpriseBeanModel<Panther> panther = new EnterpriseBeanModel<Panther>(new SimpleAnnotatedType<Panther>(Panther.class), getEmptyAnnotatedType(Panther.class), manager);
assert panther.getRemoveMethod().getAnnotatedItem().getDelegate().getName().equals("remove");
assert panther.getRemoveMethod().getParameters().size() == 1;
@@ -171,7 +171,7 @@
@Test
public void testMessageDriven()
{
- AbstractEnterpriseBeanModel<Leopard> leopard = new EnterpriseBeanModel<Leopard>(new SimpleAnnotatedType(Leopard.class), getEmptyAnnotatedItem(Leopard.class), manager);
+ AbstractEnterpriseBeanModel<Leopard> leopard = new EnterpriseBeanModel<Leopard>(new SimpleAnnotatedType(Leopard.class), getEmptyAnnotatedType(Leopard.class), manager);
Reflections.annotationSetMatches(leopard.getBindingTypes(), Current.class);
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java 2008-10-25 20:38:12 UTC (rev 153)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -1,6 +1,6 @@
package org.jboss.webbeans.test;
-import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedType;
import javax.webbeans.AmbiguousDependencyException;
import javax.webbeans.UnsatisfiedDependencyException;
@@ -25,9 +25,9 @@
public void testAmbiguousDependencies() throws Exception
{
InjectableField<ScottishFish> whiteScottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
- Bean<Cod> plaiceBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Bean<Cod> plaiceBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedType(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedType(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedType(Sole.class), super.manager), manager);
manager.addBean(plaiceBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
@@ -42,8 +42,8 @@
public void testUnsatisfiedDependencies() throws Exception
{
InjectableField<ScottishFish> whiteScottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
- Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedType(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedType(Salmon.class), super.manager), manager);
manager.addBean(codBean);
manager.addBean(salmonBean);
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java 2008-10-25 20:38:12 UTC (rev 153)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -1,6 +1,6 @@
package org.jboss.webbeans.test;
-import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedType;
import javax.webbeans.AmbiguousDependencyException;
import javax.webbeans.AnnotationLiteral;
@@ -32,9 +32,9 @@
public void testAmbiguousDependencies() throws Exception
{
InjectableField<ScottishFish> whiteScottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
- Bean<Cod> plaiceBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Bean<Cod> plaiceBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedType(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedType(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedType(Sole.class), super.manager), manager);
manager.addBean(plaiceBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
@@ -49,9 +49,9 @@
public void testUnsatisfiedDependencies() throws Exception
{
InjectableField<ScottishFish> whiteScottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
- Bean<Cod> plaiceBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Bean<Cod> plaiceBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedType(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedType(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedType(Sole.class), super.manager), manager);
manager.addBean(plaiceBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
@@ -66,7 +66,7 @@
public void testUnproxyableDependencies() throws Exception
{
InjectableField<Plaice> plaiceField = new InjectableField<Plaice>(PlaiceFarm.class.getDeclaredField("plaice"));
- Bean<Plaice> plaiceBean = new BeanImpl<Plaice>(new SimpleBeanModel<Plaice>(new SimpleAnnotatedType<Plaice>(Plaice.class), getEmptyAnnotatedItem(Plaice.class), super.manager), manager);
+ Bean<Plaice> plaiceBean = new BeanImpl<Plaice>(new SimpleBeanModel<Plaice>(new SimpleAnnotatedType<Plaice>(Plaice.class), getEmptyAnnotatedType(Plaice.class), super.manager), manager);
manager.addBean(plaiceBean);
ResolutionManager resolutionManager = manager.getResolutionManager();
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java 2008-10-25 20:38:12 UTC (rev 153)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameBasedResolutionTest.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -1,6 +1,6 @@
package org.jboss.webbeans.test;
-import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedType;
import javax.webbeans.manager.Bean;
@@ -21,13 +21,13 @@
@Test
public void testNamedBasedResolution()
{
- Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
- Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
- Bean<SeaBass> seaBassBean = new BeanImpl<SeaBass>(new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), super.manager), manager);
- Bean<Haddock> haddockBean = new BeanImpl<Haddock>(new SimpleBeanModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), super.manager), manager);
- Bean<Plaice> plaiceBean = new BeanImpl<Plaice>(new SimpleBeanModel<Plaice>(new SimpleAnnotatedType<Plaice>(Plaice.class), getEmptyAnnotatedItem(Plaice.class), super.manager), manager);
+ Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedType(Tuna.class), super.manager), manager);
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedType(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedType(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedType(Sole.class), super.manager), manager);
+ Bean<SeaBass> seaBassBean = new BeanImpl<SeaBass>(new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedType(SeaBass.class), super.manager), manager);
+ Bean<Haddock> haddockBean = new BeanImpl<Haddock>(new SimpleBeanModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedType(Haddock.class), super.manager), manager);
+ Bean<Plaice> plaiceBean = new BeanImpl<Plaice>(new SimpleBeanModel<Plaice>(new SimpleAnnotatedType<Plaice>(Plaice.class), getEmptyAnnotatedType(Plaice.class), super.manager), manager);
manager.addBean(tunaBean);
manager.addBean(codBean);
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-10-25 20:38:12 UTC (rev 153)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanModelTest.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -1,6 +1,6 @@
package org.jboss.webbeans.test;
-import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedType;
import java.lang.reflect.Method;
@@ -11,6 +11,7 @@
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.bean.ProducerMethodBeanModel;
import org.jboss.webbeans.model.bean.SimpleBeanModel;
+import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
import org.jboss.webbeans.test.annotations.Tame;
import org.jboss.webbeans.test.beans.Animal;
import org.jboss.webbeans.test.beans.BlackWidow;
@@ -29,10 +30,20 @@
public class ProducerMethodBeanModelTest extends AbstractTest
{
+ @Test @SpecAssertion(section="2.5.3")
+ public void testProducerMethodInheritsDeploymentTypeOfDeclaringWebBean() throws Exception
+ {
+ SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedType(SpiderProducer.class), manager);
+ manager.getModelManager().addBeanModel(model);
+ Method method = SpiderProducer.class.getMethod("produceTameTarantula");
+ ProducerMethodBeanModel<Tarantula> tarantulaModel = new ProducerMethodBeanModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
+ tarantulaModel.getDeploymentType().equals(AnotherDeploymentType.class);
+ }
+
@Test @SpecAssertion(section="3.3")
public void testStaticMethod() throws SecurityException, NoSuchMethodException
{
- SimpleBeanModel<BeanWithStaticProducerMethod> model = new SimpleBeanModel<BeanWithStaticProducerMethod>(new SimpleAnnotatedType<BeanWithStaticProducerMethod>(BeanWithStaticProducerMethod.class), getEmptyAnnotatedItem(BeanWithStaticProducerMethod.class), manager);
+ SimpleBeanModel<BeanWithStaticProducerMethod> model = new SimpleBeanModel<BeanWithStaticProducerMethod>(new SimpleAnnotatedType<BeanWithStaticProducerMethod>(BeanWithStaticProducerMethod.class), getEmptyAnnotatedType(BeanWithStaticProducerMethod.class), manager);
manager.getModelManager().addBeanModel(model);
Method method = BeanWithStaticProducerMethod.class.getMethod("getString");
boolean exception = false;
@@ -50,7 +61,7 @@
@Test @SpecAssertion(section="3.3")
public void testApiTypes() throws SecurityException, NoSuchMethodException
{
- SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedType(SpiderProducer.class), manager);
manager.getModelManager().addBeanModel(model);
Method method = SpiderProducer.class.getMethod("produceTarantula");
ProducerMethodBeanModel<Tarantula> tarantulaModel = new ProducerMethodBeanModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
@@ -65,7 +76,7 @@
@Test @SpecAssertion(section="3.3.1")
public void testDefaultBindingType() throws SecurityException, NoSuchMethodException
{
- SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedType(SpiderProducer.class), manager);
manager.getModelManager().addBeanModel(model);
Method method = SpiderProducer.class.getMethod("produceTarantula");
ProducerMethodBeanModel<Tarantula> tarantulaModel = new ProducerMethodBeanModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
@@ -76,7 +87,7 @@
@Test
public void testBindingType() throws SecurityException, NoSuchMethodException
{
- SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedType(SpiderProducer.class), manager);
manager.getModelManager().addBeanModel(model);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
ProducerMethodBeanModel<Tarantula> tarantulaModel = new ProducerMethodBeanModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
@@ -87,7 +98,7 @@
@Test @SpecAssertion(section="3.3")
public void testFinalMethod() throws SecurityException, NoSuchMethodException
{
- SimpleBeanModel<BeanWithFinalProducerMethod> model = new SimpleBeanModel<BeanWithFinalProducerMethod>(new SimpleAnnotatedType<BeanWithFinalProducerMethod>(BeanWithFinalProducerMethod.class), getEmptyAnnotatedItem(BeanWithFinalProducerMethod.class), manager);
+ SimpleBeanModel<BeanWithFinalProducerMethod> model = new SimpleBeanModel<BeanWithFinalProducerMethod>(new SimpleAnnotatedType<BeanWithFinalProducerMethod>(BeanWithFinalProducerMethod.class), getEmptyAnnotatedType(BeanWithFinalProducerMethod.class), manager);
manager.getModelManager().addBeanModel(model);
Method method = BeanWithFinalProducerMethod.class.getMethod("getString");
boolean exception = false;
@@ -105,7 +116,7 @@
@Test @SpecAssertion(section="3.3")
public void testFinalMethodWithDependentScope() throws SecurityException, NoSuchMethodException
{
- SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedType(SpiderProducer.class), manager);
manager.getModelManager().addBeanModel(model);
Method method = SpiderProducer.class.getMethod("produceTrapdoorSpider");
ProducerMethodBeanModel<TrapdoorSpider> trapdoorSpiderModel = new ProducerMethodBeanModel<TrapdoorSpider>(new SimpleAnnotatedMethod<TrapdoorSpider>(method), manager);
@@ -115,7 +126,7 @@
@Test @SpecAssertion(section="3.3.6")
public void testNamedMethod() throws SecurityException, NoSuchMethodException
{
- SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedType(SpiderProducer.class), manager);
manager.getModelManager().addBeanModel(model);
Method method = SpiderProducer.class.getMethod("produceBlackWidow");
ProducerMethodBeanModel<BlackWidow> blackWidowSpiderModel = new ProducerMethodBeanModel<BlackWidow>(new SimpleAnnotatedMethod<BlackWidow>(method), manager);
@@ -125,7 +136,7 @@
@Test @SpecAssertion(section="3.3.6")
public void testDefaultNamedMethod() throws SecurityException, NoSuchMethodException
{
- SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedType(SpiderProducer.class), manager);
manager.getModelManager().addBeanModel(model);
Method method = SpiderProducer.class.getMethod("produceDaddyLongLegs");
ProducerMethodBeanModel<DaddyLongLegs> daddyLongLegsSpiderModel = new ProducerMethodBeanModel<DaddyLongLegs>(new SimpleAnnotatedMethod<DaddyLongLegs>(method), manager);
@@ -135,7 +146,7 @@
@Test @SpecAssertion(section="3.3.6")
public void testDefaultNamedJavaBeanMethod() throws SecurityException, NoSuchMethodException
{
- SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ SimpleBeanModel<SpiderProducer> model = new SimpleBeanModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedType(SpiderProducer.class), manager);
manager.getModelManager().addBeanModel(model);
Method method = SpiderProducer.class.getMethod("getLadybirdSpider");
ProducerMethodBeanModel<LadybirdSpider> ladybirdSpiderModel = new ProducerMethodBeanModel<LadybirdSpider>(new SimpleAnnotatedMethod<LadybirdSpider>(method), manager);
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-10-25 20:38:12 UTC (rev 153)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ScopeTypeTest.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -1,6 +1,7 @@
package org.jboss.webbeans.test;
-import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+import static org.jboss.webbeans.test.util.Util.createSimpleWebBean;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedType;
import java.lang.annotation.Annotation;
import java.util.HashMap;
@@ -8,8 +9,10 @@
import javax.webbeans.ApplicationScoped;
import javax.webbeans.ConversationScoped;
+import javax.webbeans.DefinitionException;
import javax.webbeans.Dependent;
import javax.webbeans.RequestScoped;
+import javax.webbeans.manager.Bean;
import org.jboss.webbeans.bindings.ConversationScopedAnnotationLiteral;
import org.jboss.webbeans.bindings.RequestScopedAnnotationLiteral;
@@ -17,11 +20,13 @@
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.bean.SimpleBeanModel;
import org.jboss.webbeans.test.annotations.AnimalStereotype;
+import org.jboss.webbeans.test.annotations.AnotherScopeType;
import org.jboss.webbeans.test.annotations.FishStereotype;
import org.jboss.webbeans.test.annotations.RiverFishStereotype;
import org.jboss.webbeans.test.beans.Antelope;
import org.jboss.webbeans.test.beans.BeanWithTooManyScopeTypes;
import org.jboss.webbeans.test.beans.Haddock;
+import org.jboss.webbeans.test.beans.Mullet;
import org.jboss.webbeans.test.beans.Order;
import org.jboss.webbeans.test.beans.SeaBass;
import org.jboss.webbeans.test.bindings.AnimalStereotypeAnnotationLiteral;
@@ -29,29 +34,31 @@
import org.jboss.webbeans.test.bindings.RiverFishStereotypeAnnotationLiteral;
import org.testng.annotations.Test;
+ at SpecVersion("PDR")
public class ScopeTypeTest extends AbstractTest
{
@Test @SpecAssertion(section="2.4")
public void testScopeTypesAreExtensible()
{
- assert false;
+ Bean<Mullet> mullet = createSimpleWebBean(Mullet.class, manager);
+ assert mullet.getScopeType().equals(AnotherScopeType.class);
}
- @Test @SpecAssertion(section="2.4.2")
+ @Test(groups="annotationDefinition") @SpecAssertion(section="2.4.2")
public void testScopeTypeHasCorrectTarget()
{
assert false;
}
- @Test @SpecAssertion(section="2.4.2")
+ @Test(groups="annotationDefinition") @SpecAssertion(section="2.4.2")
public void testScopeTypeHasCorrectRetention()
{
assert false;
}
- @Test @SpecAssertion(section="2.4.2")
- public void testScopeTypeDeclaresBindingTypeAnnotation()
+ @Test(groups="annotationDefinition") @SpecAssertion(section="2.4.2")
+ public void testScopeTypeDeclaresScopeTypeAnnotation()
{
assert false;
}
@@ -59,42 +66,24 @@
@Test @SpecAssertion(section="2.4.3")
public void testScopeDeclaredInJava()
{
- SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), manager);
+ SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedType(SeaBass.class), manager);
assert trout.getScopeType().equals(RequestScoped.class);
}
- @Test @SpecAssertion(section="2.4.3")
+ @Test(expectedExceptions=DefinitionException.class) @SpecAssertion(section="2.4.3")
public void testTooManyScopesSpecifiedInJava()
{
- boolean exception = false;
- try
- {
- new SimpleBeanModel<BeanWithTooManyScopeTypes>(new SimpleAnnotatedType<BeanWithTooManyScopeTypes>(BeanWithTooManyScopeTypes.class), getEmptyAnnotatedItem(BeanWithTooManyScopeTypes.class), manager);
- }
- catch (Exception e)
- {
- exception = true;
- }
- assert exception;
+ new SimpleBeanModel<BeanWithTooManyScopeTypes>(new SimpleAnnotatedType<BeanWithTooManyScopeTypes>(BeanWithTooManyScopeTypes.class), getEmptyAnnotatedType(BeanWithTooManyScopeTypes.class), manager);
}
- @Test @SpecAssertion(section="2.4.3")
+ @Test(expectedExceptions=DefinitionException.class)
public void testTooManyScopesSpecifiedInXml()
{
- boolean exception = false;
- try
- {
- Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
- annotations.put(RequestScoped.class, new RequestScopedAnnotationLiteral());
- annotations.put(ConversationScoped.class, new ConversationScopedAnnotationLiteral());
- AnnotatedType<Antelope> antelopeAnnotatedItem = new SimpleAnnotatedType<Antelope>(Antelope.class, annotations);
- new SimpleBeanModel<Antelope>(getEmptyAnnotatedItem(Antelope.class), antelopeAnnotatedItem, manager);
- }
- catch (Exception e)
- {
- exception = true;
- }
- assert exception;
+ Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
+ annotations.put(RequestScoped.class, new RequestScopedAnnotationLiteral());
+ annotations.put(ConversationScoped.class, new ConversationScopedAnnotationLiteral());
+ AnnotatedType<Antelope> antelopeAnnotatedItem = new SimpleAnnotatedType<Antelope>(Antelope.class, annotations);
+ new SimpleBeanModel<Antelope>(getEmptyAnnotatedType(Antelope.class), antelopeAnnotatedItem, manager);
}
@Test @SpecAssertion(section="2.4.4")
@@ -131,7 +120,7 @@
@Test @SpecAssertion(section="2.4.5")
public void testDefaultScope()
{
- SimpleBeanModel<Order> order = new SimpleBeanModel<Order>(new SimpleAnnotatedType<Order>(Order.class), getEmptyAnnotatedItem(Order.class), manager);
+ SimpleBeanModel<Order> order = new SimpleBeanModel<Order>(new SimpleAnnotatedType<Order>(Order.class), getEmptyAnnotatedType(Order.class), manager);
assert order.getScopeType().equals(Dependent.class);
}
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-10-25 20:38:12 UTC (rev 153)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -1,6 +1,6 @@
package org.jboss.webbeans.test;
-import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedType;
import java.lang.annotation.Annotation;
import java.util.HashMap;
@@ -18,12 +18,7 @@
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.bean.SimpleBeanModel;
-import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
-import org.jboss.webbeans.test.annotations.FishStereotype;
-import org.jboss.webbeans.test.annotations.HornedAnimalDeploymentType;
-import org.jboss.webbeans.test.annotations.HornedMammalStereotype;
import org.jboss.webbeans.test.annotations.Synchronous;
-import org.jboss.webbeans.test.beans.Antelope;
import org.jboss.webbeans.test.beans.Chair;
import org.jboss.webbeans.test.beans.Cow;
import org.jboss.webbeans.test.beans.Goldfish;
@@ -33,14 +28,9 @@
import org.jboss.webbeans.test.beans.Moose;
import org.jboss.webbeans.test.beans.Order;
import org.jboss.webbeans.test.beans.SeaBass;
-import org.jboss.webbeans.test.beans.Tuna;
-import org.jboss.webbeans.test.beans.broken.BeanWithTooManyDeploymentTypes;
import org.jboss.webbeans.test.beans.broken.Carp;
import org.jboss.webbeans.test.beans.broken.Pig;
import org.jboss.webbeans.test.beans.broken.OuterBean.InnerBean;
-import org.jboss.webbeans.test.bindings.AnotherDeploymentTypeAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.FishStereotypeAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.HornedMamalStereotypeAnnotationLiteral;
import org.jboss.webbeans.test.bindings.SynchronousAnnotationLiteral;
import org.jboss.webbeans.util.Reflections;
import org.testng.annotations.Test;
@@ -51,72 +41,7 @@
private abstract class NamedAnnotationLiteral extends AnnotationLiteral<Named> implements Named {}
- // **** TESTS FOR DEPLOYMENT TYPE **** //
- @Test @SpecAssertion(section="2.5.3")
- public void testTooManyDeploymentTypes()
- {
- boolean exception = false;
- try
- {
- new SimpleBeanModel<BeanWithTooManyDeploymentTypes>(new SimpleAnnotatedType<BeanWithTooManyDeploymentTypes>(BeanWithTooManyDeploymentTypes.class), getEmptyAnnotatedItem(BeanWithTooManyDeploymentTypes.class), manager);
- }
- catch (Exception e)
- {
- exception = true;
- }
- assert exception;
- }
-
- @Test @SpecAssertion(section="2.5.4")
- public void testXmlDeploymentTypeOverridesJava()
- {
- Map<Class<? extends Annotation>, Annotation> xmlDefinedDeploymentTypeAnnotations = new HashMap<Class<? extends Annotation>, Annotation>();
- xmlDefinedDeploymentTypeAnnotations.put(AnotherDeploymentType.class, new AnotherDeploymentTypeAnnotationLiteral());
- AnnotatedType<BeanWithTooManyDeploymentTypes> xmlDefinedDeploymentTypeAnnotatedItem = new SimpleAnnotatedType<BeanWithTooManyDeploymentTypes>(BeanWithTooManyDeploymentTypes.class, xmlDefinedDeploymentTypeAnnotations);
-
- SimpleBeanModel<BeanWithTooManyDeploymentTypes> model = new SimpleBeanModel<BeanWithTooManyDeploymentTypes>(new SimpleAnnotatedType<BeanWithTooManyDeploymentTypes>(BeanWithTooManyDeploymentTypes.class), xmlDefinedDeploymentTypeAnnotatedItem, manager);
- assert model.getDeploymentType().equals(AnotherDeploymentType.class);
- }
-
- @Test @SpecAssertion(section="2.5.5")
- public void testXmlDefaultDeploymentType()
- {
- AnnotatedType<Antelope> antelopeAnnotatedItem = new SimpleAnnotatedType<Antelope>(Antelope.class, new HashMap<Class<? extends Annotation>, Annotation>());
- SimpleBeanModel<Antelope> antelope = new SimpleBeanModel<Antelope>(getEmptyAnnotatedItem(Antelope.class), antelopeAnnotatedItem, manager);
- assert antelope.getDeploymentType().equals(Production.class);
- }
-
- @Test @SpecAssertion(section="2.5.4")
- public void testXmlRespectsJavaDeploymentType()
- {
- AnnotatedType<Tuna> annotatedItem = new SimpleAnnotatedType<Tuna>(Tuna.class, new HashMap<Class<? extends Annotation>, Annotation>());
- SimpleBeanModel<Tuna> tuna = new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), annotatedItem, manager);
- assert tuna.getDeploymentType().equals(AnotherDeploymentType.class);
- }
-
- @Test @SpecAssertion(section="2.5.7")
- public void testDeploymentTypePrecedenceSelection()
- {
- Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
- annotations.put(HornedMammalStereotype.class, new HornedMamalStereotypeAnnotationLiteral());
- AnnotatedType<Moose> annotatedItem = new SimpleAnnotatedType<Moose>(Moose.class, annotations);
-
- SimpleBeanModel<Moose> moose = new SimpleBeanModel<Moose>(new SimpleAnnotatedType<Moose>(Moose.class), annotatedItem, manager);
- assert moose.getDeploymentType().equals(HornedAnimalDeploymentType.class);
-
- }
-
- @Test @SpecAssertion(section="2.7.2")
- public void testDeploymentTypeSpecifiedAndStereotyped()
- {
- Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
- annotations.put(FishStereotype.class, new FishStereotypeAnnotationLiteral());
- AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
- SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
- assert trout.getScopeType().equals(RequestScoped.class);
- }
-
// **** TESTS FOR SCOPES **** //
@@ -126,7 +51,7 @@
@Test @SpecAssertion(section="2.6.1")
public void testDefaultNamed()
{
- SimpleBeanModel<Haddock> haddock = new SimpleBeanModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), manager);
+ SimpleBeanModel<Haddock> haddock = new SimpleBeanModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedType(Haddock.class), manager);
assert haddock.getName() != null;
assert haddock.getName().equals("haddock");
}
@@ -171,14 +96,14 @@
@Test @SpecAssertion(section="2.6.4")
public void testNotNamed()
{
- SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), manager);
+ SimpleBeanModel<SeaBass> trout = new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedType(SeaBass.class), manager);
assert trout.getName() == null;
}
@Test @SpecAssertion(section="2.6.1")
public void testNonDefaultNamed()
{
- SimpleBeanModel<Moose> moose = new SimpleBeanModel<Moose>(new SimpleAnnotatedType<Moose>(Moose.class), getEmptyAnnotatedItem(Moose.class), manager);
+ SimpleBeanModel<Moose> moose = new SimpleBeanModel<Moose>(new SimpleAnnotatedType<Moose>(Moose.class), getEmptyAnnotatedType(Moose.class), manager);
assert moose.getName().equals("aMoose");
}
@@ -213,7 +138,7 @@
@Test @SpecAssertion(section="2.7.2")
public void testSingleStereotype()
{
- SimpleBeanModel<Gorilla> gorilla = new SimpleBeanModel<Gorilla>(new SimpleAnnotatedType<Gorilla>(Gorilla.class), getEmptyAnnotatedItem(Gorilla.class), manager);
+ SimpleBeanModel<Gorilla> gorilla = new SimpleBeanModel<Gorilla>(new SimpleAnnotatedType<Gorilla>(Gorilla.class), getEmptyAnnotatedType(Gorilla.class), manager);
assert gorilla.getName() == null;
assert gorilla.getDeploymentType().equals(Production.class);
assert gorilla.getBindingTypes().iterator().next().annotationType().equals(Current.class);
@@ -225,7 +150,7 @@
{
try
{
- new SimpleBeanModel<Gorilla>(new SimpleAnnotatedType<Gorilla>(Gorilla.class), getEmptyAnnotatedItem(Gorilla.class), manager);
+ new SimpleBeanModel<Gorilla>(new SimpleAnnotatedType<Gorilla>(Gorilla.class), getEmptyAnnotatedType(Gorilla.class), manager);
}
catch (Exception e)
{
@@ -237,7 +162,7 @@
@Test(expectedExceptions=Exception.class) @SpecAssertion(section="2.7.4")
public void testRequiredTypeIsNotImplemented()
{
- new SimpleBeanModel<Chair>(new SimpleAnnotatedType<Chair>(Chair.class), getEmptyAnnotatedItem(Chair.class), manager);
+ new SimpleBeanModel<Chair>(new SimpleAnnotatedType<Chair>(Chair.class), getEmptyAnnotatedType(Chair.class), manager);
}
@Test @SpecAssertion(section="2.7.4")
@@ -245,7 +170,7 @@
{
try
{
- new SimpleBeanModel<Goldfish>(new SimpleAnnotatedType<Goldfish>(Goldfish.class), getEmptyAnnotatedItem(Goldfish.class), manager);
+ new SimpleBeanModel<Goldfish>(new SimpleAnnotatedType<Goldfish>(Goldfish.class), getEmptyAnnotatedType(Goldfish.class), manager);
}
catch (Exception e)
{
@@ -257,7 +182,7 @@
@Test(expectedExceptions=Exception.class) @SpecAssertion(section="2.7.4")
public void testScopeIsNotSupported()
{
- new SimpleBeanModel<Carp>(new SimpleAnnotatedType<Carp>(Carp.class), getEmptyAnnotatedItem(Carp.class), manager);
+ new SimpleBeanModel<Carp>(new SimpleAnnotatedType<Carp>(Carp.class), getEmptyAnnotatedType(Carp.class), manager);
}
@Test @SpecAssertion(section="2.7.2")
@@ -274,7 +199,7 @@
boolean exception = false;
try
{
- new SimpleBeanModel<Cow>(new SimpleAnnotatedType<Cow>(Cow.class), getEmptyAnnotatedItem(Cow.class), manager);
+ new SimpleBeanModel<Cow>(new SimpleAnnotatedType<Cow>(Cow.class), getEmptyAnnotatedType(Cow.class), manager);
}
catch (Exception e)
{
@@ -289,7 +214,7 @@
boolean exception = false;
try
{
- new SimpleBeanModel<InnerBean>(new SimpleAnnotatedType<InnerBean>(InnerBean.class), getEmptyAnnotatedItem(InnerBean.class), manager);
+ new SimpleBeanModel<InnerBean>(new SimpleAnnotatedType<InnerBean>(InnerBean.class), getEmptyAnnotatedType(InnerBean.class), manager);
}
catch (Exception e)
{
@@ -304,7 +229,7 @@
boolean exception = false;
try
{
- new SimpleBeanModel<Horse>(new SimpleAnnotatedType<Horse>(Horse.class), getEmptyAnnotatedItem(Horse.class), manager);
+ new SimpleBeanModel<Horse>(new SimpleAnnotatedType<Horse>(Horse.class), getEmptyAnnotatedType(Horse.class), manager);
}
catch (Exception e)
{
@@ -331,7 +256,7 @@
boolean exception = false;
try
{
- new SimpleBeanModel<Pig>(new SimpleAnnotatedType<Pig>(Pig.class), getEmptyAnnotatedItem(Pig.class), manager);
+ new SimpleBeanModel<Pig>(new SimpleAnnotatedType<Pig>(Pig.class), getEmptyAnnotatedType(Pig.class), manager);
}
catch (Exception e)
{
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java 2008-10-25 20:38:12 UTC (rev 153)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeSafeResolutionTest.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -1,6 +1,6 @@
package org.jboss.webbeans.test;
-import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedItem;
+import static org.jboss.webbeans.test.util.Util.getEmptyAnnotatedType;
import java.util.HashSet;
import java.util.Set;
@@ -51,7 +51,7 @@
public void testSingleApiTypeWithCurrent() throws Exception
{
InjectableField<Tuna> tunaField = new InjectableField<Tuna>(FishFarm.class.getDeclaredField("tuna"));
- Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
+ Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedType(Tuna.class), super.manager), manager);
Set<Bean<?>> beans = new HashSet<Bean<?>>();
beans.add(tunaBean);
Set<Bean<?>> possibleTargets = tunaField.getMatchingBeans(beans);
@@ -63,9 +63,9 @@
public void testOneBindingType() throws Exception
{
InjectableField<ScottishFish> whiteScottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
- Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedType(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedType(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedType(Sole.class), super.manager), manager);
Set<Bean<?>> beans = new HashSet<Bean<?>>();
beans.add(codBean);
beans.add(salmonBean);
@@ -80,9 +80,9 @@
public void testABindingType() throws Exception
{
InjectableField<Animal> whiteChunkyFishField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("realChunkyWhiteFish"));
- Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedType(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedType(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedType(Sole.class), super.manager), manager);
Set<Bean<?>> beans = new HashSet<Bean<?>>();
beans.add(codBean);
beans.add(salmonBean);
@@ -96,8 +96,8 @@
public void testMultipleApiTypeWithCurrent() throws Exception
{
InjectableField<Animal> animalField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("animal"));
- Bean<SeaBass> seaBassBean = new BeanImpl<SeaBass>(new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), super.manager), manager);
- Bean<Haddock> haddockBean = new BeanImpl<Haddock>(new SimpleBeanModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), super.manager), manager);
+ Bean<SeaBass> seaBassBean = new BeanImpl<SeaBass>(new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedType(SeaBass.class), super.manager), manager);
+ Bean<Haddock> haddockBean = new BeanImpl<Haddock>(new SimpleBeanModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedType(Haddock.class), super.manager), manager);
Set<Bean<?>> beans = new HashSet<Bean<?>>();
beans.add(seaBassBean);
beans.add(haddockBean);
@@ -115,12 +115,12 @@
InjectableField<ScottishFish> scottishFishField = new InjectableField<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"));
InjectableField<Tuna> tunaField = new InjectableField<Tuna>(FishFarm.class.getDeclaredField("tuna"));
- Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
- Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedItem(Salmon.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
- Bean<SeaBass> seaBassBean = new BeanImpl<SeaBass>(new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), super.manager), manager);
- Bean<Haddock> haddockBean = new BeanImpl<Haddock>(new SimpleBeanModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedItem(Haddock.class), super.manager), manager);
+ Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleBeanModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedType(Tuna.class), super.manager), manager);
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedType(Cod.class), super.manager), manager);
+ Bean<Salmon> salmonBean = new BeanImpl<Salmon>(new SimpleBeanModel<Salmon>(new SimpleAnnotatedType<Salmon>(Salmon.class), getEmptyAnnotatedType(Salmon.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedType(Sole.class), super.manager), manager);
+ Bean<SeaBass> seaBassBean = new BeanImpl<SeaBass>(new SimpleBeanModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedType(SeaBass.class), super.manager), manager);
+ Bean<Haddock> haddockBean = new BeanImpl<Haddock>(new SimpleBeanModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), getEmptyAnnotatedType(Haddock.class), super.manager), manager);
manager.addBean(tunaBean);
manager.addBean(codBean);
@@ -174,8 +174,8 @@
{
InjectableField<Farmer<ScottishFish>> scottishFishFarmerField = new InjectableField<Farmer<ScottishFish>>(FishFarm.class.getDeclaredField("scottishFishFarmer"));
- Bean<ScottishFishFarmer> scottishFishFarmerBean = new BeanImpl<ScottishFishFarmer>(new SimpleBeanModel<ScottishFishFarmer>(new SimpleAnnotatedType<ScottishFishFarmer>(ScottishFishFarmer.class), getEmptyAnnotatedItem(ScottishFishFarmer.class), super.manager), manager);
- Bean<Farmer> farmerBean = new BeanImpl<Farmer>(new SimpleBeanModel<Farmer>(new SimpleAnnotatedType<Farmer>(Farmer.class), getEmptyAnnotatedItem(Farmer.class), super.manager), manager);
+ Bean<ScottishFishFarmer> scottishFishFarmerBean = new BeanImpl<ScottishFishFarmer>(new SimpleBeanModel<ScottishFishFarmer>(new SimpleAnnotatedType<ScottishFishFarmer>(ScottishFishFarmer.class), getEmptyAnnotatedType(ScottishFishFarmer.class), super.manager), manager);
+ Bean<Farmer> farmerBean = new BeanImpl<Farmer>(new SimpleBeanModel<Farmer>(new SimpleAnnotatedType<Farmer>(Farmer.class), getEmptyAnnotatedType(Farmer.class), super.manager), manager);
manager.addBean(scottishFishFarmerBean);
manager.addBean(farmerBean);
@@ -192,9 +192,9 @@
{
InjectableField<Animal> whiteFishField = new InjectableField<Animal>(FishFarm.class.getDeclaredField("whiteFish"));
- Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedItem(Cod.class), super.manager), manager);
- Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedItem(Sole.class), super.manager), manager);
- Bean<Plaice> plaiceBean = new BeanImpl<Plaice>(new SimpleBeanModel<Plaice>(new SimpleAnnotatedType<Plaice>(Plaice.class), getEmptyAnnotatedItem(Plaice.class), super.manager), manager);
+ Bean<Cod> codBean = new BeanImpl<Cod>(new SimpleBeanModel<Cod>(new SimpleAnnotatedType<Cod>(Cod.class), getEmptyAnnotatedType(Cod.class), super.manager), manager);
+ Bean<Sole> soleBean = new BeanImpl<Sole>(new SimpleBeanModel<Sole>(new SimpleAnnotatedType<Sole>(Sole.class), getEmptyAnnotatedType(Sole.class), super.manager), manager);
+ Bean<Plaice> plaiceBean = new BeanImpl<Plaice>(new SimpleBeanModel<Plaice>(new SimpleAnnotatedType<Plaice>(Plaice.class), getEmptyAnnotatedType(Plaice.class), super.manager), manager);
manager.addBean(plaiceBean);
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/AnotherScopeType.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/AnotherScopeType.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/AnotherScopeType.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.test.annotations;
+
+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.webbeans.ScopeType;
+
+ at Target( { TYPE, METHOD })
+ at Retention(RUNTIME)
+ at Documented
+ at ScopeType
+public @interface AnotherScopeType
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/annotations/AnotherScopeType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Mullet.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Mullet.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Mullet.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.beans;
+
+import org.jboss.webbeans.test.annotations.AnotherScopeType;
+
+ at AnotherScopeType
+public class Mullet
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Mullet.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-10-25 20:38:12 UTC (rev 153)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SpiderProducer.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -3,11 +3,11 @@
import javax.webbeans.Dependent;
import javax.webbeans.Named;
import javax.webbeans.Produces;
-import javax.webbeans.Production;
+import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
import org.jboss.webbeans.test.annotations.Tame;
- at Production
+ at AnotherDeploymentType
public class SpiderProducer
{
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Gazelle.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Gazelle.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Gazelle.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.beans.broken;
+
+import javax.webbeans.Standard;
+
+ at Standard
+public class Gazelle
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/Gazelle.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/PlaiceFarm.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/PlaiceFarm.java 2008-10-25 20:38:12 UTC (rev 153)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/PlaiceFarm.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -4,6 +4,7 @@
import org.jboss.webbeans.test.annotations.Whitefish;
import org.jboss.webbeans.test.beans.Plaice;
+import org.jboss.webbeans.test.beans.Tuna;
@Production
public class PlaiceFarm
@@ -13,4 +14,6 @@
@Whitefish
private Plaice plaice;
+ private Tuna tuna;
+
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/util/Util.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/util/Util.java 2008-10-25 20:38:12 UTC (rev 153)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/util/Util.java 2008-10-25 23:13:22 UTC (rev 154)
@@ -19,11 +19,16 @@
public static <T> SimpleBeanModel<T> createSimpleModel(Class<T> clazz, ManagerImpl manager)
{
- return new SimpleBeanModel<T>(new SimpleAnnotatedType<T>(clazz), getEmptyAnnotatedItem(clazz), manager);
+ return new SimpleBeanModel<T>(new SimpleAnnotatedType<T>(clazz), getEmptyAnnotatedType(clazz), manager);
}
- public static <T> AnnotatedType<T> getEmptyAnnotatedItem(Class<T> type)
+ public static <T> SimpleBeanModel<T> createSimpleModel(Class<T> clazz, AnnotatedType<T> xmlAnnotatedType, ManagerImpl manager)
{
+ return new SimpleBeanModel<T>(new SimpleAnnotatedType<T>(clazz), xmlAnnotatedType, manager);
+ }
+
+ public static <T> AnnotatedType<T> getEmptyAnnotatedType(Class<T> type)
+ {
return new SimpleAnnotatedType<T>(type, new HashMap<Class<? extends Annotation>, Annotation>());
}
Modified: ri/trunk/webbeans-ri/testng.xml
===================================================================
--- ri/trunk/webbeans-ri/testng.xml 2008-10-25 20:38:12 UTC (rev 153)
+++ ri/trunk/webbeans-ri/testng.xml 2008-10-25 23:13:22 UTC (rev 154)
@@ -14,6 +14,8 @@
<exclude name="injection" />
<exclude name="contexts" />
<exclude name="ejb3" />
+ <exclude name="annotationDefinition" />
+ <exclude name="webbeansxml" />
</run>
</groups>
<packages>
More information about the weld-commits
mailing list