Author: shane.bryzak(a)jboss.com
Date: 2009-03-21 08:59:19 -0400 (Sat, 21 Mar 2009)
New Revision: 2128
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/BorderCollie.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/BorderCollieLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/Hairy.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/HairyBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/LongHairedDog.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/SessionBindingDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/City.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/CityProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/IndirectOrderProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/IntermediateOrderProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/OrderProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/OrderProcessorLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/SessionBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/MegaPoor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/MegaPoorBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/MegaPoorHenHouse.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/PoorHenHouse.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/SessionBeanInjectionTest.java
Log:
some session bean tests
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/BorderCollie.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/BorderCollie.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/BorderCollie.java 2009-03-21
12:59:19 UTC (rev 2128)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.definition.binding.session;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class BorderCollie extends LongHairedDog implements BorderCollieLocal
+{
+
+}
\ No newline at end of file
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/BorderCollieLocal.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/BorderCollieLocal.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/BorderCollieLocal.java 2009-03-21
12:59:19 UTC (rev 2128)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.definition.binding.session;
+
+import javax.ejb.Local;
+
+@Local
+public interface BorderCollieLocal
+{
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/Hairy.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/Hairy.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/Hairy.java 2009-03-21
12:59:19 UTC (rev 2128)
@@ -0,0 +1,25 @@
+package org.jboss.jsr299.tck.tests.definition.binding.session;
+
+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.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.BindingType;
+
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@Inherited
+@interface Hairy
+{
+ public boolean clipped();
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/HairyBinding.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/HairyBinding.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/HairyBinding.java 2009-03-21
12:59:19 UTC (rev 2128)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.definition.binding.session;
+
+import javax.inject.AnnotationLiteral;
+
+public class HairyBinding extends AnnotationLiteral<Hairy> implements Hairy
+{
+ private boolean clipped;
+
+ public HairyBinding(boolean clipped)
+ {
+ this.clipped = clipped;
+ }
+
+ public boolean clipped()
+ {
+ return clipped;
+ }
+
+}
\ No newline at end of file
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/LongHairedDog.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/LongHairedDog.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/LongHairedDog.java 2009-03-21
12:59:19 UTC (rev 2128)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.definition.binding.session;
+
+@Hairy(clipped=false)
+class LongHairedDog
+{
+
+}
\ No newline at end of file
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/SessionBindingDefinitionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/SessionBindingDefinitionTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/session/SessionBindingDefinitionTest.java 2009-03-21
12:59:19 UTC (rev 2128)
@@ -0,0 +1,27 @@
+package org.jboss.jsr299.tck.tests.definition.binding.session;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+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.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.testng.annotations.Test;
+
+@Artifact
+@IntegrationTest
+(a)Packaging(PackagingType.EAR)
+public class SessionBindingDefinitionTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertion(section = "4.1", id = "ad")
+ public void testBindingDeclaredInheritedIsInherited() throws Exception
+ {
+ Set<? extends Annotation> bindings =
getCurrentManager().resolveByType(BorderCollieLocal.class, new
HairyBinding(false)).iterator().next().getBindings();
+ assert bindings.size() == 1;
+ assert bindings.iterator().next().annotationType().equals(Hairy.class);
+ }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/City.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/City.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/City.java 2009-03-21
12:59:19 UTC (rev 2128)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.disposal.definition;
+
+class City
+{
+ private boolean disposed = false;
+ void dispose() { disposed = true; }
+
+ boolean isDisposed() { return disposed; }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/CityProducer.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/CityProducer.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/CityProducer.java 2009-03-21
12:59:19 UTC (rev 2128)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.disposal.definition;
+
+import javax.inject.Disposes;
+import javax.inject.Produces;
+
+class CityProducer
+{
+ @Produces City createCity() { return new City(); }
+
+ void disposeCity(@Disposes City city) { city.dispose(); }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/IndirectOrderProcessor.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/IndirectOrderProcessor.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/IndirectOrderProcessor.java 2009-03-21
12:59:19 UTC (rev 2128)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.implementation.session.lifecycle;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+@Stateful
+public class IndirectOrderProcessor extends IntermediateOrderProcessor implements
OrderProcessorLocal
+{
+ @Remove
+ public void remove()
+ {
+
+ }
+}
\ No newline at end of file
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/IntermediateOrderProcessor.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/IntermediateOrderProcessor.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/IntermediateOrderProcessor.java 2009-03-21
12:59:19 UTC (rev 2128)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.session.lifecycle;
+
+class IntermediateOrderProcessor extends OrderProcessor
+{
+
+}
\ No newline at end of file
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/OrderProcessor.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/OrderProcessor.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/OrderProcessor.java 2009-03-21
12:59:19 UTC (rev 2128)
@@ -0,0 +1,30 @@
+package org.jboss.jsr299.tck.tests.implementation.session.lifecycle;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+
+class OrderProcessor
+{
+ public static boolean postConstructCalled = false;
+
+ public static boolean preDestroyCalled = true;
+
+ @PostConstruct
+ public void postConstruct()
+ {
+ postConstructCalled = true;
+ }
+
+ @PreDestroy
+ public void preDestroy()
+ {
+ preDestroyCalled = true;
+ }
+
+ public void order()
+ {
+
+ }
+
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/OrderProcessorLocal.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/OrderProcessorLocal.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/OrderProcessorLocal.java 2009-03-21
12:59:19 UTC (rev 2128)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.session.lifecycle;
+
+import javax.ejb.Local;
+
+@Local
+public interface OrderProcessorLocal
+{
+ void order();
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/SessionBeanLifecycleTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/SessionBeanLifecycleTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/lifecycle/SessionBeanLifecycleTest.java 2009-03-21
12:59:19 UTC (rev 2128)
@@ -0,0 +1,32 @@
+package org.jboss.jsr299.tck.tests.implementation.session.lifecycle;
+
+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.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.testng.annotations.Test;
+
+@Artifact
+@IntegrationTest
+(a)Packaging(PackagingType.EAR)
+public class SessionBeanLifecycleTest extends AbstractJSR299Test
+{
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "4.2", id = "bac")
+ public void testIndirectSubClassInheritsPostConstructOnSuperclass() throws Exception
+ {
+ OrderProcessor.postConstructCalled = false;
+ assert getCurrentManager().resolveByType(OrderProcessorLocal.class).size() == 1;
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ getCurrentManager().getInstanceByType(OrderProcessorLocal.class).order();
+ }
+ }.run();
+ assert OrderProcessor.postConstructCalled;
+ }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/MegaPoor.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/MegaPoor.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/MegaPoor.java 2009-03-21
12:59:19 UTC (rev 2128)
@@ -0,0 +1,24 @@
+package org.jboss.jsr299.tck.tests.lookup.injection.session;
+
+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.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@Inherited
+@interface MegaPoor
+{
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/MegaPoorBinding.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/MegaPoorBinding.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/MegaPoorBinding.java 2009-03-21
12:59:19 UTC (rev 2128)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.lookup.injection.session;
+
+import javax.inject.AnnotationLiteral;
+
+class MegaPoorBinding extends AnnotationLiteral<MegaPoor> implements MegaPoor
+{
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/MegaPoorHenHouse.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/MegaPoorHenHouse.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/MegaPoorHenHouse.java 2009-03-21
12:59:19 UTC (rev 2128)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.lookup.injection.session;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+@MegaPoor
+@Stateful
+public class MegaPoorHenHouse extends PoorHenHouse implements HenHouseLocal
+{
+ public Fox getFox()
+ {
+ return fox;
+ }
+
+ @Remove
+ public void remove()
+ {
+
+ }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/PoorHenHouse.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/PoorHenHouse.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/PoorHenHouse.java 2009-03-21
12:59:19 UTC (rev 2128)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.lookup.injection.session;
+
+class PoorHenHouse extends HenHouse
+{
+
+}
Modified:
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 2009-03-21
10:50:31 UTC (rev 2127)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/SessionBeanInjectionTest.java 2009-03-21
12:59:19 UTC (rev 2128)
@@ -35,4 +35,21 @@
}
}.run();
}
+
+ @Test
+ @SpecAssertion(section = "4.2", id = "ad")
+ public void testFieldDeclaredInSessionBeanIndirectSuperclassInjected() throws
Exception
+ {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ Bean<HenHouseLocal> bean =
getCurrentManager().resolveByType(HenHouseLocal.class, new
MegaPoorBinding()).iterator().next();
+ HenHouseLocal henHouse = getCurrentManager().getInstance(bean);
+ assert henHouse.getFox() != null;
+ assert henHouse.getFox().getName().equals("gavin");
+ }
+ }.run();
+ }
}