Author: shane.bryzak(a)jboss.com
Date: 2009-03-25 21:25:37 -0400 (Wed, 25 Mar 2009)
New Revision: 2207
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/Apple.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/AppleTree.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/GrannySmithAppleTree.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
Log:
fix 4.2.da test, add test for another aspect of same assertion
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/Apple.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/Apple.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/Apple.java 2009-03-26
01:25:37 UTC (rev 2207)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.definition;
+
+class Apple
+{
+ private AppleTree tree;
+
+ public Apple(AppleTree tree)
+ {
+ this.tree = tree;
+ }
+
+ public AppleTree getTree()
+ {
+ return tree;
+ }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/AppleTree.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/AppleTree.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/AppleTree.java 2009-03-26
01:25:37 UTC (rev 2207)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.definition;
+
+import javax.inject.Produces;
+
+class AppleTree
+{
+ @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/GrannySmithAppleTree.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/GrannySmithAppleTree.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/GrannySmithAppleTree.java 2009-03-26
01:25:37 UTC (rev 2207)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.definition;
+
+class GrannySmithAppleTree extends AppleTree
+{
+
+}
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
00:42:15 UTC (rev 2206)
+++
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)
@@ -196,17 +196,23 @@
assert wolfSpider.getScopeType().equals(RequestScoped.class);
}
- @Test(groups="ri-broken")
+ @Test
@SpecAssertion(section = "4.2", id = "da")
- public void testNonStaticProducerMethodNotInherited()
+ public void testNonStaticProducerMethodInheritedBySpecializingSubclass()
{
- // TODO - does this even test the assertion correctly? where is class Y?
assert getCurrentManager().resolveByType(Egg.class, new
AnnotationLiteral<Yummy>() {}).size() == 1;
- System.out.println(getCurrentManager().getInstanceByType(Egg.class, new
AnnotationLiteral<Yummy>() {}).getMother().getClass());
- assert getCurrentManager().getInstanceByType(Egg.class, new
AnnotationLiteral<Yummy>() {}).getMother().getClass().equals(Chicken.class);
+ assert getCurrentManager().getInstanceByType(Egg.class, new
AnnotationLiteral<Yummy>()
{}).getMother().getClass().equals(AndalusianChicken.class);
}
@Test
+ @SpecAssertion(section = "4.2", id = "da")
+ 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);
+ }
+
+ @Test
@SpecAssertion(section = "2.3.6", id = "a")
public void testBindingTypesAppliedToProducerMethodParameters()
{
Show replies by date