[webbeans-commits] Webbeans SVN: r851 - in tck/trunk: api and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 07:37:54 -0500 (Fri, 09 Jan 2009)
New Revision: 851
Modified:
tck/trunk/api/pom.xml
tck/trunk/impl/pom.xml
tck/trunk/pom.xml
Log:
fix build
Modified: tck/trunk/api/pom.xml
===================================================================
--- tck/trunk/api/pom.xml 2009-01-09 12:30:01 UTC (rev 850)
+++ tck/trunk/api/pom.xml 2009-01-09 12:37:54 UTC (rev 851)
@@ -35,17 +35,12 @@
<url>http://www.seamframework.org/WebBeans</url>
<dependencies>
+
<dependency>
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-api</artifactId>
</dependency>
-
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <scope>test</scope>
- <classifier>jdk15</classifier>
- </dependency>
+
</dependencies>
Modified: tck/trunk/impl/pom.xml
===================================================================
--- tck/trunk/impl/pom.xml 2009-01-09 12:30:01 UTC (rev 850)
+++ tck/trunk/impl/pom.xml 2009-01-09 12:37:54 UTC (rev 851)
@@ -17,11 +17,15 @@
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-api</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans.tck</groupId>
+ <artifactId>webbeans-tck-api</artifactId>
+ </dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <scope>test</scope>
<classifier>jdk15</classifier>
</dependency>
Modified: tck/trunk/pom.xml
===================================================================
--- tck/trunk/pom.xml 2009-01-09 12:30:01 UTC (rev 850)
+++ tck/trunk/pom.xml 2009-01-09 12:37:54 UTC (rev 851)
@@ -115,6 +115,12 @@
<version>${webbeans.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.webbeans.tck</groupId>
+ <artifactId>webbeans-tck-api</artifactId>
+ <version>${webbeans.tck.version}</version>
+ </dependency>
+
</dependencies>
</dependencyManagement>
@@ -216,6 +222,7 @@
<properties>
<webbeans.version>1.0.0-SNAPSHOT</webbeans.version>
+ <webbeans.tck.version>1.0.0-SNAPSHOT</webbeans.tck.version>
</properties>
</project>
16 years
[webbeans-commits] Webbeans SVN: r850 - in tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test: binding and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-01-09 07:30:01 -0500 (Fri, 09 Jan 2009)
New Revision: 850
Added:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/binding/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/binding/CurrentBinding.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java
Log:
add CurrentBinding
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java 2009-01-09 12:26:50 UTC (rev 849)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java 2009-01-09 12:30:01 UTC (rev 850)
@@ -4,11 +4,7 @@
import javax.webbeans.Current;
import javax.webbeans.manager.Bean;
-import javax.webbeans.manager.Manager;
-import org.jboss.webbeans.tck.api.Managers;
-import org.jboss.webbeans.tck.impl.TckUtils;
-import org.jboss.webbeans.tck.impl.util.Reflections;
import org.jboss.webbeans.tck.impl.test.annotations.Synchronous;
import org.jboss.webbeans.tck.impl.test.beans.Barn;
import org.jboss.webbeans.tck.impl.test.beans.Cat;
@@ -19,9 +15,8 @@
import org.jboss.webbeans.tck.impl.test.beans.SpiderProducer;
import org.jboss.webbeans.tck.impl.test.beans.Tarantula;
import org.jboss.webbeans.tck.impl.test.beans.Tuna;
-
-import org.jboss.webbeans.binding.CurrentBinding;
-
+import org.jboss.webbeans.tck.impl.test.binding.CurrentBinding;
+import org.jboss.webbeans.tck.impl.util.Reflections;
import org.testng.annotations.Test;
@SpecVersion("2001206")
@@ -118,8 +113,6 @@
assert false;
}
-
-
@Test(groups={"injection", "producerMethod"}) @SpecAssertion(section="2.3.5")
public void testFieldInjectedFromProducerMethod() throws Exception
{
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/binding/CurrentBinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/binding/CurrentBinding.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/binding/CurrentBinding.java 2009-01-09 12:30:01 UTC (rev 850)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.tck.impl.test.binding;
+
+import javax.webbeans.AnnotationLiteral;
+import javax.webbeans.Current;
+
+/**
+ * Annotation literal for @Current
+ *
+ * @author Pete Muir
+ */
+public class CurrentBinding extends AnnotationLiteral<Current> implements Current {}
\ No newline at end of file
16 years
[webbeans-commits] Webbeans SVN: r849 - in tck/trunk: impl/src/main/java/org/jboss/webbeans/tck/impl/test and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-01-09 07:26:50 -0500 (Fri, 09 Jan 2009)
New Revision: 849
Modified:
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java
Log:
tck support for producer methods
Modified: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java 2009-01-09 12:17:03 UTC (rev 848)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java 2009-01-09 12:26:50 UTC (rev 849)
@@ -1,5 +1,7 @@
package org.jboss.webbeans.tck.api;
+import java.lang.reflect.Method;
+
import javax.webbeans.manager.Bean;
import javax.webbeans.manager.Manager;
@@ -11,5 +13,5 @@
public interface Beans
{
<T> Bean<T> createSimpleBean(Class<T> clazz, Manager manager);
-
+ <T> Bean<T> getProducerMethodBean(Method method, Bean<T> clazz, Manager manager);
}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java 2009-01-09 12:17:03 UTC (rev 848)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java 2009-01-09 12:26:50 UTC (rev 849)
@@ -5,6 +5,7 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.lang.reflect.Method;
import java.util.Arrays;
import javax.webbeans.Production;
@@ -34,6 +35,11 @@
{
return TckUtils.getBeans().createSimpleBean(beanClass, manager);
}
+
+ public <T> Bean<?> getProducerMethodBean(Method method, Bean<?> producerBean)
+ {
+ return TckUtils.getBeans().getProducerMethodBean(method, producerBean, manager);
+ }
/*
protected <T> AbstractClassBean<T> registerBean(Class<T> clazz)
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java 2009-01-09 12:17:03 UTC (rev 848)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java 2009-01-09 12:26:50 UTC (rev 849)
@@ -20,7 +20,6 @@
import org.jboss.webbeans.tck.impl.test.beans.Tarantula;
import org.jboss.webbeans.tck.impl.test.beans.Tuna;
-import org.jboss.webbeans.bean.ProducerMethodBean;
import org.jboss.webbeans.binding.CurrentBinding;
import org.testng.annotations.Test;
@@ -127,7 +126,7 @@
Bean<SpiderProducer> spiderProducer = getSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- manager.addBean(ProducerMethodBean.of(method, spiderProducer, manager));
+ manager.addBean(getProducerMethodBean(method, spiderProducer));
Barn barn = getSimpleBean(Barn.class).create();
assert barn.petSpider != null;
assert barn.petSpider instanceof DefangedTarantula;
@@ -145,15 +144,16 @@
assert false;
}
+ @SuppressWarnings("unchecked")
@Test(groups={"injection", "producerMethod"})
public void testMethodWithBindingAnnotationsOnParametersAreInjected() throws Exception
{
- SimpleBean<SpiderProducer> spiderProducer = SimpleBean.of(SpiderProducer.class, manager);
+ Bean<SpiderProducer> spiderProducer = getSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- manager.addBean(ProducerMethodBean.of(method, spiderProducer, manager));
+ manager.addBean(getProducerMethodBean(method, spiderProducer));
method = SpiderProducer.class.getMethod("produceSpiderFromInjection", Tarantula.class);
- ProducerMethodBean<Spider> spiderBean = ProducerMethodBean.of(method, spiderProducer, manager);
+ Bean<Spider> spiderBean = (Bean<Spider>) getProducerMethodBean(method, spiderProducer);
Spider spider = spiderBean.create();
assert spider != null;
assert spider instanceof DefangedTarantula;
16 years
[webbeans-commits] Webbeans SVN: r848 - in tck/trunk: api/src/main/java/org/jboss/webbeans/tck/api and 5 other directories.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-01-09 07:17:03 -0500 (Fri, 09 Jan 2009)
New Revision: 848
Added:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java
Removed:
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/
Modified:
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/TckUtils.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecAssertion.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecVersion.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/AnimalStereotype.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Chunky.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/HornedAnimalDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Synchronous.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Tame.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Whitefish.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Animal.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Barn.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/BlackWidow.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Cat.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Cod.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DaddyLongLegs.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DeadlyAnimal.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DeadlySpider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DefangedTarantula.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/FunnelWeaver.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/LadybirdSpider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Order.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/ScottishFish.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Spider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/SpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Tarantula.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/TrapdoorSpider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Tuna.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/WolfSpider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/DeploymentProperties.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/EnumerationIterable.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/EnumerationIterator.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/Reflections.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/ResourceLoadingException.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/SimpleResourceLoader.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/Strings.java
Log:
refactored
Modified: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,5 +1,6 @@
package org.jboss.webbeans.tck.api;
+import javax.webbeans.manager.Bean;
import javax.webbeans.manager.Manager;
/**
@@ -9,6 +10,6 @@
*/
public interface Beans
{
- <T> T createSimpleBean(Class<T> clazz, Manager manager);
+ <T> Bean<T> createSimpleBean(Class<T> clazz, Manager manager);
}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/TckUtils.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/TckUtils.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/TckUtils.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,10 +1,14 @@
-package org.jboss.webbeans.tck.api;
+package org.jboss.webbeans.tck.impl;
import java.lang.reflect.Constructor;
-import org.jboss.webbeans.tck.api.util.DeploymentProperties;
-import org.jboss.webbeans.tck.api.util.Reflections;
+import org.jboss.webbeans.tck.api.Beans;
+import org.jboss.webbeans.tck.api.Contexts;
+import org.jboss.webbeans.tck.api.Managers;
+import org.jboss.webbeans.tck.impl.util.DeploymentProperties;
+import org.jboss.webbeans.tck.impl.util.Reflections;
+
/**
*
* @author Shane Bryzak
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/AbstractTest.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -0,0 +1,102 @@
+package org.jboss.webbeans.tck.impl.test;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.Arrays;
+
+import javax.webbeans.Production;
+import javax.webbeans.Standard;
+import javax.webbeans.manager.Bean;
+import javax.webbeans.manager.Manager;
+
+import org.jboss.webbeans.tck.impl.TckUtils;
+import org.testng.annotations.BeforeMethod;
+
+public class AbstractTest
+{
+ protected static final int BUILT_IN_BEANS = 3;
+
+ protected Manager manager;
+
+ public static boolean visited = false;
+
+ @BeforeMethod
+ public final void before()
+ {
+ manager = TckUtils.getManagers().createManager();
+ //addStandardDeploymentTypesForTests();
+ }
+
+ public <T> Bean<T> getSimpleBean(Class<T> beanClass)
+ {
+ return TckUtils.getBeans().createSimpleBean(beanClass, manager);
+ }
+
+ /*
+ protected <T> AbstractClassBean<T> registerBean(Class<T> clazz)
+ {
+ AbstractClassBean<T> bean = null;
+ if (CurrentManager.rootManager().getEjbDescriptorCache().containsKey(clazz))
+ {
+ bean = EnterpriseBean.of(clazz, manager);
+ }
+ else
+ {
+ bean = SimpleBean.of(clazz, manager);
+ }
+ CurrentManager.rootManager().addBean(bean);
+ return bean;
+ }
+ */
+
+/*
+ protected void registerBeans(Class<?>[] classes)
+ {
+ for (Class<?> clazz : classes)
+ {
+ registerBean(clazz);
+ }
+ }
+ */
+
+ /*
+ @SuppressWarnings("unchecked")
+ protected void addStandardDeploymentTypesForTests()
+ {
+ manager.setEnabledDeploymentTypes(Arrays.asList(Standard.class, Production.class, AnotherDeploymentType.class, HornedAnimalDeploymentType.class));
+ }
+
+ protected <T> void addToEjbCache(Class<T> clazz)
+ {
+ manager.getEjbDescriptorCache().add(new MockEjbDescriptor<T>(clazz));
+ }
+ */
+
+ protected byte[] serialize(Object instance) throws IOException
+ {
+ ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(bytes);
+ out.writeObject(instance);
+ return bytes.toByteArray();
+ }
+
+ protected Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException
+ {
+ ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
+ return in.readObject();
+ }
+
+/* protected void activateDependentContext()
+ {
+ DependentContext.INSTANCE.setActive(true);
+ }
+
+ protected void deactivateDependentContext()
+ {
+ DependentContext.INSTANCE.setActive(false);
+ }
+ */
+}
\ No newline at end of file
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test;
+package org.jboss.webbeans.tck.impl.test;
import java.lang.reflect.Method;
@@ -7,18 +7,18 @@
import javax.webbeans.manager.Manager;
import org.jboss.webbeans.tck.api.Managers;
-import org.jboss.webbeans.tck.api.TckUtils;
-import org.jboss.webbeans.tck.api.util.Reflections;
-import org.jboss.webbeans.tck.test.annotations.Synchronous;
-import org.jboss.webbeans.tck.test.beans.Barn;
-import org.jboss.webbeans.tck.test.beans.Cat;
-import org.jboss.webbeans.tck.test.beans.Cod;
-import org.jboss.webbeans.tck.test.beans.DefangedTarantula;
-import org.jboss.webbeans.tck.test.beans.Order;
-import org.jboss.webbeans.tck.test.beans.Spider;
-import org.jboss.webbeans.tck.test.beans.SpiderProducer;
-import org.jboss.webbeans.tck.test.beans.Tarantula;
-import org.jboss.webbeans.tck.test.beans.Tuna;
+import org.jboss.webbeans.tck.impl.TckUtils;
+import org.jboss.webbeans.tck.impl.util.Reflections;
+import org.jboss.webbeans.tck.impl.test.annotations.Synchronous;
+import org.jboss.webbeans.tck.impl.test.beans.Barn;
+import org.jboss.webbeans.tck.impl.test.beans.Cat;
+import org.jboss.webbeans.tck.impl.test.beans.Cod;
+import org.jboss.webbeans.tck.impl.test.beans.DefangedTarantula;
+import org.jboss.webbeans.tck.impl.test.beans.Order;
+import org.jboss.webbeans.tck.impl.test.beans.Spider;
+import org.jboss.webbeans.tck.impl.test.beans.SpiderProducer;
+import org.jboss.webbeans.tck.impl.test.beans.Tarantula;
+import org.jboss.webbeans.tck.impl.test.beans.Tuna;
import org.jboss.webbeans.bean.ProducerMethodBean;
import org.jboss.webbeans.binding.CurrentBinding;
@@ -26,16 +26,14 @@
import org.testng.annotations.Test;
@SpecVersion("2001206")
-public class BindingTypeTest
+public class BindingTypeTest extends AbstractTest
{
@SuppressWarnings("unchecked")
@Test @SpecAssertion(section={"2.3.3", "2.3.1"})
public void testDefaultBindingTypeDeclaredInJava()
- {
- Manager manager = TckUtils.getManagers().createManager();
-
- Bean<Order> order = TckUtils.getBeans().createSimpleBean(Order.class, manager);
+ {
+ Bean<Order> order = getSimpleBean(Order.class);
assert order.getBindingTypes().size() == 1;
order.getBindingTypes().iterator().next().annotationType().equals(Current.class);
}
@@ -61,20 +59,16 @@
@SuppressWarnings("unchecked")
@Test @SpecAssertion(section="2.3.3")
public void testBindingTypesDeclaredInJava()
- {
- Manager manager = TckUtils.getManagers().createManager();
-
- SimpleBean<Cat> cat = SimpleBean.of(Cat.class, manager);
+ {
+ Bean<Cat> cat = getSimpleBean(Cat.class);
assert cat.getBindingTypes().size() == 1;
assert Reflections.annotationSetMatches(cat.getBindingTypes(), Synchronous.class);
}
@Test @SpecAssertion(section="2.3.3")
public void testMultipleBindingTypes()
- {
- Manager manager = TckUtils.getManagers().createManager();
-
- SimpleBean<?> model = SimpleBean.of(Cod.class, manager);
+ {
+ Bean<?> model = getSimpleBean(Cod.class);
assert model.getBindingTypes().size() == 2;
}
@@ -119,9 +113,7 @@
@Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section={"2.3.4", "2.3.1"})
public void testDefaultBindingTypeDeclaredInXml()
{
- Manager manager = TckUtils.getManagers().createManager();
-
- SimpleBean<?> model = SimpleBean.of(Tuna.class, manager);
+ Bean<?> model = getSimpleBean(Tuna.class);
assert model.getBindingTypes().size() == 1;
assert model.getBindingTypes().contains(new CurrentBinding());
assert false;
@@ -132,13 +124,11 @@
@Test(groups={"injection", "producerMethod"}) @SpecAssertion(section="2.3.5")
public void testFieldInjectedFromProducerMethod() throws Exception
{
- Manager manager = TckUtils.getManagers().createManager();
-
- SimpleBean<SpiderProducer> spiderProducer = SimpleBean.of(SpiderProducer.class, manager);
+ Bean<SpiderProducer> spiderProducer = getSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
manager.addBean(ProducerMethodBean.of(method, spiderProducer, manager));
- Barn barn = SimpleBean.of(Barn.class, manager).create();
+ Barn barn = getSimpleBean(Barn.class).create();
assert barn.petSpider != null;
assert barn.petSpider instanceof DefangedTarantula;
}
@@ -158,8 +148,6 @@
@Test(groups={"injection", "producerMethod"})
public void testMethodWithBindingAnnotationsOnParametersAreInjected() throws Exception
{
- Manager manager = TckUtils.getManagers().createManager();
-
SimpleBean<SpiderProducer> spiderProducer = SimpleBean.of(SpiderProducer.class, manager);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecAssertion.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecAssertion.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecAssertion.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test;
+package org.jboss.webbeans.tck.impl.test;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecVersion.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecVersion.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecVersion.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test;
+package org.jboss.webbeans.tck.impl.test;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/AnimalStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/AnimalStereotype.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/AnimalStereotype.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.annotations;
+package org.jboss.webbeans.tck.impl.test.annotations;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
@@ -11,7 +11,7 @@
import javax.webbeans.RequestScoped;
import javax.webbeans.Stereotype;
-import org.jboss.webbeans.tck.test.beans.Animal;
+import org.jboss.webbeans.tck.impl.test.beans.Animal;
@Stereotype(requiredTypes=Animal.class)
@Target( { TYPE, METHOD, FIELD })
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/AnotherDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/AnotherDeploymentType.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/AnotherDeploymentType.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.annotations;
+package org.jboss.webbeans.tck.impl.test.annotations;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Chunky.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Chunky.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Chunky.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.annotations;
+package org.jboss.webbeans.tck.impl.test.annotations;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/HornedAnimalDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/HornedAnimalDeploymentType.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/HornedAnimalDeploymentType.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.annotations;
+package org.jboss.webbeans.tck.impl.test.annotations;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Synchronous.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Synchronous.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Synchronous.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.annotations;
+package org.jboss.webbeans.tck.impl.test.annotations;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Tame.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Tame.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Tame.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.annotations;
+package org.jboss.webbeans.tck.impl.test.annotations;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Whitefish.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Whitefish.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Whitefish.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.annotations;
+package org.jboss.webbeans.tck.impl.test.annotations;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Animal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Animal.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Animal.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
public interface Animal
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Barn.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Barn.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Barn.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,6 +1,6 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
-import org.jboss.webbeans.tck.test.annotations.Tame;
+import org.jboss.webbeans.tck.impl.test.annotations.Tame;
public class Barn
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/BlackWidow.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/BlackWidow.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/BlackWidow.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
public class BlackWidow extends Spider implements DeadlySpider
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Cat.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Cat.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Cat.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,8 +1,8 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
import javax.webbeans.Production;
-import org.jboss.webbeans.test.annotations.Synchronous;
+import org.jboss.webbeans.tck.impl.test.annotations.Synchronous;
@Production
@Synchronous
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Cod.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Cod.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Cod.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,10 +1,10 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
import javax.webbeans.Named;
import javax.webbeans.Production;
-import org.jboss.webbeans.tck.test.annotations.Chunky;
-import org.jboss.webbeans.tck.test.annotations.Whitefish;
+import org.jboss.webbeans.tck.impl.test.annotations.Chunky;
+import org.jboss.webbeans.tck.impl.test.annotations.Whitefish;
@Production
@Whitefish
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DaddyLongLegs.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DaddyLongLegs.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DaddyLongLegs.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
public class DaddyLongLegs extends Spider
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DeadlyAnimal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DeadlyAnimal.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DeadlyAnimal.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
public interface DeadlyAnimal
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DeadlySpider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DeadlySpider.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DeadlySpider.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
public interface DeadlySpider extends DeadlyAnimal
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DefangedTarantula.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DefangedTarantula.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DefangedTarantula.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
public class DefangedTarantula extends Tarantula
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/FunnelWeaver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/FunnelWeaver.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/FunnelWeaver.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
public class FunnelWeaver<T>
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/LadybirdSpider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/LadybirdSpider.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/LadybirdSpider.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
import javax.webbeans.ApplicationScoped;
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Order.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Order.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Order.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
import javax.webbeans.Production;
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/ScottishFish.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/ScottishFish.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/ScottishFish.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
public interface ScottishFish extends Animal
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Spider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Spider.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Spider.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
public class Spider implements Animal
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/SpiderProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/SpiderProducer.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/SpiderProducer.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
import javax.webbeans.Dependent;
import javax.webbeans.Named;
@@ -6,9 +6,9 @@
import javax.webbeans.Production;
import javax.webbeans.RequestScoped;
-import org.jboss.webbeans.tck.test.annotations.AnimalStereotype;
-import org.jboss.webbeans.tck.test.annotations.AnotherDeploymentType;
-import org.jboss.webbeans.tck.test.annotations.Tame;
+import org.jboss.webbeans.tck.impl.test.annotations.AnimalStereotype;
+import org.jboss.webbeans.tck.impl.test.annotations.AnotherDeploymentType;
+import org.jboss.webbeans.tck.impl.test.annotations.Tame;
@AnotherDeploymentType
public class SpiderProducer
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Tarantula.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Tarantula.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Tarantula.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
public class Tarantula extends Spider implements DeadlySpider
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/TrapdoorSpider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/TrapdoorSpider.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/TrapdoorSpider.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
public class TrapdoorSpider
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Tuna.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Tuna.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Tuna.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,8 +1,8 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
import javax.webbeans.RequestScoped;
-import org.jboss.webbeans.tck.test.annotations.AnotherDeploymentType;
+import org.jboss.webbeans.tck.impl.test.annotations.AnotherDeploymentType;
@AnotherDeploymentType
@RequestScoped
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/WolfSpider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/WolfSpider.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/WolfSpider.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.test.beans;
+package org.jboss.webbeans.tck.impl.test.beans;
public class WolfSpider implements Animal
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/DeploymentProperties.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/DeploymentProperties.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/DeploymentProperties.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,7 +1,5 @@
-package org.jboss.webbeans.tck.api.util;
+package org.jboss.webbeans.tck.impl.util;
-import static org.jboss.webbeans.tck.api.util.Strings.split;
-
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
@@ -109,7 +107,7 @@
{
if (value != null)
{
- String[] properties = split(value, ":");
+ String[] properties = Strings.split(value, ":");
for (String property : properties)
{
values.add(property);
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/EnumerationIterable.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/EnumerationIterable.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/EnumerationIterable.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.api.util;
+package org.jboss.webbeans.tck.impl.util;
import java.util.Enumeration;
import java.util.Iterator;
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/EnumerationIterator.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/EnumerationIterator.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/EnumerationIterator.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.api.util;
+package org.jboss.webbeans.tck.impl.util;
import java.util.Enumeration;
import java.util.Iterator;
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/Reflections.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/Reflections.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/Reflections.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.api.util;
+package org.jboss.webbeans.tck.impl.util;
import java.beans.Introspector;
import java.io.Serializable;
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/ResourceLoadingException.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/ResourceLoadingException.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/ResourceLoadingException.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.api.util;
+package org.jboss.webbeans.tck.impl.util;
import javax.webbeans.ExecutionException;
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/SimpleResourceLoader.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/SimpleResourceLoader.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/SimpleResourceLoader.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.api.util;
+package org.jboss.webbeans.tck.impl.util;
import java.io.IOException;
import java.net.URL;
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/Strings.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/Strings.java 2009-01-09 12:13:56 UTC (rev 847)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/Strings.java 2009-01-09 12:17:03 UTC (rev 848)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.tck.api.util;
+package org.jboss.webbeans.tck.impl.util;
import java.util.StringTokenizer;
16 years
[webbeans-commits] Webbeans SVN: r847 - in ri/trunk: webbeans-ri/src/test/java/org/jboss/webbeans/test/mock and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 07:13:56 -0500 (Fri, 09 Jan 2009)
New Revision: 847
Modified:
ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbResolver.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java
Log:
Actually commit @PersistenceContext work
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-01-09 11:57:21 UTC (rev 846)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-01-09 12:13:56 UTC (rev 847)
@@ -23,7 +23,10 @@
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
import javax.webbeans.DefinitionException;
+import javax.webbeans.ExecutionException;
import javax.webbeans.Initializer;
import javax.webbeans.InjectionPoint;
@@ -251,17 +254,29 @@
for (AnnotatedField<?> field : annotatedItem.getAnnotatedFields(manager.getEjbResolver().getPersistenceContextAnnotation()))
{
+ if (field.getAnnotation(PersistenceContext.class).type().equals(PersistenceContextType.EXTENDED))
+ {
+ throw new ExecutionException("Cannot inject an extended persistence context into " + field);
+ }
InjectionPoint injectionPoint = new InjectionPointImpl(field, this, beanInstance);
- Object puInstance = manager.getEjbResolver().resolvePersistenceUnit(injectionPoint, manager.getNaming());
+ Object puInstance = manager.getEjbResolver().resolvePersistenceContext(injectionPoint, manager.getNaming());
field.inject(beanInstance, puInstance);
}
for (AnnotatedMethod<?> method : annotatedItem.getAnnotatedMethods(manager.getEjbResolver().getPersistenceContextAnnotation()))
{
InjectionPoint injectionPoint = new InjectionPointImpl(method, this, beanInstance);
- Object puInstance = manager.getEjbResolver().resolvePersistenceUnit(injectionPoint, manager.getNaming());
+ Object puInstance = manager.getEjbResolver().resolvePersistenceContext(injectionPoint, manager.getNaming());
method.invoke(beanInstance, puInstance);
}
+
+ for (AnnotatedField<?> field : annotatedItem.getAnnotatedFields(manager.getEjbResolver().getResourceAnnotation()))
+ {
+ InjectionPoint injectionPoint = new InjectionPointImpl(field, this, beanInstance);
+ Object resourceInstance = manager.getEjbResolver().resolveResource(injectionPoint, manager.getNaming());
+ field.inject(beanInstance, resourceInstance);
+ }
+
}
/**
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java 2009-01-09 11:57:21 UTC (rev 846)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java 2009-01-09 12:13:56 UTC (rev 847)
@@ -2,8 +2,8 @@
import java.lang.annotation.Annotation;
+import javax.annotation.Resource;
import javax.ejb.EJB;
-import javax.persistence.EntityManagerFactory;
import javax.persistence.PersistenceContext;
import javax.webbeans.InjectionPoint;
@@ -56,13 +56,24 @@
return null;
}
- public EntityManagerFactory resolvePersistenceUnit(InjectionPoint injectionPoint, Naming naming)
+ public Object resolvePersistenceContext(InjectionPoint injectionPoint, Naming naming)
{
// TODO Implement PU resolution for Unit tests
return null;
}
+ public Class<? extends Annotation> getResourceAnnotation()
+ {
+ return Resource.class;
+ }
+ public Object resolveResource(InjectionPoint injectionPoint, Naming naming)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
};
Modified: ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbResolver.java
===================================================================
--- ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbResolver.java 2009-01-09 11:57:21 UTC (rev 846)
+++ ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbResolver.java 2009-01-09 12:13:56 UTC (rev 847)
@@ -2,14 +2,13 @@
import java.lang.annotation.Annotation;
-import javax.webbeans.DefinitionException;
import javax.webbeans.InjectionPoint;
import org.jboss.webbeans.resources.spi.Naming;
/**
* A container should implement this interface to allow the Web Beans RI to
- * resolve EJBs and JPA persistence units
+ * resolve EJBs, Resources and JPA persistence units
*
* @author Pete Muir
*
@@ -20,55 +19,69 @@
public static final String PROPERTY_NAME = EjbResolver.class.getName();
/**
- * Resolve the value for the given
+ * Resolve the value for the given @EJB injection point
*
- * @EJB injection point
- *
- * @param injectionPoint
- * The injection point metadata
- * @return the JNDI name
+ * @param injectionPoint the injection point metadata
+ * @return an instance of the EJB
* @throws IllegalArgumentException
- * if the injection point is not annotated with @EJB
- * @throws DefinitionException
- * if the injection point is not suitable for injection
+ * if the injection point is not annotated with @EJB, or, if the
+ * injection point is a method that doesn't follow JavaBean
+ * conventions
* @throws IllegalStateException
* if no EJBs can be resolved for injection
*/
public Object resolveEjb(InjectionPoint injectionPoint, Naming naming);
/**
- * Resolve the value for the given
+ * Resolve the value for the given @PersistenceContext injection point
*
- * @PersistenceContext injection point
- *
- * @param injectionPoint
- * The injection point metadata
- * @return the JNDI name
+ * @param injectionPoint the injection point metadata
+ * @param naming the pluggable Web Beans JNDI lookup facility
+ * @return an instance of the persistence unit
* @throws IllegalArgumentException
- * if the injection point is not annotated with @PersistenceContext
- * @throws UnsupportedOperationException
- * if the injection point is annotated @PersistenceContext(EXTENTED)
+ * if the injection point is not annotated with
+ * @PersistenceContext, or, if the injection point is a method
+ * that doesn't follow JavaBean conventions
* @throws IllegalStateException
* if no suitable persistence units can be resolved for injection
*/
- public Object resolvePersistenceUnit(InjectionPoint injectionPoint, Naming naming);
+ public Object resolvePersistenceContext(InjectionPoint injectionPoint, Naming naming);
/**
- * Get the annotation which defines an
+ * Resolve the value for the given @Resource injection point
*
- * @EJB injection point
+ * @param injectionPoint the injection point metadata
+ * @param naming the pluggable Web Beans JNDI lookup facility
+ * @return an instance of the resource
+ * @throws IllegalArgumentException
+ * if the injection point is not annotated with @Resource, or, if
+ * the injection point is a method that doesn't follow JavaBean
+ * conventions
+ * @throws IllegalStateException
+ * if no resource can be resolved for injection
+ */
+ public Object resolveResource(InjectionPoint injectionPoint, Naming naming);
+
+ /**
+ * Get the annotation which defines an @EJB injection point
*
* @return the annotation which defines an @EJB injection point
*/
public Class<? extends Annotation> getEJBAnnotation();
/**
- * Get the annoation which defines a
+ * Get the annotation which defines a @PersistenceContext injection point
*
- * @PersistenceContext injection point
- *
- * @return the annoation which defines a @PersistenceContext injection point
+ * @return the annotation which defines a @PersistenceContext injection point
*/
public Class<? extends Annotation> getPersistenceContextAnnotation();
+ /**
+ * Get the annotation which defines a @Resource injection point
+ *
+ * @return the annotation which defines a @Resource injection point
+ */
+ public Class<? extends Annotation> getResourceAnnotation();
+
+
}
16 years
[webbeans-commits] Webbeans SVN: r846 - in tck/trunk/impl/src/main/java: org and 8 other directories.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-01-09 06:57:21 -0500 (Fri, 09 Jan 2009)
New Revision: 846
Added:
tck/trunk/impl/src/main/java/org/
tck/trunk/impl/src/main/java/org/jboss/
tck/trunk/impl/src/main/java/org/jboss/webbeans/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/TckUtils.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecAssertion.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecVersion.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/AnimalStereotype.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Chunky.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/HornedAnimalDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Synchronous.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Tame.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Whitefish.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Animal.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Barn.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/BlackWidow.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Cat.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Cod.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DaddyLongLegs.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DeadlyAnimal.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DeadlySpider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DefangedTarantula.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/FunnelWeaver.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/LadybirdSpider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Order.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/ScottishFish.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Spider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/SpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Tarantula.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/TrapdoorSpider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Tuna.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/WolfSpider.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/DeploymentProperties.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/EnumerationIterable.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/EnumerationIterator.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/Reflections.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/ResourceLoadingException.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/SimpleResourceLoader.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/Strings.java
Log:
moved from api
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/TckUtils.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/TckUtils.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/TckUtils.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,85 @@
+package org.jboss.webbeans.tck.api;
+
+import java.lang.reflect.Constructor;
+
+import org.jboss.webbeans.tck.api.util.DeploymentProperties;
+import org.jboss.webbeans.tck.api.util.Reflections;
+
+/**
+ *
+ * @author Shane Bryzak
+ *
+ */
+public class TckUtils
+{
+ private static DeploymentProperties deploymentProperties = new DeploymentProperties();
+
+ public static Managers getManagers()
+ {
+ Managers managers = null;
+
+ for (Class<? extends Managers> cls : deploymentProperties.getClasses(Managers.class.getName(), Managers.class))
+ {
+ Constructor<? extends Managers> constructor = Reflections.getConstructor(cls);
+ if (constructor != null)
+ {
+ try
+ {
+ managers = constructor.newInstance();
+ }
+ catch (Exception ex)
+ {
+ // Do something with the exception (log it?)
+ }
+ }
+ }
+
+ return managers;
+ }
+
+ public static Contexts getContexts()
+ {
+ Contexts contexts = null;
+
+ for (Class<? extends Contexts> cls : deploymentProperties.getClasses(Contexts.class.getName(), Contexts.class))
+ {
+ Constructor<? extends Contexts> constructor = Reflections.getConstructor(cls);
+ if (constructor != null)
+ {
+ try
+ {
+ contexts = constructor.newInstance();
+ }
+ catch (Exception ex)
+ {
+ // Do something with the exception (log it?)
+ }
+ }
+ }
+
+ return contexts;
+ }
+
+ public static Beans getBeans()
+ {
+ Beans beans = null;
+
+ for (Class<? extends Beans> cls : deploymentProperties.getClasses(Beans.class.getName(), Beans.class))
+ {
+ Constructor<? extends Beans> constructor = Reflections.getConstructor(cls);
+ if (constructor != null)
+ {
+ try
+ {
+ beans = constructor.newInstance();
+ }
+ catch (Exception ex)
+ {
+ // Do something with the exception (log it?)
+ }
+ }
+ }
+
+ return beans;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/BindingTypeTest.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,186 @@
+package org.jboss.webbeans.tck.test;
+
+import java.lang.reflect.Method;
+
+import javax.webbeans.Current;
+import javax.webbeans.manager.Bean;
+import javax.webbeans.manager.Manager;
+
+import org.jboss.webbeans.tck.api.Managers;
+import org.jboss.webbeans.tck.api.TckUtils;
+import org.jboss.webbeans.tck.api.util.Reflections;
+import org.jboss.webbeans.tck.test.annotations.Synchronous;
+import org.jboss.webbeans.tck.test.beans.Barn;
+import org.jboss.webbeans.tck.test.beans.Cat;
+import org.jboss.webbeans.tck.test.beans.Cod;
+import org.jboss.webbeans.tck.test.beans.DefangedTarantula;
+import org.jboss.webbeans.tck.test.beans.Order;
+import org.jboss.webbeans.tck.test.beans.Spider;
+import org.jboss.webbeans.tck.test.beans.SpiderProducer;
+import org.jboss.webbeans.tck.test.beans.Tarantula;
+import org.jboss.webbeans.tck.test.beans.Tuna;
+
+import org.jboss.webbeans.bean.ProducerMethodBean;
+import org.jboss.webbeans.binding.CurrentBinding;
+
+import org.testng.annotations.Test;
+
+@SpecVersion("2001206")
+public class BindingTypeTest
+{
+
+ @SuppressWarnings("unchecked")
+ @Test @SpecAssertion(section={"2.3.3", "2.3.1"})
+ public void testDefaultBindingTypeDeclaredInJava()
+ {
+ Manager manager = TckUtils.getManagers().createManager();
+
+ Bean<Order> order = TckUtils.getBeans().createSimpleBean(Order.class, manager);
+ assert order.getBindingTypes().size() == 1;
+ order.getBindingTypes().iterator().next().annotationType().equals(Current.class);
+ }
+
+ @Test(groups={"stub", "annotationDefinition"}) @SpecAssertion(section="2.3.2")
+ public void testBindingTypeHasCorrectTarget()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "annotationDefinition"}) @SpecAssertion(section="2.3.2")
+ public void testBindingTypeHasCorrectRetention()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "annotationDefinition"}) @SpecAssertion(section="2.3.2")
+ public void testBindingTypeDeclaresBindingTypeAnnotation()
+ {
+ assert false;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test @SpecAssertion(section="2.3.3")
+ public void testBindingTypesDeclaredInJava()
+ {
+ Manager manager = TckUtils.getManagers().createManager();
+
+ SimpleBean<Cat> cat = SimpleBean.of(Cat.class, manager);
+ assert cat.getBindingTypes().size() == 1;
+ assert Reflections.annotationSetMatches(cat.getBindingTypes(), Synchronous.class);
+ }
+
+ @Test @SpecAssertion(section="2.3.3")
+ public void testMultipleBindingTypes()
+ {
+ Manager manager = TckUtils.getManagers().createManager();
+
+ SimpleBean<?> model = SimpleBean.of(Cod.class, manager);
+ assert model.getBindingTypes().size() == 2;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="2.3.4")
+ public void testBindingTypesDeclaredInXml()
+ {
+ //Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
+ //annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
+ //AnnotatedClass annotatedItem = new SimpleAnnotatedClass(Antelope.class, annotations);
+
+ //SimpleBean<Antelope> antelope = createSimpleBean(Antelope.class, annotatedItem, manager);
+ // assert Reflections.annotationSetMatches(antelope.getBindingTypes(), Asynchronous.class);
+ assert false;
+ }
+
+ @Test(groups={"stub", "webbeansxml"}) @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());
+ //AnnotatedClass<Cat> annotatedItem = new SimpleAnnotatedClass<Cat>(Cat.class, annotations);
+
+ //SimpleBean<Cat> cat = createSimpleBean(Cat.class, annotatedItem, manager);
+ //assert cat.getBindingTypes().size() == 1;
+ //assert cat.getBindingTypes().contains(new AnnotationLiteral<Asynchronous>() {});
+ assert false;
+ }
+
+ @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section="2.3.4")
+ public void testNoBindingTypesDeclaredInXml()
+ {
+ //Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
+ //AnnotatedClass<Cat> annotatedItem = new SimpleAnnotatedClass<Cat>(Cat.class, annotations);
+
+ //SimpleBean<Cat> cat = createSimpleBean(Cat.class, annotatedItem, manager);
+ //assert cat.getBindingTypes().size() == 1;
+ //assert cat.getBindingTypes().contains(new AnnotationLiteral<Synchronous>() {});
+ assert false;
+ }
+
+ @Test(groups={"stub", "webbeansxml"}) @SpecAssertion(section={"2.3.4", "2.3.1"})
+ public void testDefaultBindingTypeDeclaredInXml()
+ {
+ Manager manager = TckUtils.getManagers().createManager();
+
+ SimpleBean<?> model = SimpleBean.of(Tuna.class, manager);
+ assert model.getBindingTypes().size() == 1;
+ assert model.getBindingTypes().contains(new CurrentBinding());
+ assert false;
+ }
+
+
+
+ @Test(groups={"injection", "producerMethod"}) @SpecAssertion(section="2.3.5")
+ public void testFieldInjectedFromProducerMethod() throws Exception
+ {
+ Manager manager = TckUtils.getManagers().createManager();
+
+ SimpleBean<SpiderProducer> spiderProducer = SimpleBean.of(SpiderProducer.class, manager);
+ manager.addBean(spiderProducer);
+ Method method = SpiderProducer.class.getMethod("produceTameTarantula");
+ manager.addBean(ProducerMethodBean.of(method, spiderProducer, manager));
+ Barn barn = SimpleBean.of(Barn.class, manager).create();
+ assert barn.petSpider != null;
+ assert barn.petSpider instanceof DefangedTarantula;
+ }
+
+ @Test(groups={"stub", "injection", "webbeansxml"}) @SpecAssertion(section="2.3.5")
+ public void testFieldWithBindingTypeInXml()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "injection", "webbeansxml"}) @SpecAssertion(section="2.3.5")
+ public void testFieldWithBindingTypeInXmlIgnoresAnnotations()
+ {
+ assert false;
+ }
+
+ @Test(groups={"injection", "producerMethod"})
+ public void testMethodWithBindingAnnotationsOnParametersAreInjected() throws Exception
+ {
+ Manager manager = TckUtils.getManagers().createManager();
+
+ SimpleBean<SpiderProducer> spiderProducer = SimpleBean.of(SpiderProducer.class, manager);
+ manager.addBean(spiderProducer);
+ Method method = SpiderProducer.class.getMethod("produceTameTarantula");
+ manager.addBean(ProducerMethodBean.of(method, spiderProducer, manager));
+ method = SpiderProducer.class.getMethod("produceSpiderFromInjection", Tarantula.class);
+ ProducerMethodBean<Spider> spiderBean = ProducerMethodBean.of(method, spiderProducer, manager);
+ Spider spider = spiderBean.create();
+ assert spider != null;
+ assert spider instanceof DefangedTarantula;
+ }
+
+ @Test(groups={"stub", "injection", "webbeansxml"}) @SpecAssertion(section="2.3.6")
+ public void testMethodWithBindingAnnotationsOnParametersDeclaredInXml()
+ {
+ assert false;
+ }
+
+ @Test(groups={"stub", "injection", "webbeansxml"}) @SpecAssertion(section="2.3.6")
+ public void testMethodWithBindingAnnotationsOnParametersDeclaredInXmlIgnoresAnnotations()
+ {
+ assert false;
+ }
+
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecAssertion.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecAssertion.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecAssertion.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.tck.test;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+(a)Target(ElementType.METHOD)
+@Documented
+public @interface SpecAssertion
+{
+
+ public String[] section();
+
+ public String note() default "";
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecVersion.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecVersion.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/SpecVersion.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.tck.test;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+@Documented
+(a)Target(ElementType.TYPE)
+public @interface SpecVersion {
+
+ String value();
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/AnimalStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/AnimalStereotype.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/AnimalStereotype.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,23 @@
+package org.jboss.webbeans.tck.test.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.RequestScoped;
+import javax.webbeans.Stereotype;
+
+import org.jboss.webbeans.tck.test.beans.Animal;
+
+(a)Stereotype(requiredTypes=Animal.class)
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@RequestScoped
+public @interface AnimalStereotype
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/AnotherDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/AnotherDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/AnotherDeploymentType.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.tck.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.DeploymentType;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+public @interface AnotherDeploymentType
+{
+
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Chunky.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Chunky.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Chunky.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,24 @@
+package org.jboss.webbeans.tck.test.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+public @interface Chunky
+{
+
+ boolean realChunky();
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/HornedAnimalDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/HornedAnimalDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/HornedAnimalDeploymentType.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.tck.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.DeploymentType;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+public @interface HornedAnimalDeploymentType
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Synchronous.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Synchronous.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Synchronous.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.tck.test.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+public @interface Synchronous
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Tame.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Tame.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Tame.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.tck.test.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+public @interface Tame
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Whitefish.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Whitefish.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/annotations/Whitefish.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.tck.test.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+public @interface Whitefish
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Animal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Animal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Animal.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public interface Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Barn.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Barn.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Barn.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,10 @@
+package org.jboss.webbeans.tck.test.beans;
+
+import org.jboss.webbeans.tck.test.annotations.Tame;
+
+public class Barn
+{
+ @Tame
+ public Tarantula petSpider;
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/BlackWidow.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/BlackWidow.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/BlackWidow.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public class BlackWidow extends Spider implements DeadlySpider
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Cat.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Cat.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Cat.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.tck.test.beans;
+
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.test.annotations.Synchronous;
+
+@Production
+@Synchronous
+public class Cat
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Cod.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Cod.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Cod.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.tck.test.beans;
+
+import javax.webbeans.Named;
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.tck.test.annotations.Chunky;
+import org.jboss.webbeans.tck.test.annotations.Whitefish;
+
+@Production
+@Whitefish
+@Chunky(realChunky=true)
+@Named("whitefish")
+public class Cod implements ScottishFish
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DaddyLongLegs.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DaddyLongLegs.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DaddyLongLegs.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public class DaddyLongLegs extends Spider
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DeadlyAnimal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DeadlyAnimal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DeadlyAnimal.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public interface DeadlyAnimal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DeadlySpider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DeadlySpider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DeadlySpider.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public interface DeadlySpider extends DeadlyAnimal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DefangedTarantula.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DefangedTarantula.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/DefangedTarantula.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public class DefangedTarantula extends Tarantula
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/FunnelWeaver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/FunnelWeaver.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/FunnelWeaver.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public class FunnelWeaver<T>
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/LadybirdSpider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/LadybirdSpider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/LadybirdSpider.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.tck.test.beans;
+
+import javax.webbeans.ApplicationScoped;
+
+@ApplicationScoped
+public class LadybirdSpider extends Spider
+{
+
+ public void spinWeb()
+ {
+
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Order.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Order.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Order.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.tck.test.beans;
+
+import javax.webbeans.Production;
+
+@Production
+public class Order
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/ScottishFish.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/ScottishFish.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/ScottishFish.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public interface ScottishFish extends Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Spider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Spider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Spider.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public class Spider implements Animal
+{
+
+ public final void layEggs()
+ {
+
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/SpiderProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/SpiderProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/SpiderProducer.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,104 @@
+package org.jboss.webbeans.tck.test.beans;
+
+import javax.webbeans.Dependent;
+import javax.webbeans.Named;
+import javax.webbeans.Produces;
+import javax.webbeans.Production;
+import javax.webbeans.RequestScoped;
+
+import org.jboss.webbeans.tck.test.annotations.AnimalStereotype;
+import org.jboss.webbeans.tck.test.annotations.AnotherDeploymentType;
+import org.jboss.webbeans.tck.test.annotations.Tame;
+
+@AnotherDeploymentType
+public class SpiderProducer
+{
+
+ private static Spider[] ALL_SPIDERS = { new Tarantula(), new LadybirdSpider(), new DaddyLongLegs() };
+
+ @Produces @Tame public Tarantula produceTameTarantula()
+ {
+ return new DefangedTarantula();
+ }
+
+ @Produces public Tarantula produceTarantula()
+ {
+ return new Tarantula();
+ }
+
+ @Produces @Dependent public final TrapdoorSpider produceTrapdoorSpider()
+ {
+ return new TrapdoorSpider();
+ }
+
+ @Produces @Named("blackWidow") public BlackWidow produceBlackWidow()
+ {
+ return new BlackWidow();
+ }
+
+ @Produces @Named @RequestScoped public DaddyLongLegs produceDaddyLongLegs()
+ {
+ return new DaddyLongLegs();
+ }
+
+ @Produces @Named @Production public LadybirdSpider getLadybirdSpider()
+ {
+ return new LadybirdSpider();
+ }
+
+ @Produces @Named("Shelob") public Tarantula produceShelob()
+ {
+ return null;
+ }
+
+ @Produces @AnimalStereotype public WolfSpider produceWolfSpider()
+ {
+ return new WolfSpider();
+ }
+
+ @Produces public Animal makeASpider()
+ {
+ return new WolfSpider();
+ }
+
+ @Produces public int getWolfSpiderSize()
+ {
+ return 4;
+ }
+
+ @Produces public Spider[] getSpiders()
+ {
+ return ALL_SPIDERS;
+ }
+
+ @Produces public String[] getStrings()
+ {
+ return new String[0];
+ }
+
+ @Produces public <T> FunnelWeaver<T> getFunnelWeaver()
+ {
+ return new FunnelWeaver<T>();
+ }
+
+ @Produces public FunnelWeaver<?> getAnotherFunnelWeaver()
+ {
+ return new FunnelWeaver<Object>();
+ }
+
+ @Produces public FunnelWeaver<Spider> getFunnelWeaverSpider()
+ {
+ return new FunnelWeaver<Spider>();
+ }
+
+ @Produces public Spider getNullSpider()
+ {
+ return null;
+ }
+
+ @Produces public Spider produceSpiderFromInjection(@Tame Tarantula tarantula)
+ {
+ return tarantula;
+ }
+
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Tarantula.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Tarantula.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Tarantula.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public class Tarantula extends Spider implements DeadlySpider
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/TrapdoorSpider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/TrapdoorSpider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/TrapdoorSpider.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public class TrapdoorSpider
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Tuna.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Tuna.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/Tuna.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,17 @@
+package org.jboss.webbeans.tck.test.beans;
+
+import javax.webbeans.RequestScoped;
+
+import org.jboss.webbeans.tck.test.annotations.AnotherDeploymentType;
+
+@AnotherDeploymentType
+@RequestScoped
+public class Tuna
+{
+
+ public String getName()
+ {
+ return "Ophir";
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/WolfSpider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/WolfSpider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/test/beans/WolfSpider.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public class WolfSpider implements Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/DeploymentProperties.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/DeploymentProperties.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/DeploymentProperties.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,148 @@
+package org.jboss.webbeans.tck.api.util;
+
+import static org.jboss.webbeans.tck.api.util.Strings.split;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+/**
+ * Utility class to load deployment properties
+ *
+ * @author Pete Muir
+ */
+public class DeploymentProperties
+{
+ // The resource bundle used to control Web Beans RI deployment
+ public static final String RESOURCE_BUNDLE = "META-INF/web-beans-ri.properties";
+
+ // The class to work from
+ private SimpleResourceLoader resourceLoader;
+
+ /**
+ * Constructor
+ *
+ * @param classLoader The classloader to work on
+ */
+ public DeploymentProperties()
+ {
+ this.resourceLoader = new SimpleResourceLoader();
+ }
+
+ /**
+ * Get a list of possible values for a given key.
+ *
+ * First, System properties are tried, followed by the specified resource
+ * bundle (first in classpath only).
+ *
+ * @param key The key to search for
+ * @return A list of possible values. An empty list is returned if there are
+ * no matches.
+ */
+ public List<String> getPropertyValues(String key)
+ {
+ List<String> values = new ArrayList<String>();
+ addPropertiesFromSystem(key, values);
+ addPropertiesFromResourceBundle(key, values);
+ return values;
+ }
+
+ /**
+ * Adds matches from system properties
+ *
+ * @param key The key to match
+ * @param values The currently found values
+ */
+ private void addPropertiesFromSystem(String key, List<String> values)
+ {
+ addProperty(key, System.getProperty(key), values);
+ }
+
+ /**
+ * Adds matches from detected resource bundles
+ *
+ * @param key The key to match
+ * @param values The currently found values
+ */
+ private void addPropertiesFromResourceBundle(String key, List<String> values)
+ {
+ try
+ {
+ for (URL url : resourceLoader.getResources(RESOURCE_BUNDLE))
+ {
+ Properties properties = new Properties();
+ InputStream propertyStream = url.openStream();
+ try
+ {
+ properties.load(propertyStream);
+ addProperty(key, properties.getProperty(key), values);
+ }
+ finally
+ {
+ if (propertyStream != null)
+ {
+ propertyStream.close();
+ }
+ }
+ }
+ }
+ catch (IOException e)
+ {
+ // No - op, file is optional
+ }
+ }
+
+ /**
+ * Add the property to the set of properties only if it hasn't already been
+ * added
+ *
+ * @param key The key searched for
+ * @param value The value of the property
+ * @param values The currently found values
+ */
+ private void addProperty(String key, String value, List<String> values)
+ {
+ if (value != null)
+ {
+ String[] properties = split(value, ":");
+ for (String property : properties)
+ {
+ values.add(property);
+ }
+
+ }
+ }
+
+ /**
+ * Gets the possible implementation class for a given property for which the
+ * values are classanames
+ *
+ * @param deploymentProperties The deployment properties object to use
+ * @param resourceLoader The resource laoder to use to attempt
+ * @param propertyName The name of the property to load
+ * @return A set of classes specified
+ */
+ @SuppressWarnings("unchecked")
+ public <T> Set<Class<? extends T>> getClasses(String propertyName, Class<T> expectedType)
+ {
+ Set<Class<? extends T>> classes = new HashSet<Class<? extends T>>();
+ for (String className : getPropertyValues(propertyName))
+ {
+ try
+ {
+ classes.add((Class<? extends T>) resourceLoader.classForName(className));
+ }
+ catch (ResourceLoadingException e)
+ {
+ //log.debug("Unable to load class " + className + " for property " + propertyName, e);
+ }
+ }
+ return classes;
+ }
+
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/EnumerationIterable.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/EnumerationIterable.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/EnumerationIterable.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,37 @@
+package org.jboss.webbeans.tck.api.util;
+
+import java.util.Enumeration;
+import java.util.Iterator;
+
+/**
+ * An Enumeration -> Iteratble adaptor
+ *
+ * @author Pete Muir
+ * @see org.jboss.webbeans.util.EnumerationIterator
+ */
+public class EnumerationIterable<T> implements Iterable<T>
+{
+ // The enumeration-iteartor
+ private EnumerationIterator<T> iterator;
+
+ /**
+ * Constructor
+ *
+ * @param enumeration The enumeration
+ */
+ public EnumerationIterable(Enumeration<T> enumeration)
+ {
+ this.iterator = new EnumerationIterator<T>(enumeration);
+ }
+
+ /**
+ * Gets an iterator
+ *
+ * @return The iterator
+ */
+ public Iterator<T> iterator()
+ {
+ return iterator;
+ }
+
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/EnumerationIterator.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/EnumerationIterator.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/EnumerationIterator.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,55 @@
+package org.jboss.webbeans.tck.api.util;
+
+import java.util.Enumeration;
+import java.util.Iterator;
+
+/**
+ * An enumeration -> iterator adapter
+ *
+ * @author Pete Muir
+ */
+@SuppressWarnings("unchecked")
+public class EnumerationIterator<T> implements Iterator<T>
+{
+ // The enumeration
+ private Enumeration e;
+
+ /**
+ * Constructor
+ *
+ * @param e The enumeration
+ */
+ public EnumerationIterator(Enumeration e)
+ {
+ this.e = e;
+ }
+
+ /**
+ * Indicates if there are more items to iterate
+ *
+ * @return True if more, false otherwise
+ */
+ public boolean hasNext()
+ {
+ return e.hasMoreElements();
+ }
+
+ /**
+ * Gets the next item
+ *
+ * @return The next items
+ */
+ public T next()
+ {
+ return (T) e.nextElement();
+ }
+
+ /**
+ * Removes an item. Not supported
+ */
+ public void remove()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/Reflections.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/Reflections.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/Reflections.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,629 @@
+package org.jboss.webbeans.tck.api.util;
+
+import java.beans.Introspector;
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Member;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.webbeans.BindingType;
+import javax.webbeans.ExecutionException;
+
+/**
+ * Utility class for static reflection-type operations
+ *
+ * @author Pete Muir
+ *
+ */
+public class Reflections
+{
+
+ /**
+ * Gets the property name from a getter method
+ *
+ * @param method The getter method
+ * @return The name of the property. Returns null if method wasn't JavaBean
+ * getter-styled
+ */
+ public static String getPropertyName(Method method)
+ {
+ String methodName = method.getName();
+ if (methodName.matches("^(get).*") && method.getParameterTypes().length == 0)
+ {
+ return Introspector.decapitalize(methodName.substring(3));
+ }
+ else if (methodName.matches("^(is).*") && method.getParameterTypes().length == 0)
+ {
+ return Introspector.decapitalize(methodName.substring(2));
+ }
+ else
+ {
+ return null;
+ }
+
+ }
+
+ /**
+ * Checks if class is final
+ *
+ * @param clazz The class to check
+ * @return True if final, false otherwise
+ */
+ public static boolean isFinal(Class<?> clazz)
+ {
+ return Modifier.isFinal(clazz.getModifiers());
+ }
+
+ /**
+ * Checks if member is final
+ *
+ * @param member The member to check
+ * @return True if final, false otherwise
+ */
+ public static boolean isFinal(Member member)
+ {
+ return Modifier.isFinal(member.getModifiers());
+ }
+
+ /**
+ * Checks if type or member is final
+ *
+ * @param type Type or member
+ * @return True if final, false otherwise
+ */
+ public static boolean isTypeOrAnyMethodFinal(Class<?> type)
+ {
+ if (isFinal(type))
+ {
+ return true;
+ }
+ for (Method method : type.getDeclaredMethods())
+ {
+ if (isFinal(method))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Checks if type is primitive
+ *
+ * @param type Type to check
+ * @return True if primitive, false otherwise
+ */
+ public static boolean isPrimitive(Class<?> type)
+ {
+ return type.isPrimitive();
+ }
+
+ /**
+ * Checks if type is static
+ *
+ * @param type Type to check
+ * @return True if static, false otherwise
+ */
+ public static boolean isStatic(Class<?> type)
+ {
+ return Modifier.isStatic(type.getModifiers());
+ }
+
+ /**
+ * Checks if member is static
+ *
+ * @param member Member to check
+ * @return True if static, false otherwise
+ */
+ public static boolean isStatic(Member member)
+ {
+ return Modifier.isStatic(member.getModifiers());
+ }
+
+ public static boolean isTransient(Member member)
+ {
+ return Modifier.isTransient(member.getModifiers());
+ }
+
+ /**
+ * Checks if clazz is abstract
+ *
+ * @param clazz Class to check
+ * @return True if abstract, false otherwise
+ */
+ public static boolean isAbstract(Class<?> clazz)
+ {
+ return Modifier.isAbstract(clazz.getModifiers());
+ }
+
+ /**
+ * Checks if class is a static inner one
+ *
+ * @param clazz Class to check
+ * @return True if static, false otherwise
+ */
+ public static boolean isStaticInnerClass(Class<?> clazz)
+ {
+ return clazz.isMemberClass() && isStatic(clazz);
+ }
+
+ /**
+ * Checks if class is a non-static inner one
+ *
+ * @param clazz Class to Check
+ * @return True if static, false otherwise
+ */
+ public static boolean isNonStaticInnerClass(Class<?> clazz)
+ {
+ return clazz.isMemberClass() && !isStatic(clazz);
+ }
+
+ /**
+ * Gets a constructor with matching parameter types
+ *
+ * @param <T> The type
+ * @param clazz The class
+ * @param parameterTypes The parameter types
+ * @return The matching constructor. Null is returned if none is found
+ */
+ public static <T> Constructor<T> getConstructor(Class<T> clazz, Class<?>... parameterTypes)
+ {
+ try
+ {
+ return clazz.getConstructor(parameterTypes);
+ }
+ catch (NoSuchMethodException e)
+ {
+ return null;
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Error accessing constructor (with parameters " + parameterTypes + ") of " + clazz, e);
+ }
+ }
+
+ /**
+ * Gets all methods with a given annotation
+ *
+ * @param clazz The class the examine
+ * @param annotationType The annotation type to search for
+ * @return A list of matching methods. An empty list is returned if no
+ * matches are found
+ */
+ public static List<Method> getMethods(Class<?> clazz, Class<? extends Annotation> annotationType)
+ {
+ List<Method> methods = new ArrayList<Method>();
+ for (Method method : clazz.getMethods())
+ {
+ if (method.isAnnotationPresent(annotationType))
+ {
+ methods.add(method);
+ }
+ }
+ return methods;
+ }
+
+ /**
+ * Gets all constructors with a given annotation
+ *
+ * @param <T> The type of the class
+ * @param clazz The class
+ * @param annotationType The annotation type
+ * @return A list of matching constructors. An empty list is returned if no
+ * matches are found
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> List<Constructor<T>> getAnnotatedConstructors(Class<? extends T> clazz, Class<? extends Annotation> annotationType)
+ {
+ List<Constructor<T>> constructors = new ArrayList<Constructor<T>>();
+ for (Constructor<?> constructor : clazz.getConstructors())
+ {
+ if (constructor.isAnnotationPresent(annotationType))
+ {
+ constructors.add((Constructor<T>) constructor);
+ }
+ }
+ return constructors;
+ }
+
+ /**
+ * Gets constructors with a given annotated parameter
+ *
+ * @param <T> The type
+ * @param clazz The class
+ * @param parameterAnnotationType The parameter annotation type
+ * @return A list of matching constructors. An empty list is returned if no
+ * matches are found
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> List<Constructor<T>> getConstructorsForAnnotatedParameter(Class<? extends T> clazz, Class<? extends Annotation> parameterAnnotationType)
+ {
+ List<Constructor<T>> constructors = new ArrayList<Constructor<T>>();
+ for (Constructor<?> constructor : clazz.getConstructors())
+ {
+ for (Annotation[] annotations : constructor.getParameterAnnotations())
+ {
+ for (Annotation annotation : annotations)
+ {
+ if (annotation.annotationType().equals(parameterAnnotationType))
+ {
+ constructors.add((Constructor<T>) constructor);
+ }
+ }
+ }
+ }
+ return constructors;
+ }
+
+ /**
+ * Gets constructors with a given meta-annotated parameter
+ *
+ * @param <T> The type
+ * @param clazz The class
+ * @param metaAnnotationType The parameter meta-annotation type
+ * @return A list of matching constructors. An empty list is returned if no
+ * matches are found
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> List<Constructor<T>> getConstructorsForMetaAnnotatedParameter(Class<? extends T> clazz, Class<? extends Annotation> metaAnnotationType)
+ {
+ List<Constructor<T>> constructors = new ArrayList<Constructor<T>>();
+ for (Constructor<?> constructor : clazz.getConstructors())
+ {
+ for (Annotation[] annotations : constructor.getParameterAnnotations())
+ {
+ for (Annotation annotation : annotations)
+ {
+ if (annotation.annotationType().isAnnotationPresent(metaAnnotationType))
+ {
+ constructors.add((Constructor<T>) constructor);
+ }
+ }
+ }
+ }
+ return constructors;
+ }
+
+ /**
+ * Checks if all annotations types are in a given set of annotations
+ *
+ * @param annotations The annotation set
+ * @param annotationTypes The annotation types to match
+ * @return True if match, false otherwise
+ */
+ public static boolean annotationTypeSetMatches(Set<Class<? extends Annotation>> annotations, Class<? extends Annotation>... annotationTypes)
+ {
+ List<Class<? extends Annotation>> annotationTypeList = new ArrayList<Class<? extends Annotation>>();
+ annotationTypeList.addAll(Arrays.asList(annotationTypes));
+ for (Class<? extends Annotation> annotation : annotations)
+ {
+ if (annotationTypeList.contains(annotation))
+ {
+ annotationTypeList.remove(annotation);
+ }
+ else
+ {
+ return false;
+ }
+ }
+ return annotationTypeList.size() == 0;
+ }
+
+ /**
+ * Checks if all annotations are in a given set of annotations
+ *
+ * @param annotations The annotation set
+ * @param annotationTypes The annotations to match
+ * @return True if match, false otherwise
+ */
+ public static boolean annotationSetMatches(Set<Annotation> annotations, Class<? extends Annotation>... annotationTypes)
+ {
+ List<Class<? extends Annotation>> annotationTypeList = new ArrayList<Class<? extends Annotation>>();
+ annotationTypeList.addAll(Arrays.asList(annotationTypes));
+ for (Annotation annotation : annotations)
+ {
+ if (annotationTypeList.contains(annotation.annotationType()))
+ {
+ annotationTypeList.remove(annotation.annotationType());
+ }
+ else
+ {
+ return false;
+ }
+ }
+ return annotationTypeList.size() == 0;
+ }
+
+ /**
+ * Gets the actual type arguments of a class
+ *
+ * @param clazz The class to examine
+ * @return The type arguments
+ */
+ public static Type[] getActualTypeArguments(Class<?> clazz)
+ {
+ if (clazz.getGenericSuperclass() instanceof ParameterizedType)
+ {
+ return ((ParameterizedType) clazz.getGenericSuperclass()).getActualTypeArguments();
+ }
+ else
+ {
+ return new Type[0];
+ }
+ }
+
+ /**
+ * Checks if raw type is array type
+ *
+ * @param rawType The raw type to check
+ * @return True if array, false otherwise
+ */
+ public static boolean isArrayType(Class<?> rawType)
+ {
+ return rawType.isArray();
+ }
+
+ /**
+ * Checks if type is parameterized type
+ *
+ * @param type The type to check
+ * @return True if parameterized, false otherwise
+ */
+ public static boolean isParameterizedType(Class<?> type)
+ {
+ return type.getTypeParameters().length > 0;
+ }
+
+ /**
+ * Invokes a method and wraps exceptions
+ *
+ * @param method The method to invoke
+ * @param instance The instance to invoke on
+ * @param parameters The parameters
+ * @return The return value
+ */
+ public static Object invokeAndWrap(Method method, Object instance, Object... parameters)
+ {
+ try
+ {
+ return method.invoke(instance, parameters);
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new ExecutionException("Error invoking method " + method.getName() + " on " + method.getDeclaringClass(), e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new ExecutionException("Error invoking method " + method.getName() + " on " + method.getDeclaringClass(), e);
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new ExecutionException("Error invoking method " + method.getName() + " on " + method.getDeclaringClass(), e);
+ }
+ }
+
+ /**
+ * Invokes a method and wraps exceptions
+ *
+ * @param methodName The method name to find on the instance and invoke
+ * @param parameterTypes The method name to find on the instance and invoke
+ * @param instance The instance to invoke on
+ * @param parameterValues The parameters values
+ * @return The return value
+ */
+ public static Object invokeAndWrap(String methodName, Class<?>[] parameterTypes, Object instance, Object[] parameterValues)
+ {
+ try
+ {
+ return instance.getClass().getMethod(methodName, parameterTypes).invoke(instance, parameterValues);
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new ExecutionException("Error invoking method " + methodName + " on " + instance.getClass(), e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new ExecutionException("Error invoking method " + methodName + " on " + instance.getClass(), e);
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new ExecutionException("Error invoking method " + methodName + " on " + instance.getClass(), e);
+ }
+ catch (SecurityException e)
+ {
+ throw new ExecutionException("Error invoking method " + methodName + " on " + instance.getClass(), e);
+ }
+ catch (NoSuchMethodException e)
+ {
+ throw new ExecutionException("Error invoking method " + methodName + " on " + instance.getClass(), e);
+ }
+ }
+
+ /**
+ * Sets value of a field and wraps exceptions
+ *
+ * @param field The field to set on
+ * @param target The instance to set on
+ * @param value The value to set
+ */
+ public static void setAndWrap(Field field, Object target, Object value)
+ {
+ try
+ {
+ field.set(target, value);
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new ExecutionException("Error setting field " + field.getName() + " on " + field.getDeclaringClass(), e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new ExecutionException("Error setting field " + field.getName() + " on " + field.getDeclaringClass(), e);
+ }
+ }
+
+ /**
+ * Sets value of a field and wraps exceptions
+ *
+ * @param field The field to set on
+ * @param target The instance to set on
+ * @param value The value to set
+ */
+ public static void setAndWrap(String fieldName, Object target, Object value)
+ {
+ try
+ {
+ target.getClass().getField(fieldName).set(target, value);
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new ExecutionException("Error setting field " + fieldName + " on " + target.getClass(), e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new ExecutionException("Error setting field " + fieldName + " on " + target.getClass(), e);
+ }
+ catch (SecurityException e)
+ {
+ throw new ExecutionException("Error setting field " + fieldName + " on " + target.getClass(), e);
+ }
+ catch (NoSuchFieldException e)
+ {
+ throw new ExecutionException("Error setting field " + fieldName + " on " + target.getClass(), e);
+ }
+ }
+
+ /**
+ * Gets value of a field and wraps exceptions
+ *
+ * @param field The field to set on
+ * @param target The instance to set on
+ * @return The value to set
+ */
+ public static Object getAndWrap(Field field, Object target)
+ {
+ try
+ {
+ return field.get(target);
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new ExecutionException("Error getting field " + field.getName() + " on " + field.getDeclaringClass(), e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new ExecutionException("Error getting field " + field.getName() + " on " + field.getDeclaringClass(), e);
+ }
+ }
+
+ /**
+ * Looks up a method in the type hierarchy of an instance
+ *
+ * @param method The method to look for
+ * @param instance The instance to start from
+ * @return The method found, or an NoSuchMethodException if it is not found
+ */
+ public static Method lookupMethod(Method method, Object instance)
+ {
+ for (Class<? extends Object> clazz = instance.getClass(); clazz != null; clazz = clazz.getSuperclass())
+ {
+ try
+ {
+ Method targetMethod = clazz.getDeclaredMethod(method.getName(), method.getParameterTypes());
+ if (!targetMethod.isAccessible())
+ {
+ targetMethod.setAccessible(true);
+ }
+ return targetMethod;
+ }
+ catch (NoSuchMethodException nsme)
+ {
+ // Expected, nothing to see here.
+ }
+ }
+ throw new IllegalArgumentException("Method " + method.getName() + " not implemented by instance");
+ }
+
+ /**
+ * Indicates if an instance is a Javassist proxy
+ *
+ * @param instance The instance to examine
+ * @return True if proxy, false otherwise
+ */
+ public static boolean isProxy(Object instance)
+ {
+ return instance.getClass().getName().indexOf("_$$_javassist_") > 0;
+ }
+
+ /**
+ * Gets the type hierarchy for a class
+ *
+ * A recursive function that adds the class to the set of type and then calls
+ * itself with the suprerclass as paramater until the top of the hierarchy is
+ * reached. For each steps, adds all interfaces of the class to the set.
+ * Since the data structure is a set, duplications are eliminated
+ *
+ * @param clazz The class to examine
+ * @return The set of classes and interfaces in the hierarchy
+ * @see #getTypeHierachy(Class, Set)
+ */
+ public static Set<Class<?>> getTypeHierachy(Class<?> clazz)
+ {
+ Set<Class<?>> classes = new HashSet<Class<?>>();
+ getTypeHierachy(clazz, classes);
+ return classes;
+ }
+
+ /**
+ * Gets the flattened type hierarchy for a class, including all super classes
+ * and the entire interface type hierarchy
+ *
+ * @param clazz the class to examine
+ * @param classes the set of types
+ */
+ public static void getTypeHierachy(Class<?> clazz, Set<? super Class<?>> classes)
+ {
+ if (clazz != null)
+ {
+ classes.add(clazz);
+ getTypeHierachy(clazz.getSuperclass(), classes);
+ for (Class<?> c : clazz.getInterfaces())
+ {
+ getTypeHierachy(c, classes);
+ }
+ }
+ }
+
+ /**
+ * Checks the bindingType to make sure the annotation was declared properly
+ * as a binding type (annotated with @BindingType).
+ *
+ * @param bindingType The binding type to check
+ * @return true only if the annotation is really a binding type
+ */
+ public static boolean isBindingType(Annotation bindingType)
+ {
+ boolean isBindingAnnotation = false;
+ if (bindingType.annotationType().isAnnotationPresent(BindingType.class))
+ {
+ isBindingAnnotation = true;
+ }
+ return isBindingAnnotation;
+ }
+
+ public static boolean isSerializable(Class<?> clazz)
+ {
+ return getTypeHierachy(clazz).contains(Serializable.class);
+ }
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/ResourceLoadingException.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/ResourceLoadingException.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/ResourceLoadingException.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,54 @@
+package org.jboss.webbeans.tck.api.util;
+
+import javax.webbeans.ExecutionException;
+
+/**
+ * Exception thrown when errors occur while loading resource
+ *
+ * @author Pete Muir
+ *
+ */
+public class ResourceLoadingException extends ExecutionException
+{
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructor
+ */
+ public ResourceLoadingException()
+ {
+ super();
+ }
+
+ /**
+ * Constructor
+ *
+ * @param message The message
+ * @param throwable The exception
+ */
+ public ResourceLoadingException(String message, Throwable throwable)
+ {
+ super(message, throwable);
+ }
+
+ /**
+ * Constructor
+ *
+ * @param message The message
+ */
+ public ResourceLoadingException(String message)
+ {
+ super(message);
+ }
+
+ /**
+ * Constructor
+ *
+ * @param throwable The exception
+ */
+ public ResourceLoadingException(Throwable throwable)
+ {
+ super(throwable);
+ }
+
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/SimpleResourceLoader.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/SimpleResourceLoader.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/SimpleResourceLoader.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,43 @@
+package org.jboss.webbeans.tck.api.util;
+
+import java.io.IOException;
+import java.net.URL;
+
+public class SimpleResourceLoader
+{
+
+ public Class<?> classForName(String name)
+ {
+
+ try
+ {
+ return Class.forName(name);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new ResourceLoadingException(e);
+ }
+ catch (NoClassDefFoundError e)
+ {
+ throw new ResourceLoadingException(e);
+ }
+ }
+
+ public URL getResource(String name)
+ {
+ return getClass().getResource(name);
+ }
+
+ public Iterable<URL> getResources(String name)
+ {
+ try
+ {
+ return new EnumerationIterable<URL>(getClass().getClassLoader().getResources(name));
+ }
+ catch (IOException e)
+ {
+ throw new ResourceLoadingException(e);
+ }
+ }
+
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/Strings.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/Strings.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/impl/util/Strings.java 2009-01-09 11:57:21 UTC (rev 846)
@@ -0,0 +1,25 @@
+package org.jboss.webbeans.tck.api.util;
+
+import java.util.StringTokenizer;
+
+public class Strings
+{
+ public static String[] split(String strings, String delims)
+ {
+ if (strings == null)
+ {
+ return new String[0];
+ }
+ else
+ {
+ StringTokenizer tokens = new StringTokenizer(strings, delims);
+ String[] result = new String[tokens.countTokens()];
+ int i = 0;
+ while (tokens.hasMoreTokens())
+ {
+ result[i++] = tokens.nextToken();
+ }
+ return result;
+ }
+ }
+}
16 years
[webbeans-commits] Webbeans SVN: r845 - tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-01-09 06:56:42 -0500 (Fri, 09 Jan 2009)
New Revision: 845
Removed:
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TckUtils.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/util/
Modified:
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java
Log:
moved to impl
Modified: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java 2009-01-09 11:49:39 UTC (rev 844)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Beans.java 2009-01-09 11:56:42 UTC (rev 845)
@@ -1,5 +1,7 @@
package org.jboss.webbeans.tck.api;
+import javax.webbeans.manager.Manager;
+
/**
* Provides Bean related operations.
*
@@ -7,5 +9,6 @@
*/
public interface Beans
{
+ <T> T createSimpleBean(Class<T> clazz, Manager manager);
}
Deleted: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TckUtils.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TckUtils.java 2009-01-09 11:49:39 UTC (rev 844)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/TckUtils.java 2009-01-09 11:56:42 UTC (rev 845)
@@ -1,62 +0,0 @@
-package org.jboss.webbeans.tck.api;
-
-import java.lang.reflect.Constructor;
-
-import org.jboss.webbeans.tck.api.util.DeploymentProperties;
-import org.jboss.webbeans.tck.api.util.Reflections;
-
-/**
- *
- * @author Shane Bryzak
- *
- */
-public class TckUtils
-{
- private static DeploymentProperties deploymentProperties = new DeploymentProperties();
-
- public static Managers getManagers()
- {
- Managers managers = null;
-
- for (Class<? extends Managers> cls : deploymentProperties.getClasses(Managers.class.getName(), Managers.class))
- {
- Constructor<? extends Managers> constructor = Reflections.getConstructor(cls);
- if (constructor != null)
- {
- try
- {
- managers = constructor.newInstance();
- }
- catch (Exception ex)
- {
- // Do something with the exception (log it?)
- }
- }
- }
-
- return managers;
- }
-
- public static Contexts getContexts()
- {
- Contexts contexts = null;
-
- for (Class<? extends Contexts> cls : deploymentProperties.getClasses(Contexts.class.getName(), Contexts.class))
- {
- Constructor<? extends Contexts> constructor = Reflections.getConstructor(cls);
- if (constructor != null)
- {
- try
- {
- contexts = constructor.newInstance();
- }
- catch (Exception ex)
- {
- // Do something with the exception (log it?)
- }
- }
- }
-
- return contexts;
- }
-}
16 years
[webbeans-commits] Webbeans SVN: r844 - tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-09 06:49:39 -0500 (Fri, 09 Jan 2009)
New Revision: 844
Modified:
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Cat.java
Log:
fix build
Modified: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Cat.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Cat.java 2009-01-09 08:07:32 UTC (rev 843)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Cat.java 2009-01-09 11:49:39 UTC (rev 844)
@@ -2,7 +2,7 @@
import javax.webbeans.Production;
-import org.jboss.webbeans.test.annotations.Synchronous;
+import org.jboss.webbeans.tck.test.annotations.Synchronous;
@Production
@Synchronous
16 years
[webbeans-commits] Webbeans SVN: r843 - in tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test: annotations and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-01-09 03:07:32 -0500 (Fri, 09 Jan 2009)
New Revision: 843
Added:
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/SpecAssertion.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/SpecVersion.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/AnimalStereotype.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/Chunky.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/Synchronous.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/Tame.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/Whitefish.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Animal.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Barn.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/BlackWidow.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Cat.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Cod.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/DaddyLongLegs.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/DeadlyAnimal.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/DeadlySpider.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/DefangedTarantula.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/FunnelWeaver.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/LadybirdSpider.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Order.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/ScottishFish.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Spider.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/SpiderProducer.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Tarantula.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/TrapdoorSpider.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Tuna.java
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/WolfSpider.java
Removed:
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/AbstractTest.java
Log:
TCK test beans
Deleted: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/AbstractTest.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/AbstractTest.java 2009-01-09 07:26:24 UTC (rev 842)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/AbstractTest.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -1,54 +0,0 @@
-package org.jboss.webbeans.tck.test;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.Arrays;
-
-import javax.webbeans.Production;
-import javax.webbeans.Standard;
-import javax.webbeans.manager.Manager;
-
-import org.jboss.webbeans.tck.api.Managers;
-import org.jboss.webbeans.tck.test.annotations.AnotherDeploymentType;
-import org.jboss.webbeans.tck.test.annotations.HornedAnimalDeploymentType;
-import org.testng.annotations.BeforeMethod;
-
-public class AbstractTest
-{
- protected Manager manager;
-
- public static boolean visited = false;
-
- @BeforeMethod
- public final void before()
- {
- manager = Managers.instance().createManager();
- addStandardDeploymentTypesForTests();
- }
-
- @SuppressWarnings("unchecked")
- protected void addStandardDeploymentTypesForTests()
- {
- Managers.instance().setEnabledDeploymentTypes(Arrays.asList(Standard.class, Production.class, AnotherDeploymentType.class, HornedAnimalDeploymentType.class));
- }
-
-// protected <T> void addToEjbCache(Class<T> clazz)
-// {
-// manager.getEjbDescriptorCache().add(new MockEjbDescriptor<T>(clazz));
-// }
-
- protected byte[] serialize(Object instance) throws IOException {
- ByteArrayOutputStream bytes = new ByteArrayOutputStream();
- ObjectOutputStream out = new ObjectOutputStream(bytes);
- out.writeObject(instance);
- return bytes.toByteArray();
- }
-
- protected Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException {
- ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
- return in.readObject();
- }
-}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/SpecAssertion.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/SpecAssertion.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/SpecAssertion.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.tck.test;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+(a)Target(ElementType.METHOD)
+@Documented
+public @interface SpecAssertion
+{
+
+ public String[] section();
+
+ public String note() default "";
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/SpecVersion.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/SpecVersion.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/SpecVersion.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.tck.test;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+@Documented
+(a)Target(ElementType.TYPE)
+public @interface SpecVersion {
+
+ String value();
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/AnimalStereotype.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/AnimalStereotype.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/AnimalStereotype.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,23 @@
+package org.jboss.webbeans.tck.test.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.RequestScoped;
+import javax.webbeans.Stereotype;
+
+import org.jboss.webbeans.tck.test.beans.Animal;
+
+(a)Stereotype(requiredTypes=Animal.class)
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@RequestScoped
+public @interface AnimalStereotype
+{
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/Chunky.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/Chunky.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/Chunky.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,24 @@
+package org.jboss.webbeans.tck.test.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+public @interface Chunky
+{
+
+ boolean realChunky();
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/Synchronous.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/Synchronous.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/Synchronous.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.tck.test.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+public @interface Synchronous
+{
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/Tame.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/Tame.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/Tame.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.tck.test.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+public @interface Tame
+{
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/Whitefish.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/Whitefish.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/annotations/Whitefish.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.tck.test.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+public @interface Whitefish
+{
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Animal.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Animal.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Animal.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public interface Animal
+{
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Barn.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Barn.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Barn.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,10 @@
+package org.jboss.webbeans.tck.test.beans;
+
+import org.jboss.webbeans.tck.test.annotations.Tame;
+
+public class Barn
+{
+ @Tame
+ public Tarantula petSpider;
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/BlackWidow.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/BlackWidow.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/BlackWidow.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public class BlackWidow extends Spider implements DeadlySpider
+{
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Cat.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Cat.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Cat.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.tck.test.beans;
+
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.test.annotations.Synchronous;
+
+@Production
+@Synchronous
+public class Cat
+{
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Cod.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Cod.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Cod.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.tck.test.beans;
+
+import javax.webbeans.Named;
+import javax.webbeans.Production;
+
+import org.jboss.webbeans.tck.test.annotations.Chunky;
+import org.jboss.webbeans.tck.test.annotations.Whitefish;
+
+@Production
+@Whitefish
+@Chunky(realChunky=true)
+@Named("whitefish")
+public class Cod implements ScottishFish
+{
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/DaddyLongLegs.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/DaddyLongLegs.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/DaddyLongLegs.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public class DaddyLongLegs extends Spider
+{
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/DeadlyAnimal.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/DeadlyAnimal.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/DeadlyAnimal.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public interface DeadlyAnimal
+{
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/DeadlySpider.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/DeadlySpider.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/DeadlySpider.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public interface DeadlySpider extends DeadlyAnimal
+{
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/DefangedTarantula.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/DefangedTarantula.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/DefangedTarantula.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public class DefangedTarantula extends Tarantula
+{
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/FunnelWeaver.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/FunnelWeaver.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/FunnelWeaver.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public class FunnelWeaver<T>
+{
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/LadybirdSpider.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/LadybirdSpider.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/LadybirdSpider.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.tck.test.beans;
+
+import javax.webbeans.ApplicationScoped;
+
+@ApplicationScoped
+public class LadybirdSpider extends Spider
+{
+
+ public void spinWeb()
+ {
+
+ }
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Order.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Order.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Order.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.tck.test.beans;
+
+import javax.webbeans.Production;
+
+@Production
+public class Order
+{
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/ScottishFish.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/ScottishFish.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/ScottishFish.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public interface ScottishFish extends Animal
+{
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Spider.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Spider.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Spider.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public class Spider implements Animal
+{
+
+ public final void layEggs()
+ {
+
+ }
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/SpiderProducer.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/SpiderProducer.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/SpiderProducer.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,104 @@
+package org.jboss.webbeans.tck.test.beans;
+
+import javax.webbeans.Dependent;
+import javax.webbeans.Named;
+import javax.webbeans.Produces;
+import javax.webbeans.Production;
+import javax.webbeans.RequestScoped;
+
+import org.jboss.webbeans.tck.test.annotations.AnimalStereotype;
+import org.jboss.webbeans.tck.test.annotations.AnotherDeploymentType;
+import org.jboss.webbeans.tck.test.annotations.Tame;
+
+@AnotherDeploymentType
+public class SpiderProducer
+{
+
+ private static Spider[] ALL_SPIDERS = { new Tarantula(), new LadybirdSpider(), new DaddyLongLegs() };
+
+ @Produces @Tame public Tarantula produceTameTarantula()
+ {
+ return new DefangedTarantula();
+ }
+
+ @Produces public Tarantula produceTarantula()
+ {
+ return new Tarantula();
+ }
+
+ @Produces @Dependent public final TrapdoorSpider produceTrapdoorSpider()
+ {
+ return new TrapdoorSpider();
+ }
+
+ @Produces @Named("blackWidow") public BlackWidow produceBlackWidow()
+ {
+ return new BlackWidow();
+ }
+
+ @Produces @Named @RequestScoped public DaddyLongLegs produceDaddyLongLegs()
+ {
+ return new DaddyLongLegs();
+ }
+
+ @Produces @Named @Production public LadybirdSpider getLadybirdSpider()
+ {
+ return new LadybirdSpider();
+ }
+
+ @Produces @Named("Shelob") public Tarantula produceShelob()
+ {
+ return null;
+ }
+
+ @Produces @AnimalStereotype public WolfSpider produceWolfSpider()
+ {
+ return new WolfSpider();
+ }
+
+ @Produces public Animal makeASpider()
+ {
+ return new WolfSpider();
+ }
+
+ @Produces public int getWolfSpiderSize()
+ {
+ return 4;
+ }
+
+ @Produces public Spider[] getSpiders()
+ {
+ return ALL_SPIDERS;
+ }
+
+ @Produces public String[] getStrings()
+ {
+ return new String[0];
+ }
+
+ @Produces public <T> FunnelWeaver<T> getFunnelWeaver()
+ {
+ return new FunnelWeaver<T>();
+ }
+
+ @Produces public FunnelWeaver<?> getAnotherFunnelWeaver()
+ {
+ return new FunnelWeaver<Object>();
+ }
+
+ @Produces public FunnelWeaver<Spider> getFunnelWeaverSpider()
+ {
+ return new FunnelWeaver<Spider>();
+ }
+
+ @Produces public Spider getNullSpider()
+ {
+ return null;
+ }
+
+ @Produces public Spider produceSpiderFromInjection(@Tame Tarantula tarantula)
+ {
+ return tarantula;
+ }
+
+}
\ No newline at end of file
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Tarantula.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Tarantula.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Tarantula.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public class Tarantula extends Spider implements DeadlySpider
+{
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/TrapdoorSpider.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/TrapdoorSpider.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/TrapdoorSpider.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public class TrapdoorSpider
+{
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Tuna.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Tuna.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/Tuna.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,17 @@
+package org.jboss.webbeans.tck.test.beans;
+
+import javax.webbeans.RequestScoped;
+
+import org.jboss.webbeans.tck.test.annotations.AnotherDeploymentType;
+
+@AnotherDeploymentType
+@RequestScoped
+public class Tuna
+{
+
+ public String getName()
+ {
+ return "Ophir";
+ }
+
+}
Added: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/WolfSpider.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/WolfSpider.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/test/beans/WolfSpider.java 2009-01-09 08:07:32 UTC (rev 843)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.tck.test.beans;
+
+public class WolfSpider implements Animal
+{
+
+}
16 years
[webbeans-commits] Webbeans SVN: r842 - tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-01-09 02:26:24 -0500 (Fri, 09 Jan 2009)
New Revision: 842
Removed:
tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Configurable.java
Log:
not required
Deleted: tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Configurable.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Configurable.java 2009-01-09 07:25:50 UTC (rev 841)
+++ tck/trunk/api/src/main/java/org/jboss/webbeans/tck/api/Configurable.java 2009-01-09 07:26:24 UTC (rev 842)
@@ -1,14 +0,0 @@
-package org.jboss.webbeans.tck.api;
-
-/**
- *
- * @author Shane Bryzak
- *
- */
-public class Configurable
-{
- protected static Object getInstance(Class<?> cls)
- {
- return null;
- }
-}
16 years