Author: shane.bryzak(a)jboss.com
Date: 2009-03-25 22:53:57 -0400 (Wed, 25 Mar 2009)
New Revision: 2208
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/GreatGrannySmithAppleTree.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AndalusianChicken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AndalusianChickenLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/Apple.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AppleTree.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AppleTreeLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/Chicken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/ChickenLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/Egg.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/EnterpriseProducerMethodDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/Yummy.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/beans.xml
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
Log:
tests for 4.2.dd, 4.2.dj
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/GreatGrannySmithAppleTree.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/GreatGrannySmithAppleTree.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/GreatGrannySmithAppleTree.java 2009-03-26
02:53:57 UTC (rev 2208)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.definition;
+
+class GreatGrannySmithAppleTree extends GrannySmithAppleTree
+{
+
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-03-26
01:25:37 UTC (rev 2207)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-03-26
02:53:57 UTC (rev 2208)
@@ -205,7 +205,10 @@
}
@Test
- @SpecAssertion(section = "4.2", id = "da")
+ @SpecAssertions({
+ @SpecAssertion(section = "4.2", id = "da"),
+ @SpecAssertion(section = "4.2", id = "dg")
+ })
public void testNonStaticProducerMethodNotInherited()
{
assert getCurrentManager().resolveByType(Apple.class, new
AnnotationLiteral<Yummy>() {}).size() == 1;
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AndalusianChicken.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AndalusianChicken.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AndalusianChicken.java 2009-03-26
02:53:57 UTC (rev 2208)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.definition.enterprise;
+
+import javax.ejb.Stateful;
+import javax.inject.Specializes;
+
+@AnotherDeploymentType
+@Stateful
+@Specializes
+public class AndalusianChicken extends Chicken implements AndalusianChickenLocal
+{
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AndalusianChickenLocal.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AndalusianChickenLocal.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AndalusianChickenLocal.java 2009-03-26
02:53:57 UTC (rev 2208)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.definition.enterprise;
+
+import javax.ejb.Local;
+
+@Local
+public interface AndalusianChickenLocal
+{
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AnotherDeploymentType.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AnotherDeploymentType.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AnotherDeploymentType.java 2009-03-26
02:53:57 UTC (rev 2208)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.definition.enterprise;
+
+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.inject.DeploymentType;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface AnotherDeploymentType
+{
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/Apple.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/Apple.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/Apple.java 2009-03-26
02:53:57 UTC (rev 2208)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.definition.enterprise;
+
+public class Apple
+{
+ private AppleTree tree;
+
+ public Apple(AppleTree tree)
+ {
+ this.tree = tree;
+ }
+
+ public AppleTree getTree()
+ {
+ return tree;
+ }
+}
\ No newline at end of file
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AppleTree.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AppleTree.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AppleTree.java 2009-03-26
02:53:57 UTC (rev 2208)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.definition.enterprise;
+
+import javax.ejb.Stateful;
+import javax.inject.Produces;
+
+@Stateful
+public class AppleTree implements AppleTreeLocal
+{
+ @Produces @Yummy public Apple produceApple()
+ {
+ return new Apple(this);
+ }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AppleTreeLocal.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AppleTreeLocal.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/AppleTreeLocal.java 2009-03-26
02:53:57 UTC (rev 2208)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.definition.enterprise;
+
+import javax.ejb.Local;
+
+@Local
+public interface AppleTreeLocal
+{
+ public Apple produceApple();
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/Chicken.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/Chicken.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/Chicken.java 2009-03-26
02:53:57 UTC (rev 2208)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.definition.enterprise;
+
+import javax.ejb.Stateful;
+import javax.inject.Produces;
+
+@Stateful
+public class Chicken implements ChickenLocal
+{
+
+ @Produces @Yummy
+ public Egg produceEgg()
+ {
+ return new Egg(this);
+ }
+
+}
\ No newline at end of file
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/ChickenLocal.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/ChickenLocal.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/ChickenLocal.java 2009-03-26
02:53:57 UTC (rev 2208)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.definition.enterprise;
+
+import javax.ejb.Local;
+
+@Local
+public interface ChickenLocal
+{
+ public Egg produceEgg();
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/Egg.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/Egg.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/Egg.java 2009-03-26
02:53:57 UTC (rev 2208)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.definition.enterprise;
+
+public class Egg
+{
+ private final Chicken mother;
+
+ public Egg(Chicken mother)
+ {
+ this.mother = mother;
+ }
+
+ public Chicken getMother()
+ {
+ return mother;
+ }
+
+}
\ No newline at end of file
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/EnterpriseProducerMethodDefinitionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/EnterpriseProducerMethodDefinitionTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/EnterpriseProducerMethodDefinitionTest.java 2009-03-26
02:53:57 UTC (rev 2208)
@@ -0,0 +1,40 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.definition.enterprise;
+
+import javax.inject.AnnotationLiteral;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+@IntegrationTest
+@Artifact
+(a)BeansXml("beans.xml")
+(a)Packaging(PackagingType.EAR)
+public class EnterpriseProducerMethodDefinitionTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertion(section = "4.2", id = "dd")
+ public void testNonStaticProducerMethodInheritedBySpecializingSubclass()
+ {
+ assert getCurrentManager().resolveByType(Egg.class, new
AnnotationLiteral<Yummy>() {}).size() == 1;
+ assert getCurrentManager().getInstanceByType(Egg.class, new
AnnotationLiteral<Yummy>()
{}).getMother().getClass().equals(AndalusianChicken.class);
+ }
+
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section = "4.2", id = "dd"),
+ @SpecAssertion(section = "4.2", id = "dj")
+ })
+ public void testNonStaticProducerMethodNotInherited()
+ {
+ assert getCurrentManager().resolveByType(Apple.class, new
AnnotationLiteral<Yummy>() {}).size() == 1;
+ assert getCurrentManager().getInstanceByType(Apple.class, new
AnnotationLiteral<Yummy>() {}).getTree().getClass().equals(AppleTree.class);
+ }
+}
+
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/Yummy.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/Yummy.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/Yummy.java 2009-03-26
02:53:57 UTC (rev 2208)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.definition.enterprise;
+
+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.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Yummy
+{
+
+}
\ No newline at end of file
Added:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/beans.xml
===================================================================
---
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/beans.xml
(rev 0)
+++
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/beans.xml 2009-03-26
02:53:57 UTC (rev 2208)
@@ -0,0 +1,8 @@
+<Beans xmlns="urn:java:ee"
+
xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.producer.method.definition.enterprise">
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>