Author: shane.bryzak(a)jboss.com
Date: 2009-03-09 04:10:44 -0400 (Mon, 09 Mar 2009)
New Revision: 1867
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/OrderProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/BeanWithInjectedField_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/Farmer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/ParameterizedTypeInjectionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/wildcard/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/wildcard/BeanWithInjectedField_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/wildcard/Farmer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/wildcard/WildcardTypeInjectionTest.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/bean/Tarantula.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/Order.java
tck/trunk/impl/src/main/resources/README.TXT
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
some section 2 tests
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-03-09
01:11:51 UTC (rev 1866)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java 2009-03-09
08:10:44 UTC (rev 1867)
@@ -85,8 +85,9 @@
@SpecAssertions({
@SpecAssertion(section = "3.2.2", id = "a"),
@SpecAssertion(section = "2.2", id = "a"),
- @SpecAssertion(section = "2.2", id = "d"),
@SpecAssertion(section = "2.2", id = "e"),
+ @SpecAssertion(section = "2.2", id = "h"),
+ @SpecAssertion(section = "2.2", id = "i"),
@SpecAssertion(section = "2.2", id = "k"),
@SpecAssertion(section = "2.2", id = "l")
})
@@ -104,6 +105,22 @@
}
@Test
+ @SpecAssertion(section = "2.2", id = "m")
+ @SuppressWarnings("unused")
+ public void testBeanClientCanCastBeanInstanceToAnyBeanType()
+ {
+ assert getCurrentManager().resolveByType(Tarantula.class).size() == 1;
+ Bean<Tarantula> bean =
getCurrentManager().resolveByType(Tarantula.class).iterator().next();
+ Tarantula tarantula = getCurrentManager().getInstance(bean);
+
+ Spider spider = (Spider) tarantula;
+ Animal animal = (Animal) tarantula;
+ Object obj = (Object) tarantula;
+ DeadlySpider deadlySpider = (DeadlySpider) tarantula;
+ DeadlyAnimal deadlyAnimal = (DeadlyAnimal) tarantula;
+ }
+
+ @Test
@SpecAssertion(section = "2.2", id = "g")
public void testFinalApiType()
{
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/Tarantula.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/Tarantula.java 2009-03-09
01:11:51 UTC (rev 1866)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/Tarantula.java 2009-03-09
08:10:44 UTC (rev 1867)
@@ -1,6 +1,6 @@
package org.jboss.jsr299.tck.tests.definition.bean;
-class Tarantula extends Spider implements DeadlySpider
+final class Tarantula extends Spider implements DeadlySpider
{
}
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-03-09
01:11:51 UTC (rev 1866)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-03-09
08:10:44 UTC (rev 1867)
@@ -7,6 +7,7 @@
import javax.inject.Current;
import javax.inject.Production;
import javax.inject.manager.Bean;
+import javax.inject.manager.InjectionPoint;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
@@ -30,6 +31,15 @@
assert order.getBindings().size() == 1;
order.getBindings().iterator().next().annotationType().equals(Production.class);
}
+
+ @Test
+ @SpecAssertion(section = "2.3.1", id = "b")
+ public void testDefaultBindingForInjectionPoint()
+ {
+ Bean<Order> order =
getCurrentManager().resolveByType(Order.class).iterator().next();
+ InjectionPoint injectionPoint = order.getInjectionPoints().iterator().next();
+ assert
injectionPoint.getBean().getBindings().iterator().next().annotationType().equals(Current.class);
+ }
@Test(groups = { "annotationDefinition", "stub" })
@SpecAssertion(section = "2.3.2", id = "aa")
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Order.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Order.java 2009-03-09
01:11:51 UTC (rev 1866)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/Order.java 2009-03-09
08:10:44 UTC (rev 1867)
@@ -1,9 +1,11 @@
package org.jboss.jsr299.tck.tests.definition.binding;
+import javax.inject.Initializer;
import javax.inject.Production;
@Production
class Order
{
-
+ @Initializer
+ public Order(OrderProcessor processor) {}
}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/OrderProcessor.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/OrderProcessor.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/OrderProcessor.java 2009-03-09
08:10:44 UTC (rev 1867)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.definition.binding;
+
+import javax.inject.Production;
+
+@Production
+public class OrderProcessor
+{
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/BeanWithInjectedField_Broken.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/BeanWithInjectedField_Broken.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/BeanWithInjectedField_Broken.java 2009-03-09
08:10:44 UTC (rev 1867)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.definition.deployment.broken.typevariable;
+
+import javax.inject.Current;
+
+class BeanWithInjectedField_Broken
+{
+ @Current
+ private Farmer_Broken injectedFarmer;
+}
\ No newline at end of file
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/Farmer_Broken.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/Farmer_Broken.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/Farmer_Broken.java 2009-03-09
08:10:44 UTC (rev 1867)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.definition.deployment.broken.typevariable;
+
+import javax.inject.Production;
+
+@Production
+class Farmer_Broken<T>
+{
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/ParameterizedTypeInjectionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/ParameterizedTypeInjectionTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/ParameterizedTypeInjectionTest.java 2009-03-09
08:10:44 UTC (rev 1867)
@@ -0,0 +1,25 @@
+package org.jboss.jsr299.tck.tests.definition.deployment.broken.typevariable;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractDeclarativeTest;
+import org.jboss.jsr299.tck.impl.packaging.Artifact;
+import org.jboss.jsr299.tck.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Shane Bryzak
+ */
+@Artifact
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class ParameterizedTypeInjectionTest extends AbstractDeclarativeTest
+{
+ @Test(groups = {"broken"})
+ @SpecAssertion(section = "2.2", id = "c")
+ public void testInjectionPointIsNotParameterizedTypeWithTypeVariable()
+ {
+ assert false;
+ }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/wildcard/BeanWithInjectedField_Broken.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/wildcard/BeanWithInjectedField_Broken.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/wildcard/BeanWithInjectedField_Broken.java 2009-03-09
08:10:44 UTC (rev 1867)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.definition.deployment.broken.wildcard;
+
+import javax.inject.Current;
+
+class BeanWithInjectedField_Broken
+{
+ @Current
+ private Farmer_Broken<?> injectedBean;
+}
\ No newline at end of file
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/wildcard/Farmer_Broken.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/wildcard/Farmer_Broken.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/wildcard/Farmer_Broken.java 2009-03-09
08:10:44 UTC (rev 1867)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.definition.deployment.broken.wildcard;
+
+import javax.inject.Production;
+
+@Production
+class Farmer_Broken<T>
+{
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/wildcard/WildcardTypeInjectionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/wildcard/WildcardTypeInjectionTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/wildcard/WildcardTypeInjectionTest.java 2009-03-09
08:10:44 UTC (rev 1867)
@@ -0,0 +1,25 @@
+package org.jboss.jsr299.tck.tests.definition.deployment.broken.wildcard;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractDeclarativeTest;
+import org.jboss.jsr299.tck.impl.packaging.Artifact;
+import org.jboss.jsr299.tck.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Shane Bryzak
+ */
+@Artifact
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class WildcardTypeInjectionTest extends AbstractDeclarativeTest
+{
+ @Test(groups = {"broken"})
+ @SpecAssertion(section = "2.2", id = "d")
+ public void testInjectionPointIsNotParameterizedTypeWithWildcardVariable()
+ {
+ assert false;
+ }
+}
Modified: tck/trunk/impl/src/main/resources/README.TXT
===================================================================
--- tck/trunk/impl/src/main/resources/README.TXT 2009-03-09 01:11:51 UTC (rev 1866)
+++ tck/trunk/impl/src/main/resources/README.TXT 2009-03-09 08:10:44 UTC (rev 1867)
@@ -7,4 +7,4 @@
---------------------------
To generate a signature file, use the following command:
-java -cp %JAVA_HOME%\jre\lib\rt.jar%;sigtestdev.jar com.sun.tdk.signaturetest.Setup
-Package javax.annotation -Package javax.context -Package javax.decorator -Package
javax.event -Package javax.inject -Package javax.interceptor -Package javax.webbeans
-FileName c:/webbeans.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar -static -Exclude java
\ No newline at end of file
+java -cp %JAVA_HOME%\jre\lib\rt.jar%;sigtestdev.jar com.sun.tdk.signaturetest.Setup
-Package javax.annotation -Package javax.context -Package javax.decorator -Package
javax.event -Package javax.inject -Package javax.interceptor -Package javax.webbeans
-FileName webbeans.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar -static -Exclude java
\ No newline at end of file
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-03-09 01:11:51 UTC (rev 1866)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-03-09 08:10:44 UTC (rev 1867)
@@ -5085,7 +5085,7 @@
<!-- <section id="9" title="XML based metadata">
<assertion id="a">
- <text>XML-based bean declarations define additional beans?they do not
redefine or disable any bean that was declared via annotations</text>
+ <text>XML-based bean declarations define additional beans they do not
redefine or disable any bean that was declared via annotations</text>
</assertion>
<assertion id="b">