Author: dallen6
Date: 2009-05-18 14:37:12 -0400 (Mon, 18 May 2009)
New Revision: 2690
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Ape.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ApeLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Lion.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/LionLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Monkey.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/MonkeyLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Polar.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBear.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBearLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Tame.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/beans.xml
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodsByBindingTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionInterface.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/StateKeeper.java
Log:
Additional tests completed in sections 2 and 3
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/AnotherDeploymentType.java
(from rev 2689,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/AnotherDeploymentType.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/AnotherDeploymentType.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/AnotherDeploymentType.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition;
+
+import static java.lang.annotation.ElementType.METHOD;
+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.inject.DeploymentType;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface AnotherDeploymentType
+{
+
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodsByBindingTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodsByBindingTest.java 2009-05-17
18:02:40 UTC (rev 2689)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodsByBindingTest.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -8,21 +8,34 @@
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.jsr299.BeansXml;
import org.testng.annotations.Test;
@Artifact
+(a)BeansXml("beans.xml")
public class DisposalMethodsByBindingTest extends AbstractJSR299Test
{
private static final Annotation DEADLIEST_LITERAL = new
AnnotationLiteral<Deadliest>() {};
- @Test(groups = { "broken" })
+ @Test
@SpecAssertion(section = "2.3.6", id = "c")
- public void testBindingTypesAppliedToDisposalMethodParameters()
+ public void testBindingTypesAppliedToDisposalMethodParameters() throws Exception
{
- //TODO Fix this test copied from proposal method tests which is not working here
- Bean<Tarantula> tarantula =
getCurrentManager().resolveByType(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
- Tarantula instance = getCurrentManager().getInstance(tarantula);
- assert instance.getDeathsCaused() == 1;
+ SpiderProducer spiderProducer =
getCurrentManager().getInstanceByType(SpiderProducer.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ Bean<Tarantula> tarantula =
getCurrentManager().resolveByType(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
+ Tarantula instance = getCurrentManager().getInstance(tarantula);
+ tarantula.destroy(instance);
+ }
+
+ }.run();
+ assert spiderProducer.isTameSpiderDestroyed();
+ assert spiderProducer.isCurrentSpiderDestroyed();
}
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java 2009-05-17
18:02:40 UTC (rev 2689)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -1,10 +1,19 @@
package org.jboss.jsr299.tck.tests.implementation.disposal.method.definition;
import javax.inject.Current;
+import javax.inject.Disposes;
import javax.inject.Produces;
+@AnotherDeploymentType
class SpiderProducer
{
+ private static boolean tameSpiderDestroyed = false;
+ private static boolean currentSpiderDestroyed = false;
+
+ @Produces public Tarantula produceTarantula()
+ {
+ return new Tarantula();
+ }
@Produces @Tame public Tarantula produceTameTarantula()
{
@@ -18,8 +27,23 @@
tameTarantula : tarantula;
}
- @Produces public Tarantula produceTarantula()
+ public void destroyTameSpider(@Disposes @Tame Tarantula spider)
{
- return new Tarantula();
+ SpiderProducer.tameSpiderDestroyed = true;
}
+
+ public void destroyCurrentSpider(@Disposes @Current Tarantula spider)
+ {
+ SpiderProducer.currentSpiderDestroyed = true;
+ }
+
+ public boolean isTameSpiderDestroyed()
+ {
+ return tameSpiderDestroyed;
+ }
+
+ public boolean isCurrentSpiderDestroyed()
+ {
+ return currentSpiderDestroyed;
+ }
}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/AnotherDeploymentType.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/AnotherDeploymentType.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/AnotherDeploymentType.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+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.inject.DeploymentType;
+
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface AnotherDeploymentType
+{
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/AnotherDeploymentType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Ape.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Ape.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Ape.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.ejb.Stateless;
+
+@Stateless
+@Tame
+class Ape implements ApeLocal
+{
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Ape.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ApeLocal.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ApeLocal.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ApeLocal.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.ejb.Local;
+
+@Local
+interface ApeLocal
+{
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/ApeLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-05-17
18:02:40 UTC (rev 2689)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -1,5 +1,9 @@
package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+import java.lang.annotation.Annotation;
+
+import javax.context.RequestScoped;
+import javax.inject.AnnotationLiteral;
import javax.inject.manager.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -8,6 +12,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
/**
@@ -17,6 +22,7 @@
*/
@Artifact
@Packaging(PackagingType.EAR)
+(a)BeansXml("beans.xml")
public class EnterpriseBeanDefinitionTest extends AbstractJSR299Test
{
@Test(groups = { "enterpriseBeans" })
@@ -103,6 +109,49 @@
}
@Test(groups = "enterpriseBeans")
+ @SpecAssertion(section = "3.3.4", id = "ba")
+ public void testBeanWithScopeAnnotation()
+ {
+ Bean<LionLocal> lionBean =
getCurrentManager().resolveByType(LionLocal.class).iterator().next();
+ assert lionBean.getScopeType().equals(RequestScoped.class);
+ }
+
+ @Test(groups = "enterpriseBeans")
+ @SpecAssertion(section = "3.3.4", id = "bb")
+ public void testBeanWithNamedAnnotation()
+ {
+ Bean<MonkeyLocal> monkeyBean =
getCurrentManager().resolveByType(MonkeyLocal.class).iterator().next();
+ assert monkeyBean.getName().equals("Monkey");
+ }
+
+ @Test(groups = "enterpriseBeans")
+ @SpecAssertion(section = "3.3.4", id = "bc")
+ public void testBeanWithDeploymentType()
+ {
+ Bean<MonkeyLocal> monkeyBean =
getCurrentManager().resolveByType(MonkeyLocal.class).iterator().next();
+ assert monkeyBean.getDeploymentType().equals(AnotherDeploymentType.class);
+ }
+
+ @Test(groups = "enterpriseBeans")
+ @SpecAssertion(section = "3.3.4", id = "bd")
+ public void testBeanWithStereotype()
+ {
+ Bean<PolarBearLocal> polarBearBean =
getCurrentManager().resolveByType(PolarBearLocal.class).iterator().next();
+ assert polarBearBean.getDeploymentType().equals(AnotherDeploymentType.class);
+ assert polarBearBean.getScopeType().equals(RequestScoped.class);
+ assert polarBearBean.getName().equals("polarBear");
+ }
+
+ @Test(groups = "enterpriseBeans")
+ @SpecAssertion(section = "3.3.4", id = "be")
+ public void testBeanWithBindings()
+ {
+ Annotation tame = new AnnotationLiteral<Tame>(){};
+ Bean<ApeLocal> apeBean = getCurrentManager().resolveByType(ApeLocal.class,
tame).iterator().next();
+ assert apeBean.getBindings().contains(tame);
+ }
+
+ @Test(groups = "enterpriseBeans")
@SpecAssertion(section = "3.3.8", id = "a")
public void testDefaultName()
{
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Lion.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Lion.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Lion.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.context.RequestScoped;
+import javax.ejb.Stateful;
+
+@Stateful
+@RequestScoped
+class Lion implements LionLocal
+{
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Lion.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/LionLocal.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/LionLocal.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/LionLocal.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.ejb.Local;
+
+@Local
+interface LionLocal
+{
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/LionLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Monkey.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Monkey.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Monkey.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.annotation.Named;
+import javax.ejb.Stateless;
+
+@Stateless
+@Named("Monkey")
+@AnotherDeploymentType
+class Monkey implements MonkeyLocal
+{
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Monkey.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/MonkeyLocal.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/MonkeyLocal.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/MonkeyLocal.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.ejb.Local;
+
+@Local
+interface MonkeyLocal
+{
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/MonkeyLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Polar.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Polar.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Polar.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -0,0 +1,24 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.annotation.Named;
+import javax.annotation.Stereotype;
+import javax.context.RequestScoped;
+
+@Stereotype
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@AnotherDeploymentType
+@RequestScoped
+@Named
+@interface Polar
+{
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Polar.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBear.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBear.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBear.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.ejb.Stateful;
+
+@Stateful
+@Polar
+class PolarBear implements PolarBearLocal
+{
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBear.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBearLocal.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBearLocal.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBearLocal.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.ejb.Local;
+
+@Local
+interface PolarBearLocal
+{
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PolarBearLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Tame.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Tame.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Tame.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+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.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Tame
+{
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Tame.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionBean.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionBean.java 2009-05-17
18:02:40 UTC (rev 2689)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionBean.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -1,5 +1,6 @@
package org.jboss.jsr299.tck.tests.implementation.enterprise.remove;
+import javax.annotation.PreDestroy;
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.inject.Current;
@@ -22,4 +23,13 @@
stateKeeper.setRemoveCalled(true);
}
+ @PreDestroy
+ public void markDestroyed()
+ {
+ stateKeeper.setBeanDestroyed(true);
+ }
+
+ public void businessMethod()
+ {
+ }
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionInterface.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionInterface.java 2009-05-17
18:02:40 UTC (rev 2689)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/DependentSessionInterface.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -8,4 +8,6 @@
public void remove();
public void anotherRemoveWithParameters(String reason);
+
+ public void businessMethod();
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java 2009-05-17
18:02:40 UTC (rev 2689)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -3,6 +3,7 @@
import static org.jboss.testharness.impl.packaging.PackagingType.EAR;
import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.IntegrationTest;
@@ -58,7 +59,10 @@
}
@Test(groups = { "enterpriseBeans", "removeMethod",
"lifecycle", "ri-broken" }, expectedExceptions =
UnsupportedOperationException.class)
- @SpecAssertion(section = "3.3.1", id = "c")
+ @SpecAssertions({
+ @SpecAssertion(section = "3.3.1", id = "b"),
+ @SpecAssertion(section = "3.3.1", id = "c")
+ })
public void
applicationCannotCallRemoveMethodOnNonDependentScopedSessionEnterpriseBean()
{
SessionScopedSessionInterface sessionBean =
getCurrentManager().getInstanceByType(SessionScopedSessionInterface.class);
@@ -66,18 +70,22 @@
assert false : "Should never reach this assertion";
}
- @Test(groups = { "enterpriseBeans", "removeMethod",
"lifecycle", "stub" })
+ @Test(groups = { "enterpriseBeans", "removeMethod",
"lifecycle" })
@SpecAssertion(section = "3.3.1", id = "db")
- public void
applicationMayCallRemoveMethodOnDependentScopedSessionEnterpriseBeansButInstanceIsNotDestroyed()
+ public void
applicationMayCallRemoveMethodOnDependentScopedSessionEnterpriseBeansButInstanceIsNotDestroyed()
throws Exception
{
- assert false;
+ StateKeeper stateKeeper =
getCurrentManager().getInstanceByType(StateKeeper.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ DependentSessionInterface sessionBean =
getCurrentManager().getInstanceByType(DependentSessionInterface.class);
+ sessionBean.businessMethod();
+ }
+ }.run();
+ assert !stateKeeper.isBeanDestroyed();
}
- @Test(groups = { "enterprisebean", "removemethod",
"lifecycle", "stub" })
- @SpecAssertion(section = "3.3.1", id = "b")
- public void
testApplicationCalledRemoveMethodOfStatefulSessionBeanWithNonDependentScopeFails()
- {
- assert false;
- }
-
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/StateKeeper.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/StateKeeper.java 2009-05-17
18:02:40 UTC (rev 2689)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/StateKeeper.java 2009-05-18
18:37:12 UTC (rev 2690)
@@ -5,7 +5,8 @@
@ApplicationScoped
class StateKeeper
{
- private boolean removeCalled = false;
+ private boolean removeCalled = false;
+ private boolean beanDestroyed = false;
public boolean isRemoveCalled()
{
@@ -17,4 +18,14 @@
this.removeCalled = removeCalled;
}
+ public boolean isBeanDestroyed()
+ {
+ return beanDestroyed;
+ }
+
+ public void setBeanDestroyed(boolean beanDestroyed)
+ {
+ this.beanDestroyed = beanDestroyed;
+ }
+
}
Added:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/beans.xml
===================================================================
---
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/beans.xml
(rev 0)
+++
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/beans.xml 2009-05-18
18:37:12 UTC (rev 2690)
@@ -0,0 +1,8 @@
+<Beans xmlns="urn:java:ee"
+
xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.disposal.method.definition">
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Property changes on:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/beans.xml
===================================================================
---
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/beans.xml
(rev 0)
+++
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/beans.xml 2009-05-18
18:37:12 UTC (rev 2690)
@@ -0,0 +1,8 @@
+<Beans xmlns="urn:java:ee"
+
xmlns:test="urn:java:org.jboss.jsr299.tck.tests.implementation.enterprise.definition">
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Property changes on:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain