[webbeans-commits] Webbeans SVN: r975 - in tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests: definition and 1 other directory.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Thu Jan 15 00:41:46 EST 2009
Author: shane.bryzak at jboss.com
Date: 2009-01-15 00:41:46 -0500 (Thu, 15 Jan 2009)
New Revision: 975
Added:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/BindingTypeTest.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/BindingTypeTest.java
Log:
moved test
Deleted: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/BindingTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/BindingTypeTest.java 2009-01-15 04:49:52 UTC (rev 974)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/BindingTypeTest.java 2009-01-15 05:41:46 UTC (rev 975)
@@ -1,168 +0,0 @@
-package org.jboss.webbeans.tck.tests;
-
-
-import java.lang.reflect.Method;
-
-import javax.webbeans.Production;
-import javax.webbeans.manager.Bean;
-
-import org.jboss.webbeans.tck.impl.SpecAssertion;
-import org.jboss.webbeans.tck.impl.SpecVersion;
-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.tck.impl.test.binding.CurrentBinding;
-import org.jboss.webbeans.tck.impl.util.Reflections;
-import org.testng.annotations.Test;
-
- at SpecVersion("20081206")
-public class BindingTypeTest extends AbstractTest
-{
-
- @Test @SpecAssertion(section={"2.3.3", "2.3.1"})
- public void testDefaultBindingTypeDeclaredInJava()
- {
- Bean<Order> order = getSimpleBean(Order.class);
- assert order.getBindings().size() == 1;
- order.getBindings().iterator().next().annotationType().equals(Production.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()
- {
- Bean<Cat> cat = getSimpleBean(Cat.class);
- assert cat.getBindings().size() == 1;
- assert Reflections.annotationSetMatches(cat.getBindings(), Synchronous.class);
- }
-
- @Test @SpecAssertion(section="2.3.3")
- public void testMultipleBindingTypes()
- {
- Bean<?> model = getSimpleBean(Cod.class);
- assert model.getBindings().size() == 2;
- }
-
- @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()
- {
- Bean<?> model = getSimpleBean(Tuna.class);
- assert model.getBindings().size() == 1;
- assert model.getBindings().contains(new CurrentBinding());
- assert false;
- }
-
- @Test(groups={"injection", "producerMethod"}) @SpecAssertion(section="2.3.5")
- public void testFieldInjectedFromProducerMethod() throws Exception
- {
- Bean<SpiderProducer> spiderProducer = getSimpleBean(SpiderProducer.class);
- manager.addBean(spiderProducer);
- Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- manager.addBean(getProducerMethodBean(method, spiderProducer));
- Barn barn = getSimpleBean(Barn.class).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;
- }
-
- @SuppressWarnings("unchecked")
- @Test(groups={"injection", "producerMethod"})
- public void testMethodWithBindingAnnotationsOnParametersAreInjected() throws Exception
- {
- Bean<SpiderProducer> spiderProducer = getSimpleBean(SpiderProducer.class);
- manager.addBean(spiderProducer);
- Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- manager.addBean(getProducerMethodBean(method, spiderProducer));
- method = SpiderProducer.class.getMethod("produceSpiderFromInjection", Tarantula.class);
- Bean<Spider> spiderBean = (Bean<Spider>) getProducerMethodBean(method, spiderProducer);
- 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/tests/definition/BindingTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/BindingTypeTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/definition/BindingTypeTest.java 2009-01-15 05:41:46 UTC (rev 975)
@@ -0,0 +1,169 @@
+package org.jboss.webbeans.tck.tests.definition;
+
+
+import java.lang.reflect.Method;
+
+import javax.webbeans.Production;
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.tck.impl.SpecAssertion;
+import org.jboss.webbeans.tck.impl.SpecVersion;
+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.tck.impl.test.binding.CurrentBinding;
+import org.jboss.webbeans.tck.impl.util.Reflections;
+import org.jboss.webbeans.tck.tests.AbstractTest;
+import org.testng.annotations.Test;
+
+ at SpecVersion("20081206")
+public class BindingTypeTest extends AbstractTest
+{
+
+ @Test @SpecAssertion(section={"2.3.3", "2.3.1"})
+ public void testDefaultBindingTypeDeclaredInJava()
+ {
+ Bean<Order> order = getSimpleBean(Order.class);
+ assert order.getBindings().size() == 1;
+ order.getBindings().iterator().next().annotationType().equals(Production.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()
+ {
+ Bean<Cat> cat = getSimpleBean(Cat.class);
+ assert cat.getBindings().size() == 1;
+ assert Reflections.annotationSetMatches(cat.getBindings(), Synchronous.class);
+ }
+
+ @Test @SpecAssertion(section="2.3.3")
+ public void testMultipleBindingTypes()
+ {
+ Bean<?> model = getSimpleBean(Cod.class);
+ assert model.getBindings().size() == 2;
+ }
+
+ @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()
+ {
+ Bean<?> model = getSimpleBean(Tuna.class);
+ assert model.getBindings().size() == 1;
+ assert model.getBindings().contains(new CurrentBinding());
+ assert false;
+ }
+
+ @Test(groups={"injection", "producerMethod"}) @SpecAssertion(section="2.3.5")
+ public void testFieldInjectedFromProducerMethod() throws Exception
+ {
+ Bean<SpiderProducer> spiderProducer = getSimpleBean(SpiderProducer.class);
+ manager.addBean(spiderProducer);
+ Method method = SpiderProducer.class.getMethod("produceTameTarantula");
+ manager.addBean(getProducerMethodBean(method, spiderProducer));
+ Barn barn = getSimpleBean(Barn.class).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;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test(groups={"injection", "producerMethod"})
+ public void testMethodWithBindingAnnotationsOnParametersAreInjected() throws Exception
+ {
+ Bean<SpiderProducer> spiderProducer = getSimpleBean(SpiderProducer.class);
+ manager.addBean(spiderProducer);
+ Method method = SpiderProducer.class.getMethod("produceTameTarantula");
+ manager.addBean(getProducerMethodBean(method, spiderProducer));
+ method = SpiderProducer.class.getMethod("produceSpiderFromInjection", Tarantula.class);
+ Bean<Spider> spiderBean = (Bean<Spider>) getProducerMethodBean(method, spiderProducer);
+ 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
More information about the weld-commits
mailing list