Author: shane.bryzak(a)jboss.com
Date: 2009-03-12 02:47:06 -0400 (Thu, 12 Mar 2009)
New Revision: 1939
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java
Log:
added tests for implicit bean
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java 2009-03-12
03:59:48 UTC (rev 1938)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java 2009-03-12
06:47:06 UTC (rev 1939)
@@ -2,8 +2,10 @@
import static org.jboss.jsr299.tck.tests.lookup.dynamic.PayBy.PaymentMethod.CHEQUE;
+import javax.context.Dependent;
import javax.inject.DuplicateBindingTypeException;
import javax.inject.Instance;
+import javax.inject.Standard;
import javax.inject.manager.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -71,5 +73,24 @@
injectionPoint.getPaymentProcessor().get(new NonBinding() );
}
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section = "5.8", id = "k"),
+ @SpecAssertion(section = "5.8", id = "l"),
+ @SpecAssertion(section = "5.8", id = "m"),
+ @SpecAssertion(section = "5.8", id = "n"),
+ @SpecAssertion(section = "5.8", id = "o")
+ })
+ public void testImplicitBeanExists()
+ {
+ Bean<Instance> instanceBean =
getCurrentManager().resolveByType(Instance.class,
+ new PayByBinding() { public PaymentMethod value() { return CHEQUE;
}}).iterator().next();
+
+ assert instanceBean != null;
+ assert instanceBean.getDeploymentType().equals(Standard.class);
+ assert instanceBean.getScopeType().equals(Dependent.class);
+ assert instanceBean.getName() == null;
+ }
+
}