Author: shane.bryzak(a)jboss.com
Date: 2009-08-10 09:22:35 -0400 (Mon, 10 Aug 2009)
New Revision: 3416
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Hallway.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/HallwayBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Interior.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/InteriorDecorator.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/InteriorHallway.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/InteriorRoom.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Room.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/RoomBinding.java
Modified:
tck/trunk/doc/reference/en-US/reporting.xml
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
Log:
dependent context tests
Modified: tck/trunk/doc/reference/en-US/reporting.xml
===================================================================
--- tck/trunk/doc/reference/en-US/reporting.xml 2009-08-09 21:59:46 UTC (rev 3415)
+++ tck/trunk/doc/reference/en-US/reporting.xml 2009-08-10 13:22:35 UTC (rev 3416)
@@ -233,7 +233,7 @@
</itemizedlist>
<para>
- For reasons provided in the tck-audit.xml document and presented in
+ For reasons provided in the <literal>tck-audit.xml</literal>
document and presented in
the coverage report, some assertions are not testable.
</para>
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-08-09
21:59:46 UTC (rev 3415)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-08-10
13:22:35 UTC (rev 3416)
@@ -9,11 +9,11 @@
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.spi.Bean;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.impl.MockCreationalContext;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.impl.MockCreationalContext;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
@@ -346,4 +346,30 @@
assert HorseStable.getInstanceThatObservedEvent() != null;
assert HorseStable.isDestroyed();
}
+
+ @Test(groups = { "contexts", "broken" })
+ @SpecAssertion(section = "6.4.1", id = "ab")
+ public void testDependentScopedDecoratorsAreDependentObjectsOfBean()
+ {
+ Bean<Interior> roomBean = getBeans(Interior.class, new
RoomBinding()).iterator().next();
+ Bean<Interior> hallwayBean = getBeans(Interior.class, new
HallwayBinding()).iterator().next();
+
+ CreationalContext<Interior> roomCreationalContext =
getCurrentManager().createCreationalContext(roomBean);
+ CreationalContext<Interior> hallwayCreationalContext =
getCurrentManager().createCreationalContext(hallwayBean);
+
+ Interior room = roomBean.create(roomCreationalContext);
+ Interior hallway = hallwayBean.create(hallwayCreationalContext);
+
+ InteriorDecorator.instances.clear();
+
+ room.foo();
+
+ assert InteriorDecorator.instances.size() > 0;
+ assert InteriorDecorator.instances.size() == 1;
+
+ hallway.foo();
+
+ assert InteriorDecorator.instances.size() == 2;
+ assert
!InteriorDecorator.instances.get(0).equals(InteriorDecorator.instances.get(1));
+ }
}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Hallway.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Hallway.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Hallway.java 2009-08-10
13:22:35 UTC (rev 3416)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+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.enterprise.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Hallway
+{
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/HallwayBinding.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/HallwayBinding.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/HallwayBinding.java 2009-08-10
13:22:35 UTC (rev 3416)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+import javax.enterprise.inject.AnnotationLiteral;
+
+class HallwayBinding extends AnnotationLiteral<Hallway> implements Hallway
+{
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Interior.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Interior.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Interior.java 2009-08-10
13:22:35 UTC (rev 3416)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+interface Interior
+{
+ public void foo();
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/InteriorDecorator.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/InteriorDecorator.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/InteriorDecorator.java 2009-08-10
13:22:35 UTC (rev 3416)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.decorator.Decorates;
+import javax.decorator.Decorator;
+
+@Decorator
+class InteriorDecorator
+{
+ @Decorates Interior interior;
+
+ public static List<InteriorDecorator> instances = new
ArrayList<InteriorDecorator>();
+
+ public void foo()
+ {
+ instances.add(this);
+ interior.foo();
+ }
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/InteriorHallway.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/InteriorHallway.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/InteriorHallway.java 2009-08-10
13:22:35 UTC (rev 3416)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+@Hallway
+class InteriorHallway implements Interior
+{
+
+ public void foo()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/InteriorRoom.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/InteriorRoom.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/InteriorRoom.java 2009-08-10
13:22:35 UTC (rev 3416)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+@Room
+class InteriorRoom implements Interior
+{
+ public void foo()
+ {
+ // TODO Auto-generated method stub
+
+ }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Room.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Room.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Room.java 2009-08-10
13:22:35 UTC (rev 3416)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+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.enterprise.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Room
+{
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/RoomBinding.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/RoomBinding.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/RoomBinding.java 2009-08-10
13:22:35 UTC (rev 3416)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+import javax.enterprise.inject.AnnotationLiteral;
+
+class RoomBinding extends AnnotationLiteral<Room> implements Room
+{
+
+}
Show replies by date