Author: dan.j.allen
Date: 2009-07-17 02:21:32 -0400 (Fri, 17 Jul 2009)
New Revision: 3073
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/AbstractAntelope.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/FriendlyAntelope.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/enterprise/EnterpriseBindingDefinitionTest.java
Log:
update to 20090625 spec assertions
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/AbstractAntelope.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/AbstractAntelope.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/AbstractAntelope.java 2009-07-17
06:21:32 UTC (rev 3073)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.definition.bean;
+
+public abstract class AbstractAntelope implements Animal
+{
+ public abstract String getGreeting();
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java 2009-07-17
05:39:03 UTC (rev 3072)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java 2009-07-17
06:21:32 UTC (rev 3073)
@@ -14,7 +14,7 @@
import org.testng.annotations.Test;
/**
- * This test class should be used for common assertions about Web Beans
+ * This test class should be used for common assertions about managed beans (not session
beans)
*
* @author Pete Muir
*
@@ -61,10 +61,9 @@
assert
getBeans(RedSnapper.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
- @Test
+ @Test(groups = "rewrite")
@SpecAssertions({
- @SpecAssertion(section = "2", id = "review"), // deployment
types removed from spec
- @SpecAssertion(section = "review", id = "review"), //
deployment types removed from spec
+ @SpecAssertion(section = "2", id = "d"),
@SpecAssertion(section = "3.1.3", id = "bc"),
@SpecAssertion(section = "11.1", id = "ba")
})
@@ -76,6 +75,7 @@
@Test(groups = "producerMethod")
@SpecAssertions({
+ @SpecAssertion(section = "2.2.1", id = "j"),
@SpecAssertion(section = "5.3.4", id = "ba"),
@SpecAssertion(section = "11.1", id = "bd")
})
@@ -96,7 +96,7 @@
@SpecAssertion(section = "2.2.1", id = "a"),
@SpecAssertion(section = "2.2.1", id = "d"),
@SpecAssertion(section = "2.2.1", id = "e"),
- @SpecAssertion(section = "2.2", id = "review"),
+ @SpecAssertion(section = "2.2", id = "l"),
@SpecAssertion(section = "11.1", id = "ba")
})
public void testBeanTypes()
@@ -121,14 +121,27 @@
Bean<Tarantula> bean = getBeans(Tarantula.class).iterator().next();
Tarantula tarantula =
getCurrentManager().getContext(bean.getScopeType()).get(bean);
- Spider spider = (Spider) tarantula;
- Animal animal = (Animal) tarantula;
- Object obj = (Object) tarantula;
- DeadlySpider deadlySpider = (DeadlySpider) tarantula;
- DeadlyAnimal deadlyAnimal = (DeadlyAnimal) tarantula;
+ Spider spider = tarantula;
+ Animal animal = tarantula;
+ Object obj = tarantula;
+ DeadlySpider deadlySpider = tarantula;
+ DeadlyAnimal deadlyAnimal = tarantula;
}
-
+
@Test
+ @SpecAssertion(section = "2.2.1", id = "c")
+ public void testAbstractApiType()
+ {
+ assert getBeans(FriendlyAntelope.class).size() == 1;
+ Bean<FriendlyAntelope> bean =
getBeans(FriendlyAntelope.class).iterator().next();
+ assert bean.getTypes().size() == 4;
+ assert bean.getTypes().contains(FriendlyAntelope.class);
+ assert bean.getTypes().contains(AbstractAntelope.class);
+ assert bean.getTypes().contains(Animal.class);
+ assert bean.getTypes().contains(Object.class);
+ }
+
+ @Test
@SpecAssertion(section = "2.2.1", id = "d")
public void testFinalApiType()
{
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/FriendlyAntelope.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/FriendlyAntelope.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/FriendlyAntelope.java 2009-07-17
06:21:32 UTC (rev 3073)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.definition.bean;
+
+public class FriendlyAntelope extends AbstractAntelope
+{
+ @Override
+ public String getGreeting()
+ {
+ return "Chao!";
+ }
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-07-17
05:39:03 UTC (rev 3072)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-07-17
06:21:32 UTC (rev 3073)
@@ -6,7 +6,6 @@
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
-import org.apache.commons.httpclient.methods.GetMethod;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -17,7 +16,7 @@
import org.testng.annotations.Test;
/**
- * Spec version: 20090519
+ * Spec version: 20090625
*/
@Artifact
public class BindingDefinitionTest extends AbstractJSR299Test
@@ -87,7 +86,7 @@
@SpecAssertion(section = "2.3.5", id = "a")
public void testFieldInjectedFromProducerMethod() throws Exception
{
- Bean<Barn> barnBean = getBeans(Barn.class).iterator().next();
+ Bean<Barn> barnBean = getBeans(Barn.class).iterator().next();
Barn barn =
barnBean.create(getCurrentManager().createCreationalContext(barnBean));
assert barn.petSpider != null;
assert barn.petSpider instanceof DefangedTarantula;
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/enterprise/EnterpriseBindingDefinitionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/enterprise/EnterpriseBindingDefinitionTest.java 2009-07-17
05:39:03 UTC (rev 3072)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/enterprise/EnterpriseBindingDefinitionTest.java 2009-07-17
06:21:32 UTC (rev 3073)
@@ -14,7 +14,11 @@
import org.testng.annotations.Test;
/**
- * Spec version: 20090519
+ * TODO This test specifically tests session beans even though the assertions are true
+ * for all managed beans. So likely there should be a parallel set of tests for session
+ * and other managed beans.
+ *
+ * Spec version: 20090625
*/
@Artifact
@IntegrationTest
@@ -35,5 +39,5 @@
{
Set<? extends Annotation> bindings = getBeans(EnglishBorderCollieLocal.class,
new HairyBinding(false)).iterator().next().getBindings();
assert annotationSetMatches(bindings, Any.class, Hairy.class);
- }
+ }
}