Author: shane.bryzak(a)jboss.com
Date: 2009-08-04 02:56:39 -0400 (Tue, 04 Aug 2009)
New Revision: 3398
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxFarm.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxHole.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Missile.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/MissileInterceptor.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
Log:
dependent context tests
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-03
22:03:52 UTC (rev 3397)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-08-04
06:56:39 UTC (rev 3398)
@@ -43,6 +43,24 @@
FoxRun foxRun = foxRunBean.create(creationalContext);
assert !foxRun.fox.equals(foxRun.anotherFox);
}
+
+ @Test(groups = { "contexts", "injection" })
+ @SpecAssertions({
+ @SpecAssertion(section = "6.4.1", id = "ga"),
+ @SpecAssertion(section = "6.4.1", id = "gb"),
+ @SpecAssertion(section = "6.4.1", id = "gc")
+ })
+ public void testDependentBeanIsDependentObjectOfBeanInjectedInto()
+ {
+ FoxFarm foxFarm = getInstanceByType(FoxFarm.class);
+ FoxHole foxHole = getInstanceByType(FoxHole.class);
+
+ assert !foxFarm.fox.equals(foxHole.fox);
+ assert !foxFarm.fox.equals(foxFarm.constructorFox);
+
+ assert !foxFarm.constructorFox.equals(foxHole.initializerFox);
+ assert !foxHole.fox.equals(foxHole.initializerFox);
+ }
@Test(groups = { "contexts", "el" })
@SpecAssertion(section = "6.4", id = "c")
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxFarm.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxFarm.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxFarm.java 2009-08-04
06:56:39 UTC (rev 3398)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Initializer;
+
+class FoxFarm
+{
+ @Current public Fox fox;
+
+ public Fox constructorFox;
+
+ @Initializer
+ public FoxFarm(@Current Fox fox)
+ {
+ this.constructorFox = fox;
+ }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxHole.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxHole.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/FoxHole.java 2009-08-04
06:56:39 UTC (rev 3398)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Initializer;
+
+class FoxHole
+{
+ @Current public Fox fox;
+
+ public Fox initializerFox;
+
+ @Initializer
+ public void init(@Current Fox fox)
+ {
+ this.initializerFox = fox;
+ }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Missile.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Missile.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Missile.java 2009-08-04
06:56:39 UTC (rev 3398)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+import javax.interceptor.Interceptors;
+
+(a)Interceptors(MissileInterceptor.class)
+class Missile
+{
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/MissileInterceptor.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/MissileInterceptor.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/MissileInterceptor.java 2009-08-04
06:56:39 UTC (rev 3398)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+@Interceptor
+class MissileInterceptor
+{
+ public Object intercept(InvocationContext context) throws Exception
+ {
+ return context.proceed();
+ }
+}
Show replies by date