Author: pete.muir(a)jboss.org
Date: 2009-06-03 18:46:13 -0400 (Wed, 03 Jun 2009)
New Revision: 2755
Modified:
tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
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/ejb/DependentContextEjbTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Kassel.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/KleinStadt.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
Log:
updates for ejb remove methods
Modified: tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java 2009-06-03 22:46:00
UTC (rev 2754)
+++ tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java 2009-06-03 22:46:13
UTC (rev 2755)
@@ -72,7 +72,7 @@
*/
public <T> T getEnterpriseBean(Class<? extends T> beanType, Class<T>
localInterface);
- public <T> void destroyBeanInstance(Bean<T> bean, T instance);
+ public <T> void destroyAndRemoveBeanInstance(Bean<T> bean, T instance);
public <T> T createBeanInstance(Bean<T> bean);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java 2009-06-03
22:46:00 UTC (rev 2754)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java 2009-06-03
22:46:13 UTC (rev 2755)
@@ -163,8 +163,8 @@
* @param bean the bean
* @param instance the instance to destroy
*/
- public <T> void destroyBeanInstance(Bean<T> bean, T instance)
+ public <T> void destroyAndRemoveBeanInstance(Bean<T> bean, T instance)
{
- getCurrentConfiguration().getBeans().destroyBeanInstance(bean, instance);
+ getCurrentConfiguration().getBeans().destroyAndRemoveBeanInstance(bean, instance);
}
}
\ No newline at end of file
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-06-03
22:46:00 UTC (rev 2754)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-06-03
22:46:13 UTC (rev 2755)
@@ -97,7 +97,7 @@
Bean<Tarantula> tarantulaBean =
getCurrentManager().getBeans(Tarantula.class).iterator().next();
Tarantula tarantula = createBeanInstance(tarantulaBean);
assert tarantula != null;
- destroyBeanInstance(tarantulaBean, tarantula);
+ destroyAndRemoveBeanInstance(tarantulaBean, tarantula);
assert SpiderProducer.getInstanceUsedForDisposal() != null;
assert SpiderProducer.getInstanceUsedForDisposal() != spiderProducer;
}
@@ -204,7 +204,7 @@
Tarantula tarantula = createBeanInstance(tarantulaBean);
assert tarantula != null;
SpiderProducer.setDependentContextActive(false);
- destroyBeanInstance(tarantulaBean, tarantula);
+ destroyAndRemoveBeanInstance(tarantulaBean, tarantula);
assert SpiderProducer.isDependentContextActive();
}
@@ -288,7 +288,7 @@
farm.open();
Stable.destroyed = false;
Horse.destroyed = false;
- destroyBeanInstance(farmBean, farm);
+ destroyAndRemoveBeanInstance(farmBean, farm);
assert Stable.destroyed;
assert Horse.destroyed;
}
@@ -317,7 +317,7 @@
Bean<FoxRun> bean =
getCurrentManager().getBeans(FoxRun.class).iterator().next();
FoxRun instance = createBeanInstance(bean);
assert instance.fox != instance.anotherFox;
- destroyBeanInstance(bean, instance);
+ destroyAndRemoveBeanInstance(bean, instance);
assert Fox.isDestroyed();
assert Fox.getDestroyCount() == 2;
}
@@ -405,7 +405,7 @@
// Reset test class state
SpiderProducer.setDestroyed(false);
- destroyBeanInstance(tarantulaBean, tarantula);
+ destroyAndRemoveBeanInstance(tarantulaBean, tarantula);
assert SpiderProducer.isDestroyed();
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java 2009-06-03
22:46:00 UTC (rev 2754)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java 2009-06-03
22:46:13 UTC (rev 2755)
@@ -68,7 +68,7 @@
HouseLocal instance = createBeanInstance(bean);
Room.destroyed = false;
Table.destroyed = false;
- destroyBeanInstance(bean, instance);
+ destroyAndRemoveBeanInstance(bean, instance);
assert Room.destroyed;
assert Table.destroyed;
}
@@ -91,7 +91,7 @@
FarmLocal farm = createBeanInstance(farmBean);
Horse.destroyed = false;
Stable.destroyed = false;
- destroyBeanInstance(farmBean, farm);
+ destroyAndRemoveBeanInstance(farmBean, farm);
assert Horse.destroyed;
assert Stable.destroyed;
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java 2009-06-03
22:46:00 UTC (rev 2754)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java 2009-06-03
22:46:13 UTC (rev 2755)
@@ -38,7 +38,7 @@
{
Bean<Tarantula> tarantula =
getCurrentManager().getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
Tarantula instance = getCurrentManager().getInstance(tarantula);
- destroyBeanInstance(tarantula, instance);
+ destroyAndRemoveBeanInstance(tarantula, instance);
}
}.run();
@@ -61,7 +61,7 @@
{
Bean<Tarantula> tarantula =
getCurrentManager().getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
Tarantula instance = getCurrentManager().getInstance(tarantula);
- destroyBeanInstance(tarantula, instance);
+ destroyAndRemoveBeanInstance(tarantula, instance);
}
}.run();
@@ -88,7 +88,7 @@
{
Bean<Tarantula> tarantula =
getCurrentManager().getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
Tarantula instance = getCurrentManager().getInstance(tarantula);
- destroyBeanInstance(tarantula, instance);
+ destroyAndRemoveBeanInstance(tarantula, instance);
}
}.run();
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-06-03
22:46:00 UTC (rev 2754)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-06-03
22:46:13 UTC (rev 2755)
@@ -81,7 +81,7 @@
//frankfurt.dispose();
}
- @Test(groups = { "enterpriseBeans", "clientProxy",
"lifecycle", "integration", "ri-broken" })
+ @Test(groups = { "enterpriseBeans", "clientProxy",
"lifecycle", "integration" })
@SpecAssertions({
@SpecAssertion(section = "6.5", id = "b"),
@SpecAssertion(section = "6", id = "e")
@@ -93,7 +93,8 @@
assert stadtBean != null : "Expected a bean for stateful session bean
Kassel";
Context requestContext = getCurrentManager().getContext(RequestScoped.class);
KleinStadt kassel = createBeanInstance(stadtBean);
- destroyBeanInstance(stadtBean, kassel);
+ kassel.ping();
+ destroyAndRemoveBeanInstance(stadtBean, kassel);
assert frankfurt.isKleinStadtDestroyed() : "Expected SFSB bean to be
destroyed";
kassel = requestContext.get(stadtBean);
@@ -148,14 +149,14 @@
assert alteStadt.getAnotherPlaceOfInterest() != null;
}
- @Test(groups = { "enterpriseBeans", "lifecycle",
"ri-broken" })
+ @Test(groups = { "enterpriseBeans", "lifecycle" })
@SpecAssertion(section = "6.11", id = "f")
public void testDependentObjectsDestroyed()
{
UniStadt marburg = getCurrentManager().getInstanceByType(UniStadt.class);
assert marburg != null : "Couldn't find the main SFSB";
Bean<UniStadt> uniStadtBean =
getCurrentManager().getBeans(UniStadt.class).iterator().next();
- destroyBeanInstance(uniStadtBean, marburg);
+ destroyAndRemoveBeanInstance(uniStadtBean, marburg);
GrossStadt frankfurt = getCurrentManager().getInstanceByType(GrossStadt.class);
assert frankfurt.isSchlossDestroyed();
}
@@ -194,7 +195,7 @@
assert OrderProcessor.postConstructCalled;
}
- @Test(groups = "ri-broken")
+ @Test
@SpecAssertion(section = "4.2", id = "bbb")
public void testSubClassInheritsPreDestroyOnSuperclass() throws Exception
{
@@ -207,7 +208,7 @@
{
Bean<DirectOrderProcessorLocal> bean =
getCurrentManager().getBeans(DirectOrderProcessorLocal.class).iterator().next();
DirectOrderProcessorLocal instance =
getCurrentManager().getInstanceByType(DirectOrderProcessorLocal.class);
- destroyBeanInstance(bean, instance);
+ destroyAndRemoveBeanInstance(bean, instance);
}
}.run();
assert OrderProcessor.preDestroyCalled;
@@ -226,7 +227,7 @@
{
Bean<IndirectOrderProcessor> bean =
getCurrentManager().getBeans(IndirectOrderProcessor.class).iterator().next();
IndirectOrderProcessor instance =
getCurrentManager().getInstanceByType(IndirectOrderProcessor.class);
- destroyBeanInstance(bean, instance);
+ destroyAndRemoveBeanInstance(bean, instance);
}
}.run();
assert OrderProcessor.preDestroyCalled;
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Kassel.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Kassel.java 2009-06-03
22:46:00 UTC (rev 2754)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Kassel.java 2009-06-03
22:46:13 UTC (rev 2755)
@@ -2,16 +2,16 @@
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
-import javax.ejb.EJB;
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Current;
@Stateful
@RequestScoped
public class Kassel implements KleinStadt, SchoeneStadt
{
- @EJB
+ @Current
private GrossStadt grossStadt;
@PostConstruct
@@ -30,5 +30,7 @@
{
grossStadt.kleinStadtDestroyed();
}
+
+ public void ping() {}
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/KleinStadt.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/KleinStadt.java 2009-06-03
22:46:00 UTC (rev 2754)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/KleinStadt.java 2009-06-03
22:46:13 UTC (rev 2755)
@@ -11,4 +11,6 @@
public void zustandVerloren();
+ public void ping();
+
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java 2009-06-03
22:46:00 UTC (rev 2754)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java 2009-06-03
22:46:13 UTC (rev 2755)
@@ -94,7 +94,7 @@
FoxLocal newFox = getCurrentManager().getInstanceByType(FoxLocal.class, new
NewLiteral());
Bean<Litter> litterBean =
getCurrentManager().getBeans(Litter.class).iterator().next();
Litter litter = getCurrentManager().getInstanceByType(Litter.class);
- destroyBeanInstance(litterBean, litter);
+ destroyAndRemoveBeanInstance(litterBean, litter);
assert fox.isLitterDisposed();
assert !newFox.isLitterDisposed();
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-06-03
22:46:00 UTC (rev 2754)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-06-03
22:46:13 UTC (rev 2755)
@@ -71,7 +71,7 @@
assert getCurrentManager().getBeans(String.class).size() == 1;
String aString = getCurrentManager().getInstanceByType(String.class);
Bean<String> stringBean =
getCurrentManager().getBeans(String.class).iterator().next();
- destroyBeanInstance(stringBean, aString);
+ destroyAndRemoveBeanInstance(stringBean, aString);
assert BeanWithStaticProducerMethod.stringDestroyed;
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-06-03
22:46:00 UTC (rev 2754)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-06-03
22:46:13 UTC (rev 2755)
@@ -40,7 +40,7 @@
SpiderProducer.setTarantulaDestroyed(false);
Tarantula tarantula =
getCurrentManager().getInstanceByType(Tarantula.class);
Bean<Tarantula> tarantulaBean =
getCurrentManager().getBeans(Tarantula.class).iterator().next();
- destroyBeanInstance(tarantulaBean, tarantula);
+ destroyAndRemoveBeanInstance(tarantulaBean, tarantula);
assert SpiderProducer.isTarantulaDestroyed();
assert SpiderProducer.isDestroyArgumentsSet();
assert !SpiderProducerNotUsed.isTarantulaDestroyed();
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-06-03
22:46:00 UTC (rev 2754)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-06-03
22:46:13 UTC (rev 2755)
@@ -156,7 +156,7 @@
assert farm.founded != null;
assert farm.initialStaff == 20;
assert farm.closed == null;
- destroyBeanInstance(farmBean, farm);
+ destroyAndRemoveBeanInstance(farmBean, farm);
assert farm.closed != null;
}
@@ -172,7 +172,7 @@
assert !EggProducer.isEggDisposed();
assert !Egg.isEggDestroyed();
- destroyBeanInstance(gooseBean, goose);
+ destroyAndRemoveBeanInstance(gooseBean, goose);
assert EggProducer.isEggDisposed();
//TODO Apparently Dependent scoped injected objects do not have their PreDestroy
method called
//assert Egg.isEggDestroyed();
@@ -187,7 +187,7 @@
Bean<Cod> codBean =
getCurrentManager().getBeans(Cod.class).iterator().next();
Cod codInstance = getCurrentManager().getInstanceByType(Cod.class);
codInstance.ping();
- destroyBeanInstance(codBean, codInstance);
+ destroyAndRemoveBeanInstance(codBean, codInstance);
}
@Test(groups = "beanLifecycle")
@@ -198,7 +198,7 @@
{
Bean<FishPond> pondBean =
getCurrentManager().getBeans(FishPond.class).iterator().next();
FishPond fishPond = getCurrentManager().getInstanceByType(FishPond.class);
- destroyBeanInstance(pondBean, fishPond);
+ destroyAndRemoveBeanInstance(pondBean, fishPond);
assert Salmon.isBeanDestroyed();
}
@@ -249,7 +249,7 @@
{
Bean<CdOrderProcessor> bean =
getCurrentManager().getBeans(CdOrderProcessor.class).iterator().next();
CdOrderProcessor instance =
getCurrentManager().getInstanceByType(CdOrderProcessor.class);
- destroyBeanInstance(bean, instance);
+ destroyAndRemoveBeanInstance(bean, instance);
}
}.run();
assert OrderProcessor.preDestroyCalled;
@@ -268,7 +268,7 @@
{
Bean<IndirectOrderProcessor> bean =
getCurrentManager().getBeans(IndirectOrderProcessor.class).iterator().next();
IndirectOrderProcessor instance =
getCurrentManager().getInstanceByType(IndirectOrderProcessor.class);
- destroyBeanInstance(bean, instance);
+ destroyAndRemoveBeanInstance(bean, instance);
}
}.run();
assert OrderProcessor.preDestroyCalled;
@@ -304,7 +304,7 @@
{
Bean<NovelOrderProcessor> bean =
getCurrentManager().getBeans(NovelOrderProcessor.class).iterator().next();
NovelOrderProcessor instance =
getCurrentManager().getInstanceByType(NovelOrderProcessor.class);
- destroyBeanInstance(bean, instance);
+ destroyAndRemoveBeanInstance(bean, instance);
}
}.run();
assert !OrderProcessor.preDestroyCalled;
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-06-03
22:46:00 UTC (rev 2754)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-06-03
22:46:13 UTC (rev 2755)
@@ -150,7 +150,7 @@
Fox newFox = getCurrentManager().getInstanceByType(Fox.class, new
NewLiteral());
Bean<Litter> litterBean =
getCurrentManager().getBeans(Litter.class).iterator().next();
Litter litter = getCurrentManager().getInstanceByType(Litter.class);
- destroyBeanInstance(litterBean, litter);
+ destroyAndRemoveBeanInstance(litterBean, litter);
assert fox.isLitterDisposed();
assert !newFox.isLitterDisposed();
}