Author: shane.bryzak(a)jboss.com
Date: 2009-02-19 02:41:39 -0500 (Thu, 19 Feb 2009)
New Revision: 1595
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/context/ContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/context/passivating/PassivatingContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/lookup/injection/InjectionTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
matched a bunch more tests, more chapter 5 assertions
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/context/ContextTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/context/ContextTest.java 2009-02-19
01:54:31 UTC (rev 1594)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/context/ContextTest.java 2009-02-19
07:41:39 UTC (rev 1595)
@@ -26,25 +26,15 @@
*/
public class ContextTest
{
- /**
- * The built-in contexts do not propagate across remote method invocations or
- * to asynchronous processes such as JMS message listeners or EJB timer
- * service timeouts
- */
@Test(groups = { "stub", "contexts", "integration" })
- @SpecAssertion(section = "8.5", id = "unknown")
+ @SpecAssertion(section = "8.5", id = "c")
public void
testBuiltInNormalScopedContextsDoNotPropagateAcrossRemoteMethodInvocations()
{
assert false;
}
- /**
- * The built-in contexts do not propagate across remote method invocations or
- * to asynchronous processes such as JMS message listeners or EJB timer
- * service timeouts
- */
@Test(groups = { "stub", "contexts", "integration" })
- @SpecAssertion(section = "8.5", id = "unknown")
+ @SpecAssertion(section = "8.5", id = "c")
public void
testBuiltInNormalScopedContextsDoNotPropagateAcrossAsynchronousMethodInvocations()
{
assert false;
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/context/passivating/PassivatingContextTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/context/passivating/PassivatingContextTest.java 2009-02-19
01:54:31 UTC (rev 1594)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/integration/context/passivating/PassivatingContextTest.java 2009-02-19
07:41:39 UTC (rev 1595)
@@ -16,42 +16,22 @@
*/
public class PassivatingContextTest extends AbstractDeclarativeTest
{
-
- /**
- * EJB local objects are serializable. Therefore, an enterprise Web Bean may
- * declare any passivating scope.
- */
@Test(groups = { "contexts", "passivation",
"enterpriseBean", "integration" })
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "a")
public void testEJBWebBeanCanDeclarePassivatingScope()
{
deployBeans(Turku.class);
}
- /**
- * The Web Bean manager must guarantee that JMS endpoint proxy objects are
- * serializable.
- */
@Test(groups = { "stub", "contexts", "passivation",
"jms" })
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "u")
public void testJMSEndpointProxyIsSerializable()
{
assert false;
}
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- *
- * @throws NoSuchMethodException
- * @throws SecurityException
- */
@Test(groups = { "contexts", "passivation",
"integration", "broken" }, expectedExceptions =
IllegalProductException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "p")
public void
testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoStatefulSessionBeanFails()
throws SecurityException, NoSuchMethodException
{
deployBeans(CityProducer2.class, Maarianhamina_Broken.class);
@@ -64,23 +44,14 @@
*/
// TODO requires an EJB instance
@Test(groups = { "contexts", "passivation", "stub",
"integration" })
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "review")
public void testStatefulEJBIsSerializedWhenPassivatedByEJBContainer() throws
IOException, ClassNotFoundException
{
assert false;
}
- /**
- * If a producer method or field of scope @Dependent returns a
- * non-serializable object for injection into a stateful session bean, into a
- * non-transient field, Web Bean constructor parameter or initializer method
- * parameter of a Web Bean which declares a passivating scope type, or into a
- * parameter of a producer method which declares a passivating scope type, an
- * IllegalProductException is thrown by the Web Bean manager.
- *
- */
@Test(groups = { "contexts", "passivation", "stub",
"integration" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "8.4", id = "unknown")
+ @SpecAssertion(section = "8.4", id = "p")
public void
testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoStatefulSessionBeanFails()
throws Exception
{
assert false;
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java 2009-02-19
01:54:31 UTC (rev 1594)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java 2009-02-19
07:41:39 UTC (rev 1595)
@@ -35,8 +35,8 @@
@Test
@SpecAssertions({
- @SpecAssertion(section = "4.3.1", id = "unknown"),
- @SpecAssertion(section = "3.2.7", id = "unknown")
+ @SpecAssertion(section = "4.3.1", id = "c"),
+ @SpecAssertion(section = "3.2.7", id = "a")
})
public void testSpecializingBeanHasBindingsOfSpecializedAndSpecializingBean()
{
@@ -49,8 +49,8 @@
@Test
@SpecAssertions({
- @SpecAssertion(section = "4.3.1", id = "unknown"),
- @SpecAssertion(section = "3.2.7", id = "unknown")
+ @SpecAssertion(section = "4.3.1", id = "d"),
+ @SpecAssertion(section = "3.2.7", id = "a")
})
public void testSpecializingBeanHasNameOfSpecializedBean()
{
@@ -61,7 +61,7 @@
}
@Test(expectedExceptions=DefinitionException.class)
- @SpecAssertion(section = "4.3.1", id = "unknown")
+ @SpecAssertion(section = "4.3.1", id = "e")
public void testSpecializingAndSpecializedBeanHasName()
{
deployBeans(FarmYard_Broken.class);
@@ -69,8 +69,8 @@
@Test(groups="broken")
@SpecAssertions({
- @SpecAssertion(section = "4.3.1", id = "unknown"),
- @SpecAssertion(section = "3.2.7", id = "unknown")
+ @SpecAssertion(section = "4.3.1", id = "f"),
+ @SpecAssertion(section = "3.2.7", id = "b")
})
public void testSpecializedBeanNotInstantiated() throws Exception
{
@@ -89,14 +89,14 @@
}
@Test(expectedExceptions=InconsistentSpecializationException.class)
- @SpecAssertion(section="4.3.1", id = "unknown")
+ @SpecAssertion(section="4.3.3", id = "a")
public void testSpecializingBeanDoesNotHaveHigherPrecedenceThanSpecializedBean()
{
deployBeans(Farmer.class, OrganicFarmer_Broken.class);
}
@Test(groups="broken")
- @SpecAssertion(section="4.3.1", id = "unknown")
+ @SpecAssertion(section="4.3.1", id = "g")
public void testProducerMethodOnSpecializedBeanCalledOnSpecializingBean() throws
Exception
{
deployBeans(Office.class, Building.class);
@@ -114,42 +114,42 @@
}
@Test(expectedExceptions=InconsistentSpecializationException.class)
- @SpecAssertion(section="4.3.1", id = "unknown")
+ @SpecAssertion(section="4.3.3", id = "a")
public void testTwoBeansSpecializeTheSameBean()
{
deployBeans(Farmer.class, SheepFarmer_Broken.class, FishFarmer_Broken.class);
}
@Test(groups={"specialization"},expectedExceptions=DefinitionException.class)
- @SpecAssertion(section="3.2.7", id = "unknown")
+ @SpecAssertion(section="3.2.7", id = "d")
public void testSpecializingClassDirectlyExtendsSimpleBean()
{
deployBeans(Tractor_Broken.class);
}
@Test(groups={"specialization"},expectedExceptions=DefinitionException.class)
- @SpecAssertion(section="3.2.7", id = "unknown")
+ @SpecAssertion(section="3.2.7", id = "d")
public void testSpecializingClassDirectlyExtendsNothing()
{
deployBeans(Cow_Broken.class);
}
@Test(groups={"specialization"},expectedExceptions=DefinitionException.class)
- @SpecAssertion(section="3.2.7", id = "unknown")
+ @SpecAssertion(section="3.2.7", id = "d")
public void testSpecializingClassImplementsInterfaceAndExtendsNothing()
{
deployBeans(Donkey_Broken.class);
}
@Test(groups={"broken",
"specialization"},expectedExceptions=DefinitionException.class)
- @SpecAssertion(section="3.3.7", id = "unknown")
+ @SpecAssertion(section="3.3.7", id = "a")
public void testSpecializingBeanDoesNotSupportAllLocalInterfacesOnSpecializedBean()
{
assert false;
}
@Test(groups={"broken",
"specialization"},expectedExceptions=DefinitionException.class)
- @SpecAssertion(section="3.3.7", id = "unknown")
+ @SpecAssertion(section="3.3.7", id = "a")
public void testSpecializingBeanDoesNotSupportLocalInterfaceView()
{
assert false;
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/lookup/injection/InjectionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/lookup/injection/InjectionTest.java 2009-02-19
01:54:31 UTC (rev 1594)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/lookup/injection/InjectionTest.java 2009-02-19
07:41:39 UTC (rev 1595)
@@ -30,7 +30,7 @@
}
@Test(groups = { "injection", "producerMethod" })
- @SpecAssertion(section = "5.2", id = "unknown")
+ @SpecAssertion(section = "5.2", id = "review")
public void testInjectionPerformsBoxingIfNecessary() throws Exception
{
Bean<SpiderProducer> spiderProducer =
createSimpleBean(SpiderProducer.class);
@@ -43,14 +43,14 @@
}
@Test(groups = { "injection", "producerMethod" },
expectedExceptions = NullableDependencyException.class)
- @SpecAssertion(section = "5.2", id = "unknown")
+ @SpecAssertion(section = "5.2", id = "a")
public void testPrimitiveInjectionPointResolvesToNullableWebBean() throws Exception
{
deployBeans(FarmHouseProducer_Broken.class, FarmHouse_Broken.class);
}
@Test(groups = { "injection", "clientProxy" }, expectedExceptions
= ContextNotActiveException.class)
- @SpecAssertion(section = "5.3", id = "unknown")
+ @SpecAssertion(section = "5.3", id = "a")
public void testInvokeNormalInjectedWebBeanWhenContextNotActive()
{
Bean<TunaFarm> tunaFarmBean = createSimpleBean(TunaFarm.class);
@@ -63,7 +63,7 @@
}
@Test(groups = "injection")
- @SpecAssertion(section = "5.3", id = "unknown")
+ @SpecAssertion(section = "5.3", id = "b")
public void testInvokeDependentScopeWhenContextNotActive()
{
Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
@@ -74,7 +74,7 @@
}
@Test(groups = "injection", expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.7", id = "unknown")
+ @SpecAssertion(section = "3.7", id = "outdated")
public void testInjectingStaticField()
{
Bean<BeanWithStaticBoundField_Broken> bean =
createSimpleBean(BeanWithStaticBoundField_Broken.class);
@@ -84,7 +84,7 @@
}
@Test(groups = "injection", expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.7", id = "unknown")
+ @SpecAssertion(section = "3.7", id = "outdated")
public void testInjectingFinalField()
{
Bean<BeanWithFinalBoundField_Broken> bean =
createSimpleBean(BeanWithFinalBoundField_Broken.class);
@@ -111,35 +111,35 @@
}
@Test(groups = { "stub", "injection", "webbeansxml" })
- @SpecAssertion(section = "3.8.2", id = "unknown")
+ @SpecAssertion(section = "3.8.2", id = "a")
public void testInjectFieldsDeclaredInXml()
{
assert false;
}
@Test(groups = { "stub", "injection", "webbeansxml" })
- @SpecAssertion(section = "3.8.2", id = "unknown")
+ @SpecAssertion(section = "3.8.2", id = "b")
public void testInjectedFieldDeclaredInXmlIgnoresJavaAnnotations()
{
assert false;
}
@Test(groups = { "stub", "injection", "webbeansxml" })
- @SpecAssertion(section = "3.8.2", id = "unknown")
+ @SpecAssertion(section = "3.8.2", id = "c")
public void testInjectedFieldDeclaredInXmlAssumesCurrent()
{
assert false;
}
@Test(groups = { "stub", "injection", "webbeansxml" },
expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.8.2", id = "unknown")
+ @SpecAssertion(section = "3.8.2", id = "d")
public void testNonexistentFieldDefinedInXml()
{
assert false;
}
@Test(groups = { "stub", "injection", "webbeansxml" })
- @SpecAssertion(section = "3.8.2", id = "unknown")
+ @SpecAssertion(section = "3.8.2", id = "review")
public void testInjectFieldsDeclaredInXmlAndJava()
{
assert false;
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-02-19 01:54:31 UTC (rev 1594)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-02-19 07:41:39 UTC (rev 1595)
@@ -1663,35 +1663,35 @@
</assertion>
<assertion id="l">
- <text>The lifecycles of the injected objects are managed by the container,
and therefore the application need not explicitly close() any injected JMS object. If the
application calls close() on an instance of a QueueConnection, an
UnsupportedOperationException is thrown by the container.</text>
+ <text>If the application calls close() on an instance of a QueueConnection,
an UnsupportedOperationException is thrown by the container.</text>
</assertion>
<assertion id="m">
- <text>The lifecycles of the injected objects are managed by the container,
and therefore the application need not explicitly close() any injected JMS object. If the
application calls close() on an instance of a QueueSession, an
UnsupportedOperationException is thrown by the container.</text>
+ <text>If the application calls close() on an instance of a QueueSession, an
UnsupportedOperationException is thrown by the container.</text>
</assertion>
<assertion id="n">
- <text>The lifecycles of the injected objects are managed by the container,
and therefore the application need not explicitly close() any injected JMS object. If the
application calls close() on an instance of a QueueReceiver, an
UnsupportedOperationException is thrown by the container.</text>
+ <text>If the application calls close() on an instance of a QueueReceiver, an
UnsupportedOperationException is thrown by the container.</text>
</assertion>
<assertion id="o">
- <text>The lifecycles of the injected objects are managed by the container,
and therefore the application need not explicitly close() any injected JMS object. If the
application calls close() on an instance of a QueueSender, an
UnsupportedOperationException is thrown by the container.</text>
+ <text>If the application calls close() on an instance of a QueueSender, an
UnsupportedOperationException is thrown by the container.</text>
</assertion>
<assertion id="p">
- <text>The lifecycles of the injected objects are managed by the container,
and therefore the application need not explicitly close() any injected JMS object. If the
application calls close() on an instance of a TopicConnection, an
UnsupportedOperationException is thrown by the container.</text>
+ <text>If the application calls close() on an instance of a TopicConnection,
an UnsupportedOperationException is thrown by the container.</text>
</assertion>
<assertion id="q">
- <text>The lifecycles of the injected objects are managed by the container,
and therefore the application need not explicitly close() any injected JMS object. If the
application calls close() on an instance of a TopicSession, an
UnsupportedOperationException is thrown by the container.</text>
+ <text>If the application calls close() on an instance of a TopicSession, an
UnsupportedOperationException is thrown by the container.</text>
</assertion>
<assertion id="r">
- <text>The lifecycles of the injected objects are managed by the container,
and therefore the application need not explicitly close() any injected JMS object. If the
application calls close() on an instance of a TopicSubscriber, an
UnsupportedOperationException is thrown by the container.</text>
+ <text>If the application calls close() on an instance of a TopicSubscriber,
an UnsupportedOperationException is thrown by the container.</text>
</assertion>
<assertion id="s">
- <text>The lifecycles of the injected objects are managed by the container,
and therefore the application need not explicitly close() any injected JMS object. If the
application calls close() on an instance of a TopicPublisher, an
UnsupportedOperationException is thrown by the container.</text>
+ <text>If the application calls close() on an instance of a TopicPublisher, an
UnsupportedOperationException is thrown by the container.</text>
</assertion>
<assertion id="t">
@@ -2279,27 +2279,112 @@
</section>
<section id="5.4" title="Client proxies">
+ <assertion id="a">
+ <text>Client proxies are never required for a bean whose scope is a
pseudo-scope such as @Dependent</text>
+ </assertion>
+ <assertion id="b">
+ <text>All client proxies must be serializable</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>All client proxies must be serializable</text>
+ </assertion>
</section>
<section id="5.4.1" title="Unproxyable bean types">
-
+ <assertion id="a">
+ <text>Classes without a non-private constructor with no parameters cannot be
proxied by the container</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Classes which are declared final or have final methods cannot be
proxied by the container</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Primitive types cannot be proxied by the container</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Array types cannot be proxied by the container</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an injection point whose declared type cannot be proxied by the
container resolves to a bean with a normal scope, an UnproxyableDependencyException is
thrown by the container at deployment time</text>
+ </assertion>
</section>
<section id="5.4.2" title="Client proxy invocation">
-
+ <assertion id="a">
+ <text>Every time a method of the bean is invoked upon a client proxy, the
client proxy must obtain the context object by calling Manager.getContext(), passing the
bean scope, then obtain an instance of the bean by calling Context.get(), passing the Bean
instance representing the bean and an instance of CreationalContext, and invoke the method
upon the bean</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The behavior of all methods declared by java.lang.Object, except for
toString(), is undefined for a client proxy</text>
+ </assertion>
+
</section>
<section id="5.5" title="The default binding at injection
points">
-
+ <assertion id="a">
+ <text>If an injection point declares no binding, the default binding @Current
is assumed</text>
+ </assertion>
</section>
<section id="5.6" title="Injection point metadata">
-
+ <assertion id="a">
+ <text>The javax.inject.manager.InjectionPoint.getBean() method returns the
Bean object representing the bean that defines the injection point</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The javax.inject.manager.InjectionPoint.getType() and getBindings()
methods return the declared type and bindings of the injection point. If the injection
point is declared in XML, the type and bindings are determined according to Section 9.10,
"Specifying bean types and bindings"</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The javax.inject.manager.InjectionPoint.getMember() method returns the
Field object in the case of field injection, the Method object in the case of method
parameter injection or the Constructor object in the case of constructor parameter
injection</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The javax.inject.manager.InjectionPoint.getAnnotation() and
getAnnotations() methods return annotations of the field in the case of field injection,
or annotations of the parameter in the case of method parameter or constructor parameter
injection. getAnnotation() returns a null value if no annotation of the given type exists
at the injection point</text>
+ </assertion>
</section>
<section id="5.6.1" title="Injecting InjectionPoint">
-
+ <assertion id="a">
+ <text>Whenever a @Dependent scoped object is instantiated by the container
for injection into a second bean, any injection point of type InjectionPoint and binding
@Current receives an instance of InjectionPoint that represents the injection point of the
second bean</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When a @Dependent scoped object is instantiated by the container to
receive a producer method, any injection point of type InjectionPoint and binding @Current
receives a null value</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>When a @Dependent scoped object is instantiated by the container to
receive a producer field, any injection point of type InjectionPoint and binding @Current
receives a null value</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When a @Dependent scoped object is instantiated by the container to
receive an observer , any injection point of type InjectionPoint and binding @Current
receives a null value</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>When a @Dependent scoped object is instantiated by the container to
receive a disposal method invocation, any injection point of type InjectionPoint and
binding @Current receives a null value</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>When a @Dependent scoped object is instantiated by the container during
EL expression evaluation, any injection point of type InjectionPoint and binding @Current
receives a null value</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>When a @Dependent scoped object is instantiated by the container as a
result of a direct call to the Manager API, any injection point of type InjectionPoint and
binding @Current receives a null value</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If a bean that declares any scope other than @Dependent has an
injection point of type InjectionPoint and binding @Current, a DefinitionException is
thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If an object that is not a bean has an injection point of type
InjectionPoint and binding @Current, a DefinitionException is thrown by the container at
deployment time</text>
+ </assertion>
</section>
<section id="5.7" title="The Manager object">
@@ -2307,11 +2392,100 @@
</section>
<section id="5.7.1" title="Resolving dependencies">
-
+ <assertion id="a">
+ <text>Implementations of Bean maintain a reference to an instance of
Manager</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When the Bean implementation performs dependency injection, it must
obtain the contextual instances to inject by calling Manager.getInstanceToInject(),
passing an instance of InjectionPoint that represents the injection point and the instance
of CreationalContext that was passed to Bean.create()</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Manager.getInstanceToInject() returns a contextual instance or client
proxy to be injected to the given injection point</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The Manager.getInstanceToInject() method must Identify the bean by
calling Manager.resolveByType(), passing the type and bindings of the injection
point</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The Manager.getInstanceToInject() method must throw an
UnsatisfiedDependencyException if resolveByType() did not return a bean</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The Manager.getInstanceToInject() method must throw an
AmbiguousDependencyException if resolveByType() returned more than one bean</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The Manager.getInstanceToInject() method must throw an
UnproxyableDependencyExceptionif the bean has a normal scope and the type cannot be
proxied by the container, as defined in Section 5.4.1, "Unproxyable bean
types"</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The Manager.getInstanceToInject() method must obtain an instance of the
bean (or a client proxy) by calling Manager.getInstance(), passing the Bean object
representing the bean, and return it. Alternatively, return an incompletely initialized
instance of the bean that was
+registered by calling CreationalContext.push(), as defined in Section 6.1, "The
Contextual interface"</text>
+ </assertion>
</section>
<section id="5.7.2" title="Obtaining contextual instances">
-
+ <assertion id="a">
+ <text>The container provides a built-in bean with bean type Manager, scope
@Dependent, deployment type @Standard and binding @Current. Thus, any bean may obtain an
instance of Manager by injecting it</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The application may obtain the Manager object from JNDI. The container
must register an instance of Manager with name java:app/Manager in JNDI at deployment
time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A contextual instance of a bean may be obtained by calling
Manager.getInstance(), passing the Bean object representing the bean</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Manager.getInstance() returns a contextual instance or client proxy for
the given bean</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the given Bean instance represents a bean with a normal scope, as
defined in Section 8.2, "Normal scopes and pseudo-scopes", Manager.getInstance()
must return a client proxy</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the Bean instance represents a bean with a pseudo-scope, as defined
in Section 8.2, "Normal scopes and pseudo-scopes", Manager.getInstance() must
obtain the context object by calling Manager.getContext(), passing the bean scope, then
obtain an instance of the bean by calling Context.get(), passing the Bean instance
representing the bean and an instance of CreationalContext</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The Manager.getInstanceByType() methods obtain a contextual instance of
a bean</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If no bindings are passed to Manager.getInstanceByType(), the default
binding @Current is assumed</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If a parameterized type with a type parameter or wildcard is passed to
resolveByType(), an IllegalArgumentException is thrown</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If two instances of the same binding type are passed to
getInstanceByType(), a DuplicateBindingTypeException is thrown</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If an instance of an annotation that is not a binding type is passed to
getInstanceByType(), an IllegalArgumentException is thrown</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The getInstanceByType() method must identify the bean by calling
Manager.resolveByType(), passing the given type and bindings</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>The getInstanceByType() method must throw an
UnsatisfiedDependencyException if resolveByType() did not return a bean</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>The getInstanceByType() method must throw an
AmbiguousDependencyException if resolveByType() returned more than one bean</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>The getInstanceByType() method must obtain an instance of the bean (or
a client proxy) by calling Manager.getInstance(), passing the Bean object representing the
bean, and return it</text>
+ </assertion>
</section>
<section id="5.8" title="Dynamic lookup">
@@ -3040,8 +3214,7 @@
</assertion>
<assertion id="h">
- <text>In either case of assertion f or g above, any non-transient field that
holds a reference to another bean must be serialized along with the bean that is
-being serialized. Therefore, the reference must be to a serializable type</text>
+ <text>In either case of assertion f or g above, any non-transient field that
holds a reference to another bean must be serialized along with the bean that is being
serialized. Therefore, the reference must be to a serializable type</text>
</assertion>
<assertion id="i">