Author: shane.bryzak(a)jboss.com
Date: 2009-03-16 18:04:04 -0400 (Mon, 16 Mar 2009)
New Revision: 2052
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/DeluxeHenHouse.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/Fox.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/HenHouse.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/HenHouseLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/SessionBeanInjectionTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/session/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/session/beans.xml
Log:
section 4.2 tests
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/DeluxeHenHouse.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/DeluxeHenHouse.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/DeluxeHenHouse.java 2009-03-16
22:04:04 UTC (rev 2052)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.lookup.injection.session;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.inject.Production;
+
+@Production
+@Stateful
+public class DeluxeHenHouse /*extends HenHouse */implements HenHouseLocal
+{
+ public Fox getFox()
+ {
+ //return fox;
+ return null;
+ }
+
+ @Remove
+ public void remove()
+ {
+
+ }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/Fox.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/Fox.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/Fox.java 2009-03-16
22:04:04 UTC (rev 2052)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.lookup.injection.session;
+
+import java.io.Serializable;
+
+import javax.context.Dependent;
+
+@Dependent
+class Fox implements Serializable
+{
+ public String getName()
+ {
+ return "gavin";
+ }
+}
\ No newline at end of file
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/HenHouse.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/HenHouse.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/HenHouse.java 2009-03-16
22:04:04 UTC (rev 2052)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.lookup.injection.session;
+
+import javax.inject.Current;
+
+class HenHouse
+{
+ @Current
+ public Fox fox;
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/HenHouseLocal.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/HenHouseLocal.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/HenHouseLocal.java 2009-03-16
22:04:04 UTC (rev 2052)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.lookup.injection.session;
+
+import javax.ejb.Local;
+
+@Local
+public interface HenHouseLocal
+{
+ Fox getFox();
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/SessionBeanInjectionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/SessionBeanInjectionTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/SessionBeanInjectionTest.java 2009-03-16
22:04:04 UTC (rev 2052)
@@ -0,0 +1,36 @@
+package org.jboss.jsr299.tck.tests.lookup.injection.session;
+
+import javax.inject.manager.Bean;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: PRD2
+ */
+@Artifact
+(a)Packaging(PackagingType.EAR)
+public class SessionBeanInjectionTest extends AbstractJSR299Test
+{
+ @Test(groups = "broken")
+ @SpecAssertion(section = "4.2", id = "ab")
+ public void testFieldDeclaredInSessionBeanSuperclassInjected() throws Exception
+ {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ Bean<HenHouseLocal> bean =
getCurrentManager().resolveByType(HenHouseLocal.class).iterator().next();
+ HenHouseLocal henHouse = getCurrentManager().getInstance(bean);
+ assert henHouse.getFox() != null;
+ assert henHouse.getFox().getName().equals("gavin");
+ }
+ }.run();
+ }
+}
Added:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/session/beans.xml
===================================================================
---
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/session/beans.xml
(rev 0)
+++
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/session/beans.xml 2009-03-16
22:04:04 UTC (rev 2052)
@@ -0,0 +1,7 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.tests.lookup.injection">
+ <Deploy>
+ <Standard />
+ <Production />
+ </Deploy>
+</Beans>