Author: shane.bryzak(a)jboss.com
Date: 2009-03-30 03:11:48 -0400 (Mon, 30 Mar 2009)
New Revision: 2266
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java
Log:
tests for 5.7.2.c, 5.7.2.d
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java 2009-03-30
02:45:16 UTC (rev 2265)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java 2009-03-30
07:11:48 UTC (rev 2266)
@@ -7,6 +7,7 @@
import javax.inject.manager.Manager;
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.testng.annotations.Test;
@@ -43,6 +44,7 @@
assert getCurrentManager().resolveByType(Manager.class).size() > 0;
}
+ @Test
@SpecAssertion(section = "5.7.2", id = "ab")
public void testManagerBeanIsDependentScoped()
{
@@ -50,6 +52,7 @@
assert manager.getScopeType().equals(Dependent.class);
}
+ @Test
@SpecAssertion(section = "5.7.2", id = "ac")
public void testManagerBeanHasStandardDeployment()
{
@@ -57,10 +60,22 @@
assert manager.getDeploymentType().equals(Standard.class);
}
+ @Test
@SpecAssertion(section = "5.7.2", id = "ad")
public void testManagerBeanHasCurrentBinding()
{
Bean<Manager> manager =
getCurrentManager().resolveByType(Manager.class).iterator().next();
assert manager.getBindings().iterator().next() instanceof Current;
}
+
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section = "5.7.2", id = "c"),
+ @SpecAssertion(section = "5.7.2", id = "d")
+ })
+ public void testGetInstanceReturnsContextualInstance()
+ {
+ Bean<FishFarmOffice> bean =
getCurrentManager().resolveByType(FishFarmOffice.class).iterator().next();
+ assert getCurrentManager().getInstance(bean) instanceof FishFarmOffice;
+ }
}
Show replies by date