Author: pete.muir(a)jboss.org
Date: 2009-07-25 17:01:32 -0400 (Sat, 25 Jul 2009)
New Revision: 3229
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java
Log:
remove the runindependentcontext
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-07-25
20:58:18 UTC (rev 3228)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java 2009-07-25
21:01:32 UTC (rev 3229)
@@ -1,5 +1,7 @@
package org.jboss.jsr299.tck.tests.implementation.enterprise.newBean;
+import java.util.Set;
+
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.spi.Bean;
@@ -69,43 +71,27 @@
@SpecAssertion(section = "3.10", id = "w")
public void testNewBeanHasNoProducerFields() throws Exception
{
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- FoxLocal fox = getInstanceByType(FoxLocal.class);
- FoxLocal newFox = getInstanceByType(FoxLocal.class,new NewLiteral());
- newFox.setDen(new Den("NewFoxDen"));
- Den theOnlyDen = getInstanceByType(Den.class,new
AnnotationLiteral<Tame>(){});
- assert theOnlyDen.getName().equals(fox.getDen().getName());
- }
-
- }.run();
+ FoxLocal fox = getInstanceByType(FoxLocal.class);
+ FoxLocal newFox = getInstanceByType(FoxLocal.class,new NewLiteral());
+ newFox.setDen(new Den("NewFoxDen"));
+ Den theOnlyDen = getInstanceByType(Den.class,new
AnnotationLiteral<Tame>(){});
+ assert theOnlyDen.getName().equals(fox.getDen().getName());
}
@Test(groups = { "new", "ri-broken", "disposal" })
@SpecAssertion(section = "3.10", id = "x")
- public void testNewBeanHasNoDisposerMethods() throws Exception
+ public void testNewBeanHasNoDisposalMethods() throws Exception
{
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- FoxLocal fox = getInstanceByType(FoxLocal.class);
- FoxLocal newFox = getInstanceByType(FoxLocal.class,new NewLiteral());
- Bean<Litter> litterBean = getBeans(Litter.class).iterator().next();
- CreationalContext<Litter> creationalContext =
getCurrentManager().createCreationalContext(litterBean);
- Litter litter = getInstanceByType(Litter.class);
- litterBean.destroy(litter, creationalContext);
- assert fox.isLitterDisposed();
- assert !newFox.isLitterDisposed();
- }
-
- }.run();
+ FoxLocal fox = getInstanceByType(FoxLocal.class);
+ FoxLocal newFox = getInstanceByType(FoxLocal.class,new NewLiteral());
+ Set<Bean<Litter>> beans = getBeans(Litter.class, new
AnnotationLiteral<Tame>() {});
+ assert beans.size() == 1;
+ Bean<Litter> litterBean = beans.iterator().next();
+ CreationalContext<Litter> creationalContext =
getCurrentManager().createCreationalContext(litterBean);
+ Litter litter = litterBean.create(creationalContext);
+ litterBean.destroy(litter, creationalContext);
+ assert fox.isLitterDisposed();
+ assert !newFox.isLitterDisposed();
}
}