[webbeans-commits] Webbeans SVN: r3077 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck: tests/context and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-07-17 12:46:21 -0400 (Fri, 17 Jul 2009)
New Revision: 3077
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/AnotherSessionBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextExtensions.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DummyContext.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DummyScoped.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetFromContextualTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/Unregistered.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetTest.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/MockCreationalContext.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetOnInactiveContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetWithNoCreationalContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/InactiveContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MySessionBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java
Log:
update to 20090625 spec assertions
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/MockCreationalContext.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/MockCreationalContext.java 2009-07-17 16:44:57 UTC (rev 3076)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/MockCreationalContext.java 2009-07-17 16:46:21 UTC (rev 3077)
@@ -7,6 +7,7 @@
private static Object lastBeanPushed = null;
private static boolean pushCalled = false;
+ private static boolean releaseCalled = false;
public void push(T incompleteInstance)
{
@@ -34,15 +35,21 @@
MockCreationalContext.pushCalled = pushCalled;
}
+ public static boolean isReleaseCalled()
+ {
+ return releaseCalled;
+ }
+
public static void reset()
{
lastBeanPushed = null;
pushCalled = false;
+ releaseCalled = false;
}
public void release()
{
-
+ releaseCalled = true;
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/AnotherSessionBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/AnotherSessionBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/AnotherSessionBean.java 2009-07-17 16:46:21 UTC (rev 3077)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.context;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.SessionScoped;
+
+@SessionScoped class AnotherSessionBean implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ public void ping() {}
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextExtensions.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextExtensions.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextExtensions.java 2009-07-17 16:46:21 UTC (rev 3077)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.context;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
+
+class ContextExtensions
+{
+ public void addNewContexts(@Observes AfterBeanDiscovery event)
+ {
+ event.addContext(new DummyContext());
+ event.addContext(new DummyContext());
+ }
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java 2009-07-17 16:44:57 UTC (rev 3076)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java 2009-07-17 16:46:21 UTC (rev 3077)
@@ -1,15 +1,11 @@
package org.jboss.jsr299.tck.tests.context;
-import java.lang.annotation.Annotation;
-
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.ContextNotActiveException;
import javax.enterprise.context.Dependent;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.context.SessionScoped;
import javax.enterprise.context.spi.Context;
-import javax.enterprise.context.spi.Contextual;
-import javax.enterprise.context.spi.CreationalContext;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
@@ -18,59 +14,16 @@
import org.testng.annotations.Test;
/**
- * Spec version: 20090519
+ * Spec version: 20090625
*/
@Artifact
public class ContextTest extends AbstractJSR299Test
{
-
- private @interface Dummy
- {
-
- }
-
- private @interface Unregistered
- {
-
- }
-
- private static class DummyContext implements Context
- {
-
- public <T> T get(Contextual<T> bean, CreationalContext<T> creationalContext)
- {
- throw new UnsupportedOperationException();
- }
-
- public <T> T get(Contextual<T> contextual)
- {
- return get(contextual, null);
- }
-
- public Class<? extends Annotation> getScopeType()
- {
- return Dummy.class;
- }
-
- public boolean isActive()
- {
- return true;
- }
- }
-
@Test(expectedExceptions = { IllegalStateException.class }, groups = { "manager" })
@SpecAssertion(section = "6.5.1", id = "b")
public void testGetContextWithTooManyActiveContextsFails()
{
- Context firstContext = new DummyContext()
- {
- };
- Context secondContext = new DummyContext()
- {
- };
- getCurrentManager().addContext(firstContext);
- getCurrentManager().addContext(secondContext);
- getCurrentManager().getContext(Dummy.class);
+ getCurrentManager().getContext(DummyScoped.class);
}
@Test(expectedExceptions = { ContextNotActiveException.class }, groups = { "manager" })
@@ -82,11 +35,11 @@
@Test(groups = { "contexts" })
@SpecAssertions({
- @SpecAssertion(section = "6.2", id = "aa"),
- @SpecAssertion(section = "2.4.1", id = "a"),
- @SpecAssertion(section = "2.4.1", id = "b"),
- @SpecAssertion(section = "2.4.1", id = "c"),
- @SpecAssertion(section = "11.3.18", id = "a")
+ @SpecAssertion(section = "2.4.1", id = "aa"),
+ @SpecAssertion(section = "2.4.1", id = "ab"),
+ @SpecAssertion(section = "2.4.1", id = "ac"),
+ @SpecAssertion(section = "2.4.1", id = "ca"),
+ @SpecAssertion(section = "11.3.15", id = "a")
})
public void testBuiltInContexts()
{
@@ -98,5 +51,6 @@
assert context != null;
context = getCurrentManager().getContext(ApplicationScoped.class);
assert context != null;
+ // QUESTION why can't we grab the ConversionScoped context here?
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java 2009-07-17 16:44:57 UTC (rev 3076)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java 2009-07-17 16:46:21 UTC (rev 3077)
@@ -12,9 +12,7 @@
import org.testng.annotations.Test;
/**
- *
- * Spec version: 20090519
- *
+ * Spec version: 20090625
*/
@Artifact
public class DestroyedInstanceReturnedByGetTest extends AbstractJSR299Test
@@ -22,7 +20,7 @@
@Test(groups = { "contexts" })
@SpecAssertions({
@SpecAssertion(section = "6.2", id = "q"),
- @SpecAssertion(section = "11.1", id = "a")
+ @SpecAssertion(section = "11.1", id = "aa")
})
public void testDestroyedInstanceMustNotBeReturnedByGet()
{
@@ -32,6 +30,7 @@
assert beanInstance != null;
destroyContext(getCurrentManager().getContext(SessionScoped.class));
setContextActive(getCurrentManager().getContext(SessionScoped.class));
+
beanInstance = getCurrentManager().getContext(SessionScoped.class).get(mySessionBean);
assert beanInstance == null;
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DummyContext.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DummyContext.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DummyContext.java 2009-07-17 16:46:21 UTC (rev 3077)
@@ -0,0 +1,30 @@
+package org.jboss.jsr299.tck.tests.context;
+
+import java.lang.annotation.Annotation;
+
+import javax.enterprise.context.spi.Context;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+
+class DummyContext implements Context
+{
+ public <T> T get(Contextual<T> bean, CreationalContext<T> creationalContext)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public <T> T get(Contextual<T> contextual)
+ {
+ return get(contextual, null);
+ }
+
+ public Class<? extends Annotation> getScopeType()
+ {
+ return DummyScoped.class;
+ }
+
+ public boolean isActive()
+ {
+ return true;
+ }
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DummyScoped.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DummyScoped.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DummyScoped.java 2009-07-17 16:46:21 UTC (rev 3077)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.context;
+
+@interface DummyScoped
+{
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetFromContextualTest.java (from rev 3070, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetTest.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetFromContextualTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetFromContextualTest.java 2009-07-17 16:46:21 UTC (rev 3077)
@@ -0,0 +1,42 @@
+package org.jboss.jsr299.tck.tests.context;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.impl.MockCreationalContext;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+/**
+ * Spec version: 20090625
+ */
+@Artifact
+public class GetFromContextualTest extends AbstractJSR299Test
+{
+ @Test(groups = { "contexts" })
+ @SpecAssertions({
+ @SpecAssertion(section = "6.2", id = "o"),
+ @SpecAssertion(section = "6.2", id = "na")
+ })
+ public void testGetMayNotCreateNewInstanceUnlessCreationalContextGiven()
+ {
+ Contextual<MySessionBean> mySessionBean = getBeans(MySessionBean.class).iterator().next();
+ assert getCurrentManager().getContext(SessionScoped.class).get(mySessionBean) == null;
+
+ Contextual<MyApplicationBean> myApplicationBean = getBeans(MyApplicationBean.class).iterator().next();
+ assert getCurrentManager().getContext(ApplicationScoped.class).get(myApplicationBean) == null;
+
+ // Now try same operation with a CreationalContext
+ CreationalContext<MySessionBean> myCreationalContext = new MockCreationalContext<MySessionBean>();
+ assert getCurrentManager().getContext(SessionScoped.class).get(mySessionBean, myCreationalContext) != null;
+
+ CreationalContext<MyApplicationBean> myOtherCreationalContext = new MockCreationalContext<MyApplicationBean>();
+ assert getCurrentManager().getContext(ApplicationScoped.class).get(myApplicationBean, myOtherCreationalContext) != null;
+ }
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetOnInactiveContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetOnInactiveContextTest.java 2009-07-17 16:44:57 UTC (rev 3076)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetOnInactiveContextTest.java 2009-07-17 16:46:21 UTC (rev 3077)
@@ -11,7 +11,7 @@
import org.testng.annotations.Test;
/**
- * Spec version: 20090519
+ * Spec version: 20090625
*/
@Artifact
public class GetOnInactiveContextTest extends AbstractJSR299Test
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetTest.java 2009-07-17 16:44:57 UTC (rev 3076)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetTest.java 2009-07-17 16:46:21 UTC (rev 3077)
@@ -1,40 +0,0 @@
-package org.jboss.jsr299.tck.tests.context;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.context.SessionScoped;
-import javax.enterprise.context.spi.Contextual;
-import javax.enterprise.context.spi.CreationalContext;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.impl.MockCreationalContext;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.testng.annotations.Test;
-
-/**
- *
- * Spec version: 20090519
- *
- */
-@Artifact
-public class GetTest extends AbstractJSR299Test
-{
- @Test(groups = { "contexts" })
- @SpecAssertion(section = "6.2", id = "o")
- public void testGetMayNotCreateNewInstanceUnlessCreationalContextGiven()
- {
- Contextual<MySessionBean> mySessionBean = getBeans(MySessionBean.class).iterator().next();
- assert getCurrentManager().getContext(SessionScoped.class).get(mySessionBean) == null;
-
- Contextual<MyApplicationBean> myApplicationBean = getBeans(MyApplicationBean.class).iterator().next();
- assert getCurrentManager().getContext(ApplicationScoped.class).get(myApplicationBean) == null;
-
- // Now try same operation with a CreationalContext
- CreationalContext<MySessionBean> myCreationalContext = new MockCreationalContext<MySessionBean>();
- assert getCurrentManager().getContext(SessionScoped.class).get(mySessionBean, myCreationalContext) != null;
-
- CreationalContext<MyApplicationBean> myOtherCreationalContext = new MockCreationalContext<MyApplicationBean>();
- assert getCurrentManager().getContext(ApplicationScoped.class).get(myApplicationBean, myOtherCreationalContext) != null;
- }
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetWithNoCreationalContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetWithNoCreationalContextTest.java 2009-07-17 16:44:57 UTC (rev 3076)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetWithNoCreationalContextTest.java 2009-07-17 16:46:21 UTC (rev 3077)
@@ -10,9 +10,7 @@
import org.testng.annotations.Test;
/**
- *
- * Spec version: 20090519
- *
+ * Spec version: 20090625
*/
@Artifact
public class GetWithNoCreationalContextTest extends AbstractJSR299Test
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/InactiveContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/InactiveContextTest.java 2009-07-17 16:44:57 UTC (rev 3076)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/InactiveContextTest.java 2009-07-17 16:46:21 UTC (rev 3077)
@@ -9,15 +9,12 @@
import org.testng.annotations.Test;
/**
- *
* Spec version: 20090519
- *
*/
@Artifact
public class InactiveContextTest extends AbstractJSR299Test
{
-
@Test(expectedExceptions = { ContextNotActiveException.class }, groups = { "manager" })
@SpecAssertion(section = "6.2", id = "m")
public void testGetContextWithNoActiveContextsFails()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MySessionBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MySessionBean.java 2009-07-17 16:44:57 UTC (rev 3076)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MySessionBean.java 2009-07-17 16:46:21 UTC (rev 3077)
@@ -23,7 +23,6 @@
public void ping()
{
-
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java 2009-07-17 16:44:57 UTC (rev 3076)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java 2009-07-17 16:46:21 UTC (rev 3077)
@@ -9,13 +9,10 @@
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.impl.MockCreationalContext;
-import org.jboss.jsr299.tck.tests.context.dependent.ejb.FoxRunLocal;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
/**
- * This class tests a basic context against section 8 of the specification
- *
* Spec version: 20090519
*
* @author Nicklas Karlsson
@@ -27,9 +24,10 @@
{
@Test(groups = { "contexts" })
- @SpecAssertions( {
- @SpecAssertion(section = "6.2", id = "j"),
- @SpecAssertion(section = "6.3", id = "c")
+ @SpecAssertions( {
+ @SpecAssertion(section = "6.2", id = "j"),
+ @SpecAssertion(section = "6.2", id = "l"),
+ @SpecAssertion(section = "6.3", id = "c")
} )
public void testGetReturnsExistingInstance()
{
@@ -39,10 +37,14 @@
first.setId(10);
MySessionBean second = getCurrentManager().getContext(SessionScoped.class).get(mySessionBean, creationalContext);
assert second.getId() == 10;
+ MySessionBean third = getCurrentManager().getContext(SessionScoped.class).get(mySessionBean);
+ assert third.getId() == 10;
+ MySessionBean fourth = getCurrentManager().getContext(SessionScoped.class).get(mySessionBean, getCurrentManager().createCreationalContext(mySessionBean));
+ assert fourth.getId() == 10;
}
@Test(groups = { "contexts" })
- @SpecAssertions( {
+ @SpecAssertions( {
@SpecAssertion(section = "6.2", id = "l")
} )
public void testGetWithCreationalContextReturnsNewInstance()
@@ -73,7 +75,7 @@
}
@Test(groups = { "contexts" })
- @SpecAssertions( {
+ @SpecAssertions( {
@SpecAssertion(section = "6.2", id = "p"),
@SpecAssertion(section = "6.3", id = "d")
})
@@ -94,8 +96,26 @@
assert bean.isDestroyCalled();
}
+ @Test
+ // This assertion is very weak and vague
+ @SpecAssertion(section = "6.2", id = "r")
+ public void testDestroyForSameCreationalContextOnly()
+ {
+ Context sessionContext = getCurrentManager().getContext(SessionScoped.class);
+ Bean<AnotherSessionBean> sessionBean = getBeans(AnotherSessionBean.class).iterator().next();
+ MockCreationalContext.reset();
+ CreationalContext<AnotherSessionBean> creationalContext = new MockCreationalContext<AnotherSessionBean>();
+ AnotherSessionBean instance = sessionContext.get(sessionBean, creationalContext);
+ instance.ping();
+
+ sessionBean.destroy(instance, getCurrentManager().createCreationalContext(sessionBean));
+ assert !MockCreationalContext.isReleaseCalled();
+ sessionBean.destroy(instance, creationalContext);
+ assert MockCreationalContext.isReleaseCalled();
+ }
+
@Test(groups = { "contexts" })
- @SpecAssertions( {
+ @SpecAssertions( {
@SpecAssertion(section = "6.3", id = "e")
})
public void testSameNormalScopeBeanInjectedEverywhere()
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/Unregistered.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/Unregistered.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/Unregistered.java 2009-07-17 16:46:21 UTC (rev 3077)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.context;
+
+@interface Unregistered
+{
+}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3076 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-07-17 12:44:57 -0400 (Fri, 17 Jul 2009)
New Revision: 3076
Modified:
tck/trunk/impl/src/main/resources/tck-audit-20090519.xml
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
fix some typos
Modified: tck/trunk/impl/src/main/resources/tck-audit-20090519.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit-20090519.xml 2009-07-17 12:13:59 UTC (rev 3075)
+++ tck/trunk/impl/src/main/resources/tck-audit-20090519.xml 2009-07-17 16:44:57 UTC (rev 3076)
@@ -2568,7 +2568,7 @@
</assertion>
<assertion id="q">
- <text> A destroyed instance must not subsequently be returned by the |get()| method.</text>
+ <text>A destroyed instance must not subsequently be returned by the |get()| method.</text>
</assertion>
</section>
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-17 12:13:59 UTC (rev 3075)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-17 16:44:57 UTC (rev 3076)
@@ -205,20 +205,25 @@
</section>
<section id="2.4.1" title="Built-in scope types">
- <assertion id="a" testable="false">
- <text>The |@RequestScoped|, |@ApplicationScoped| and |@SessionScoped| annotations defined in Section 6.7, "Context management for built-in scopes" represent the standard scopes defined by the Java Servlets specification</text>
- <note>This is a statement of intent</note>
+ <assertion id="aa">
+ <text>There are five standard scope types defined by this specification, all defined in the package javax.enterprise.context. The |@RequestScoped|~, |@ApplicationScoped| and |@SessionScoped|~ annotations defined in Section 6.7, "Context management for built-in scopes" represent the standard scopes defined by the Java Servlets specification.</text>
</assertion>
- <assertion id="b" testable="false">
- <text>The |@ConversationScoped| annotation represents the conversation scope defined in Section 6.7.4, "Conversation context lifecycle".</text>
- <note>This is a statement of intent</note>
+ <assertion id="ab">
+ <text>There are five standard scope types defined by this specification, all defined in the package javax.enterprise.context. The ~|@RequestScoped|, ~|@ApplicationScoped|~ and |@SessionScoped|~ annotations defined in Section 6.7, "Context management for built-in scopes" represent the standard scopes defined by the Java Servlets specification.</text>
</assertion>
- <assertion id="c" testable="false">
- <text>The |@Dependent| pseudo-scope is for dependent objects, as defined in Section 6.4, "Dependent pseudo-scope"</text>
- <note>This is a statement of intent</note>
+ <assertion id="ac">
+ <text>There are five standard scope types defined by this specification, all defined in the package javax.enterprise.context. The ~|@RequestScoped|, |@ApplicationScoped| and ~|@SessionScoped| annotations defined in Section 6.7, "Context management for built-in scopes" represent the standard scopes defined by the Java Servlets specification.</text>
</assertion>
+
+ <assertion id="ba">
+ <text>There are five standard scope types defined by this specification, all defined in the package javax.enterprise.context. The |@ConversationScoped| annotation represents the conversation scope defined in Section 6.7.4, "Conversation context lifecycle".</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>There are five standard scope types defined by this specification, all defined in the package javax.enterprise.context. The |@Dependent| pseudo-scope is for dependent objects, as defined in Section 6.4, "Dependent pseudo-scope"</text>
+ </assertion>
</section>
<section id="2.4.2" title="Defining new scope types">
@@ -573,23 +578,23 @@
</assertion>
<assertion id="ba">
- <text>A bean class may also specify a ~scope~, name, deployment type, stereotypes and/or bindings</text>
+ <text>A bean class may also specify a scope~, name, deployment type, stereotypes and/or bindings~</text>
</assertion>
<assertion id="bb">
- <text>A bean class may also specify a scope~, name~, deployment type, stereotypes and/or bindings</text>
+ <text>A bean class may also specify a ~scope, ~name~, deployment type, stereotypes and/or bindings~</text>
</assertion>
<assertion id="bc">
- <text>A bean class may also specify a scope, name~, deployment type~, stereotypes and/or bindings</text>
+ <text>A bean class may also specify a ~scope, name, ~deployment type~, stereotypes and/or bindings~</text>
</assertion>
<assertion id="bd">
- <text>A bean class may also specify a scope, name, deployment type~, stereotypes~ and/or bindings</text>
+ <text>A bean class may also specify ~a scope, name, deployment type, ~stereotypes~ and/or bindings~</text>
</assertion>
<assertion id="be">
- <text>A bean class may also specify a scope, name, deployment type, stereotypes~ and/or bindings~</text>
+ <text>A bean class may also specify ~a scope, name, deployment type, stereotypes and/or ~bindings</text>
</assertion>
<assertion id="c">
@@ -738,23 +743,23 @@
</assertion>
<assertion id="ba">
- <text>A bean class may also specify a ~scope~, name, deployment type, stereotypes and/or bindings</text>
+ <text>A bean class may also specify a scope~, name, deployment type, stereotypes and/or bindings~</text>
</assertion>
<assertion id="bb">
- <text>A bean class may also specify a scope~, name~, deployment type, stereotypes and/or bindings</text>
+ <text>A bean class may also specify a ~scope, ~name~, deployment type, stereotypes and/or bindings~</text>
</assertion>
<assertion id="bc">
- <text>A bean class may also specify a scope, name~, deployment type~, stereotypes and/or bindings</text>
+ <text>A bean class may also specify a ~scope, name, ~deployment type~, stereotypes and/or bindings~</text>
</assertion>
<assertion id="bd">
- <text>A bean class may also specify a scope, name, deployment type~, stereotypes~ and/or bindings</text>
+ <text>A bean class may also specify ~a scope, name, deployment type, ~stereotypes~ and/or bindings~</text>
</assertion>
<assertion id="be">
- <text>A bean class may also specify a scope, name, deployment type, stereotypes~ and/or bindings~</text>
+ <text>A bean class may also specify ~a scope, name, deployment type, stereotypes and/or ~bindings</text>
</assertion>
<assertion id="c">
@@ -2263,15 +2268,15 @@
</assertion>
<assertion id="j">
- <text>The |Context.get()| method may either return an existing instance of the given contextual type, ~or if no |CreationalContext| is given, return a null value, or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create() and return the new instance~.</text>
+ <text>The |Context.get()| method may either return an existing instance of the given contextual type, ~or if no |CreationalContext| is given, return a null value, or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create()| and return the new instance~.</text>
</assertion>
<assertion id="k">
- <text>The |Context.get()| method may either ~return an existing instance of the given contextual type~, or if no |CreationalContext| is given, return a null value, ~or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create() and return the new instance~.</text>
+ <text>The |Context.get()| method may either ~return an existing instance of the given contextual type~, or if no |CreationalContext| is given, return a null value, ~or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create()| and return the new instance~.</text>
</assertion>
<assertion id="l">
- <text>The |Context.get()| method may either ~return an existing instance of the given contextual type, or if no |CreationalContext| is given, return a null value~, or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create() and return the new instance.</text>
+ <text>The |Context.get()| method may either ~return an existing instance of the given contextual type, or if no |CreationalContext| is given, return a null value~, or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create()| and return the new instance.</text>
</assertion>
<assertion id="m">
@@ -2291,12 +2296,11 @@
</assertion>
<assertion id="p">
- <text>The context object is responsible for destroying any contextual instance it creates by passing the instance to the |destroy()|
-method of the Contextual object representing the contextual type.</text>
+ <text>The context object is responsible for destroying any contextual instance it creates by passing the instance to the |destroy()| method of the Contextual object representing the contextual type.</text>
</assertion>
<assertion id="q">
- <text> A destroyed instance must not subsequently be returned by the |get()| method.</text>
+ <text>A destroyed instance must not subsequently be returned by the |get()| method.</text>
</assertion>
<assertion id="r">
@@ -2316,7 +2320,7 @@
</assertion>
<assertion id="c">
- <text>The |get()| operation of the |Context| object for an active normal scope returns the current instance of the given contextual type</text>
+ <text>The |get()| operation of the |Context| object for an active normal scope returns the current instance of the given contextual type.</text>
</assertion>
<assertion id="d">
@@ -3760,6 +3764,10 @@
</section>
<section id="11.1" title="The Bean interface">
+ <assertion id="aa">
+ <text>Implementations of |Bean| must also implement the inherited operations defined by the |Contextual| interface defined in Section 6.1, "The Contextual interface".</text>
+ </assertion>
+
<assertion id="ba">
<text>|getTypes()|, |getBindings()|, |getScopeType()|, |getName()| and |getStereotypes()| must return the bean types, bindings, scope type, EL name and stereotypes of the bean, as defined in Chapter 2, Concepts.</text>
</assertion>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3075 - ri/trunk/impl/src/main/java/org/jboss/webbeans and 22 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-07-17 08:13:59 -0400 (Fri, 17 Jul 2009)
New Revision: 3075
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/ProcessObserverMethodImpl.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/addDefinitionError/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/addDefinitionError/javax.enterprise.inject.spi.Extension
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Jamsa_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Kuopio_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/London_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Loviisa_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Mikkeli_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Nokia_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Uusikaupunki_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Violation2.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/InitializedBinding.java
Modified:
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Bean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ManagerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AbstractBeanDeployer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/ActivitiesTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/child/SameBeanTypeInChildActivityTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/current/ELCurrentActivityTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/current/InstanceCurrentActivityTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/NullProducerTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MyContextual.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken6/NonSerializableTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken7/NonSerializableTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken8/NonSerializableTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/addDefinitionError/AddDefinitionErrorTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/ImplicitEventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java
Log:
Changes to the Bean interface, implementation, and tests for the latest specification.
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Bean.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Bean.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Bean.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -49,6 +49,7 @@
/**
* The deployment type of a bean
+ * @deprecated
*
* @return the deployment type
*/
@@ -62,13 +63,21 @@
public String getName();
/**
- * The serializability of a bean
+ * The bean class of the managed bean or session bean or of the bean that
+ * declares the producer method or field
*
- * @return true if the bean is serializable
+ * @return the class of the managed bean
*/
- public boolean isSerializable();
+ public Class<?> getBeanClass();
/**
+ * Test to see if the bean is a policy
+ *
+ * @return true if the bean is a policy
+ */
+ public boolean isPolicy();
+
+ /**
* The nullability of a bean
*
* @return true if the bean is nullable
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -16,6 +16,7 @@
*/
package org.jboss.webbeans;
+import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.Iterator;
@@ -34,7 +35,7 @@
*
* @param <T>
*/
-public class InstanceImpl<T> extends FacadeImpl<T> implements Instance<T>
+public class InstanceImpl<T> extends FacadeImpl<T> implements Instance<T>, Serializable
{
private static final long serialVersionUID = -376721889693284887L;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -17,6 +17,7 @@
package org.jboss.webbeans;
import java.lang.annotation.Annotation;
+import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
@@ -27,7 +28,6 @@
import java.util.List;
import java.util.Set;
-import javax.enterprise.context.Dependent;
import javax.enterprise.event.Event;
import javax.enterprise.inject.AmbiguousResolutionException;
import javax.enterprise.inject.Instance;
@@ -46,6 +46,7 @@
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.bootstrap.api.Service;
+import org.jboss.webbeans.injection.FieldInjectionPoint;
import org.jboss.webbeans.introspector.WBAnnotated;
import org.jboss.webbeans.metadata.cache.MetaAnnotationStore;
import org.jboss.webbeans.resolution.ResolvableWBClass;
@@ -104,14 +105,14 @@
}
specializedBeans.add(abstractBean.getSpecializedBean());
}
- if (Beans.isPassivatingBean(bean, beanManager) && bean instanceof AbstractClassBean)
+ if (Beans.isPassivationCapableBean(bean) && bean instanceof AbstractClassBean<?>)
{
AbstractClassBean<?> classBean = (AbstractClassBean<?>) bean;
if (classBean.hasDecorators())
{
for (Decorator<?> decorator : classBean.getDecorators())
{
- if (!decorator.isSerializable())
+ if (!Reflections.isSerializable(decorator.getBeanClass()))
{
throw new UnserializableDependencyException("The bean " + bean + " declares a passivating scope but has non-serializable decorator: " + decorator);
}
@@ -166,7 +167,7 @@
{
throw new NullableDependencyException("The injection point " + ij + " has nullable dependencies");
}
- if (Beans.isPassivatingBean(ij.getBean(), beanManager) && !resolvedBean.isSerializable() && resolvedBean.getScopeType().equals(Dependent.class))
+ if (Beans.isPassivatingScope(ij.getBean(), beanManager) && (!ij.isTransient()) && !Beans.isPassivationCapableBean(resolvedBean))
{
throw new UnserializableDependencyException("The bean " + ij.getBean() + " declares a passivating scope but has non-serializable dependency: " + resolvedBean);
}
@@ -177,7 +178,7 @@
List<RIBean<?>> specializedBeans = new ArrayList<RIBean<?>>();
for (Bean<?> bean : manager.getBeans())
{
- if (bean instanceof RIBean)
+ if (bean instanceof RIBean<?>)
{
validateRIBean((RIBean<?>) bean, manager, specializedBeans);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -292,7 +292,7 @@
Bean<?> resolvedBean = manager.getBeans(injectionPoint.getJavaClass(), bindings).iterator().next();
if (passivating)
{
- if (Dependent.class.equals(resolvedBean.getScopeType()) && !resolvedBean.isSerializable() && (((injectionPoint instanceof WBField) && !((WBField<?>) injectionPoint).isTransient()) || (injectionPoint instanceof WBParameter)))
+ if (Dependent.class.equals(resolvedBean.getScopeType()) && !Reflections.isSerializable(resolvedBean.getBeanClass()) && (((injectionPoint instanceof WBField) && !((WBField<?>) injectionPoint).isTransient()) || (injectionPoint instanceof WBParameter)))
{
return false;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -205,41 +205,44 @@
{
throw new IllegalProductException("Cannot return null from a non-dependent producer method");
}
- boolean passivating = manager.getServices().get(MetaAnnotationStore.class).getScopeModel(getScopeType()).isPassivating();
- if (passivating && !Reflections.isSerializable(instance.getClass()))
+ else if (instance != null)
{
- throw new IllegalProductException("Producers cannot declare passivating scope and return a non-serializable class");
- }
- InjectionPoint injectionPoint = manager.getInjectionPoint();
- if (injectionPoint == null)
- {
- return;
- }
- if (isDependent() && Beans.isPassivatingBean(injectionPoint.getBean(), manager))
- {
- if (injectionPoint.getMember() instanceof Field)
+ boolean passivating = manager.getServices().get(MetaAnnotationStore.class).getScopeModel(getScopeType()).isPassivating();
+ if (passivating && !Reflections.isSerializable(instance.getClass()))
{
- if (!Reflections.isTransient(injectionPoint.getMember()) && instance != null && !Reflections.isSerializable(instance.getClass()))
- {
- throw new IllegalProductException("Dependent scoped producers cannot produce non-serializable instances for injection into non-transient fields of passivating beans\n\nProducer: " + this.toString() + "\nInjection Point: " + injectionPoint.toString());
- }
+ throw new IllegalProductException("Producers cannot declare passivating scope and return a non-serializable class");
}
- else if (injectionPoint.getMember() instanceof Method)
+ InjectionPoint injectionPoint = manager.getInjectionPoint();
+ if (injectionPoint == null)
{
- Method method = (Method) injectionPoint.getMember();
- if (method.isAnnotationPresent(Initializer.class))
+ return;
+ }
+ if (!Reflections.isSerializable(instance.getClass()) && Beans.isPassivationCapableBean(injectionPoint.getBean()))
+ {
+ if (injectionPoint.getMember() instanceof Field)
{
- throw new IllegalProductException("Dependent scoped producers cannot produce non-serializable instances for injection into parameters of intializers of beans declaring passivating scope. Bean " + toString() + " being injected into " + injectionPoint.toString());
+ if (!Reflections.isTransient(injectionPoint.getMember()) && instance != null && !Reflections.isSerializable(instance.getClass()))
+ {
+ throw new IllegalProductException("Producers cannot produce non-serializable instances for injection into non-transient fields of passivating beans\n\nProducer: " + this.toString() + "\nInjection Point: " + injectionPoint.toString());
+ }
}
- if (method.isAnnotationPresent(Produces.class))
+ else if (injectionPoint.getMember() instanceof Method)
{
- throw new IllegalProductException("Dependent scoped producers cannot produce non-serializable instances for injection into parameters of producer methods declaring passivating scope. Bean " + toString() + " being injected into " + injectionPoint.toString());
+ Method method = (Method) injectionPoint.getMember();
+ if (method.isAnnotationPresent(Initializer.class))
+ {
+ throw new IllegalProductException("Producers cannot produce non-serializable instances for injection into parameters of intializers of beans declaring passivating scope. Bean " + toString() + " being injected into " + injectionPoint.toString());
+ }
+ if (method.isAnnotationPresent(Produces.class))
+ {
+ throw new IllegalProductException("Producers cannot produce non-serializable instances for injection into parameters of producer methods declaring passivating scope. Bean " + toString() + " being injected into " + injectionPoint.toString());
+ }
}
+ else if (injectionPoint.getMember() instanceof Constructor)
+ {
+ throw new IllegalProductException("Producers cannot produce non-serializable instances for injection into parameters of constructors of beans declaring passivating scope. Bean " + toString() + " being injected into " + injectionPoint.toString());
+ }
}
- else if (injectionPoint.getMember() instanceof Constructor)
- {
- throw new IllegalProductException("Dependent scoped producers cannot produce non-serializable instances for injection into parameters of constructors of beans declaring passivating scope. Bean " + toString() + " being injected into " + injectionPoint.toString());
- }
}
}
@@ -351,6 +354,11 @@
protected abstract T produceInstance(CreationalContext<T> creationalContext);
+ public boolean isPolicy()
+ {
+ return false;
+ }
+
/**
* Gets a string representation
*
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -345,4 +345,9 @@
return id;
}
+ public boolean isPolicy()
+ {
+ return false;
+ }
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -386,6 +386,11 @@
{
return manager.getServices().get(EjbServices.class).resolveEjb(getEjbDescriptor().delegate());
}
+
+ public boolean isPolicy()
+ {
+ return false;
+ }
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -45,6 +45,13 @@
}
/**
+ * Abstract getter for the delegate
+ *
+ * @return The delegate
+ */
+ protected abstract Bean<T> delegate();
+
+ /**
* Destroys an instance through the delegate
*
* @param instance The instance to destroy
@@ -55,6 +62,22 @@
}
/**
+ * Compares an object with the delegate
+ *
+ * @return True if equals, false otherwise
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ public Class<?> getBeanClass()
+ {
+ return delegate().getBeanClass();
+ }
+
+ /**
* Gets the binding types of the delegate
*
* @return The binding types
@@ -74,6 +97,11 @@
return delegate().getDeploymentType();
}
+ public Set<InjectionPoint> getInjectionPoints()
+ {
+ return delegate().getInjectionPoints();
+ }
+
/**
* Gets the name of the delegate
*
@@ -105,31 +133,6 @@
}
/**
- * Indicates if the delegate is nullable
- *
- * @return True if nullable, false otherwise
- */
- public boolean isNullable()
- {
- return delegate().isNullable();
- }
-
- /**
- * Indicates if the delegate is serializable
- *
- * @return True if serializable, false otherwise
- */
- public boolean isSerializable()
- {
- return delegate().isSerializable();
- }
-
- public Set<InjectionPoint> getInjectionPoints()
- {
- return delegate().getInjectionPoints();
- }
-
- /**
* Gets the hash code of the delegate
*
* @return The hash code
@@ -141,22 +144,19 @@
}
/**
- * Compares an object with the delegate
+ * Indicates if the delegate is nullable
*
- * @return True if equals, false otherwise
+ * @return True if nullable, false otherwise
*/
- @Override
- public boolean equals(Object obj)
+ public boolean isNullable()
{
- return delegate().equals(obj);
+ return delegate().isNullable();
}
- /**
- * Abstract getter for the delegate
- *
- * @return The delegate
- */
- protected abstract Bean<T> delegate();
+ public boolean isPolicy()
+ {
+ return delegate().isPolicy();
+ }
/**
* Returns a string representation
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -60,6 +60,11 @@
public abstract Class<T> getType();
+ public Class<?> getBeanClass()
+ {
+ return getType();
+ }
+
public abstract void initialize(BeanDeployerEnvironment environment);
public abstract boolean isSpecializing();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -533,4 +533,10 @@
return specializedBean;
}
+ public boolean isPolicy()
+ {
+ //TODO Implement the isPolicy() on SimpleBean
+ return false;
+ }
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -66,12 +66,6 @@
// TODO Auto-generated method stub
}
- @Override
- public boolean isSerializable()
- {
- return true;
- }
-
protected abstract T newInstance(Type type, Set<Annotation> annotations);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -96,17 +96,18 @@
return false;
}
- public boolean isSerializable()
+ @Override
+ public boolean isSpecializing()
{
return false;
}
- @Override
- public boolean isSpecializing()
+ public boolean isPolicy()
{
+ //TODO Implement the isPolicy() method based on the annotations of this bean
return false;
}
-
+
@Override
public boolean isProxyable()
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -56,6 +56,12 @@
return TYPE;
}
+ @Override
+ public Class<?> getBeanClass()
+ {
+ return EventImpl.class;
+ }
+
public Set<Type> getTypes()
{
return DEFAULT_TYPES;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -57,6 +57,12 @@
return TYPE;
}
+ @Override
+ public Class<?> getBeanClass()
+ {
+ return InstanceImpl.class;
+ }
+
public Set<Type> getTypes()
{
return DEFAULT_TYPES;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ManagerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ManagerBean.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ManagerBean.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -63,12 +63,6 @@
}
@Override
- public boolean isSerializable()
- {
- return true;
- }
-
- @Override
public String toString()
{
return "Built-in javax.inject.manager.Manager bean";
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AbstractBeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AbstractBeanDeployer.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AbstractBeanDeployer.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -16,12 +16,15 @@
*/
package org.jboss.webbeans.bootstrap;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Set;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Initializer;
import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.AnnotatedMethod;
import javax.enterprise.inject.spi.ObserverMethod;
import org.jboss.webbeans.BeanManagerImpl;
@@ -52,8 +55,9 @@
private static final LogProvider log = Logging.getLogProvider(AbstractBeanDeployer.class);
- private final BeanManagerImpl manager;
+ private final BeanManagerImpl manager;
private final BeanDeployerEnvironment environment;
+ private final List<Throwable> definitionErrors = new ArrayList<Throwable>();
public AbstractBeanDeployer(BeanManagerImpl manager, BeanDeployerEnvironment environment)
{
@@ -163,8 +167,15 @@
{
ObserverMethodImpl<?, ?> observer = ObserverFactory.create(method, declaringBean, manager);
environment.getObservers().add(observer);
+ //TODO Not sure how to create the templated event without any type information here
+ //fireProcessObserverMethod(observer, method);
}
+ private <X, T> void fireProcessObserverMethod(final ObserverMethodImpl<X, T> observerMethod, final AnnotatedMethod<X> method)
+ {
+ manager.fireEvent(new ProcessObserverMethodImpl<X, T>(method, observerMethod, definitionErrors));
+ }
+
protected <T> void createSimpleBean(WBClass<T> annotatedClass)
{
SimpleBean<T> bean = SimpleBean.of(annotatedClass, manager);
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/ProcessObserverMethodImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/ProcessObserverMethodImpl.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/ProcessObserverMethodImpl.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.webbeans.bootstrap;
+
+import java.util.List;
+
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.ObserverMethod;
+import javax.enterprise.inject.spi.ProcessObserverMethod;
+
+/**
+ * Implementation of the event used to notify observers for each observer
+ * method that is added.
+ *
+ * @author David Allen
+ *
+ */
+public class ProcessObserverMethodImpl<X, T> implements ProcessObserverMethod<X, T>
+{
+ private final AnnotatedMethod<X> beanMethod;
+ private final ObserverMethod<X, T> observerMethod;
+ private final List<Throwable> definitionErrors;
+
+ public ProcessObserverMethodImpl(AnnotatedMethod<X> beanMethod, ObserverMethod<X, T> observerMethod, List<Throwable> definitionErrors)
+ {
+ this.beanMethod = beanMethod;
+ this.observerMethod = observerMethod;
+ this.definitionErrors = definitionErrors;
+ }
+
+ public void addDefinitionError(Throwable t)
+ {
+ this.definitionErrors.add(t);
+ }
+
+ public AnnotatedMethod<X> getAnnotatedMethod()
+ {
+ return beanMethod;
+ }
+
+ public ObserverMethod<X, T> getObserverMethod()
+ {
+ return observerMethod;
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/ProcessObserverMethodImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -16,6 +16,8 @@
*/
package org.jboss.webbeans.conversation;
+import java.io.Serializable;
+
import javax.enterprise.context.Conversation;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Initializer;
@@ -34,9 +36,14 @@
@RequestScoped
@Named("javax.context.conversation")
@Standard
-public class ConversationImpl implements Conversation
+public class ConversationImpl implements Conversation, Serializable
{
+ /**
+ * Eclipse generated UID.
+ */
+ private static final long serialVersionUID = 5262382965141841363L;
+
private static LogProvider log = Logging.getLogProvider(ConversationImpl.class);
// The conversation ID
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -44,20 +44,20 @@
* Helper class for bean inspection
*
* @author Pete Muir
+ * @author David Allen
*
*/
public class Beans
{
-
/**
- * Indicates if a bean is passivating
+ * Indicates if a bean's scope type is passivating
*
* @param bean The bean to inspect
- * @return True if passivating, false otherwise
+ * @return True if the scope is passivating, false otherwise
*/
- public static boolean isPassivatingBean(Bean<?> bean, BeanManagerImpl manager)
+ public static boolean isPassivatingScope(Bean<?> bean, BeanManagerImpl manager)
{
- if (bean instanceof EnterpriseBean)
+ if (bean instanceof EnterpriseBean<?>)
{
return ((EnterpriseBean<?>) bean).getEjbDescriptor().isStateful();
}
@@ -68,6 +68,25 @@
}
/**
+ * Tests if a bean is capable of having its state temporarily stored to
+ * secondary storage
+ *
+ * @param bean The bean to inspect
+ * @return True if the bean is passivation capable
+ */
+ public static boolean isPassivationCapableBean(Bean<?> bean)
+ {
+ if (bean instanceof EnterpriseBean<?>)
+ {
+ return ((EnterpriseBean<?>) bean).getEjbDescriptor().isStateful();
+ }
+ else
+ {
+ return Reflections.isSerializable(bean.getBeanClass());
+ }
+ }
+
+ /**
* Indicates if a bean is proxyable
*
* @param bean The bean to test
@@ -75,7 +94,7 @@
*/
public static boolean isBeanProxyable(Bean<?> bean)
{
- if (bean instanceof RIBean)
+ if (bean instanceof RIBean<?>)
{
return ((RIBean<?>) bean).isProxyable();
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/ActivitiesTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/ActivitiesTest.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/ActivitiesTest.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -87,11 +87,6 @@
return false;
}
- public boolean isSerializable()
- {
- return false;
- }
-
public Object create(CreationalContext<Object> creationalContext)
{
return null;
@@ -102,6 +97,16 @@
}
+ public Class<?> getBeanClass()
+ {
+ return Object.class;
+ }
+
+ public boolean isPolicy()
+ {
+ return false;
+ }
+
};
InjectionPoint injectionPoint = new InjectionPoint()
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/child/SameBeanTypeInChildActivityTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/child/SameBeanTypeInChildActivityTest.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/child/SameBeanTypeInChildActivityTest.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -80,11 +80,6 @@
return false;
}
- public boolean isSerializable()
- {
- return false;
- }
-
public MyBean create(CreationalContext<MyBean> creationalContext)
{
return null;
@@ -95,6 +90,16 @@
}
+ public Class<?> getBeanClass()
+ {
+ return MyBean.class;
+ }
+
+ public boolean isPolicy()
+ {
+ return false;
+ }
+
};
return bean;
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/current/ELCurrentActivityTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/current/ELCurrentActivityTest.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/current/ELCurrentActivityTest.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -141,6 +141,16 @@
}
+ public Class<?> getBeanClass()
+ {
+ return Cow.class;
+ }
+
+ public boolean isPolicy()
+ {
+ return false;
+ }
+
}
@Test
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/current/InstanceCurrentActivityTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/current/InstanceCurrentActivityTest.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/activities/current/InstanceCurrentActivityTest.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -138,11 +138,6 @@
return true;
}
- public boolean isSerializable()
- {
- return false;
- }
-
public Cow create(CreationalContext<Cow> creationalContext)
{
return new Cow();
@@ -154,6 +149,16 @@
}
+ public Class<?> getBeanClass()
+ {
+ return Cow.class;
+ }
+
+ public boolean isPolicy()
+ {
+ return false;
+ }
+
}
@Test
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/NullProducerTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/NullProducerTest.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/NullProducerTest.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -9,7 +9,7 @@
{
@Test(description="WBRI-276")
- public void testProduerMethodReturnsNull()
+ public void testProducerMethodReturnsNull()
{
getCurrentManager().getInstanceByType(Government.class).destabilize();
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -79,11 +79,6 @@
return true;
}
- public boolean isSerializable()
- {
- return false;
- }
-
public Dummy create(CreationalContext<Dummy> creationalContext)
{
return null;
@@ -93,6 +88,16 @@
{
}
+
+ public Class<?> getBeanClass()
+ {
+ return Dummy.class;
+ }
+
+ public boolean isPolicy()
+ {
+ return false;
+ }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -52,11 +52,6 @@
return delegate().isNullable();
}
- public boolean isSerializable()
- {
- return delegate().isSerializable();
- }
-
public T create(CreationalContext<T> creationalContext)
{
return delegate().create(creationalContext);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MyContextual.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MyContextual.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/MyContextual.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -61,11 +61,6 @@
return false;
}
- public boolean isSerializable()
- {
- return true;
- }
-
public MySessionBean create(CreationalContext<MySessionBean> creationalContext)
{
createCalled = true;
@@ -95,4 +90,14 @@
this.shouldReturnNullInstances = shouldReturnNullInstances;
}
+ public Class<?> getBeanClass()
+ {
+ return MySessionBean.class;
+ }
+
+ public boolean isPolicy()
+ {
+ return false;
+ }
+
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Jamsa_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Jamsa_Broken.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Jamsa_Broken.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -1,25 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.passivating;
-
-import java.io.Serializable;
-
-import javax.enterprise.context.SessionScoped;
-import javax.enterprise.inject.Current;
-import javax.enterprise.inject.Produces;
-
-@SessionScoped
-@AnotherDeploymentType
-class Jamsa_Broken extends City implements Serializable
-{
- private static final long serialVersionUID = 8228981889946806181L;
-
- public Jamsa_Broken()
- {
- }
-
- @Produces
- @SessionScoped
- public Violation2 create(@Current Violation violation)
- {
- return new Violation2();
- }
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Kuopio_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Kuopio_Broken.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Kuopio_Broken.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -1,21 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.passivating;
-
-import java.io.Serializable;
-
-import javax.enterprise.context.SessionScoped;
-import javax.enterprise.inject.Initializer;
-
-@SessionScoped
-class Kuopio_Broken extends City implements Serializable
-{
- private static final long serialVersionUID = 2446135216757213774L;
-
- public Kuopio_Broken() {
-
- }
-
- @Initializer
- public void init(@Big Violation reference) {
-
- }
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/London_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/London_Broken.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/London_Broken.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -1,25 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.passivating;
-
-import java.io.Serializable;
-
-import javax.enterprise.context.SessionScoped;
-import javax.enterprise.inject.Produces;
-
-@SessionScoped
-@AnotherDeploymentType
-class London_Broken extends City implements Serializable
-{
- private static final long serialVersionUID = 8228981889946806181L;
-
- public London_Broken()
- {
- }
-
- @Produces
- @SessionScoped
- @Big
- public Violation2 create(@Big Violation violation)
- {
- return new Violation2();
- }
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Loviisa_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Loviisa_Broken.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Loviisa_Broken.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -1,20 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.passivating;
-
-import java.io.Serializable;
-
-import javax.enterprise.context.SessionScoped;
-import javax.enterprise.inject.Initializer;
-
-@SessionScoped
-class Loviisa_Broken extends City implements Serializable
-{
- private static final long serialVersionUID = -2866858442948392508L;
-
- public Loviisa_Broken() {
- }
-
- @Initializer
- public Loviisa_Broken(@Big Violation reference) {
-
- }
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Mikkeli_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Mikkeli_Broken.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Mikkeli_Broken.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -1,23 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.passivating;
-
-import java.io.Serializable;
-
-import javax.enterprise.context.SessionScoped;
-import javax.enterprise.inject.Current;
-import javax.enterprise.inject.Initializer;
-
-@SessionScoped
-class Mikkeli_Broken extends City implements Serializable
-{
- private static final long serialVersionUID = -3853118456066667893L;
-
- public Mikkeli_Broken()
- {
- }
-
- @Initializer
- public Mikkeli_Broken(@Current Violation reference)
- {
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Nokia_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Nokia_Broken.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Nokia_Broken.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -1,16 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.passivating;
-
-import java.io.Serializable;
-
-import javax.enterprise.context.SessionScoped;
-import javax.enterprise.inject.Current;
-
-@SessionScoped
-class Nokia_Broken extends City implements Serializable
-{
- private static final long serialVersionUID = -9104722758108835718L;
-
- @SuppressWarnings("unused")
- @Current
- private Violation reference;
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -1,6 +1,7 @@
package org.jboss.jsr299.tck.tests.context.passivating;
import java.io.IOException;
+import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.util.Set;
@@ -17,6 +18,7 @@
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.jboss.testharness.impl.util.Reflections;
import org.testng.annotations.Test;
/**
@@ -24,18 +26,17 @@
* @author Nicklas Karlsson
* @author David Allen
*
- * Spec version: 20090625
+ * Spec version: 20090519
*/
@Artifact
@BeansXml("beans.xml")
@Packaging(PackagingType.EAR)
public class PassivatingContextTest extends AbstractJSR299Test
{
- private static final Annotation BIG_LITERAL = new AnnotationLiteral<Big>() {};
@Test(groups = { "contexts", "passivation", "review" })
@SpecAssertion(section = "6.6.1", id = "b")
- public void testManagedWebBeanWithSerializableImplementationClassOK()
+ public void testSimpleWebBeanWithSerializableImplementationClassOK()
{
Set<Bean<Jyvaskyla>> beans = getBeans(Jyvaskyla.class);
assert !beans.isEmpty();
@@ -55,10 +56,10 @@
@Test(groups = { "contexts", "passivation" })
@SpecAssertions({
- @SpecAssertion(section = "6.6.4", id = "unknown"),
- @SpecAssertion(section = "6.6.4", id = "unknown")
+ @SpecAssertion(section = "unknown", id = "unknown"),
+ @SpecAssertion(section = "unknown", id = "unknown")
})
- public void testManagedWebBeanDeclaringPassivatingScopeIsSerializedWhenContextIsPassivated() throws IOException, ClassNotFoundException
+ public void testSimpleWebBeanDeclaringPassivatingScopeIsSerializedWhenContextIsPassivated() throws IOException, ClassNotFoundException
{
Kajaani instance = getInstanceByType(Kajaani.class);
instance.setTheNumber(100);
@@ -84,7 +85,7 @@
* @throws IOException
*/
@Test(groups = { "contexts", "passivation", "ri-broken" })
- @SpecAssertion(section = "6.6.2", id = "unknown")
+ @SpecAssertion(section = "unknown", id = "unknown")
public void testDependentEJBsAreSerializable() throws IOException, ClassNotFoundException
{
Set<Bean<Vaasa>> vaasaBeans = getBeans(Vaasa.class);
@@ -93,20 +94,13 @@
}
@Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "6.6.2", id = "unknown")
- public void testManagedDependentWebBeanWithNonSerializableImplementationInjectedIntoTransientFieldOK()
+ @SpecAssertion(section = "6.6.4", id = "aab")
+ public void testSimpleWebBeanWithNonSerializableImplementationInjectedIntoTransientFieldOK()
{
Set<Bean<Joensuu>> beans = getBeans(Joensuu.class);
assert !beans.isEmpty();
}
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "6.6.2", id = "unknown")
- public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
- {
- getInstanceByType(Nokia_Broken.class).ping();
- }
-
@Test(groups = { "contexts", "passivation" })
@SpecAssertion(section = "unknown", id = "unknown")
public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoTransientFieldOfWebBeanWithPassivatingScopeOK()
@@ -115,34 +109,6 @@
assert !beans.isEmpty();
}
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "unknown", id = "unknown")
- public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
- {
- getInstanceByType(Loviisa_Broken.class).ping();
- }
-
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "unknown", id = "unknown")
- public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
- {
- getInstanceByType(Kuopio_Broken.class).ping();
- }
-
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "unknown", id = "unknown")
- public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoProducerMethodParameterWithPassivatingScopeFails()
- {
- getInstanceByType(Violation2.class).ping();
- }
-
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "unknown", id = "unknown")
- public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
- {
- getInstanceByType(Uusikaupunki_Broken.class).ping();
- }
-
@Test(groups = { "contexts", "passivation" })
@SpecAssertion(section = "unknown", id = "unknown")
public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoTransientFieldOfWebBeanWithPassivatingScopeOK()
@@ -150,27 +116,6 @@
getInstanceByType(Salo_Broken.class).ping();
}
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "unknown", id = "unknown")
- public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
- {
- getInstanceByType(Loviisa_Broken.class).ping();
- }
-
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "unknown", id = "unknown")
- public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
- {
- getInstanceByType(Mikkeli_Broken.class).ping();
- }
-
- @Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "unknown", id = "unknown")
- public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoProducerMethodParameterWithPassivatingScopeFails()
- {
- getInstanceByType(Violation2.class,BIG_LITERAL).ping();
- }
-
@Test(groups = { "contexts", "passivation", "enterpriseBean", "integration" })
//@SpecAssertion(section = "8.4", id = "a")
@SpecAssertion(section = "unknown", id = "unknown")
@@ -180,17 +125,23 @@
}
@Test(expectedExceptions = IllegalProductException.class)
- @SpecAssertion(section = "unknown", id = "unknown")
+ @SpecAssertion(section = "6.6.4", id = "d")
public void testNonSerializableProducerFieldDeclaredPassivatingThrowsIllegalProductException()
{
getInstanceByType(HelsinkiNonSerializable.class).ping();
}
@Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "unknown", id = "unknown")
- public void testIsSerializableOnBean()
+ @SpecAssertion(section = "6.6.1", id = "b")
+ public void testPassivationCapableBean()
{
- assert !getBeans(Sysma.class).iterator().next().isSerializable();
- assert getBeans(Hyvinkaa.class).iterator().next().isSerializable();
+ assert !isSerializable(getBeans(Sysma.class).iterator().next().getBeanClass());
+ assert isSerializable(getBeans(Hyvinkaa.class).iterator().next().getBeanClass());
}
+
+ public static boolean isSerializable(Class<?> clazz)
+ {
+ return clazz.isPrimitive() || Serializable.class.isAssignableFrom(clazz);
+ }
+
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Uusikaupunki_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Uusikaupunki_Broken.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Uusikaupunki_Broken.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -1,17 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.passivating;
-
-import java.io.Serializable;
-
-import javax.enterprise.context.SessionScoped;
-import javax.enterprise.inject.Current;
-
-@SessionScoped
-class Uusikaupunki_Broken extends City implements Serializable
-{
- private static final long serialVersionUID = 5097928748462594346L;
-
- @SuppressWarnings("unused")
- @Current
- private Violation reference;
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Violation2.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Violation2.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Violation2.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -1,14 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.passivating;
-
-import javax.enterprise.context.Dependent;
-
-@Dependent
-class Violation2
-{
-
- public void ping()
- {
-
- }
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken6/NonSerializableTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken6/NonSerializableTest.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken6/NonSerializableTest.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -7,12 +7,16 @@
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
+/**
+ *
+ * Spec version: 20090625
+ */
@Artifact
@ExpectedDeploymentException(DeploymentError.class)
public class NonSerializableTest extends AbstractJSR299Test
{
@Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "8.4", id = "l")
+ @SpecAssertion(section = "6.6.4", id = "aab")
public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken7/NonSerializableTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken7/NonSerializableTest.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken7/NonSerializableTest.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -7,12 +7,16 @@
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
+/**
+ *
+ * Spec version: 20090625
+ */
@Artifact
@ExpectedDeploymentException(DeploymentError.class)
public class NonSerializableTest extends AbstractJSR299Test
{
@Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "8.4", id = "m")
+ @SpecAssertion(section = "6.6.4", id = "aab")
public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken8/NonSerializableTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken8/NonSerializableTest.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken8/NonSerializableTest.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -7,12 +7,16 @@
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
+/**
+ *
+ * Spec version: 20090625
+ */
@Artifact
@ExpectedDeploymentException(DeploymentError.class)
public class NonSerializableTest extends AbstractJSR299Test
{
@Test(groups = { "contexts", "passivation" })
- @SpecAssertion(section = "8.4", id = "n")
+ @SpecAssertion(section = "6.6.4", id = "aab")
public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
{
assert false;
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/InitializedBinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/InitializedBinding.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/InitializedBinding.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -1,29 +0,0 @@
-package org.jboss.jsr299.tck.tests.deployment.lifecycle;
-
-import javax.enterprise.context.spi.Context;
-import javax.enterprise.inject.spi.AfterBeanDiscovery;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.ObserverMethod;
-
-class InitializedBinding implements AfterBeanDiscovery
-{
- public void addDefinitionError(Throwable t)
- {
- throw new RuntimeException(t);
- }
-
- public void addBean(Bean<?> bean)
- {
- throw new UnsupportedOperationException();
- }
-
- public void addContext(Context context)
- {
- throw new UnsupportedOperationException();
- }
-
- public void addObserverMethod(ObserverMethod<?, ?> observerMethod)
- {
- throw new UnsupportedOperationException();
- }
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/addDefinitionError/AddDefinitionErrorTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/addDefinitionError/AddDefinitionErrorTest.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/addDefinitionError/AddDefinitionErrorTest.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -5,6 +5,9 @@
import org.jboss.jsr299.tck.DefinitionError;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
import org.testng.annotations.Test;
/**
@@ -17,18 +20,22 @@
* @author Dan Allen
*/
@Artifact
+@Resources({
+ @Resource(source="javax.enterprise.inject.spi.Extension", destination="WEB-INF/classes/META-INF/services/javax.enterprise.inject.spi.Extension")
+})
+//TODO I don't see why a test that uses the SPI extension mechanism must be an integration test (DRA)
+//@IntegrationTest
@ExpectedDeploymentException(DefinitionError.class)
public class AddDefinitionErrorTest extends AbstractJSR299Test
{
- @Test(groups="broken")
+ @Test
+ //TODO This test is not working in container due to exceptions being unwound on the server
@SpecAssertion(section = "11.5.2", id = "c")
public void testObserverDefinitionErrorTreatedAsDefinitionError()
{
assert false;
}
- // TODO make this an integration test using Extension
-
// FIXME need to communicate state of container at the time of failure
// @Override
// @AfterClass(alwaysRun = true, groups = "scaffold")
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/ImplicitEventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/ImplicitEventTest.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/ImplicitEventTest.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -1,5 +1,7 @@
package org.jboss.jsr299.tck.tests.event.implicit;
+import java.io.Serializable;
+
import javax.enterprise.context.Dependent;
import javax.enterprise.event.Event;
import javax.enterprise.inject.TypeLiteral;
@@ -54,7 +56,8 @@
assert event.getName() == null;
assert event.getBindings().size() == 1;
assert event.getBindings().iterator().next().equals(new AnyLiteral());
- assert event.isSerializable();
+ Registration registration = this.getInstanceByType(Registration.class);
+ assert isSerializable(registration.getCourseFullEvent().getClass());
}
@Test
@@ -64,4 +67,10 @@
assert getInstanceByType(Registration.class).getCourseFullEvent() != null;
}
+
+ public static boolean isSerializable(Class<?> clazz)
+ {
+ return clazz.isPrimitive() || Serializable.class.isAssignableFrom(clazz);
+ }
+
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java 2009-07-17 06:44:48 UTC (rev 3074)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java 2009-07-17 12:13:59 UTC (rev 3075)
@@ -144,6 +144,16 @@
return this == obj;
}
+ public Class<?> getBeanClass()
+ {
+ return Mustard.class;
+ }
+
+ public boolean isPolicy()
+ {
+ return false;
+ }
+
};
getCurrentManager().addBean(wrappedBean);
Copied: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/addDefinitionError/javax.enterprise.inject.spi.Extension (from rev 3041, tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/javax.enterprise.inject.spi.Extension)
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/addDefinitionError/javax.enterprise.inject.spi.Extension (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/addDefinitionError/javax.enterprise.inject.spi.Extension 2009-07-17 12:13:59 UTC (rev 3075)
@@ -0,0 +1 @@
+org.jboss.jsr299.tck.tests.deployment.lifecycle.broken.addDefinitionError.BeanDiscoveryObserver
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3074 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-07-17 02:44:48 -0400 (Fri, 17 Jul 2009)
New Revision: 3074
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
Log:
matched producer method lifecycle tests
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-07-17 06:21:32 UTC (rev 3073)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-07-17 06:44:48 UTC (rev 3074)
@@ -13,7 +13,7 @@
/**
*
- * Spec version: 20090519
+ * Spec version: 20090625
*
*/
@Artifact
@@ -22,10 +22,7 @@
{
@Test(groups = { "producerMethod", "disposalMethod" })
- @SpecAssertions({
- @SpecAssertion(section = "7", id = "f"),
- @SpecAssertion(section = "7.5", id = "ma")
- })
+ @SpecAssertion(section = "7.3.4", id = "ma")
public void testProducerMethodBeanDestroy() throws Exception
{
new RunInDependentContext()
@@ -48,9 +45,7 @@
}
@Test(groups = { "producerMethod" })
- @SpecAssertions({
- @SpecAssertion(section = "7", id = "b")
- })
+ @SpecAssertion(section = "7.3.4", id = "review")
public void testProducerMethodBeanCreate() throws Exception
{
new RunInDependentContext()
@@ -68,7 +63,7 @@
@Test(groups = { "producerMethod" })
@SpecAssertions({
- @SpecAssertion(section = "7.5", id = "ea")
+ @SpecAssertion(section = "7.3.4", id = "ea")
})
public void testProducerMethodInvokedOnCreate() throws Exception
{
@@ -89,7 +84,7 @@
@Test(groups = { "producerMethod", "rewrite" })
//Test needs to user the InjectionTarget interface for these assertions
@SpecAssertions({
- @SpecAssertion(section = "11.4.1", id = "g")
+ @SpecAssertion(section = "review", id = "review")
})
public void testProducerMethodFromMostSpecializedBeanUsed() throws Exception
{
@@ -110,7 +105,7 @@
@Test(groups = { "producerMethod" })
@SpecAssertions({
- @SpecAssertion(section = "7.5", id = "k")
+ @SpecAssertion(section = "7.3.4", id = "k")
})
public void testCreateReturnsNullIfProducerDoesAndDependent() throws Exception
{
@@ -121,7 +116,7 @@
@Test(groups = { "producerMethod", "broken" }, expectedExceptions = IllegalProductException.class )
@SpecAssertions({
- @SpecAssertion(section = "7.5", id = "l")
+ @SpecAssertion(section = "7.3.4", id = "l")
})
// TODO I'm not quite sure what this test is currently doing!
public void testCreateFailsIfProducerReturnsNullAndNotDependent() throws Exception
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3073 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition: binding and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-07-17 02:21:32 -0400 (Fri, 17 Jul 2009)
New Revision: 3073
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/AbstractAntelope.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/FriendlyAntelope.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/enterprise/EnterpriseBindingDefinitionTest.java
Log:
update to 20090625 spec assertions
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/AbstractAntelope.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/AbstractAntelope.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/AbstractAntelope.java 2009-07-17 06:21:32 UTC (rev 3073)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.definition.bean;
+
+public abstract class AbstractAntelope implements Animal
+{
+ public abstract String getGreeting();
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java 2009-07-17 05:39:03 UTC (rev 3072)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java 2009-07-17 06:21:32 UTC (rev 3073)
@@ -14,7 +14,7 @@
import org.testng.annotations.Test;
/**
- * This test class should be used for common assertions about Web Beans
+ * This test class should be used for common assertions about managed beans (not session beans)
*
* @author Pete Muir
*
@@ -61,10 +61,9 @@
assert getBeans(RedSnapper.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
- @Test
+ @Test(groups = "rewrite")
@SpecAssertions({
- @SpecAssertion(section = "2", id = "review"), // deployment types removed from spec
- @SpecAssertion(section = "review", id = "review"), // deployment types removed from spec
+ @SpecAssertion(section = "2", id = "d"),
@SpecAssertion(section = "3.1.3", id = "bc"),
@SpecAssertion(section = "11.1", id = "ba")
})
@@ -76,6 +75,7 @@
@Test(groups = "producerMethod")
@SpecAssertions({
+ @SpecAssertion(section = "2.2.1", id = "j"),
@SpecAssertion(section = "5.3.4", id = "ba"),
@SpecAssertion(section = "11.1", id = "bd")
})
@@ -96,7 +96,7 @@
@SpecAssertion(section = "2.2.1", id = "a"),
@SpecAssertion(section = "2.2.1", id = "d"),
@SpecAssertion(section = "2.2.1", id = "e"),
- @SpecAssertion(section = "2.2", id = "review"),
+ @SpecAssertion(section = "2.2", id = "l"),
@SpecAssertion(section = "11.1", id = "ba")
})
public void testBeanTypes()
@@ -121,14 +121,27 @@
Bean<Tarantula> bean = getBeans(Tarantula.class).iterator().next();
Tarantula tarantula = getCurrentManager().getContext(bean.getScopeType()).get(bean);
- Spider spider = (Spider) tarantula;
- Animal animal = (Animal) tarantula;
- Object obj = (Object) tarantula;
- DeadlySpider deadlySpider = (DeadlySpider) tarantula;
- DeadlyAnimal deadlyAnimal = (DeadlyAnimal) tarantula;
+ Spider spider = tarantula;
+ Animal animal = tarantula;
+ Object obj = tarantula;
+ DeadlySpider deadlySpider = tarantula;
+ DeadlyAnimal deadlyAnimal = tarantula;
}
-
+
@Test
+ @SpecAssertion(section = "2.2.1", id = "c")
+ public void testAbstractApiType()
+ {
+ assert getBeans(FriendlyAntelope.class).size() == 1;
+ Bean<FriendlyAntelope> bean = getBeans(FriendlyAntelope.class).iterator().next();
+ assert bean.getTypes().size() == 4;
+ assert bean.getTypes().contains(FriendlyAntelope.class);
+ assert bean.getTypes().contains(AbstractAntelope.class);
+ assert bean.getTypes().contains(Animal.class);
+ assert bean.getTypes().contains(Object.class);
+ }
+
+ @Test
@SpecAssertion(section = "2.2.1", id = "d")
public void testFinalApiType()
{
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/FriendlyAntelope.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/FriendlyAntelope.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/FriendlyAntelope.java 2009-07-17 06:21:32 UTC (rev 3073)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.definition.bean;
+
+public class FriendlyAntelope extends AbstractAntelope
+{
+ @Override
+ public String getGreeting()
+ {
+ return "Chao!";
+ }
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-07-17 05:39:03 UTC (rev 3072)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-07-17 06:21:32 UTC (rev 3073)
@@ -6,7 +6,6 @@
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
-import org.apache.commons.httpclient.methods.GetMethod;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -17,7 +16,7 @@
import org.testng.annotations.Test;
/**
- * Spec version: 20090519
+ * Spec version: 20090625
*/
@Artifact
public class BindingDefinitionTest extends AbstractJSR299Test
@@ -87,7 +86,7 @@
@SpecAssertion(section = "2.3.5", id = "a")
public void testFieldInjectedFromProducerMethod() throws Exception
{
- Bean<Barn> barnBean = getBeans(Barn.class).iterator().next();
+ Bean<Barn> barnBean = getBeans(Barn.class).iterator().next();
Barn barn = barnBean.create(getCurrentManager().createCreationalContext(barnBean));
assert barn.petSpider != null;
assert barn.petSpider instanceof DefangedTarantula;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/enterprise/EnterpriseBindingDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/enterprise/EnterpriseBindingDefinitionTest.java 2009-07-17 05:39:03 UTC (rev 3072)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/enterprise/EnterpriseBindingDefinitionTest.java 2009-07-17 06:21:32 UTC (rev 3073)
@@ -14,7 +14,11 @@
import org.testng.annotations.Test;
/**
- * Spec version: 20090519
+ * TODO This test specifically tests session beans even though the assertions are true
+ * for all managed beans. So likely there should be a parallel set of tests for session
+ * and other managed beans.
+ *
+ * Spec version: 20090625
*/
@Artifact
@IntegrationTest
@@ -35,5 +39,5 @@
{
Set<? extends Annotation> bindings = getBeans(EnglishBorderCollieLocal.class, new HairyBinding(false)).iterator().next().getBindings();
assert annotationSetMatches(bindings, Any.class, Hairy.class);
- }
+ }
}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3072 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: event/observer and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-07-17 01:39:03 -0400 (Fri, 17 Jul 2009)
New Revision: 3072
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/DuplicateBindingTypesWhenResolvingTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/CheckTypeParametersWhenResolvingObserversTest.java
Log:
matched bean definition, observer, duplicate binding type tests to assertions
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java 2009-07-17 05:38:18 UTC (rev 3071)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java 2009-07-17 05:39:03 UTC (rev 3072)
@@ -18,7 +18,7 @@
*
* @author Pete Muir
*
- * Spec version: 20090519
+ * Spec version: 20090625
*/
@Artifact
public class BeanDefinitionTest extends AbstractJSR299Test
@@ -40,7 +40,7 @@
@Test
@SpecAssertions({
@SpecAssertion(section = "2", id = "b"),
- @SpecAssertion(section = "11.1", id = "b")
+ @SpecAssertion(section = "11.1", id = "ba")
})
public void testBindingTypesNonEmpty()
{
@@ -52,8 +52,8 @@
@SpecAssertions({
@SpecAssertion(section = "2", id = "c"),
@SpecAssertion(section = "2.4", id = "a"),
- @SpecAssertion(section = "3.2.3", id = "ba"),
- @SpecAssertion(section = "11.1", id = "b")
+ @SpecAssertion(section = "3.1.3", id = "ba"),
+ @SpecAssertion(section = "11.1", id = "ba")
})
public void testHasScopeType()
{
@@ -63,10 +63,10 @@
@Test
@SpecAssertions({
- @SpecAssertion(section = "2", id = "d"),
- @SpecAssertion(section = "2.5.3", id = "a"),
- @SpecAssertion(section = "3.2.3", id = "bc"),
- @SpecAssertion(section = "11.1", id = "b")
+ @SpecAssertion(section = "2", id = "review"), // deployment types removed from spec
+ @SpecAssertion(section = "review", id = "review"), // deployment types removed from spec
+ @SpecAssertion(section = "3.1.3", id = "bc"),
+ @SpecAssertion(section = "11.1", id = "ba")
})
public void testHasDeploymentType()
{
@@ -76,8 +76,8 @@
@Test(groups = "producerMethod")
@SpecAssertions({
- @SpecAssertion(section = "5.1.3", id = "ba"),
- @SpecAssertion(section = "11.1", id = "e")
+ @SpecAssertion(section = "5.3.4", id = "ba"),
+ @SpecAssertion(section = "11.1", id = "bd")
})
public void testIsNullable() throws Exception
{
@@ -91,13 +91,13 @@
@Test
@SpecAssertions({
- @SpecAssertion(section = "3.2.2", id = "a"),
+ @SpecAssertion(section = "3.1.2", id = "a"),
@SpecAssertion(section = "2.2", id = "a"),
@SpecAssertion(section = "2.2.1", id = "a"),
@SpecAssertion(section = "2.2.1", id = "d"),
@SpecAssertion(section = "2.2.1", id = "e"),
- @SpecAssertion(section = "2.2", id = "l"),
- @SpecAssertion(section = "11.1", id = "b")
+ @SpecAssertion(section = "2.2", id = "review"),
+ @SpecAssertion(section = "11.1", id = "ba")
})
public void testBeanTypes()
{
@@ -137,8 +137,8 @@
@Test
@SpecAssertions({
- @SpecAssertion(section = "3.2.3", id = "bd"),
- @SpecAssertion(section = "11.1", id = "b")
+ @SpecAssertion(section = "3.1.3", id = "bd"),
+ @SpecAssertion(section = "11.1", id = "ba")
})
public void testMultipleStereotypes()
{
@@ -148,7 +148,7 @@
}
@Test
- @SpecAssertion(section = "3.2.3", id = "c")
+ @SpecAssertion(section = "3.1.3", id = "c")
public void testBeanExtendsAnotherBean()
{
assert !getBeans(Spider.class).isEmpty();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java 2009-07-17 05:38:18 UTC (rev 3071)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java 2009-07-17 05:39:03 UTC (rev 3072)
@@ -11,7 +11,7 @@
import org.testng.annotations.Test;
/**
- * Spec version: 20090519
+ * Spec version: 20090625
*/
@Artifact
public class ObserverTest extends AbstractJSR299Test
@@ -43,8 +43,7 @@
@Test(groups = { "events", "ri-broken" })
@SpecAssertions( {
@SpecAssertion(section = "10.2", id = "h"),
- @SpecAssertion(section = "11.2.7", id = "b"),
- @SpecAssertion(section = "10.6", id = "a")
+ @SpecAssertion(section = "10.5", id = "a")
})
public void testObserverNotifiedWhenEventTypeAndAllBindingsMatch()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/DuplicateBindingTypesWhenResolvingTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/DuplicateBindingTypesWhenResolvingTest.java 2009-07-17 05:38:18 UTC (rev 3071)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/DuplicateBindingTypesWhenResolvingTest.java 2009-07-17 05:39:03 UTC (rev 3072)
@@ -8,7 +8,7 @@
import org.testng.annotations.Test;
/**
- * Spec version: 20090519
+ * Spec version: 20090625
*/
@Artifact
public class DuplicateBindingTypesWhenResolvingTest extends AbstractJSR299Test
@@ -28,7 +28,7 @@
}
@Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
- @SpecAssertion(section = "11.2.9", id = "d")
+ @SpecAssertion(section = "11.3.11", id = "d")
public void testDuplicateBindingTypesWhenResolvingFails()
{
getCurrentManager().resolveObserverMethods(new AnEventType(), new BindingTypeABinding(), new BindingTypeABinding());
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/CheckTypeParametersWhenResolvingObserversTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/CheckTypeParametersWhenResolvingObserversTest.java 2009-07-17 05:38:18 UTC (rev 3071)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/CheckTypeParametersWhenResolvingObserversTest.java 2009-07-17 05:39:03 UTC (rev 3072)
@@ -12,7 +12,7 @@
import org.testng.annotations.Test;
/**
- * Spec version: 20090519
+ * Spec version: 20090625
*/
@Artifact
public class CheckTypeParametersWhenResolvingObserversTest extends AbstractJSR299Test
@@ -54,8 +54,8 @@
@Test(groups = { "events" })
@SpecAssertions({
- @SpecAssertion(section = "10.5.1", id = "a"),
- @SpecAssertion(section = "11.2.9", id = "a")
+ @SpecAssertion(section = "10.4.1", id = "a"),
+ @SpecAssertion(section = "11.3.11", id = "a")
})
public void testResolvingChecksTypeParameters()
{
@@ -66,7 +66,7 @@
@Test(groups = { "events" })
@SpecAssertions({
@SpecAssertion(section = "10.2", id = "h"),
- @SpecAssertion(section = "10.5", id = "a")
+ @SpecAssertion(section = "10.4", id = "aa")
// FIXME also 10.3.1, which does not yet have spec assertions cataloged
})
public void testResolvingChecksTypeParametersOnObservesMethod()
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3071 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-07-17 01:38:18 -0400 (Fri, 17 Jul 2009)
New Revision: 3071
Added:
tck/trunk/impl/src/main/resources/tck-audit-20090519.xml
Log:
copy of 20090519 version of tck-audit for historical purposes
Added: tck/trunk/impl/src/main/resources/tck-audit-20090519.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit-20090519.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/tck-audit-20090519.xml 2009-07-17 05:38:18 UTC (rev 3071)
@@ -0,0 +1,5119 @@
+<specification
+ xmlns="http://jboss.com/products/webbeans/tck/audit"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/webbeans/tck/audit http://snapshots.jboss.org/maven2/org/hibernate/tck-utils-api/0.9-SNAPSHO..."
+ name="JSR-299: Java Contexts and Dependency Injection"
+ version="20090519">
+
+ <section id="2" title="Bean definition">
+
+ <assertion id="a">
+ <text>A bean comprises of a (nonempty) set of bean types</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A bean comprises of a (nonempty) set of bindings</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A bean comprises of a scope</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A bean comprises of a deployment type</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A bean comprises of an optional bean name</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A bean comprises of a bean implementation</text>
+ </assertion>
+ </section>
+
+ <section id="2.2" title="Bean types">
+
+ <assertion id="a">
+ <text>A bean may have multiple bean types</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>All beans have the bean type java.lang.Object</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.2.1" title="Legal bean types">
+ <assertion id="a">
+ <text>A bean type may be an interface</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A bean type may be a concrete class</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A bean type may be an abstract class</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A bean type may be declared final</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A bean type may have final methods</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A bean type may be a parameterized type with actual type parameters</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A bean type may be a parameterized type with type variables</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>A bean type may be a parameterized type with wildcards</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>A bean type may be an array type. Two array types are considered identical only if the element type is identical.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>A bean type may be a primitive type. Primitive types are considered to be identical to their corresponding wrapper types in java.lang.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>A bean type may be a raw type.</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>A type parameter is not a legal bean type</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>If an injection point type is a type variable, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="2.2.2" title="Typecasting between bean types">
+
+ <assertion id="a">
+ <text>A client of a bean may typecast its contextual reference to a bean to any bean type of the bean which is a Java interface. However, the client may not in general typecast its contextual reference to an arbitrary concrete bean type of the bean.</text>
+ </assertion>
+ </section>
+
+ <section id="2.3" title="Bindings">
+
+ </section>
+
+ <section id="2.3.1" title="Built-in binding types">
+
+ <assertion id="a0">
+ <text>Every bean has the built-in binding @Any, even if it does not explicitly declare this binding, except for beans with the builtin binding @New defined in Section 3.11, "Beans with the @New binding".</text>
+ </assertion>
+
+ <assertion id="aa">
+ <text>If a bean does not explicitly declare a binding, the bean has exactly one additional binding, of type |@Current|</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The default binding is also assumed for any injection point that does not explicitly declare a binding</text>
+ </assertion>
+ </section>
+
+ <section id="2.3.2" title="Defining new binding types">
+ <assertion id="aa" testable="false">
+ <text>A binding type is a Java annotation defined as |@Target({METHOD, FIELD, PARAMETER, TYPE})|~ and |@Retention(RUNTIME)|~.</text>
+ </assertion>
+
+ <assertion id="ab" testable="false">
+ <text>A binding type is a Java annotation defined as ~|@Target({METHOD, FIELD, PARAMETER, TYPE})| and ~|@Retention(RUNTIME)|.</text>
+ <note>Non-runtime retention annotations are discarded by the compiler</note>
+ </assertion>
+
+ <assertion id="ba">
+ <text>A binding type may be declared by specifying the |(a)javax.enterprise.inject.BindingType| meta-annotation</text>
+ </assertion>
+
+ <assertion id="d" testable="false">
+ <text>A binding type may define annotation members</text>
+ <note>This is true by default in the JLS</note>
+ </assertion>
+ </section>
+
+ <section id="2.3.3" title="Declaring the bindings of a bean">
+
+ <assertion id="a">
+ <text>A bean's bindings are declared by annotating the bean class with the binding types</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A bean's bindings are declared by annotating the producer method with the binding types</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A bean's bindings are declared by annotating the producer field with the binding types</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Any bean may declare multiple binding types</text>
+ </assertion>
+ </section>
+
+ <section id="2.3.4" title="Specifying bindings of an injected field">
+
+ <assertion id="a">
+ <text>Binding types may be applied to injected fields (see Section 3.8, "Injected fields") to determine the bean that is injected, according to the typesafe resolution algorithm defined in Section 5.9, "Typesafe resolution algorithm".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A bean may only be injected to an injection point if it has all the bindings of the injection point</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.3.5" title="Specifying bindings of a method or constructor parameter">
+ <assertion id="a">
+ <text>Binding types may be applied to parameters of producer methods (see Chapter 3, Bean implementation) to determine the bean instance that is passed when the method is called by the container</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Binding types may be applied to parameters of initializer methods (see Chapter 3, Bean implementation) to determine the bean instance that is passed when the method is called by the container</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Binding types may be applied to parameters of disposal methods (see Chapter 3, Bean implementation) to determine the bean instance that is passed when the method is called by the container</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>Binding types may be applied to parameters of observer methods (see Chapter 3, Bean implementation) to determine the bean instance that is passed when the method is called by the container</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Binding types may be applied to parameters of bean constructors (see Chapter 3, Bean implementation) to determine the bean instance that is passed when the method is called by the container</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.4" title="Scopes">
+
+ <assertion id="a">
+ <text>All beans have a scope</text>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>A scope type is represented by an annotation type.</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+
+ <assertion id="c">
+ <text>The set of scope types is extensible</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.4.1" title="Built-in scope types">
+ <assertion id="a" testable="false">
+ <text>The |@RequestScoped|, |@ApplicationScoped| and |@SessionScoped| annotations defined in Section 6.7, "Context management for built-in scopes" represent the standard scopes defined by the Java Servlets specification</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>The |@ConversationScoped| annotation represents the conversation scope defined in Section 6.7.4, "Conversation context lifecycle".</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+
+ <assertion id="c" testable="false">
+ <text>The |@Dependent| pseudo-scope is for dependent objects, as defined in Section 6.4, "Dependent pseudo-scope"</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+ </section>
+
+ <section id="2.4.2" title="Defining new scope types">
+ <assertion id="aa">
+ <text>A scope type is a Java annotation defined as |@Target({TYPE, METHOD, FIELD})|~ and |@Retention(RUNTIME)|~</text>
+ </assertion>
+
+ <assertion id="ab" testable="false">
+ <text>A scope type is a Java annotation defined as ~|@Target({TYPE, METHOD, FIELD})| and ~|@Retention(RUNTIME)|</text>
+ <note>Non-runtime retention annotations are discarded by the compiler</note>
+ </assertion>
+
+ <assertion id="ba">
+ <text>All scope types must specify the |(a)javax.enterprise.context.ScopeType| meta-annotation</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.4.3" title="Declaring the bean scope">
+ <assertion id="a">
+ <text>The bean's scope is defined by annotating the bean class or producer method or field with a scope type</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>A bean class or producer method or field may specify at most one scope type annotation. If a bean class or producer method or field specifies multiple scope type annotations, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A scope type may be specified using a stereotype annotation, as defined in Section 2.7.2, "Declaring the stereotypes for a bean"</text>
+ </assertion>
+ </section>
+
+ <section id="2.4.4" title="Default scope">
+ <assertion id="aa">
+ <text>When no scope is explicitly declared by annotating the bean class or producer method or field the scope of a bean is defaulted.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the bean does not declare any stereotype with a declared default scope, the default scope for the bean is |@Dependent|</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If all stereotypes declared by the bean that have some declared default scope have the same default scope, then that scope is the default scope for the bean</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If there are two different stereotypes declared by the bean that declare different default scopes, then there is no default scope and the bean must explicitly declare a scope. If it does not explicitly declare a scope, the container automatically
+detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a bean explicitly declares a scope, any default scopes declared by stereotypes are ignored</text>
+ </assertion>
+ </section>
+
+ <section id="2.5" title="Deployment types">
+ <assertion id="a" testable="false">
+ <text>The set of deployment types is extensible</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+ </section>
+
+ <section id="2.5.1" title="Built-in deployment types">
+
+ <assertion id="a0">
+ <text>The default deployment type for beans which do not explicitly declare a deployment type is |@Production|.</text>
+ </assertion>
+
+ <assertion id="a">
+ <text>All standard beans defined by this specification, and provided by the container, are defined using the |@Standard| deployment type</text>
+ <note>This is tested in the test for each bean defined. See 5.6.1.za, 5.7.2.ca, 8.5.4.i</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>No bean may be declared with the |@Standard| deployment type unless explicitly required by this specification</text>
+ </assertion>
+ </section>
+
+ <section id="2.5.2" title="Defining new deployment types">
+
+ <assertion id="a">
+ <text>A deployment type is a Java annotation defined as |@Target({TYPE, METHOD, FIELD})|</text>
+ </assertion>
+
+ <assertion id="bb" testable="false">
+ <text>A deployment type is a Java annotation defined with |@Retention(RUNTIME)|</text>
+ <note>Non-runtime retention annotations are discarded by the compiler</note>
+ </assertion>
+
+ <assertion id="c">
+ <text>All deployment types must also specify the |(a)javax.inject.DeploymentType| meta-annotation.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Applications and third-party frameworks may define their own deployment types</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.5.3" title="Declaring the deployment type of a bean">
+
+ <assertion id="a">
+ <text>The deployment type of the bean is declared by annotating the bean class</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The deployment type of the bean is declared by annotating the producer method</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The deployment type of the bean is declared by annotating the field</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>A bean class may specify at most one deployment type. If multiple deployment type annotations are specified, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ea">
+ <text>A producer method may specify at most one deployment type. If multiple deployment type annotations are specified, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="fa">
+ <text>A producer field may specify at most one deployment type. If multiple deployment type annotations are specified, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text> </assertion>
+
+ <assertion id="g">
+ <text>By default, if no deployment type annotation is explicitly specified, a producer method inherits the deployment type of the bean in which it is defined.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>By default, if no deployment type annotation is explicitly specified, a producer field inherits the deployment type of the bean in which it is defined.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>a deployment type may be specified using a stereotype annotation, as defined in Section 2.7.2, "Declaring the stereotypes for a bean using annotations".</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.5.4" title="Default deployment type">
+
+ <assertion id="a0">
+ <text>If a producer method does not declare any stereotype with a declared default deployment type, then the default deployment type is the deployment type of the bean that declares the producer method or field.</text>
+ </assertion>
+
+ <assertion id="a1">
+ <text>If a producer field does not declare any stereotype with a declared default deployment type, then the default deployment type is the deployment type of the bean that declares the producer method or field.</text>
+ </assertion>
+
+ <assertion id="aa">
+ <text>If a bean that is not a producer method or producer field does not declare any stereotype with a declared default deployment type, then the default deployment type is |@Production|</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Otherwise, the default deployment type for the bean is the highest-precedence default deployment type declared by any stereotype declared by the bean</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a bean explicitly declares a deployment type, any default deployment type declared by stereotypes are ignored.</text>
+ </assertion>
+ </section>
+
+ <section id="2.5.5" title="Enabled deployment types">
+
+ <assertion id="a">
+ <text>Beans declared with a deployment type that is not enabled are not available to the resolution algorithms defined in Chapter 5, Lookup, dependency injection and EL resolution.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>If a |<Deploy>| element is specified, the explicitly declared deployment types are enabled, together with |@Standard|, which need not be declared explicitly.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If no |<Deploy>| element is specified in any |beans.xml| file, only the |@Standard| and |@Production| deployment types are enabled.</text>
+ </assertion>
+
+ <assertion id="ea">
+ <text>If the |<Deploy>| element is specified in more than one |beans.xml| document, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.6" title="Bean EL names">
+
+ <assertion id="a">
+ <text>A valid bean EL name is a period-separated list of valid EL identifiers</text>
+ </assertion>
+ </section>
+
+ <section id="2.6.1" title="Declaring the bean EL name">
+
+ <assertion id="a">
+ <text>To specify the EL name of a bean, the |(a)javax.annotation.Named| annotation is applied to the bean class.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>To specify the EL name of a bean, the |(a)javax.annotation.Named| annotation is applied to the producer method.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>To specify the EL name of a bean, the |(a)javax.annotation.Named| annotation is applied to the producer field.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the |@Named| annotation does not specify the value member, the default name is assumed</text>
+ </assertion>
+ </section>
+
+ <section id="2.6.2" title="Default bean EL names">
+
+ <assertion id="a">
+ <text>A default EL name must be assigned by the container when a bean class defined using annotations declares a |@Named| annotation and no EL name is explicitly specified by the value member</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A default EL name must be assigned by the container when a producer method of a bean defined using annotations declares a |@Named| annotation and EL no name is explicitly specified by the value member</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A default EL name must be assigned by the container when a producer field of a bean defined using annotations declares a |@Named| annotation and no EL name is explicitly specified by the value member</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A default EL name must be assigned by the container when a bean declares a stereotype that declares an empty |@Named| annotation, and the bean does not explicitly specify an EL name.</text>
+ </assertion>
+ </section>
+
+ <section id="2.6.3" title="Beans with no EL name">
+
+ <assertion id="a">
+ <text>If |@Named| is not specified, by neither the bean nor its stereotypes, a bean has no EL name</text>
+ <note>I've pointed out to Gavin that this is a double negative, and should probably be reworded</note>
+ </assertion>
+ </section>
+
+ <section id="2.7" title="Stereotypes">
+
+ <assertion id="a">
+ <text>A stereotype may specify that all beans with the stereotype have defaulted bean names</text>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>A bean may declare zero stereotypes</text>
+ <note>Not testable through API</note>
+ </assertion>
+
+ <assertion id="c">
+ <text>A bean may declare one stereotype</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A bean may declare multiple stereotypes</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.7.1" title="Defining new stereotypes">
+ <assertion id="aa" testable="false">
+ <text>A beans stereotype is a Java annotation defined as |@Target({TYPE, METHOD, FIELD})|~, |@Target(TYPE)|, |@Target(METHOD)|, |@Target(FIELD)| or |@Target({METHOD, FIELD})| and |@Retention(RUNTIME)|~</text>
+ </assertion>
+
+ <assertion id="ab" testable="false">
+ <text>A beans stereotype is a Java annotation defined as ~|@Target({TYPE, METHOD, FIELD})|,~ |@Target(TYPE)|~, |@Target(METHOD)|, |@Target(FIELD)| or |@Target({METHOD, FIELD})| and |@Retention(RUNTIME)|~</text>
+ </assertion>
+
+ <assertion id="ac" testable="false">
+ <text>A beans stereotype is a Java annotation defined as ~|@Target({TYPE, METHOD, FIELD})|, |@Target(TYPE)|, |@Target(METHOD)|, ~|@Target(FIELD)| ~or |@Target({METHOD, FIELD})| and |@Retention(RUNTIME)|~</text>
+ </assertion>
+
+ <assertion id="ad" testable="false">
+ <text>A beans stereotype is a Java annotation defined as ~|@Target({TYPE, METHOD, FIELD})|, |@Target(TYPE)|, |@Target(METHOD)|, |@Target(FIELD)| or~ |@Target({METHOD, FIELD})|~ and |@Retention(RUNTIME)|~</text>
+ </assertion>
+
+ <assertion id="ae" testable="false">
+ <text>A beans stereotype is a Java annotation defined as ~|@Target({TYPE, METHOD, FIELD})|, |@Target(TYPE)|, |@Target(METHOD)|, |@Target(FIELD)| or |@Target({METHOD, FIELD})| and~ |@Retention(RUNTIME)|</text>
+ <note>Non-runtime retention annotations are discarded by the compiler</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>A stereotype may be declared by specifying the |(a)javax.annotation.Stereotype| meta-annotation</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>A stereotype may not declare any binding annotation. If a stereotype declares a binding annotation, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.1.1" title="Declaring the default scope and deployment type for a stereotype">
+ <assertion id="aa">
+ <text>A stereotype may declare at most one scope. If a stereotype declares more than one scope, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the
+container".</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>A stereotype may declare at most one deployment type. If a stereotype declares more than one deployment type, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected
+automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.1.2" title="Specifying interceptor bindings for a stereotype">
+ <assertion id="a">
+ <text>A stereotype may declare zero interceptor bindings.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A stereotype may declare one interceptor bindings.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A stereotype may declare multiple interceptor bindings.</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.1.3" title="Specifying name defaulting for a stereotype">
+ <assertion id="aa">
+ <text>A stereotype may declare an empty |@Named| annotation. If a stereotype declares a non-empty |@Named| annotation, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A stereotype may specify that every bean with the stereotype has a defaulted name when a name is not explicitly specified by the bean</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.1.4" title="Stereotypes with additional stereotypes">
+ <assertion id="a">
+ <text>A stereotype may declare other stereotypes</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Stereotype declarations are transitive - a stereotype declared by a second stereotype is inherited by all beans and other stereotypes that declare the second stereotype</text>
+ </assertion>
+
+ <assertion id="c" >
+ <text>Stereotypes declared |@Target(TYPE)| may not be applied to stereotypes declared |@Target({TYPE, METHOD, FIELD})|</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Stereotypes declared |@Target(TYPE)| may not be applied to stereotypes declared |@Target(METHOD)|</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Stereotypes declared |@Target(TYPE)| may not be applied to stereotypes declared |@Target(FIELD)|</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Stereotypes declared |@Target(TYPE)| may not be applied to stereotypes declared |@Target({METHOD, FIELD})|</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.7.2" title="Declaring the stereotypes for a bean">
+ <assertion id="a">
+ <text>Stereotype annotations may be applied to a bean class</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Stereotype annotations may be applied to a producer method</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Stereotype annotations may be applied to a producer field</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>The default deployment type declared by the stereotype may be overridden by the bean</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>The default scope declared by the stereotype may be overridden by the bean</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Multiple stereotypes may be applied to the same bean</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.3" title="Built-in stereotypes">
+ <assertion id="aa" testable="false">
+ <text>The built-in stereotype |(a)javax.enterprise.inject.Model| is intended for use with beans that define the model layer of an MVC web application architecture such as JSF</text>
+ <note>Tested by API signature test</note>
+ </assertion>
+ </section>
+
+ <section id="3" title="Bean Implementation">
+
+ </section>
+
+ <section id="3.1" title="Restriction upon bean instantiation">
+ <assertion id="a">
+ <text>The bean class is a concrete class and is not required to implement any special interface or extend any special superclass</text>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>If the application calls a producer method directly, instead of letting the container call it, the returned object is not a contextual instance and the capabilities listed in Section 2.1, "Functionality provided by the container to the bean" will not be available to the returned object.</text>
+ </assertion>
+ </section>
+
+ <section id="3.2" title="Managed beans">
+ <assertion id="f0">
+ <text>If the bean class of a managed bean is annotated with both the |@Interceptor| and |@Decorator| stereotypes, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="fa">
+ <text>If a managed bean has a public field, it must have scope |@Dependent|.</text>
+ <note>Check that a dependent scoped bean with a public field does work</note>
+ </assertion>
+
+ <assertion id="fba">
+ <text>If a managed bean has a public field, it must have scope |@Dependent|. If a managed bean with a public field declares any scope other than |@Dependent|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the managed bean class is a parameterized type, it must have scope |@Dependent|. If a managed bean with a parameterized bean class declares any scope other than |@Dependent|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.1" title="Which Java classes are managed beans?">
+ <assertion id="b">
+ <text>A top-level Java class is not a managed bean if it is a non-static inner class</text>
+ </assertion>
+ <assertion id="ba">
+ <text>A top-level Java class that is a static inner class can be a managed bean</text>
+ </assertion>
+ <assertion id="ca">
+ <text>A top-level Java class is not a managed bean if it is an abstract class</text>
+ </assertion>
+ <assertion id="cb">
+ <text>A top-level Java class is not a managed bean if it is an interface</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A top-level Java class is not a managed bean if it is annotated with any of the EJB component-defining annotations</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>A top-level Java class is not a managed bean if it is declared as an EJB bean class in |ejb-jar.xml|</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>A top-level Java class is only a managed bean if it has an appropriate constructor - a constructor with no parameters</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>A top-level Java class is only a managed bean if it has an appropriate constructor - a constructor annotated |@Initializer|</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.2" title="Bean types of a managed bean">
+ <assertion id="a">
+ <text>The set of bean types for a simple bean contains the bean class, every superclass and all interfaces it implements directly or indirectly.</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.3" title="Declaring a managed bean">
+ <assertion id="a">
+ <text>A managed bean with a constructor that takes no parameters does not require any special annotations</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>A bean class may also specify a scope~, name, deployment type, stereotypes and/or bindings~</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>A bean class may also specify a ~scope,~ name~, deployment type, stereotypes and/or bindings~</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>A bean class may also specify a ~scope, name, ~deployment type~, stereotypes and/or bindings~</text>
+ </assertion>
+
+ <assertion id="bd">
+ <text>A bean class may also specify ~a scope, name, deployment type, ~stereotypes~ and/or bindings~</text>
+ </assertion>
+
+ <assertion id="be">
+ <text>A bean class may also specify ~a scope, name, deployment type, stereotypes and/or~ bindings</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A managed bean may extend another managed bean</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.4" title="Bean constructors">
+ <assertion id="a">
+ <text>When the container instantiates a managed bean, it calls the bean constructor. The bean constructor is a constructor of the bean class</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.4.1" title="Declaring a bean constructor">
+ <assertion id="a">
+ <text>The bean constructor may be identified by annotating the constructor |@Initializer|</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>If a managed bean does not explicitly declare a constructor using |@Initializer|, the constructor that accepts no parameters is the bean constructor</text>
+ <note>Can't check implicit constructor</note>
+ </assertion>
+
+ <assertion id="ca">
+ <text>If a managed bean has more than one constructor annotated |@Initializer|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If a bean constructor has a parameter annotated |@Disposes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ea">
+ <text>If a bean constructor has a parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.4.2" title="Bean constructor parameters">
+ <assertion id="b">
+ <text>A bean constructor may have any number of parameters.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>All parameters of a bean constructor are injection points.</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.5" title="Specializing a managed bean">
+ <assertion id="aa">
+ <text>If a bean class of a managed bean X is annotated @Specializes, then the bean class of X must directly extend the bean class of another managed bean Y. Then X directly specializes Y, as defined in Section 4.3, "Specialization".</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If the bean class of X does not directly extend the bean class of another managed bean, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.6" title="Default name for a managed bean">
+ <assertion id="a">
+ <text>The default name for a managed bean is the unqualified class name of the bean class, after converting the first character to lower case</text>
+ </assertion>
+ </section>
+
+ <section id="3.3" title="Session beans">
+ <assertion id="aa" testable="false">
+ <text>A session bean is a bean that is implemented by a session bean with an EJB 3.x client view. The basic lifecycle and semantics of an EJB session bean are defined by the EJB specification.</text>
+ <note>This is a reference to the EJB specification</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>A stateless session bean must belong to the |@Dependent| pseudo-scope</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A singleton bean must belong to either the |@ApplicationScoped| scope or to the |@Dependent| pseudo-scope</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If a session bean specifies an illegal scope, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A stateful session bean may have any scope.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>When a contextual instance of a session bean is obtained via the dependency injection service, the behavior of |SessionContext.getInvokedBusinessInterface()| is specific to the container implementation. Portable applications should not rely upon the value returned by this method.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the bean class of a session bean is annotated |@Interceptor|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If the bean class of a session bean is annotated |@Decorator|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If the session bean class is a parameterized type, it must have scope |@Dependent|. If a session bean with a parameterized bean class declares any scope other than |@Dependent|, the container automatically detects the problem and treats it as a
+definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.1" title="EJB remove methods of session beans">
+ <assertion id="a">
+ <text>If a session bean is a stateful session bean, and the scope is |@Dependent|, the application may call any EJB remove method of an instance of the session bean.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If a session bean is a stateful session bean, and the scope is not |@Dependent|, the application may not directly call any EJB remove method of any instance of the session bean</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the application directly calls an EJB remove method of an instance of a session bean that is a stateful session bean and declares any scope other than |@Dependent|, an |UnsupportedOperationException| is thrown</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If the application directly calls an EJB remove method of an instance of a session bean that is a stateful session bean and has scope |@Dependent| then no parameters are passed to the method by the container.</text>
+ </assertion>
+
+ <assertion id="dba">
+ <text>If the application directly calls an EJB remove method of an instance of a session bean that is a stateful session bean and has scope |@Dependent| then the container ignores the instance instead of destroying it when |Contextual.destroy()| is called, as defined in Section 6.5, "Lifecycle of stateful session beans"</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.2" title="Bean types of a session bean">
+ <assertion id="aa">
+ <text>The set of bean types for a session bean contains all local interfaces of the bean and their superinterfaces.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>If the session bean has a bean class local view, the set of bean types contains the bean class and all superclasses.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>|java.lang.Object| is a bean type of every session bean</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Remote interfaces are not included in the set of bean types</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.3" title="Declaring a session bean">
+ <assertion id="a">
+ <text>A session bean does not require any special annotations</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>A bean class may also specify a scope~, name, deployment type, stereotypes and/or bindings~</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>A bean class may also specify a ~scope, ~name~, deployment type, stereotypes and/or bindings~</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>A bean class may also specify a ~scope, name, ~deployment type~, stereotypes and/or bindings~</text>
+ </assertion>
+
+ <assertion id="bd">
+ <text>A bean class may also specify a ~scope, name, deployment type, ~stereotypes ~and/or bindings~</text>
+ </assertion>
+
+ <assertion id="be">
+ <text>A bean class may also specify a ~scope, name, deployment type, stereotypes and/or~ bindings~</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A session bean class may extend another bean class</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.4" title="Specializing a session bean">
+
+ <assertion id="aa">
+ <text>If a bean class of a session bean X is annotated |@Specializes|, then the bean class of X must directly extend the bean class of another session bean Y. Then X directly specializes Y, as defined in Section 4.3 "Specialization".</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If the bean class of X does not directly extend the bean class of another session bean, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Session bean X that specializes session bean Y must support all local interfaces supported by Y</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Session bean X that specializes session bean Y must support a bean-class local view if Y supports a bean-class local view</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.5" title="Default name for a session bean">
+ <assertion id="a">
+ <text>The default name for a managed bean is the unqualified class name of the session bean class, after converting the first character to lower case</text>
+ </assertion>
+ </section>
+
+ <section id="3.4" title="Producer methods">
+ <assertion id="a">
+ <text>A producer method must be a method of a managed bean class or session bean class</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A producer method may be static</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A producer method may be non-static</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the bean is a session bean, the producer method must be either a business method of the EJB or a static method of the bean class</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a producer method sometimes returns a null value, then the producer method must have scope |@Dependent|</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If a producer method returns a null value at runtime, and the producer method declares scope other than |@Dependent|, an |IllegalProductException| is thrown by the container. This restriction allows the container to use a client proxy, as defined in Section 5.3, "Client proxies".</text>
+ </assertion>
+
+ <assertion id="ga">
+ <text>If the producer method return type is a parameterized type, it must specify an actual type parameter or type variable for each type parameter</text>
+ </assertion>
+
+ <assertion id="ha">
+ <text>If a producer method return type contains a wildcard type parameter the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ia">
+ <text>If the producer method return type is a parameterized type with a type variable, it must have scope @Dependent. If a producer
+method with a parameterized return type with a type variable declares any scope other than |@Dependent|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ib">
+ <text>If a producer method return type is a type variable the container automatically detects the problem and treats it as a definition
+error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="j" testable="false">
+ <text>The application may call producer methods directly. However, if the application calls a producer method directly, no parameters will be passed to the producer method by the container; the returned object is not bound to any context; and its lifecycle is not managed by the container</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>A bean may declare multiple producer methods</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.1" title="Bean types of a producer method">
+ <assertion id="a">
+ <text>If the return type of a producer method is an interface, the set of bean types contains the return type, all interfaces it extends directly or indirectly and |java.lang.Object|</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If a return type of a producer method is primitive or is a Java array type, the set of bean types contains exactly two types: the method return type and |java.lang.Object|</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the return type of a producer method is a class, the set of bean types contains the return type, every superclass and all interfaces it implements directly or indirectly</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.2" title="Declaring a producer method">
+
+ <assertion id="a">
+ <text>A producer method may be declared by annotating a method with the |(a)javax.enterprise.inject.Produces| annotation</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>A producer method may specify a scope</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>A producer method may specify a name</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>A producer method may specify a deployment type</text>
+ </assertion>
+
+ <assertion id="bd">
+ <text>A producer method may specify stereotypes</text>
+ </assertion>
+
+ <assertion id="be">
+ <text>A producer method may specify a binding type</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>If a producer method is annotated |@Initializer|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If a producer method has a parameter annotated |@Disposes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ea">
+ <text>If a producer method has a parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="fa">
+ <text>If a non-static method of a session bean class is annotated |@Produces|, and the method is not a business method of the session bean, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.3" title="Producer method parameters">
+ <assertion id="b">
+ <text>A producer method may have any number of parameters.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>All producer method parameters are injection points.</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.4" title="Specializing a producer method">
+
+ <assertion id="aa">
+ <text>If a producer method X is annotated |@Specializes|, then it must be non-static and directly override another producer method Y. Then X directly specializes Y, as defined in Section 4.3 "Specialization".</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>If a producer method is static, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>If a producer method does not directly override another producer method, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.5" title="Disposal methods">
+ <assertion id="a">
+ <text>A disposal method must be a method of a managed bean class or session bean class.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A disposal method may be static</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A disposal method may be non-static</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the bean is a session bean, the disposal method must be a business method of the EJB or a static method of the bean class</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A bean may declare multiple disposal methods</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.6" title="Disposed parameter of a disposal method">
+ <assertion id="a">
+ <text>Each disposal method must have exactly one disposed parameter, of the same type as the corresponding producer method return type</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>When searching for disposal methods for a producer method, the container considers the type and bindings of the disposed parameter. If a disposed parameter resolves to a producer method declared by the same bean class, according to the typesafe resolution algorithm, the container must call this method when destroying an instance returned by that producer method</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>A disposal method may resolve to multiple producer methods declared by the bean class, in which case the container must call it when destroying any instance returned by any of these producer methods.</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.7" title="Declaring a disposal method">
+ <assertion id="a">
+ <text>A disposal method may be declared by annotating a parameter |(a)javax.enterprise.inject.Disposes|. That parameter is the disposed parameter</text>
+ </assertion>
+
+ <assertion id="b0">
+ <text>Bindings may be declared by annotating the disposed parameter.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>If a method has more than one parameter annotated |@Disposes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>If a disposal method is annotated |@Produces|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If a disposal method is annotated |@Initializer|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ea">
+ <text>If a disposal method has a parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="fa">
+ <text>If a non-static method of a session bean class has a parameter annotated |@Disposes|, and the method is not a business method of the session bean, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4 "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.8" title="Disposal method parameters">
+ <assertion id="a">
+ <text>In addition to the disposed parameter, a disposal method may declare additional parameters, which may also specify bindings. These additional parameters are injection points.</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.9" title="Disposal method resolution">
+ <assertion id="aa">
+ <text>When searching for disposal methods for a producer method, the container searches for disposal methods which are declared by the same bean class as the producer method, and for which the disposed parameter resolves to the producer method, according to the typesafe resolution algorithm defined in Section 5.1, "Typesafe resolution algorithm".</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>If there are multiple disposal methods for a single producer method, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>If the disposed parameter of a disposal method does not resolve to any producer method declared by the bean class, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.10" title="Default name for a producer method">
+ <assertion id="a">
+ <text>The default name for a producer method is the method name, unless the method follows the JavaBeans property getter naming convention, in which case the default name is the JavaBeans property name</text>
+ </assertion>
+ </section>
+
+ <section id="3.5" title="Producer fields">
+ <assertion id="a">
+ <text>A producer field must be a field of a managed bean class or session bean class</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A producer field may be static</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A producer field may be nonstatic</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a producer field sometimes contains a null value when accessed, then the producer field must have scope |@Dependent|</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a producer method contains a null value at runtime, and the producer field declares any other scope, an |IllegalProductException| is thrown by the container. This restriction allows the container to use a client proxy, as defined in Section 5.3, "Client proxies"</text>
+ </assertion>
+
+ <assertion id="fa">
+ <text>If the producer field type is a parameterized type, it must specify an actual type parameter or type variable for each type parameter</text>
+ </assertion>
+
+ <assertion id="ga">
+ <text>If a producer field type contains a wildcard type parameter the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="gb">
+ <text>If the producer field type is a parameterized type with a type variable, it must have scope |@Dependent|. If a producer field with a parameterized type with a type variable declares any scope other than |@Dependent|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ha">
+ <text>If a producer field type is a type variable the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="i" testable="false">
+ <text>The application may access producer fields directly. However, if the application accesses a producer field directly, the returned object is not bound to any context; and its lifecycle is not managed by the container</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+
+ <assertion id="j">
+ <text>A bean may declare multiple producer fields</text>
+ </assertion>
+ </section>
+
+ <section id="3.5.1" title="Bean types of a producer field">
+ <assertion id="a">
+ <text>The bean types of a producer field depend upon the field type. If the field type is an interface, the set of bean types contains the field type, all interfaces it extends directly or indirectly and java.lang.Object</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The bean types of a producer field depend upon the field type. If a field type is primitive or is a Java array type, the set of bean types contains exactly two types: the field type and java.lang.Object</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The bean types of a producer field depend upon the field type. If the field type is a class, the set of bean types contains the field type, every superclass and all interfaces it implements directly or indirectly</text>
+ </assertion>
+ </section>
+
+ <section id="3.5.2" title="Declaring a producer field using annotations">
+ <assertion id="a">
+ <text>A producer field may be declared by annotating a field with the |(a)javax.enterprise.inject.Produces| annotation</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A producer field may specify a scope</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A producer field may specify a name</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A producer field may specify a deployment type</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A producer field may specify stereotypes</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A producer field may specify bindings</text>
+ </assertion>
+ </section>
+
+ <section id="3.5.3" title="Default name for a producer field">
+ <assertion id="a">
+ <text>The default name for a producer field is the field name</text>
+ </assertion>
+ </section>
+
+ <section id="3.6" title="Resources">
+ <assertion id="k">
+ <text>A resource always has scope |@Dependent|</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>A resource may not declare a bean EL name</text>
+ </assertion>
+ </section>
+
+ <section id="3.6.1" title="Declaring a resource">
+ <assertion id="aa">
+ <text>A resource may be declared by specifying a Java EE component environment injection annotation as part of a producer field declaration.</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>For a Java EE resource, |@Resource| must be specified.</text>
+ </assertion>
+
+ <assertion id="cc">
+ <text>For a persistence context, |@PersistenceContext| must be specified.</text>
+ </assertion>
+
+ <assertion id="dd">
+ <text>For a persistence unit, |@PersistenceUnit| must be specified.</text>
+ </assertion>
+
+ <assertion id="ee">
+ <text>For a remote EJB, |@EJB| must be specified.</text>
+ </assertion>
+
+ <assertion id="ff">
+ <text>For a web service, |@WebServiceRef| must be specified.</text>
+ </assertion>
+
+ <assertion id="gg">
+ <text>The injection annotation specifies the metadata needed to obtain the resources, entity manager, entity manager factory, remote
+EJB instance or web service reference from the component environment.</text>
+ </assertion>
+
+ <assertion id="hh">
+ <text>The bean type, bindings and deployment type of the resource are determined by the producer field declaration.</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.6.2" title="Bean types of a resource">
+ <assertion id="a">
+ <text>The bean types of a resource are the declared type of the field declaration, together with |java.lang.Object|.</text>
+ </assertion>
+ </section>
+
+ <section id="3.6.3" title="The JTA TransactionManager">
+ <assertion id="a">
+ <text>The container must provide a built-in resource with bean type |javax.transaction.TransactionManager| and binding |@Current|, representing a reference to the JTA transaction manager.</text>
+ </assertion>
+ </section>
+
+ <section id="3.7" title="Message destinations">
+ <assertion id="b">
+ <text>JMS queue resources must allow the direct injection of the |Queue|</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>JMS queue resources must allow the direct injection of the |QueueConnection|</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>JMS queue resources must allow the direct injection of the |QueueSession|</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>JMS queue resources must allow the direct injection of the |QueueReceiver|</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>JMS queue resources must allow the direct injection of the |QueueSender|</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>JMS topic resources must allow the direct injection of the |Topic|</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>JMS topic resources must allow the direct injection of the |TopicConnection|</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>JMS topic resources must allow the direct injection of the |TopicSession|</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>JMS topic resources must allow the direct injection of the |TopicSubscriber|</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>JMS topic resources must allow the direct injection of the |TopicPublisher|</text>
+ </assertion>
+
+ <assertion id="l">
+ <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>If the application calls |close()| on an instance of a |QueueSession|, an |UnsupportedOperationException| is thrown by the container.</text>
+ </assertion>
+
+ <assertion id="n">
+ <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>If the application calls |close()| on an instance of a |QueueSender|, an |UnsupportedOperationException| is thrown by the container.</text>
+ </assertion>
+
+ <assertion id="p">
+ <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>If the application calls |close()| on an instance of a |TopicSession|, an |UnsupportedOperationException| is thrown by the container.</text>
+ </assertion>
+
+ <assertion id="r">
+ <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>If the application calls |close()| on an instance of a |TopicPublisher|, an |UnsupportedOperationException| is thrown by the container.</text>
+ </assertion>
+
+ <assertion id="t">
+ <text>A JMS |Queue| resource always has scope |@Dependent|</text>
+ </assertion>
+
+ <assertion id="u">
+ <text>A JMS |QueueConnection| resource always has scope |@Dependent|</text>
+ </assertion>
+
+ <assertion id="v">
+ <text>A JMS |QueueSession| resource always has scope |@Dependent|</text>
+ </assertion>
+
+ <assertion id="w">
+ <text>A JMS |QueueReceiver| resource always has scope |@Dependent|</text>
+ </assertion>
+
+ <assertion id="x">
+ <text>A JMS |QueueSender| resource always has scope |@Dependent|</text>
+ </assertion>
+
+ <assertion id="y">
+ <text>A JMS |Topic| resource always has scope |@Dependent|</text>
+ </assertion>
+
+ <assertion id="z">
+ <text>A JMS |TopicConnection| resource always has scope |@Dependent|</text>
+ </assertion>
+
+ <assertion id="aa">
+ <text>A JMS |TopicSession| resource always has scope |@Dependent|</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>A JMS |TopicSubscriber| resource always has scope |@Dependent|</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>A JMS |TopicPublisher| resource always has scope |@Dependent|</text>
+ </assertion>
+
+ <assertion id="ad">
+ <text>A JMS |Queue| resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="ae">
+ <text>A JMS |QueueConnection| resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="af">
+ <text>A JMS |QueueSession| resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="ag">
+ <text>A JMS |QueueReceiver| resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="ah">
+ <text>A JMS |QueueSender| resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="ai">
+ <text>A JMS |Topic| resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="aj">
+ <text>A JMS |TopicConnection| resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="ak">
+ <text>A JMS |TopicSession| resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="al">
+ <text>A JMS |TopicSubscriber| resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="am">
+ <text>A JMS |TopicPublisher| resource may not declare a bean name</text>
+ </assertion>
+ </section>
+
+ <section id="3.7.1" title="Bean types of a message destination">
+ <assertion id="a">
+ <text>For message destination that represent a queue, the bean types are |Queue|, |QueueConnection|, |QueueSession| and |QueueSender|</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For message destination that represent a topic, the bean types are |Topic|, |TopicConnection|, |TopicSession| and |TopicPublisher|</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The supertypes |Session|, |MessageProducer|, |MessageConsumer|, |Connection| and |Destination| are bean types of any message destination.</text>
+ </assertion>
+ </section>
+
+ <section id="3.7.2" title="Declaring a message destination">
+ <assertion id="d">
+ <text>A message destination may be declared by specifying a |@Resource| annotation as part of a producer field declaration of type |Topic| or |Queue|.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The |@Resource| annotation specifies the metadata needed to obtain the topic or queue from the component environment.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The bindings and deployment type of the resource are determined by the producer field declaration.</text>
+ </assertion>
+ </section>
+
+ <section id="3.8" title="Injected fields">
+ <assertion id="aa">
+ <text>An injected field is a non-static~, non-final~ field of a bean class.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>An injected field is a ~non-static, ~non-final field of a bean class.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>An injected field is a non-static, ~non-final~ field of any Java EE component class supporting injection.</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>An injected field is a ~non-static~, non-final field of any Java EE component class supporting injection.</text>
+ </assertion>
+
+ <assertion id="ea">
+ <text>Injected fields are initialized by the container before initializer methods are called, and before the |@PostConstruct| callback occurs.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If a field is a producer field, it is not an injected field</text>
+ </assertion>
+ </section>
+
+ <section id="3.8.1" title="Declaring an injected field">
+ <assertion id="a">
+ <text>An injected field may be declared by annotating the field with any binding type</text>
+ </assertion>
+ </section>
+
+ <section id="3.9" title="Initializer methods">
+ <assertion id="aa">
+ <text>An initializer method is a non-static method of a bean class.</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>An initializer method is a non-static method of any Java EE component class supporting injection.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the bean is a session bean, the initializer method is not required to be a business method of the session bean</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A bean class may declare multiple (or zero) initializer methods</text>
+ </assertion>
+
+ <assertion id="ea">
+ <text>Initializer methods are called by the container after injected fields are initialized, and before the |@PostConstruct| callback occurs.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Method interceptors are never called when the container calls an initializer method</text>
+ </assertion>
+
+ <assertion id="h" testable="false">
+ <text>The application may call initializer methods directly, but then no parameters will be passed to the method by the container</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+ </section>
+
+ <section id="3.9.1" title="Declaring an initializer method">
+ <assertion id="a">
+ <text>An initializer method may be declared by annotating the method |(a)javax.enterprise.inject.Initializer|</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>If an initializer method is annotated |@Produces|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>If an initializer method has a parameter annotated |@Disposes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If an initializer method has a parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.9.2" title="Initializer method parameters">
+ <assertion id="aa">
+ <text>An initializer method may have any number of parameters.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>All initializer method parameters are injection points.</text>
+ </assertion>
+ </section>
+
+ <section id="3.10" 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="3.11" title="Beans with the @New binding">
+ <assertion id="d">
+ <text>For each managed bean, a second bean exists which has the same bean class.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>For each managed bean, a second bean exists which has the same bean types.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>For each managed bean, a second bean exists which has the same bean constructor.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>For each managed bean, a second bean exists which has the same initializer methods.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>For each managed bean, a second bean exists which has the same injected fields.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>For each managed bean, a second bean exists which has the same interceptor bindings.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>For each session bean, a second bean exists which has the same bean class.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>For each session bean, a second bean exists which has the same bean types.</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>For each session bean, a second bean exists which has the same bean constructor.</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>For each session bean, a second bean exists which has the same initializer methods.</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>For each session bean, a second bean exists which has the same injected fields.</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>For each session bean, a second bean exists which has the same interceptor bindings.</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>This second bean has scope |@Dependent|.</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>This second bean has deployment type |@Standard|.</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>This second bean has exactly one binding: |(a)javax.enterprise.inject.New(X.class)| where |x| is the bean class.</text>
+ </assertion>
+
+ <assertion id="s">
+ <text>This second bean has no bean EL name.</text>
+ </assertion>
+
+ <assertion id="t">
+ <text>This second bean has no stereotypes.</text>
+ </assertion>
+
+ <assertion id="u">
+ <text>This second bean has no observer methods.</text>
+ </assertion>
+
+ <assertion id="v">
+ <text>This second bean has no producer methods.</text>
+ </assertion>
+
+ <assertion id="w">
+ <text>This second bean has no producer fields.</text>
+ </assertion>
+
+ <assertion id="x">
+ <text>This second bean has no disposal methods.</text>
+ </assertion>
+
+ <assertion id="y">
+ <text>This bean is available even if the bean class declares a disabled deployment type.</text>
+ </assertion>
+ </section>
+
+ <section id="4" title="Inheritance and specialization">
+
+ </section>
+
+ <section id="4.1" title="Inheritance of type-level metadata">
+ <assertion id="aa">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
+ </assertion>
+
+ <assertion id="ad">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
+ </assertion>
+
+ <assertion id="ae">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
+ </assertion>
+
+ <assertion id="ag">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ </assertion>
+
+ <assertion id="ah">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ </assertion>
+
+ <assertion id="aj">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ </assertion>
+
+ <assertion id="ak">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare a scope type.</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare a scope type.</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a scope type.</text>
+ </assertion>
+
+ <assertion id="bd">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a scope type.</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X is annotated with a _deployment type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare a deployment type.</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X is annotated with a _deployment type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare a deployment type.</text>
+ </assertion>
+
+ <assertion id="cc">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X is annotated with a _deployment type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a deployment type.</text>
+ </assertion>
+
+ <assertion id="cd">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X is annotated with a _deployment type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a deployment type.</text>
+ </assertion>
+
+ <assertion id="daa">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, the _scope types_ explicitly declared by and inherited from the class X take precedence over default _scopes_ declared by stereotypes.</text>
+ </assertion>
+
+ <assertion id="dab">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, the _deployment types_ explicitly declared by and inherited from the class X take precedence over deployment _deployment types_ declared by stereotypes.</text>
+ </assertion>
+
+ <assertion id="dba">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, the _scope types_ explicitly declared by and inherited from the class X take precedence over default _scopes_ declared by stereotypes.</text>
+ </assertion>
+
+ <assertion id="dbb">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, the _deployment types_ explicitly declared by and inherited from the class X take precedence over default _deployment types_ declared by stereotypes.</text>
+ </assertion>
+
+ <assertion id="dca">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, the _scope types_ explicitly declared by and inherited from the class X take precedence over default _scopes_ declared by stereotypes.</text>
+ </assertion>
+
+ <assertion id="dcb">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, the _deployment types_ explicitly declared by and inherited from the class X take precedence over default _deployment_ types declared by stereotypes.</text>
+ </assertion>
+
+ <assertion id="dda">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, the _scope types_ explicitly declared by and inherited from the class X take precedence over default _scopes_ declared by stereotypes.</text>
+ </assertion>
+
+ <assertion id="ddb">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, the _deployment types_ explicitly declared by and inherited from the class X take precedence over _deployment types_ declared by stereotypes.</text>
+ </assertion>
+
+ <assertion id="i" testable="false">
+ <text>For annotations defined by the bean specification, all built-in _scope types_ are declared |@Inherited|</text>
+ <note>sigtest</note>
+ </assertion>
+
+ <assertion id="j" testable="false">
+ <text>For annotations defined by the bean specification, all built-in _stereotypes_ are declared |@Inherited|</text>
+ <note>sigtest</note>
+ </assertion>
+
+ <assertion id="k" testable="false">
+ <text>For annotations defined by the bean specification, _no built-in binding type is declared |@Inherited|_</text>
+ <note>sigtest</note>
+ </assertion>
+
+ <assertion id="l" testable="false">
+ <text>For annotations defined by the bean specification, _the built-in deployment type is not declared |@Inherited|_</text>
+ <note>sigtest</note>
+ </assertion>
+
+ <assertion id="m" testable="false">
+ <text>The |@Named| annotation is not declared |@Inherited| and bean EL names are not inherited unless specialization is used</text>
+ <note>sigtest</note>
+ </assertion>
+
+ </section>
+
+ <section id="4.2" title="Inheritance of member-level metadata">
+
+ <assertion id="aa">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares an injected field x then Y inherits x.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares an injected field x then Y inherits x.</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares an injected field x then Y inherits x.</text>
+ </assertion>
+
+ <assertion id="ad">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares an injected field x then Y inherits x.</text>
+ </assertion>
+
+ <assertion id="baa">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
+ </assertion>
+
+ <assertion id="bab">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
+ </assertion>
+
+ <assertion id="bac">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
+ </assertion>
+
+ <assertion id="bad">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
+ </assertion>
+
+ <assertion id="bba">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _|@PreDestroy|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
+ </assertion>
+
+ <assertion id="bbb">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _|@PreDestroy|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
+ </assertion>
+
+ <assertion id="bbc">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _|@PreDestroy|_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
+ </assertion>
+
+ <assertion id="bbd">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _|@PreDestroy|_ method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y overrides the method x()</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="dc">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="dd">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="de">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="df">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="dg">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="dh">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="di">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="dj">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="dk">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="dl">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit this method unless Y is explicitly declared to specialize X</text>
+ </assertion>
+
+ <assertion id="ea">
+ <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit this field unless Y is explicitly declared to specialize X.</text>
+ </assertion>
+
+ <assertion id="eb">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit this field unless Y is explicitly declared to specialize X.</text>
+ </assertion>
+
+ <assertion id="ec">
+ <text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit this field unless Y is explicitly declared to specialize X.</text>
+ </assertion>
+
+ <assertion id="ed">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit this field unless Y is explicitly declared to specialize X.</text>
+ </assertion>
+
+ </section>
+
+ <section id="4.3" title="Specialization">
+
+ <assertion id="a">
+ <text>If two beans both support a certain bean type, and share at least one binding, then they are both eligible for injection to any injection point with that declared type and binding. The container will choose the bean with the highest priority enabled deployment type.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the bean with the lower priority deployment type declares a binding that is not declared by the bean with the higher priority deployment type, then the bean with the higher priority deployment type will not be eligible for injection to an injection point with that binding.</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>The only way one bean can completely override a lower-priority bean at all injection points is if it implements all the bean types and declares all the bindings of the lower-priority bean. However, if the lower-priority bean declares a producer method or observer method, then even this is not enough to ensure that the lower-priority bean is never called.</text>
+ </assertion>
+
+ </section>
+
+ <section id="4.3.1" title="Direct and indirect specialization">
+ <assertion id="i">
+ <text>A bean X is said to specialize another bean Y if X directly specializes Y.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>A bean X is said to specialize another bean Y if a bean Z exists, such that X directly specializes Z and Z specializes Y.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>A bean X that specializes bean Y will include all bindings of Y, together with all bindings declared explicitly by X.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>A bean X that specializes bean Y will have the same name as Y if Y has a name.</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>If X declares a name explicitly, using @Named, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ </section>
+
+ <section id="4.3.2" title="Most specialized enabled bean for a bean">
+ <assertion id="a">
+ <text>Non-static producer methods, producer fields, disposal methods and observer methods of a bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 5.4.6, "Invocation of producer or disposal methods", Section 5.4.7, "Access to producer field values" and Section 5.4.8, "Invocation of observer methods".</text>
+ </assertion>
+
+ </section>
+
+ <section id="4.3.3" title="Inconsistent specialization">
+ <assertion id="aa">
+ <text>If, in a particular deployment, either some enabled bean X specializes another enabled bean Y and the deployment type of X does not have a higher precedence than the deployment type of Y, the container automatically detects inconsistent specialization and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>If, in a particular deployment, more than one enabled bean directly specializes the same bean, the container automatically detects inconsistent specialization and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="5" title="Lookup, dependency injection and EL resolution">
+
+ <assertion id="b">
+ <text>The container is required to support circularities in the bean dependency graph</text>
+ <note>The RI has unit tests for this atm</note>
+ </assertion>
+ </section>
+
+ <section id="5.1" title="Typesafe resolution algorithm">
+
+ <assertion id="faa">
+ <text>When the container is resolving a bean by type, it identifies the set of matching enabled beans which have a bean type that matches the required type.</text>
+ </assertion>
+
+ <assertion id="fb">
+ <text>Primitive types are considered to be identical to their corresponding wrapper types in |java.lang|.</text>
+ </assertion>
+
+ <assertion id="fc">
+ <text>Array types are considered identical only if their element types are identical.</text>
+ </assertion>
+
+ <assertion id="fd">
+ <text>Parameterized types are considered identical only if both the type and all type parameters are identical.</text>
+ </assertion>
+
+ <assertion id="gaa">
+ <text>_If no bindings were explicitly specified, the container assumes the binding |@Current|_. </text>
+ </assertion>
+
+ <assertion id="gba">
+ <text>The container narrows the set of matching beans to just those where for each required binding, the bean declares a matching binding with _(a) the same type_ and (b) the same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.NonBinding|.</text>
+ </assertion>
+
+ <assertion id="gca">
+ <text>The container narrows the set of matching beans to just those where for each required binding, the bean declares a matching binding with (a) the same type and _(b) the same annotation member value for each member_ which is not annotated |javax.enterprise.inject.@NonBinding|.</text>
+ </assertion>
+
+ <assertion id="ha">
+ <text>When the container is resolving a bean by type, it examines the deployment types of the matching beans, as defined in Section 2.5.6, "Deployment type precedence", and returns the set of beans with the highest precedence deployment type that occurs in the set.</text>
+ </assertion>
+
+ <assertion id="hb">
+ <text>When the container is resolving a bean by type, it examines the deployment types of the matching beans, as defined in Section 2.5.6, "Deployment type precedence", and returns the set of beans with the highest precedence deployment type that occurs in the set. _If there are no matching beans, an empty set is returned_</text>
+ </assertion>
+ </section>
+
+ <section id="5.1.1" title="Assignability of raw and parameterized types">
+
+ <assertion id="a">
+ <text>A parameterized bean type is considered assignable to a raw required type if the raw types are identical and all type parameters of the bean type are either unbounded type variables or |java.lang.Object|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter and the bean type parameter are actual types with identical raw type, and, if the type is parameterized, the bean type is assignable to the required type according to these rules.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter is a wildcard, the bean type parameter is an actual type and the actual type is a subtype of the upper bound, if any, of the wildcard and a supertype of the upper bound, if any, or the wildcard.
+ </text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter is a wildcard with no lower bound, the bean type parameter is a type variable and the upper bound of the type variable is aa subtype of the upper bound, if any, of the wildcard.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter is an actual type, the bean type parameter is a type variable and the actual type is a subtype of the upper bound, if any, of the type variable.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter the required type parameter and the bean type parameter are both type variables and the upper bound of the required type parameter is a subtype of the upper bound, if any, of the bean type parameter</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the injection point is declared by a parameterized superclass, and the type declaration of the injection point contains type parameters declared by the superclass, the required type is the declared type, after substitution of actual type arguments declared by subclasses.</text>
+ </assertion>
+
+ </section>
+
+ <section id="5.1.2" title="Unsatisfied and ambiguous dependencies">
+ <assertion id="aa">
+ <text>The container must validate all injection points of all enabled beans when the application is initialized to ensure that there are no unsatisfied or ambiguous dependencies. If an unsatisfied or ambiguous dependency exists, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ <note>These need expanding out - one for each assertion that results in an exception in 5.7.1</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>For a custom implementation of the Bean interface defined in Section 11.1, "The Bean interface", the container calls |getInjectionPoints()| to determine the injection points of the bean.</text>
+ </assertion>
+
+ </section>
+
+ <section id="5.1.3" title="Primitive types and null values">
+
+ <assertion id="aa">
+ <text>If necessary, the container performs boxing ~or unboxing~ when it injects a value to a field or parameter of primitive or wrapper type.</text>
+ </assertion>
+ <assertion id="ab">
+ <text>If necessary, the container performs ~boxing or~ unboxing when it injects a value to a field or parameter of primitive or wrapper type.</text>
+ </assertion>
+
+ <assertion id="aa">
+ <text>If an injection point of primitive type resolves to a bean that may have null values, such as a producer method with a nonprimitive return type or a producer field with a non-primitive type, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4 "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>For a custom implementation of the Bean interface defined in Section 11.1, "The Bean interface", the container calls |isNullable()| to determine whether the bean may have null values.</text>
+ </assertion>
+ </section>
+
+ <section id="5.1.4" title="Binding annotations with members">
+ <assertion id="a" testable="false">
+ <text>Binding types with members are supported</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>An annotation member may be excluded from consideration using the |@NonBinding| annotation</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>Array-valued ~or annotation-valued~ members of a binding type must be annotated |@NonBinding|. If an array-valued ~or annotation-valued~ member of a binding type is not annotated |@NonBinding|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>~Array-valued or ~annotation-valued members of a binding type must be annotated |@NonBinding|. If an ~array-valued or ~annotation-valued member of a binding type is not annotated |@NonBinding|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="5.1.5" title="Multiple bindings">
+ <assertion id="a">
+ <text>A bean class may declare multiple bindings</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A producer method may declare multiple bindings</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A producer field may declare multiple bindings</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A bean must declare all of the bindings that are specified at the injection point to be considered a candidate for injection</text>
+ </assertion>
+ </section>
+
+ <section id="5.2" title="EL Name resolution algorithm">
+
+ <assertion id="b">
+ <text>When resolving a bean by name, the container must identify the set of matching enabled beans which have the given EL name</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>After the container identifies the set of matching beans, it examines the deployment types of the matching beans, as defined in Section 2.5.6, "Deployment type precedence", and returns the set of beans with the highest precedence deployment type that occurs in the set.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If there are no matching beans, an empty set is returned.</text>
+ </assertion>
+ </section>
+
+ <section id="5.2.1" title="Ambiguous EL names">
+ <assertion id="a">
+ <text>If, in a particular deployment two enabled beans have the same EL name and the same deployment type, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If, in a particular deployment, the EL name of an enabled bean is of the form |x.y|, where |y| is a valid bean EL name, and |x| is the EL name of some other enabled bean, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="5.3" 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>Client proxies are used for normal scoped beans</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must guarantee that when any valid injected reference to a bean of normal scope is invoked, the invocation is always processed by the current instance of the injected bean.</text>
+ </assertion>
+ </section>
+
+ <section id="5.3.1" title="Unproxyable bean types">
+ <assertion id="aa">
+ <text>Classes without a non-private constructor with no parameters cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="baa">
+ <text>Classes which are declared final ~or have final methods~ cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="bba">
+ <text>Classes which ~are declared final or ~have final methods cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>Primitive types cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>Array types cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="5.3.2" title="Client proxy invocation">
+ <assertion id="aa">
+ <text>Every time a method of the bean is invoked upon a client proxy, the client proxy must obtain a contextual instance of the bean, as defined in Section 6.5.2, "Contextual instance of a bean", and invoke the method upon this instance.</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.4" title="Dependency injection">
+ <assertion id="a">
+ <text>The container is required to perform dependency injection whenever it creates a contextual instance of a session bean.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The container is required to perform dependency injection whenever it creates a contextual instance of a managed bean.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container is required to perform dependency injection whenever it instantiates non-contextual instances of session beans (for example, session beans obtained by the application from JNDI or injected using |@EJB|).</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container is required to perform dependency injection whenever it instantiates non-contextual instances of managed beans.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The container is required to perform dependency injection whenever it instantiates instances of any other Java EE component class supporting injection.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>In a Java EE 5 environment, the container is not required to support injection for non-contextual objects.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The container interacts with instances of beans and other Java EE component classes supporting injection by calling methods and getting and setting the field values.</text>
+ </assertion>
+ </section>
+
+ <section id="5.4.1" title="Injectable references">
+ <assertion id="a">
+ <text>To obtain an injectable reference for an injection point, the container must identify a bean according to the rules defined in Section 5.1, "Typesafe resolution algorithm".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If typesafe resolution resulted in an empty set, throw an |UnsatisfiedResolutionException|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If typesafe resolution resulted in more than one bean, throw an |AmbiguousResolutionException|.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Otherwise, obtain a contextual reference for this bean for the type of the injection point according to Section 6.5.3, "Contextual reference for a bean".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The container is permitted to directly inject a contextual instance of the bean, as defined in Section 6.5.2, "Contextual instance of a bean".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If an incompletely initialized instance of the bean is registered with the current |CreationalContext|, as defined in Section
+6.1, "The Contextual interface", the container is permitted to directly inject this instance.</text>
+ </assertion>
+
+ </section>
+
+ <section id="5.4.2" title="Injected reference validity">
+ <assertion id="c">
+ <text>Injected references to a bean are valid until the object into which they were injected is destroyed. The application should not invoke a method of an invalid reference. If the application invokes a method of an injected reference after the object into which it was injected has been destroyed, the behavior is undefined.</text>
+ </assertion>
+ </section>
+
+ <section id="5.4.3" title="Injection using the bean constructor">
+ <assertion id="a">
+ <text>When the container instantiates a managed bean with a constructor annotated |@Initializer|, the container calls this constructor, passing an injectable reference to each parameter. If there is no constructor annotated |@Initializer|, the container calls the constructor with no parameters.</text>
+ </assertion>
+ </section>
+
+ <section id="5.4.4" title="Injection of fields and initializer methods">
+ <assertion id="a">
+ <text>When the container creates a new instance of a managed bean, session bean, or of any other Java EE component class supporting injection, the container must initialize the values of all injected fields after injection of Java EE component environment resources has been performed and before the |@PostConstruct| callback occurs and before the servlet |init()| method is called. The container sets the value of each injected field to an injectable reference.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>After the container initializes the values of the injected fields, it must call all initializer methods, passing an injectable reference to each parameter.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>After the container calls initializer methods, it must build the interceptor and decorator stacks for the instance (if the component has interceptors or decorators).</text>
+ </assertion>
+ </section>
+
+ <section id="5.4.5" title="Destruction of dependent objects">
+ <assertion>
+ <text>When the container destroys an instance of a bean or of any Java EE component class supporting injection, the container destroys all dependent objects, as defined in Section 6.4.3, "Dependent object destruction", after the |@PreDestroy| callback completes and after the servlet |destroy()| method is called.</text>
+ </assertion>
+ </section>
+
+ <section id="5.4.6" title="Invocation of producer or disposal methods">
+ <assertion id="a">
+ <text>When the container calls a producer method, if the method is static, the container must invoke the method.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When the container calls a disposal method, if the method is static, the container must invoke the method.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>When the container calls a producer method, if the method is non-static the container must determine the most specialized enabled bean that specializes the bean which declares the method, as defined in Section 4.3.2 "Most specializaed enabled bean for a bean", then obtain a contextual instance of the most specialized bean, as defined by Section 6.5.2 "Contextual instance of a bean", then invoke the method upon this instance.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When the container calls a disposal method, if the method is non-static the container must determine the most specialized enabled bean that specializes the bean which declares the method, as defined in Section 4.3.2 "Most specializaed enabled bean for a bean", then obtain a contextual instance of the most specialized bean, as defined by Section 6.5.2 "Contextual instance of a bean", then invoke the method upon this instance.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The container passes an injectable reference to each injected method parameter. The container is also responsible for destroying dependent objects created during this invocation, as defined in Section 6.4.3 "Dependent object destruction".</text>
+ </assertion>
+ </section>
+
+ <section id="5.4.7" title="Access to producer field values">
+ <assertion id="a">
+ <text>When the container accesses the value of a producer field, if the producer field is static, the container must access the field value.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When the container accesses the value of a producer field, if the producer field is non-static, the container must determine the most specialized enabled bean that specializes the bean which declares the producer field, as defined in Section 4.3.2 "Most specialized enabled bean for a bean", then obtain a contextual instance of the most specialized bean, as defined by Section 6.5.2 "Contextual instance of a bean", then access the field value of this instance.</text>
+ </assertion>
+ </section>
+
+ <section id="5.4.8" title="Invocation of observer methods">
+ <assertion id="a">
+ <text>When the container calls an observer method (defined in Section 10.5 "Observer methods"), if the observer method is static, the container must invoke the method.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When the container calls an observer method (defined in Section 10.5 "Observer methods"), if the observer method is non-static, the container must determine the most specialized enabled bean that specializes the bean which declares the observer method, as defined in Section 4.3.2 "Most specialized enabled bean for a bean", then obtain a contextual instance of the bean according to Section 6.5.2 "Contextual instance of a bean". If this observer method is a conditional observer method, obtain the contextual instance that already exists, without creating a new contextual instance. Finally, the container must invoke the observer method on the resulting instance, if any.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container must pass the event object to the event parameter and an injectable instance to each injected method parameter.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container is also responsible for destroying dependent objects created during this invocation, as defined in Section 6.4.3, "Dependent object destruction".</text>
+ </assertion>
+ </section>
+
+ <section id="5.4.9" title="Injection point metadata">
+ <assertion id="aa">
+ <text>The |javax.enterprise.inject.spi.InjectionPoint.getBean()| method returns the Bean object representing the bean that defines the injection point. If the injection point does not belong to a bean, |getBean()| returns a null value.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>The |javax.enterprise.inject.spi.InjectionPoint.getType()| method returns the declared type of the injection point.</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>The |javax.enterprise.inject.spi.InjectionPoint.getBindings()| method returns the declared bindings of the injection point.</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>The |javax.enterprise.inject.spi.InjectionPoint.getMember()| method returns the |Field| object in the case of field injection.</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>The |javax.enterprise.inject.spi.InjectionPoint.getMember()| method returns the |Method| object in the case of method parameter injection.</text>
+ </assertion>
+
+ <assertion id="cc">
+ <text>The |javax.enterprise.inject.spi.InjectionPoint.getMember()| method returns the |Constructor| object in the case of constructor parameter injection</text>
+ </assertion>
+
+ <assertion id="daa">
+ <text>The |getAnnotated()| method returns an instance of |javax.enterprise.inject.spi.AnnotatedField| or |javax.enterprise.inject.spi.AnnotatedParameter|, depending upon whether the injection point is an injected field or a constructor/method parameter.</text>
+ </assertion>
+
+ <assertion id="dba">
+ <text>The |isDelegate()| method returns true if the injection point is a decorator delegate injection point, and false otherwise.</text>
+ </assertion>
+
+ <assertion id="dca">
+ <text>The |isTransient()| method returns true if the injection point is a transient field, and false otherwise.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The container must provide a bean with deployment type |@Standard|, scope |@Dependent|, bean type |InjectionPoint| and binding |@Current|, allowing dependent objects, as defined in Section 6.4.2, "Dependent objects", to obtain information about the injection point to which they belong. The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable dependencies".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If a bean that declares any scope other than |@Dependent| has an injection point of type |InjectionPoint| and binding |@Current|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If an object that is not a bean has an injection point of type |InjectionPoint| and binding |@Current|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="5.5" title="Programmatic lookup">
+ <assertion id="aa">
+ <text>An instance of the |javax.enterprise.inject.Instance| interface may be injected.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>The method |javax.enterprise.inject.Instance.get()| returns a contextual reference.</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>Any combination of bindings may be specified at the injection point.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>The |@Any| binding may be used to allow the application to specify bindings dynamically.</text>
+ </assertion>
+ </section>
+
+ <section id="5.5.1" title="The Instance interface">
+ <assertion id="a">
+ <text>The |Instance| interface provides a method for obtaining instances of beans of a specific type, and inherits the ability to iterate
+beans of a specific type from |java.lang.Iterable|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The |select()| method of the provided implementation of |Instance| returns a child Instance for a subtype of the bean type and additional bindings. If no subtype is given, the bean type is the same as the parent.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a parameterized type with a type parameter or wildcard is passed to |select()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If two instances of the same binding type are passed to |select()|, a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an instance of an annotation that is not a binding type is passed to |select()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The |get()| method of the provided implementation of |Instance| must identify the bean by calling |BeanManager.getBeans()|, passing the type and bindings specified at the injection point. A child |Instance| passes the bean subtype and the additional bindings, along with the bindings of its parent.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If |getBeans()| did not return a bean, throw an |UnsatisfiedResolutionException|.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If |getBeans()| returned more than one bean, throw an |AmbiguousResolutionException|.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>Otherwise, obtain a contextual reference for the bean by calling |BeanManager.getReference()|, passing the |Bean| object representing the bean and the bean type or subtype, and return it.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The |iterator()| method of the provided implementation of |Instance| must identify the set of beans by calling |BeanManager.getBeans()|, passing the type and bindings specified at the injection point. A child Instance passes the subtype, the bindings specified at the injection point and the additional bindings.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The |iterator()| method of the provided implementation of |Instance| must return an |Iterator|, that iterates over the set of contextual references for the resulting beans by calling |BeanManager.getReference()|, passing the |Bean| object representing the current bean and the bean type or subtype.</text>
+ </assertion>
+ </section>
+
+ <section id="5.5.2" title="The built-in Instance">
+ <assertion id="a">
+ <text>The container must provide a built-in bean with |Instance<X>| for every legal bean type X in its set of bean types</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The container must provide a built-in bean with every binding type in its set of binding types.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container must provide a built-in bean with deployment type @Standard.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must provide a built-in bean with scope @Dependent.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The container must provide a built-in bean with no bean EL name.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The container must provide a built-in bean with an implementation provided automatically by the container. </text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable dependencies".</text>
+ </assertion>
+ </section>
+
+ <section id="5.5.3" title="Using AnnotationLiteral">
+ <assertion id="a">
+ <text>When the application calls select(), it may pass instances of binding annotation types.</text>
+ </assertion>
+ </section>
+
+ <section id="5.6" title="Integration with Unified EL">
+ <assertion id="aaa">
+ <text>The container must provide a Unified EL ELResolver to the servlet engine ~and JSF implementation~ that resolves bean EL names using the name resolution algorithm defined in Section 5.2 "EL name resolution algorithm".</text>
+ <note>This is testable implicitly by trying to resolve using EL from a servlet</note>
+ </assertion>
+
+ <assertion id="aba">
+ <text>The container must provide a Unified EL |ELResolver| to the ~servlet engine~ and JSF implementation that resolves bean EL names using the name resolution algorithm defined in Section 5.2 "EL name resolution algorithm".</text>
+ <note>This is testable implicitly by trying to resolve using EL from a JSF view</note>
+ </assertion>
+
+ <assertion id="ba">
+ <text>If a name used in an EL expression resolves to more than one bean, the |ELResolver| must throw an |AmbiguousResolutionException|.</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>If a name used in an EL expression does not resolve to any bean, the |ELResolver| must return a null value.</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>Otherwise, if a name used in an EL expression resolves to exactly one bean, the |ELResolver| must return a contextual instance of the bean, as defined in Section 6.5.2, "Contextual instance of a bean".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>For each distinct name that appears in the EL expression, the resolver must be called at most once. Even if a name appears more than once in the same expression, the container may not call the resolver multiple times with that name. This restriction ensures that there is a unique instance of each bean with scope |@Dependent| in any EL evaluation.</text>
+ </assertion>
+ </section>
+
+ <section id="6" title="Scopes and contexts">
+
+ </section>
+
+ <section id="6.1" title="The Contextual interface">
+ <assertion id="a">
+ <text>The container and portable extensions may define implementations of the Contextual interface that do not extend |Bean|, but it is not recommended that applications directly implement |Contextual|.</text>
+ </assertion>
+ </section>
+
+ <section id="6.1.1" title="Instance creation">
+ <assertion id="a">
+ <text>The |Contextual.create()| method is responsible for creating new contextual instances of the type.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If any exception occurs while creating an instance, the exception is rethrown by the |create()| method. If the exception is a checked exception, it is wrapped and rethrown as an (unchecked) |CreationException|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The interface |javax.enterprise.context.spi.CreationalContext| provides an operation that allows the |create()| method to register an incompletely initialized contextual instance with the container. A contextual instance is considered incompletely initialized until the create() method returns the instance.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |push()| registers the incompletely initialized instance.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If |create()| calls |CreationalContext.push()|, it must also return the instance passed to |push()|.</text>
+ </assertion>
+ </section>
+
+ <section id="6.1.2" title="Instance destruction">
+ <assertion id="a">
+ <text>The |Contextual.destroy()| method is responsible for destroying instances of the type. In particular, it is responsible for destroying all dependent objects of an instance, as defined in Section 6.4.3, "Dependent object destruction". If any exception occurs while destroying an instance, the exception is caught by the |destroy()| method.</text>
+ </assertion>
+ </section>
+
+ <section id="6.2" title="The Context interface">
+ <assertion id="aa">
+ <text>The |javax.enterprise.context.spi.Context| interface provides an operation for obtaining contextual instances with a particular scope of any contextual type.</text>
+ </assertion>
+
+ <assertion id="ha">
+ <text>When a context object is active the |isActive()| method returns |true|. Otherwise, we say that the context object is inactive and the |isActive()| method returns false.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The |Context.get()| method may either return an existing instance of the given contextual type, ~or if no |CreationalContext| is given, return a null value, or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create() and return the new instance~.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The |Context.get()| method may either ~return an existing instance of the given contextual type~, or if no |CreationalContext| is given, return a null value, ~or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create() and return the new instance~.</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The |Context.get()| method may either ~return an existing instance of the given contextual type, or if no |CreationalContext| is given, return a null value~, or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create() and return the new instance.</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>If the context object is inactive, the |get()| method must throw a |ContextNotActiveException|.</text>
+ </assertion>
+
+ <assertion id="na">
+ <text>The |get()| method may not return a null value _unless no |CreationalContext| is given_, or |Contextual.create()| returns a null value.</text>
+ </assertion>
+
+ <assertion id="nb">
+ <text>The |get()| method may not return a null value unless no |CreationalContext| is given, or _|Contextual.create()| returns a null value_.</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>The |get()| method may not create a new instance of the given contextual type unless a |CreationalContext| is given.</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>The context object is responsible for destroying any contextual instance it creates by passing the instance to the |destroy()|
+method of the Contextual object representing the contextual type.</text>
+ </assertion>
+
+ <assertion id="q">
+ <text> A destroyed instance must not subsequently be returned by the |get()| method.</text>
+ </assertion>
+ </section>
+
+ <section id="6.3" title="Normal scopes and pseudo-scopes">
+ <assertion id="a" testable="false">
+ <text>There may be no more than one mapped instance of a context object per contextual type per thread</text>
+ <note>Not testable through API</note>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>A context may be associated with one or more threads</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ <assertion id="c">
+ <text>The |get()| operation of the |Context| object for an active normal scope returns the current instance of the given contextual type</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When a context is destroyed, all mapped instances belonging to that context are destroyed by passing them to the |Contextual.destroy()| method.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Contexts with normal scopes must obey the following rule: Suppose beans A, B and Z all have normal scopes. Suppose A has an injection point x, and B has an injection point y. Suppose further that both x and y resolve to bean Z according to the typesafe resolution algorithm. If a is the current instance of A, and b is the current instance of B, then both a.x and b.y refer to the same instance of Z. This instance is the current instance of Z.</text>
+ </assertion>
+
+ <assertion id="f" testable="false">
+ <text>All pseudo-scopes must be explicitly declared |@ScopeType(normal=false)|, to indicate to the container that no client proxy is required</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ <assertion id="g" testable="false">
+ <text>All scopes defined by this specification, except for the |@Dependent| pseudo-scope, are normal scopes</text>
+ <note>A statement of intent</note>
+ </assertion>
+ </section>
+
+ <section id="6.4" title="Dependent pseudo-scope">
+ <assertion id="a">
+ <text>When a bean is declared to have |@Dependent| scope, no injected instance of the bean is ever shared between multiple injection points</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When a bean is declared to have |@Dependent| scope, any injected instance of the bean is bound to the lifecycle of the bean, servlet or EJB into which it is injected</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>When a bean is declared to have |@Dependent| scope, any instance of the bean that is used to evaluate a Unified EL expression exists to service that evaluation only</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>When a bean is declared to have |@Dependent| scope, any instance of the bean that receives a producer method~, producer field, disposal method or observer method~ invocation exists to service that invocation only</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>When a bean is declared to have |@Dependent| scope, any instance of the bean that receives a ~producer method,~ producer field~, disposal method or observer method~ invocation exists to service that invocation only</text>
+ </assertion>
+
+ <assertion id="dc">
+ <text>When a bean is declared to have |@Dependent| scope, any instance of the bean that receives a ~producer method, producer field,~ disposal method ~or observer method~ invocation exists to service that invocation only</text>
+ </assertion>
+
+ <assertion id="dd">
+ <text>When a bean is declared to have |@Dependent| scope, any instance of the bean that receives a ~producer method, producer field, disposal method or~ observer method invocation exists to service that invocation only</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Every invocation of the |get()| operation of the |Context| object for the |@Dependent| scope with a |CreationalContext| returns a new instance of the given bean</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Every invocation of the |get()| operation of the |Context| object for the |@Dependent| scope with no |CreationalContext| returns a null value</text>
+ </assertion>
+ </section>
+
+ <section id="6.4.1" title="Dependent scope lifecycle">
+
+ <assertion id="ga">
+ <text>The |@Dependent| scope is inactive ~except when an instance of a bean with scope |@Dependent| is created by the container to receive a producer method, producer field, disposal method or observer method ~invocation</text>
+ <note>Assertions g through k are all related and should be treated as "or" conditions</note>
+ </assertion>
+
+ <assertion id="gb">
+ <text>The |@Dependent| scope is inactive except when an instance of a bean with scope |@Dependent| is created by the container to receive a producer method~, producer field, disposal method or observer method ~invocation</text>
+ <note>Assertions g through k are all related and should be treated as "or" conditions</note>
+ </assertion>
+
+ <assertion id="gc">
+ <text>The |@Dependent| scope is inactive except when an instance of a bean with scope |@Dependent| is created by the container to receive a ~producer method,~ producer field~, disposal method or observer method ~invocation</text>
+ <note>Assertions g through k are all related and should be treated as "or" conditions</note>
+ </assertion>
+
+ <assertion id="gd">
+ <text>The |@Dependent| scope is inactive except when an instance of a bean with scope |@Dependent| is created by the container to receive a ~producer method, producer field,~ disposal method ~or observer method ~invocation</text>
+ <note>Assertions g through k are all related and should be treated as "or" conditions</note>
+ </assertion>
+
+ <assertion id="ge">
+ <text>The |@Dependent| scope is inactive except when an instance of a bean with scope |@Dependent| is created by the container to receive a ~producer method, producer field, disposal method or~ observer method ~invocation</text>
+ <note>Assertions g through k are all related and should be treated as "or" conditions</note>
+ </assertion>
+
+ <assertion id="h">
+ <text>The |@Dependent| scope is inactive except while a Unified EL expression is evaluated</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The |@Dependent| scope is inactive except while an observer method is invoked</text>
+ </assertion>
+
+ <assertion id="ja">
+ <text>The |@Dependent| scope is inactive except when the container is creating ~or destroying~ a contextual instance of a bean~, injecting its dependencies, invoking its observer methods, or invoke its |@PostConstruct| or |@PreDestroy| callback.~</text>
+ </assertion>
+
+ <assertion id="jb">
+ <text>The |@Dependent| scope is inactive except when the container is ~creating or~ destroying a contextual instance of a bean, ~injecting its dependencies, invoking its observer methods, or invoke its |@PostConstruct| or |@PreDestroy| callback.~</text>
+ </assertion>
+
+ <assertion id="jc">
+ <text>The |@Dependent| scope is inactive except when the container is ~creating or destroying a contextual instance of a bean,~ injecting its dependencies, ~invoking its observer methods, or invoke its |@PostConstruct| or |@PreDestroy| callback.~</text>
+ </assertion>
+
+ <assertion id="jd">
+ <text>The |@Dependent| scope is inactive except when the container is ~creating or destroying a contextual instance of a bean, injecting its dependencies,~ invoking its observer methods, ~or invoke its |@PostConstruct| or |@PreDestroy| callback.~</text>
+ </assertion>
+
+ <assertion id="je">
+ <text>The |@Dependent| scope is inactive except when the container is ~creating or destroying a contextual instance of a bean, injecting its dependencies, invoking its observer methods, or~ invoke its |@PostConstruct|~ or |@PreDestroy|~ callback.</text>
+ </assertion>
+
+ <assertion id="jf">
+ <text>The |@Dependent| scope is inactive except when the container is ~creating or destroying a contextual instance of a bean, injecting its dependencies, invoking its observer methods, or~ invoke ~its |@PostConstruct| or~ |@PreDestroy| callback.</text>
+ </assertion>
+
+ <assertion id="ka">
+ <text>The |@Dependent| scope is inactive except when the container is injecting dependencies ~or invoking the |@PostConstruct| or |@PreDestroy| callback~ of a Java EE component class supporting injection.</text>
+ </assertion>
+
+ <assertion id="kb">
+ <text>The |@Dependent| scope is inactive except when the container is ~injecting dependencies or~ invoking the |@PostConstruct| ~or |@PreDestroy|~ callback of a Java EE component class supporting injection.</text>
+ </assertion>
+
+ <assertion id="kc">
+ <text>The |@Dependent| scope is inactive except when the container is ~injecting dependencies or~ invoking the ~|@PostConstruct| or~ |@PreDestroy| callback of a Java EE component class supporting injection.</text>
+ </assertion>
+
+ <assertion id="la">
+ <text>The |@Dependent| scope is inactive except when |Instance.get()|, |Instance.iterator()| or |BeanManager.getReference()| is invoked upon an instance of |Instance| or |BeanManager| injected by the container into a bean or other Java EE component class supporting injection.</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>The |@Dependent| scope is not active when |Instance.get()|, |Instance.iterator()| or |BeanManager.getReference()| is invoked upon an instance of |Instance| or |BeanManager| that was not injected by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="6.4.2" title="Dependent objects">
+ <assertion id="a">
+ <text>Instances of interceptors or decorators with scope |@Dependent| are dependent objects of the bean instance they intercept or decorate.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An instance of a bean with scope |@Dependent| injected into a field, bean constructor, initializer method or observer method is a dependent object of the bean or Java EE component class instance into which it was injected.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>An instance of a bean with scope |@Dependent| injected into a producer method or disposal method is a dependent object of the producer method bean instance that is being produced or disposed.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>An instance of a bean with scope |@Dependent| obtained by direct invocation of |BeanManager| or |Instance| during invocation of a bean constructor, initializer method, observer method, |@PostConstruct| or |@PreDestroy| callback is a dependent object of the bean or Java EE component class instance upon which the method is being invoked.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>An instance of a bean with scope |@Dependent| obtained by direct invocation of |BeanManager| or |Instance| during invocation of a producer method or disposal method is a dependent object of the producer method bean instance that is being produced or disposed.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Otherwise, an instance of a bean with scope |@Dependent| obtained by direct invocation of an instance of |Instance| or |BeanManager| that was injected by the container into a bean or Java EE component class instance is a dependent object of the bean or Java EE component class instance. </text>
+ </assertion>
+ </section>
+
+ <section id="6.4.3" title="Dependent object destruction">
+ <assertion id="a">
+ <text>The container must destroy all dependent objects of a contextual bean instance when the instance is destroyed</text>
+ </assertion>
+
+ <assertion id="baa">
+ <text>The container must destroy all dependent objects of a non-contextual instance of a bean or instance of other Java EE component class when the instance is destroyed.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container must destroy all |@Dependent| scoped contextual instances created during an EL expression evaluation when the evaluation completes</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>The container must destroy any |@Dependent| scoped contextual instance created to receive a producer method~, producer field, disposal method or observer method~ invocation when the invocation completes</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>The container must destroy any |@Dependent| scoped contextual instance created to receive a ~producer method,~ producer field~, disposal method or observer method~ invocation when the invocation completes</text>
+ </assertion>
+
+ <assertion id="dc">
+ <text>The container must destroy any |@Dependent| scoped contextual instance created to receive a ~producer method, producer field,~ disposal method ~or observer method~ invocation when the invocation completes</text>
+ </assertion>
+
+ <assertion id="dd">
+ <text>The container must destroy any |@Dependent| scoped contextual instance created to receive a ~producer method, producer field, disposal method or~ observer method invocation when the invocation completes</text>
+ </assertion>
+
+ <assertion id="e" testable="false">
+ <text>The container is permitted to destroy any |@Dependent| scoped contextual instance at any time if the instance is no Scopes and contexts longer referenced by the application (excluding weak, soft and phantom references)</text>
+ <note>In other words this is unspecified</note>
+ </assertion>
+ </section>
+
+ <section id="6.5" title="Contextual instances and contextual references">
+
+ </section>
+
+ <section id="6.5.1" title="The active context object for a scope">
+ <assertion id="a">
+ <text>From time to time, the container must obtain an active context object for a certain scope type. The container must search for an active instance of |Context| associated with the scope type. If no active context object exists for the scope type, the container throws a |ContextNotActiveException|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If more than one active context object exists for the given scope type, the container must throw an |IllegalStateException|.</text>
+ </assertion>
+ </section>
+
+ <section id="6.5.2" title="Contextual instance of a bean">
+ <assertion id="a">
+ <text>From time to time, the container must obtain a contextual instance of a bean. The container must obtain the active context object for 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="b">
+ <text>From time to time, the container attempts to obtain a contextual instance of a bean that already exists, without creating a
+new contextual instance. The container must obtain the active context object for the bean scope, then obtain an instance of the bean by calling |Context.get()|, passing the |Bean| instance representing the bean without
+passing any instance of |CreationalContext|.</text>
+ </assertion>
+ </section>
+
+ <section id="6.5.3" title="Contextual reference for a bean">
+ <assertion id="a">
+ <text>If the bean has a normal scope and the given bean type cannot be proxied by the container, as defined in Section 5.3.1, "Unproxyable bean types", the container throws an |UnproxyableResolutionException|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the bean has a normal scope, then the contextual reference for the bean is a client proxy, as defined in Section 5.3, "Client proxies", created by the container, that implements the given bean type and all bean types of the bean which are Java interfaces.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean has a pseudo-scope, the container must obtain a contextual instance of the bean.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must ensure that every injection point of type |InjectionPoint| and binding |@Current| of any dependent object instantiated during this process receives an instance of |InjectionPoint| representing the injection point into which the dependent object will be injected, or a null value if it is not being injected into any injection point.</text>
+ </assertion>
+ </section>
+
+ <section id="6.5.4" title="Contextual reference validity">
+ <assertion id="a">
+ <text>Any reference to a bean with a normal scope is valid as long as the application maintains a hard reference to it. However, it may only be invoked when the context associated with the normal scope is active. If it is invoked when the context is inactive, a |ContextNotActiveException| is thrown by the container.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Any reference to a bean with a pseudo-scope (such as |@Dependent|) is valid until the bean instance to which it refers is
+destroyed. It may be invoked even if the context associated with the pseudo-scope is not active. If the application invokes a method of a reference to an instance that has already been destroyed, the behavior is undefined.</text>
+ </assertion>
+ </section>
+
+ <section id="6.6" title="Passivation and passivating scopes">
+
+ </section>
+
+ <section id="6.6.1" title="Passivation capable beans">
+ <assertion id="a">
+ <text>As defined by the EJB specification, all stateful session beans are passivation capable. Stateless and singleton session beans are not passivation capable.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A managed bean is passivation capable if and only if the bean class is serializable.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A producer method is passivation capable if and only if it never returns a value which is not passivation capable at runtime. A producer method with a return type that implements or extends serializable is passivation capable. A producer method with a return type that is declared final and does not implement |Serializable| is not passivation capable.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A producer field is passivation capable if and only if it never refers to a value which is not passivation capable at runtime. A producer field with a type that implements or extends serializable is passivation capable. A producer field with a type that is declared |final| and does not implement serializable is not passivation capable.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A custom implementation of Bean is passivation capable if |isPassivationCapable()| returns true.</text>
+ </assertion>
+ </section>
+
+ <section id="6.6.2" title="Passivation capable dependencies">
+ <assertion id="a">
+ <text>The container must guarantee that all session beans are passivation capable dependencies.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The container must guarantee that all beans with normal scope are passivation capable dependencies.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container must guarantee that all passivation capable beans with scope |@Dependent| are passivation capable dependencies.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must guarantee that all resources and message destinations are passivation capable dependencies.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The container must guarantee that the built-in beans of type |Instance|, |Event|, |InjectionPoint| and |BeanManager| are passivation capable dependencies.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A custom implementation of |Bean| is a passivation capable dependency if |isPassivationCapable()| returns |true| or |getScopeType()| returns a normal scope type.</text>
+ </assertion>
+ </section>
+
+ <section id="6.6.3" title="Passivating scopes">
+
+
+ </section>
+
+ <section id="6.6.4" title="Validation of passivation capable beans and dependencies">
+ <assertion id="aa">
+ <text>If a managed bean which declares a passivating scope is not passivation capable~, or has a non-transient injected field, bean constructor parameter or initializer method parameter that does not resolve to a passivation capable dependency, ~then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>If a managed bean which ~declares a passivating scope is not passivation capable, or~ has a non-transient injected field~, bean constructor parameter or initializer method parameter~ that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>If a managed bean which ~declares a passivating scope is not passivation capable, or~ has a non-transient ~injected field~, bean constructor parameter or ~initializer method parameter~ that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ad">
+ <text>If a managed bean which ~declares a passivating scope is not passivation capable, or~ has a non-transient ~injected field, bean constructor parameter or~ initializer method parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>If a stateful session bean has a non-transient injected field~, bean constructor parameter or initializer method parameter~ that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>If a stateful session bean has a non-transient ~injected field,~ bean constructor parameter ~or initializer method parameter~ that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>If a stateful session bean has a non-transient~ injected field, bean constructor parameter or~ initializer method parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a producer method declares a passivating scope and the container is able to determine that it is not passivation capable by inspecting its return type, or has a parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a producer field declares a passivating scope and the container is able to determine that it is not passivation capable by inspecting its type, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4,
+"Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a producer method or field which declares a passivating scope returns an unserializable object at runtime, the container must
+throw an |IllegalProductException|.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If a producer method or field of scope |@Dependent| returns an unserializable object for injection into an injection point that requires a passivation capable dependency, the container must throw an |IllegalProductException|</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>For a custom implementation of |Bean|, the container calls |getInjectionPoints()| to determine the injection points, and
+|InjectionPoint.isTransient()| to determine whether the injected point is a transient field.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If a bean which declares a passivating scope type, or any stateful session bean, has a decorator which is not a passivation capable dependency, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="6.7" title="Context management for built-in scopes">
+ <assertion id="a">
+ <text>The built-in context object is active during servlet, web service and EJB invocations, or in the case of the conversation context object, for JSF requests.</text>
+ </assertion>
+ </section>
+
+ <section id="6.7.1" title="Request context lifecycle">
+ <assertion id="aa">
+ <text>The request scope is active during the |service()| method of any servlet in the web application~ and during the |doFilter()| method of any servlet filter.~</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>The request scope is active ~during the |service()| method of any servlet in the web application and~ during the |doFilter()| method of any servlet filter.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>The request context is destroyed at the end of the servlet request, after the |service()| method ~and all |doFilter()| methods~ return.</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>The request context is destroyed at the end of the servlet request, after ~the |service()| method and~ all |doFilter()| methods return.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The request scope is active during any Java EE web service invocation.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The request context is destroyed after the web service invocation completes.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The request scope is active during any asynchronous observer method notification.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The request context is destroyed after the notification completes</text>
+ </assertion>
+
+ <assertion id="ga">
+ <text>The request scope is active during any remote method invocation of any EJB,~ during any asynchronous method invocation of any EJB, during any call to an EJB timeout method and during message delivery to any EJB message-driven bean.~</text>
+ </assertion>
+
+ <assertion id="gb">
+ <text>The request scope is active ~during any remote method invocation of any EJB~, during any asynchronous method invocation of any EJB, ~during any call to an EJB timeout method and during message delivery to any EJB message-driven bean.~</text>
+ </assertion>
+
+ <assertion id="gc">
+ <text>The request scope is active ~during any remote method invocation of any EJB, during any asynchronous method invocation of any EJB,~ during any call to an EJB timeout method ~and during message delivery to any EJB message-driven bean~.</text>
+ </assertion>
+
+ <assertion id="gd">
+ <text>The request scope is active ~during any remote method invocation of any EJB, during any asynchronous method invocation of any EJB, during any call to an EJB timeout method and~ during message delivery to any EJB message-driven bean.</text>
+ </assertion>
+
+ <assertion id="ha">
+ <text>The request context is destroyed after the remote method invocation,~ asynchronous method invocation, timeout or message delivery completes~.</text>
+ </assertion>
+
+ <assertion id="hb">
+ <text>The request context is destroyed after the ~remote method invocation,~ asynchronous method invocation~, timeout or message delivery completes~.</text>
+ </assertion>
+
+ <assertion id="hc">
+ <text>The request context is destroyed after the ~remote method invocation, asynchronous method invocation,~ timeout~ or message delivery completes~.</text>
+ </assertion>
+
+ <assertion id="hd">
+ <text>The request context is destroyed after the ~remote method invocation, asynchronous method invocation, timeout or~ message delivery completes.</text>
+ </assertion>
+
+
+ </section>
+
+ <section id="6.7.2" title="Session context lifecycle">
+ <assertion id="aa">
+ <text>The session scope is active during the |service()| method of any servlet in the web application ~and during the |doFilter()| method of any servlet filter~.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>The session scope is active ~during the |service()| method of any servlet in the web application and~ during the |doFilter()| method of any servlet filter.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The session context is shared between all servlet requests that occur in the same HTTP servlet session.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The session context is destroyed when the |HTTPSession| is invalidated ~or times out~.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The session context is destroyed when the |HTTPSession| ~is invalidated or~ times out.</text>
+ </assertion>
+
+ </section>
+
+ <section id="6.7.3" title="Application context lifecycle">
+ <assertion id="aa">
+ <text>The application scope is active during the |service()| method of any servlet in the web application ~and during the |doFilter()| method of any servlet filter.~</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>The application scope is active during ~the |service()| method of any servlet in the web application and during~ the |doFilter()| method of any servlet filter.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The application scope is active during any Java EE web service invocation.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The application scope is active during any asynchronous observer method notification.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>The application scope is also active during any remote method invocation of any EJB~, during any asynchronous method invocation of any EJB, during any call to an EJB timeout method and during message delivery to any EJB message-driven bean.</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>The application scope is also active ~during any remote method invocation of any EJB~, during any asynchronous method invocation of any EJB~, during any call to an EJB timeout method and during message delivery to any EJB message-driven bean.~</text>
+ </assertion>
+
+ <assertion id="dc">
+ <text>The application scope is also active ~during any remote method invocation of any EJB, during any asynchronous method invocation of any EJB,~ during any call to an EJB timeout method~ and during message delivery to any EJB message-driven bean.~</text>
+ </assertion>
+
+ <assertion id="dd">
+ <text>The application scope is also active ~during any remote method invocation of any EJB, during any asynchronous method invocation of any EJB, during any call to an EJB timeout method and~ during message delivery to any EJB message-driven bean.</text>
+ </assertion>
+
+ <assertion id="ea">
+ <text>The application context is shared between all servlet requests~, asynchronous observer method notifications, web service invocations, EJB remote method invocations, EJB asynchronous method invocations, EJB timeouts and message deliveries to message driven beans ~that execute within the same application.</text>
+ </assertion>
+
+ <assertion id="eb">
+ <text>The application context is shared between all ~servlet requests,~ asynchronous observer method notifications~, web service invocations, EJB remote method invocations, EJB asynchronous method invocations, EJB timeouts and message deliveries to message driven beans ~that execute within the same application.</text>
+ </assertion>
+
+ <assertion id="ec">
+ <text>The application context is shared between all ~servlet requests, asynchronous observer method notifications,~ web service invocations~, EJB remote method invocations, EJB asynchronous method invocations, EJB timeouts and message deliveries to message driven beans ~that execute within the same application~.</text>
+ </assertion>
+
+ <assertion id="ed">
+ <text>The application context is shared between all ~servlet requests, asynchronous observer method notifications, web service invocations,~ EJB remote method invocations~, EJB asynchronous method invocations, EJB timeouts and message deliveries to message driven beans ~that execute within the same application~.</text>
+ </assertion>
+
+ <assertion id="ee">
+ <text>The application context is shared between all ~servlet requests, asynchronous observer method notifications, web service invocations, EJB remote method invocations,~ EJB asynchronous method invocations~, EJB timeouts and message deliveries to message driven beans ~that execute within the same application.</text>
+ </assertion>
+
+ <assertion id="ef">
+ <text>The application context is shared between all ~servlet requests, asynchronous observer method notifications, web service invocations, EJB remote method invocations, EJB asynchronous method invocations,~ EJB timeouts ~and message deliveries to message driven beans ~that execute within the same application.</text>
+ </assertion>
+
+ <assertion id="eg">
+ <text>The application context is shared between all ~servlet requests, asynchronous observer method notifications, web service invocations, EJB remote method invocations, EJB asynchronous method invocations, EJB timeouts and~ message deliveries to message driven beans ~that execute within the same application.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The application context is destroyed when the application
+is undeployed.</text>
+ </assertion>
+ </section>
+
+ <section id="6.7.4" title="Conversation context lifecycle">
+ <assertion id="a">
+ <text>For a JSF faces request, the conversation context is active from the beginning of the apply request values phase, until the response is complete</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For a JSF non-faces request, the context is active during the render response phase</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Any JSF request has exactly one associated conversation</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The conversation associated with a JSF request is determined at the end of the restore view phase and does not change during the request</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>By default, a conversation is transient</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A transient conversation may be marked long-running by calling |Conversation.begin()|</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A long-running conversation may be marked transient by calling |Conversation.end()|</text>
+ </assertion>
+
+ <assertion id="ha">
+ <text>All long-running conversations have a string-valued unique identifier, _which may be set by the application_ when the conversation is marked long-running~, or generated by the container~</text>
+ </assertion>
+
+ <assertion id="hb">
+ <text>All long-running conversations have a string-valued unique identifier, ~which may be set by the application when the conversation is marked long-running,~ or generated by the container</text>
+ </assertion>
+
+ <assertion id="iaa">
+ <text>The container provides a built-in bean with bean type |Conversation|~, scope |@RequestScoped|, deployment type |@Standard| and binding |@Current|, named |javax.enterprise.context.conversation|~</text>
+ </assertion>
+
+ <assertion id="ib">
+ <text>The container provides a built-in bean with ~bean type |Conversation|~, scope |@RequestScoped|~, deployment type |@Standard| and binding |@Current|, named |javax.enterprise.context.conversation|~</text>
+ </assertion>
+
+ <assertion id="ic">
+ <text>The container provides a built-in bean with~ bean type |Conversation|, scope |@RequestScoped|,~ deployment type |@Standard|~ and binding |@Current|, named |javax.enterprise.context.conversation|~</text>
+ </assertion>
+
+ <assertion id="id">
+ <text>The container provides a built-in bean with bean type ~|Conversation|, scope |@RequestScoped|, deployment type |@Standard| and~ binding |@Current|~, named |javax.enterprise.context.conversation|~</text>
+ </assertion>
+
+ <assertion id="ie">
+ <text>The container provides a built-in bean with bean type ~|Conversation|, scope |@RequestScoped|, deployment type |@Standard| and binding |@Current|,~ named |javax.enterprise.context.conversation|</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If the conversation associated with the current JSF request is in the transient state at the end of a JSF request, it is destroyed, and the conversation context is also destroyed</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If the conversation associated with the current JSF request is in the long-running state at the end of a JSF request, it is not destroyed</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The long-running conversation context associated with a request that renders a JSF view is automatically propagated to any faces request (JSF form submission) that originates from that rendered page</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>The long-running conversation context associated with a request that results in a JSF redirect (via a navigation rule) is automatically propagated to the resulting non-faces request, and to any other subsequent request to the same URL. This is accomplished via use of a GET request parameter named cid containing the unique identifier of the conversation</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>The long-running conversation associated with a request may be propagated to any non-faces request via use of a GET request parameter named cid containing the unique identifier of the conversation. In this case, the application must manage this request parameter</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>When no conversation is propagated to a JSF request, the request is associated with a new transient conversation</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>All long-running conversations are scoped to a particular HTTP servlet session and may not cross session boundaries</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>When the HTTP servlet session is invalidated, all long-running conversation contexts created during the current session are destroyed</text>
+ </assertion>
+
+ <assertion id="r" testable="false">
+ <text>The container is permitted to arbitrarily destroy any long-running conversation that is associated with no current JSF request, in order to conserve resources</text>
+ <note>In other words, this is unspecified</note>
+ </assertion>
+
+ <assertion id="s">
+ <text>If the propagated conversation cannot be restored, the request is associated with a new transient conversation</text>
+ </assertion>
+
+ <assertion id="t" testable="false">
+ <text>The method |Conversation.setTimeout()| is a hint to the container that a conversation should not be destroyed if it has been active within the last given interval in milliseconds</text>
+ <note>Not required</note>
+ </assertion>
+
+ <assertion id="u" testable="false">
+ <text>The container ensures that a long-running conversation may be associated with at most one request at a time, by blocking or rejecting concurrent requests</text>
+ <note>Cannot test as their as what happens is not well defined</note>
+ </assertion>
+ </section>
+
+ <section id="7" title="Bean lifecycle">
+ <assertion id="a">
+ <text>To create a contextual instance of a session bean, the container creates an EJB local object reference</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>To create a contextual instance of a producer method bean, the container calls the producer method</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>To create a contextual instance of a producer field bean, the container retrieves the current value of the field</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>To create a contextual instance of a managed bean, the container calls the bean constructor</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>To destroy a contextual instance of a stateful session bean, the container removes the EJB instance</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>To destroy a contextual instance of a producer method bean, the container calls the disposal method, if any</text>
+ </assertion>
+ </section>
+
+ <section id="7.1" title="Container invocations and interception">
+ <assertion id="a">
+ <text>Invocations of initializer methods by the container are not business method invocations and are never intercepted.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Invocations of producer, disposal and observer methods by the container are business method invocations and are intercepted by method interceptors and decorators.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Invocation of lifecycle callbacks by the container are not business method invocations, but are intercepted by interceptors for lifecycle callbacks.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Invocations of interceptors and decorator methods during method or lifecycle callback interception are not business method invocations, and therefore no recursive interception occurs.</text>
+ </assertion>
+ </section>
+
+ <section id="7.2" title="Lifecycle of managed beans">
+ <assertion id="a">
+ <text>When the create() method of the Bean object that represents a managed bean is called, the container first calls the bean constructor to obtain an instance of the bean, as defined in Section 5.4.3, "Injection
+using the bean constructor". The container is permitted to return an instance of a container-generated subclass of the bean class, allowing interceptor and decorator bindings.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Next, the container performs Java EE component environment injection, as required by the managed bean specification.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Next, the container performs dependency injection, as defined in Section 5.4.4, "Injection of fields and initializer methods".</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Finally, the container calls the |@PostConstruct| method, if any.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>When the |destroy()| method is called, the container calls the |@PreDestroy| method, if any.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Finally, the container destroys dependent objects, as defined in Section 5.4.5, "Destruction of dependent objects.</text>
+ </assertion>
+ </section>
+
+ <section id="7.3" title="Lifecycle of stateful session beans">
+ <assertion id="aa">
+ <text>When the |create()| method of a |Bean| object that represents a stateful session bean that is called, the container creates and returns a container-specific internal local reference to a new session bean instance. The reference must be passivation capable. This reference is not directly exposed to the application.</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>Before injecting or returning a contextual instance to the application, the container transforms its internal reference into an object that implements the bean types expected by the application and delegates method invocations to the underlying stateful session bean instance. This object must be passivation capable.</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>When the |destroy()| method is called, and if the underlying EJB was not already removed by direct invocation of a remove method by the application, the container removes the stateful session bean. The |@PreDestroy| callback must be invoked by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="7.4" title="Lifecycle of stateless session and singleton beans">
+ <assertion id="a">
+ <text>When the |create()| method of a Bean object that represents a stateless session or singleton session bean is called, the container
+creates and returns a container-specific internal local reference to the session bean. This reference is not directly exposed to the application.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Before injecting or returning a contextual instance to the application, the container transforms its internal reference into an object that implements the bean types expected by the application and delegates method invocations to the underlying session bean. This object must be passivation capable.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>When the |destroy()| method is called, the container simply discards this internal reference.</text>
+ </assertion>
+ </section>
+
+ <section id="7.5" title="Lifecycle of producer methods">
+ <assertion id="a">
+ <text>Any Java object may be returned by a producer method. It is not required that the returned object be an instance of another bean</text>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>If an object returned by a producer method is not an instance of another bean, the container will not provide injection of other beans</text>
+ <note>In other words the behaviour is unspecified</note>
+ </assertion>
+
+ <assertion id="c" testable="false">
+ <text>If an object returned by a producer method is not an instance of another bean, the container will not provide lifecycle callbacks</text>
+ <note>In other words the behaviour is unspecified</note>
+ </assertion>
+
+ <assertion id="d" testable="false">
+ <text>If an object returned by a producer method is not an instance of another bean, the container will not provide method and lifecycle interception</text>
+ <note>In other words the behaviour is unspecified</note>
+ </assertion>
+
+ <assertion id="ea">
+ <text>When the create() method of a Bean object that represents a producer method is called, the container must invoke the producer method as defined by Section 5.4.6, "Invocation of producer or disposal methods". The return value of the producer method, after method interception completes, is the new contextual instance to be returned by |Bean.create()|.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If the producer method returns a null value and the producer method bean has the scope |@Dependent|, the |create()| method returns a null value</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>If the producer method returns a null value, and the scope of the producer method is not |@Dependent|, the |create()| method throws an |IllegalProductException|</text>
+ </assertion>
+
+ <assertion id="ma">
+ <text>When the destroy() method is called, and if there is a disposal method for this producer method, the container must invoke
+the disposal method as defined by Section 5.4.6, "Invocation of producer or disposal methods", passing the instance given to |destroy()| to the disposed parameter.</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>Finally, the container destroys dependent objects</text>
+ </assertion>
+ </section>
+
+ <section id="7.6" title="Lifecycle of producer fields">
+ <assertion id="a">
+ <text>Any Java object may be the value of a producer field</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>It is not required that the returned object of a producer field be an instance of another bean</text>
+ </assertion>
+
+ <assertion id="c" testable="false">
+ <text>If the object returned by a producer field is not an instance of another bean, the container will not provide injection of other beans</text>
+ <note>In other words the behaviour is unspecified</note>
+ </assertion>
+
+ <assertion id="d" testable="false">
+ <text>If the object returned by a producer field is not an instance of another bean, the container will not provide lifecycle callbacks</text>
+ <note>In other words the behaviour is unspecified</note>
+ </assertion>
+
+ <assertion id="e" testable="false">
+ <text>If the object returned by a producer field is not an instance of another bean, the container will not provide method interception</text>
+ <note>In other words the behaviour is unspecified</note>
+ </assertion>
+
+ <assertion id="f" testable="false">
+ <text>If the object returned by a producer field is not an instance of another bean, the container will not provide lifecycle interception</text>
+ <note>In other words the behaviour is unspecified</note>
+ </assertion>
+
+ <assertion id="ga">
+ <text>When the |create()| method of a |Bean| object that represents a producer field is called, the container must access the producer field as defined by Section 5.4.7, "Access to producer field values" to obtain the current value of the field. The value of the producer field is the new contextual instance to be returned by |Bean.create()|.</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>If the producer field contains a null value and the producer field bean has the scope |@Dependent|, the create() method returns a null value</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>If the producer field contains a null value, and the scope of the producer method is not |@Dependent|, the |create()| method throws an |IllegalProductException|</text>
+ </assertion>
+ </section>
+
+ <section id="7.7" title="Lifecycle of resources">
+ <assertion id="l">
+ <text>When the |create()| method of a |Bean| object that represents a resource is called, the container creates and returns a container-
+specific internal reference to the Java EE component environment resource, entity manager, entity manager factory, remote EJB instance or web service reference. This reference is not directly exposed to the application.</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>Before injecting or returning a contextual instance to the application, the container transforms its internal reference into an object that implements the bean types expected by the application and delegates method invocations to the underlying resource, entity manager, entity manager factory, remote EJB instance or web service reference. This object must be passivation capable.</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>When the |destroy()| method is called, the container discards this internal reference.</text>
+ </assertion>
+ </section>
+
+ <section id="7.8" title="Lifecycle of message destinations">
+ <assertion id="a" testable="false">
+ <text>An instance of a message destination is a proxy object, provided by the container, that implements all the bean types defined in Section 3.7, "JMS resources", delegating the actual implementation of these methods directly to the underlying JMS objects. This proxy must be passivation capable.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A message destination resource proxy object is a dependent object of the object it is injected into.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>When the |create()| method of a |Bean| object that represents a message destination is called, the container creates and returns a proxy object.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The methods of this proxy object delegate to JMS objects obtained as needed using the metadata provided by the message destination declaration.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The Destination is obtained using the JNDI name or mapped name specified by |@Resource|.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The appropriate |ConnectionFactory| for the topic or queue is obtained automatically</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The |Connection| is obtained by calling |QueueConnectionFactory.createQueueConnection()| or |TopicConnectionFactory.createTopicConnection()|</text>
+ </assertion>
+
+ <assertion id="i" testable="false">
+ <text>The container is permitted to share a connection between multiple proxy objects</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The |Session| object is obtained by calling |QueueConnection.createQueueSession()| or |TopicConnection.createTopicSession()|</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The |MessageProducer| object is obtained by calling |QueueSession.createSender()| or |TopicSession.createPublisher()|</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The |MessageConsumer| object is obtained by calling |QueueSession.createReceiver()| or |TopicSession.createSubscriber()|</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>When the |destroy()| method is called, the container must ensure that all JMS objects created by the proxy object are destroyed by calling |close()| if necessary</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>The |Connection| is destroyed by calling |Connection.close()| if necessary</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>If the connection is being shared between multiple proxy objects, the container is not required to close the connection when the proxy is destroyed</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>The |Session| object is destroyed by calling |Session.close()|</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>The |MessageProducer| object is destroyed by calling |MessageProducer.close()|</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>The |MessageConsumer| object is destroyed by calling |MessageConsumer.close()|</text>
+ </assertion>
+
+ <assertion id="s">
+ <text>The |close()| method of a message destination proxy object always throws an |UnsupportedOperationException|.</text>
+ </assertion>
+
+ </section>
+
+ <section id="8" title="Decorators">
+ <assertion id="a">
+ <text>Decorators may be bound to any managed bean that is not itself an interceptor or decorator or to any EJB session or message-driven bean.</text>
+ </assertion>
+ </section>
+
+ <section id="8.1" title="Decorator beans">
+ <assertion id="a">
+ <text>A decorator is a managed bean.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The set of decorated types of a decorator includes all interfaces implemented directly or indirectly by the bean class, except for |java.io.Serializable|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The decorator bean class and its superclasses are not decorated types of the decorator.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The decorator class may be abstract.</text>
+ </assertion>
+ </section>
+
+ <section id="8.1.1" title="Declaring a decorator">
+ <assertion id="a">
+ <text>A decorator is declared by annotating the bean class with the |(a)javax.decorator.Decorator| stereotype.</text>
+ </assertion>
+ </section>
+
+ <section id="8.1.2" title="Decorator delegate injection points">
+ <assertion id="a">
+ <text>All decorators have a delegate injection point. A delegate injection point is an injection point of the bean class. The type and bindings of the injection point are called the delegate type and delegate bindings. The delegate injection point must be be declared by annotating the field with the @javax.decorator.Decorates annotation.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The decorator applies to any bean that is eligible for injection to the delegate injection point, according to the rules defined
+in Section 5.1, "Typesafe resolution algorithm".</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>A decorator must have exactly one delegate injection point. If a decorator has more than one delegate injection point~, or does not have a delegate injection point,~ the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>A decorator must have exactly one delegate injection point. If a decorator ~has more than one delegate injection point, or~ does not have a delegate injection point, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a decorator applies to a managed bean, and the bean class is declared final, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a decorator applies to a managed bean with a non-static, non-private, final method, and the decorator also implements that method, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>When the container must inject a delegate object to the delegate injection point, the delegate object implements the delegate
+type and delegates method invocations along the decorator stack.</text>
+ </assertion>
+ </section>
+
+ <section id="8.1.3" title="Decorated types of a decorator">
+ <assertion id="a">
+ <text>The delegate type of a decorator must implement or extend every decorated type. If the delegate type does not implement or extend a decorated type of the decorator, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A decorator is not required to implement the delegate type.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A decorator may be an abstract Java class, and is not required to implement every method of every decorated type.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The decorator intercepts every method declared by a decorated type of the decorator, and that is implemented by the bean class of the decorator.</text>
+ </assertion>
+ </section>
+
+ <section id="8.2" title="Decorator enablement and ordering">
+ <assertion id="a">
+ <text>By default, decorators are not enabled. A decorator must be explicitly enabled by listing its bean class under the
+|<Decorators>| element in |beans.xml|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The order of the decorator declarations determines the decorator ordering. Decorators which occur earlier in the list are called first.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a class listed under the |<Decorators>| element is not the bean class of at least one decorator, the container automatically
+detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".
+ </text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the bean class of a decorator with a disabled deployment type is listed under the |<Decorators>| element, the container
+automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the |<Decorators>| element is specified in more than one |beans.xml| document, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Decorators are called after interceptors.</text>
+ </assertion>
+ </section>
+
+ <section id="8.3" title="Decorator resolution">
+ <assertion id="a">
+ <text>The following algorithm must be used by the container when resolving decorators for a certain bean - First, the container identifies the set of matching enabled decorators such that the bean is eligible for injection to the delegate injection point according to the rules defined in Section 5.1, "Typesafe resolution algorithm". Next, the container orders the matching decorators according to the decorator ordering specified in Section 8.2, "Decorator enablement and ordering".</text>
+ </assertion>
+ </section>
+
+ <section id="8.4" title="Decorator stack creation">
+ <assertion id="a">
+ <text>When a bean with decorators is created, the container must
+identify the decorators for the bean according to Section 8.3, "Decorator resolution", and for each decorator, obtain a contextual reference, as defined in Section 6.5.3, "Contextual reference for a bean", and build an ordered list of the decorator instances.</text>
+ </assertion>
+ </section>
+
+ <section id="8.5" title="Decorator invocation">
+ <assertion id="a">
+ <text>Whenever a business method is invoked on an instance of a bean with decorators, the container intercepts the business method invocation and, after processing the interceptor stack, invokes decorators of the bean. The container searches for the first decorator in the decorator stack for the instance that implements the method that is being
+invoked as a business method.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If no such decorator exists, the container invokes the business method of the intercepted instance.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Otherwise, the container calls the method of the decorator.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When any decorator is invoked by the container, it may in turn invoke a method of the delegate. The container intercepts the delegate invocation and searches for the first decorator in the decorator stack for the instance such that the decorator implements the method that is being invoked upon the delegate, and the decorator has not previously been invoked during this business method invocation.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If no such decorator exists, the container invokes the business method of the intercepted instance.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Otherwise, the container calls the method of the decorator.</text>
+ </assertion>
+ </section>
+
+ <section id="9" title="Interceptor bindings">
+
+ </section>
+
+ <section id="9.1" title="Interceptor binding types">
+ <assertion id="a">
+ <text>An interceptor binding type is a Java annotation defined as |@Target({TYPE, METHOD})| or |@Target(TYPE)| and |@Retention(RUNTIME)|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An interceptor binding type may be declared by specifying the |(a)javax.interceptor.InterceptorBindingType| metaannotation.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Multiple interceptors may be bound to the same interceptor binding type or types.</text>
+ </assertion>
+ </section>
+
+ <section id="9.1.1" title="Interceptor binding types with additional interceptor bindings">
+ <assertion id="a">
+ <text>An interceptor binding type may declare other interceptor bindings.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Interceptor bindings are transitive�an interceptor binding declared by an interceptor binding type is inherited by all beans and other interceptor binding types that declare that interceptor binding type.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Interceptor binding types declared |@Target(TYPE)| may not be applied to interceptor binding types declared |@Target({TYPE, METHOD})|.</text>
+ </assertion>
+ </section>
+
+ <section id="9.1.2" title="Interceptor bindings for stereotypes">
+ <assertion id="a">
+ <text>Interceptor bindings may be applied to a stereotype by annotating the stereotype annotation</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An interceptor binding declared by a stereotype are inherited by any bean that declares that stereotype.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a stereotype declares interceptor bindings, it must be defined as |@Target(TYPE)|.</text>
+ </assertion>
+ </section>
+
+ <section id="9.2" title="Declaring the interceptor bindings of an interceptor">
+ <assertion id="a">
+ <text>The interceptor bindings of an interceptor are specified by annotating the interceptor bean class with the binding types and the |(a)javax.interceptor.Interceptor| annotation.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If an interceptor does not declare an |@Interceptor| annotation, it must be bound to beans using |@Interceptors| or |ejb-jar.xml|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>All interceptors declared using |@Interceptor| must specify at least one interceptor binding. If an interceptor declared using |@Interceptor| does not declare any interceptor binding, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>An interceptor for lifecycle callbacks may only declare interceptor binding types that are defined as |@Target(TYPE)|. If an
+interceptor for lifecycle callbacks declares an interceptor binding type that is defined |@Target({TYPE, METHOD})|, the containerautomatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="9.3" title="Binding an interceptor to a bean">
+ <assertion id="a">
+ <text>An interceptor binding may be declared by annotating the bean class, or a method of the bean class, with the interceptor binding type.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Interceptors may be enabled or disabled at deployment time.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Disabled interceptors are never called at runtime.</text>
+ </assertion>
+ </section>
+
+ <section id="9.4" title="Interceptor enablement and ordering">
+ <assertion id="a">
+ <text>By default, interceptors bound via interceptor bindings are not enabled. An interceptor must be explicitly enabled by listing
+its bean class under the |<Interceptors>| element in |beans.xml|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The order of the interceptor declarations determines the interceptor ordering. Interceptors which occur earlier in the list are
+called first.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a class listed under the |<Interceptors>| element is not the bean class of at least one interceptor, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the bean class of an interceptor with a disabled deployment type is listed under the |<Interceptors>| element, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the |<Interceptors>| element is specified in more than one |beans.xml| document, the container automatically detects the
+problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Interceptors declared using |@Interceptors| or in |ejb-jar.xml| are called before interceptors declared using interceptor
+bindings.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Interceptors are called before decorators.</text>
+ </assertion>
+ </section>
+
+ <section id="9.5" title="Interceptor resolution">
+ <assertion id="a">
+ <text>For a lifecycle callback, the bean interceptor bindings include the interceptor bindings declared by the bean at the class
+level, including interceptor bindings declared as meta-annotations of other interceptor bindings, recursively, and of stereotypes.
+ </text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For a method, the bean interceptor bindings include the interceptor bindings declared by the bean at the class level, including
+interceptor bindings declared as meta-annotations of other interceptor bindings, recursively, and of stereotypes, together with all interceptor bindings declared at the method level, including interceptor bindings declared as meta-annotations of other interceptor bindings, recursively.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>First, the container identifies the set of matching enabled interceptors where for each declared interceptor binding, there exists an interceptor binding in the set of bean interceptor bindings with (a) the same type and (b) the same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.NonBinding| (see Section
+9.5.2, "Interceptor binding types with members").</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Next, the container narrows the set of matching interceptors according to whether the interceptor intercepts the given kind of lifecycle callback or business method.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Next, the container orders the matching interceptors according to the interceptor ordering specified in Section 9.4, "Interceptor enablement and ordering" and returns the resulting list of interceptors. If no matching interceptors exist in the set, an empty list is returned.</text>
+ </assertion>
+ </section>
+
+ <section id="9.5.1" title="Interceptors with multiple bindings">
+ <assertion id="a">
+ <text>An interceptor class may specify multiple interceptor bindings, in which case the interceptor will be applied only to beans
+that declare all the bindings at the class level, and to methods of beans for which every binding appears at either the method or class level.</text>
+ </assertion>
+ </section>
+
+ <section id="9.5.2" title="Interceptor binding types with members">
+ <assertion id="a">
+ <text>Interceptor binding types may have annotation members.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An annotation member may be excluded from consideration using the @NonBinding annotation.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Array-valued or annotation-valued members of an interceptor binding type must be annotated |@NonBinding|. If an array-valued or annotation-valued member of an interceptor binding type is not annotated |@NonBinding|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="10" title="Events">
+
+ </section>
+
+ <section id="10.1" title="Event types and binding types">
+
+ <assertion id="aa">
+ <text>An event object is an instance of a concrete Java class with no type variables.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The event types of the event include all superclasses and interfaces of the runtime class of the event object.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>An event binding type is a Java annotation defined as |@Target({FIELD, PARAMETER})| ~or |@Target({METHOD, FIELD, PARAMETER, TYPE})| and |@Retention(RUNTIME)|~</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>An event binding type is a Java annotation defined as ~|@Target({FIELD, PARAMETER})| or~ |@Target({METHOD, FIELD, PARAMETER, TYPE})| ~and |@Retention(RUNTIME)|~</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>An event binding type is a Java annotation defined as ~|@Target({FIELD, PARAMETER})| or |@Target({METHOD, FIELD, PARAMETER, TYPE})| and ~|@Retention(RUNTIME)|</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>All event binding types must specify the |(a)javax.enterprise.inject.BindingType| meta-annotation</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>Every event has the binding |(a)javax.enterprise.inject.Any|, even if it does not explicitly declare this binding.</text>
+ </assertion>
+ </section>
+
+ <section id="10.2" title="Observer resolution algorithm">
+ <assertion id="h">
+ <text>An event consumer will be notified of an event if the observed event type it specifies is one of the event types of the event, and if all the observed event bindings it specifies are event bindings of the event.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If the runtime type of the event object contains a type variable, the container must throw an |IllegalArgumentException|.</text>
+ </assertion>
+ </section>
+
+ <section id="10.2.1" title="Event binding types with members">
+ <assertion id="a">
+ <text>The binding type for an |Event| binding may have annotation members</text>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>The container uses |equals()| to compare event binding type member values</text>
+ <note>Since only primitive types are allowed, the call to equals() cannot be checked</note>
+ </assertion>
+ </section>
+
+ <section id="10.2.2" title="Multiple event bindings">
+ <assertion id="a">
+ <text>An event parameter may have multiple bindings</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An observer method will only be notified if all the observed event bindings are specified when the event is fired</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Other, less specific, observers will also be notified of events with multiple event bindings</text>
+ </assertion>
+ </section>
+
+ <section id="10.3" title="The Observer interface">
+ <assertion id="a">
+ <text>Observers of events implement the |javax.enterprise.event.Observer| interface.</text>
+ </assertion>
+ </section>
+
+ <section id="10.4" title="Firing events">
+ <assertion id="a">
+ <text>Beans fire events via an instance of the |javax.enterprise.event.Event| interface, which may be injected.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |fire()| accepts an event object.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Any combination of bindings may be specified at the injection point.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Or, the application may specify bindings dynamically.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The |observe()| method registers an observer.</text>
+ </assertion>
+ </section>
+
+ <section id="10.4.1" title="The Event interface">
+ <assertion id="c">
+ <text>The |Event| interface provides a method for firing events of a specific type</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The |Event| interface provides a method for registering observers for events of the same type.</text>
+ </assertion>
+
+ <assertion id="ea">
+ <text>The |select()| method of the provided implementation of |Event |returns a child |Event| for a subtype of the event type and additional event bindings. If no subtype is given, the event type is the same as the parent.</text>
+ </assertion>
+
+ <assertion id="eb">
+ <text>If two instances of the same binding type are passed to |select()|, a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="ec">
+ <text>If an instance of an annotation that is not a binding type is passed to |select()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="ed">
+ <text>The |fire()| method of the provided implementation of |Event| must call |BeanManager.fireEvent()|, passing the event type and bindings specified at the injection point. A child |Event| passes the event subtype and additional bindings, along with the bindings of its parent.</text>
+ </assertion>
+
+ <assertion id="ee">
+ <text>The |observe()| method of the provided implementation of |Event| must call |BeanManager.addObserver()|, passing the given observer object along with the event type and bindings specified at the injection point. A child |Event| passes the event subtype and additional bindings, along with the bindings of its parent.</text>
+ </assertion>
+ </section>
+
+ <section id="10.4.2" title="The built-in Event">
+ <assertion id="a">
+ <text>The container must provide a built-in bean with |Event<X>| for every legal observed event type X in its set of bean types.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The container must provide a built-in bean with every event binding type in its set of binding types.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container must provide a built-in bean with deployment type |@Standard|.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must provide a built-in bean with scope |@Dependent|.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The container must provide a built-in bean with no bean EL name.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The container must provide a built-in bean with an implementation provided automatically by the container.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable
+dependencies".</text>
+ </assertion>
+ </section>
+
+ <section id="10.5" title="Observer methods">
+ <assertion id="a">
+ <text>An observer method is an observer defined via annotations, instead of by explicitly implementing the Observer interface. Unlike regular observers, observer methods are automatically discovered and registered by the container</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An observer method must be a method of a managed bean class or session bean class</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>An observer method may be either static or non-static</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the bean is a session bean, the observer method must be either a business method of the EJB or a static method of the bean class</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>There may be arbitrarily many observer methods with the same event parameter type and bindings</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A bean may declare multiple observer methods</text>
+ </assertion>
+ </section>
+
+ <section id="10.5.1" title="Event parameter of an observer method">
+ <assertion id="a">
+ <text>Each observer method must have exactly one event parameter, of the same type as the event type it observes. When searching for observer methods for an event, the container considers the type and bindings of the event parameter</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the event parameter does not explicitly declare any binding, the observer method observes events with no binding</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>The event parameter type may contain a type variable or ~wildcard~. (added from 20090610 spec)</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>The event parameter type may contain a ~type variable~ or wildcard. (added from 20090610 spec)</text>
+ </assertion>
+
+ </section>
+
+ <section id="10.5.2" title="Declaring an observer method">
+ <assertion id="a">
+ <text>An observer method may be declared by annotating a parameter |(a)javax.enterprise.event.Observes|. That parameter is the event parameter. The declared type of the parameter is the observed event type.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If a method has more than one parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Observed event bindings may be declared by annotating the event parameter.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If an observer method is annotated |@Produces| the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an observer method is annotated |@Initializer| the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If an observer method is has a parameter annotated |@Disposes|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If a non-static method of a session bean class has a parameter annotated |@Observes|, and the method is not a business method of the EJB, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="10.5.3" title="Observer method parameters">
+ <assertion id="a">
+ <text>In addition to the event parameter, observer methods may declare additional parameters, which may declare bindings. These additional parameters are injection points.</text>
+ </assertion>
+ </section>
+
+ <section id="10.5.4" title="Conditional observer methods">
+ <assertion id="a">
+ <text>A conditional observer method may be declared by annotating the event parameter with the |(a)javax.enterprise.event.IfExists| annotation.</text>
+ </assertion>
+ </section>
+
+ <section id="10.5.5" title="Transactional observer methods">
+ <assertion id="a">
+ <text>Transactional observer methods are observer methods which receive event notifications during the before or after completion phase of the transaction in which the event was fired. If no transaction is in progress when the event is fired, they are notified at the same time as other observers</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A before completion observer method is called during the before completion phase of the transaction</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>An after completion observer method is called during the after completion phase of the transaction</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>An after success observer method is called during the after completion phase of the transaction, only when the transaction completes successfully</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>An after failure observer method is called during the after completion phase of the transaction, only when the transaction fails</text>
+ </assertion>
+
+ <assertion id="ga">
+ <text>A transactional observer method may be declared by annotating the event parameter of the observer method with one of the four following annotations defined in the package |javax.enterprise.event|.</text>
+ </assertion>
+
+ <assertion id="ha">
+ <text>The |@BeforeTransactionCompletion| annotation specifies that the observer method is a before completion observer method.</text>
+ </assertion>
+
+ <assertion id="ia">
+ <text>The |@AfterTransactionCompletion| annotation specifies that the observer method is an after completion observer method.</text>
+ </assertion>
+
+ <assertion id="ja">
+ <text>The |@AfterTransactionSuccess| annotation specifies that the observer method is an after success observer method.</text>
+ </assertion>
+
+ <assertion id="ka">
+ <text>The |@AfterTransactionFailure| annotation specifies that the observer method is an after failure observer method.</text>
+ </assertion>
+
+ <assertion id="la">
+ <text>A transactional observer method may not specify more than one of the four types. If a transactional observer method specifies more than one of the four types, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="10.5.6" title="Asynchronous observer methods">
+ <assertion id="a">
+ <text>An asynchronous observer method may be declared by annotating the event parameter of the observer method |(a)javax.enterprise.event.Asynchronously|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An asynchronous observer method may also be a transactional observer method. However, it may not be a before completion observer method or a conditional observer method. If an asynchronous observer method is specified as a before completion or conditional observer method, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="10.6" title="Observer notification">
+ <assertion id="a">
+ <text>When an event is fired by the application, the container must determine the observers for that event according to the observer resolution algorithm, then for each observer, call the |notify()| method of the |Observer| interface, passing the event object.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The order in which observers are called in not defined, and so portable applications should not rely upon the order in which observers are called.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Observers may throw exceptions. If an observer throws an exception, the exception aborts processing of the event. No other observers of that event will be called. The |fireEvent()| method rethrows the exception.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Any observer called before completion of a transaction may call setRollbackOnly() to force a transaction rollback.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>An observer may not directly initiate, commit or rollback JTA transactions.</text>
+ </assertion>
+ </section>
+
+ <section id="10.6.1" title="Observer method notification">
+ <assertion id="aa">
+ <text>For every observer method of an enabled bean, the container is responsible for providing and registering an implementation of the |Observer| interface, that delegates event notifications to the observer method, by calling the observer method as defined in Section 5.4.8, "Invocation of observer methods".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The |notify()| method of the |Observer| implementation for an observer method either invokes the observer method ~immediately~, or asynchronously, or registers the observer method for later invocation during the transaction completion phase, using a JTA Synchronization.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The |notify()| method of the |Observer| implementation for an observer method either invokes the observer method immediately, ~or asynchronously~, or registers the observer method for later invocation during the transaction completion phase, using a JTA Synchronization</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The |notify()| method of the |Observer| implementation for an observer method either invokes the observer method immediately, or asynchronously, ~or registers the observer method for later invocation during the transaction completion phase, using a JTA Synchronization~</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the observer method is an asynchronous transactional observer method and there is currently a JTA transaction in progress, the observer object calls the observer method asynchronously during the after transaction completion phase</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the observer method is a transactional observer method and there is currently a JTA transaction in progress, the observer object calls the observer method during the appropriate transaction completion phase</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the observer method is an asynchronous observer method, the container calls the observer method asynchronously</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If none of the conditions of assertions e, f, or g are true, the container calls the observer immediately</text>
+ </assertion>
+
+ <assertion id="i" testable="false">
+ <text>The container is not required to guarantee delivery of asynchronous events in the case of a server shutdown or failure</text>
+ <note>This is just a note about the lack of an assertion, and therefore is not testable.</note>
+ </assertion>
+
+ <assertion id="p" testable="false">
+ <text>If the observer is a transactional or asynchronous observer method, any exception is caught and logged by the container</text>
+ <note>Cannot be tested as they are not under our control</note>
+ </assertion>
+
+ <assertion id="q">
+ <text>If the observer isn't a transactional or asynchronous observer method, the exception is rethrown by the |notify()| method of the observer object</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>If the exception is a checked exception, it is wrapped and rethrown as an (unchecked) |ObserverException|</text>
+ </assertion>
+ </section>
+
+ <section id="10.6.2" title="Observer method invocation context">
+ <assertion id="a">
+ <text>If the observer method is an asynchronous observer method, it is called with no active transaction, no client security context and with a new request context that is destroyed when the observer method returns. The application context is also active</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the observer method is a |@BeforeTransactionCompletion| transactional observer method, it is called within the context of the transaction that is about to complete and with the same client security context and lifecycle contexts</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the observer method is any other kind of transactional observer method, it is called in an unspecified transaction context, but with the same client security context and lifecycle contexts as the transaction that just completed</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If an observer method is not an asynchronous observer method, and not a |@BeforeTransactionCompletion| transactional method, and not any other kind of transactional observer method, then the observer method is called in the same transaction context, client security context and lifecycle contexts as the invocation of |Event.fire()|</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The transaction and security contexts for a business method of a session bean also depend upon the transaction attribute and |@RunAs| descriptor, if any</text>
+ </assertion>
+ </section>
+
+ <section id="10.7" title="JMS event mappings">
+ <assertion id="a">
+ <text>An event type may be mapped to a JMS topic.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An event mapping is a special kind of observer method that is declared by an interface.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The event parameter specifies the mapped event type and bindings.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Every message destination representing a topic that any injected parameter resolves to is a mapped topic.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>An event mapping may be specified as a member of any interface.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>All observers of mapped event types must be asynchronous observer methods. If an observer for a mapped event type is not an asynchronous observer method, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>For every event mapping, the container must send a message containing the serialized event and its event bindings to every mapped topic whenever an event with the mapped event type and bindings is fired, and monitor every mapped topic for messages containing events of that mapped event type and bindings and notify all local observers whenever a message containing an event is received. Thus, events with the mapped event type and bindings are distributed to other processes which have the same event mapping.</text>
+ </assertion>
+ </section>
+
+ <section id="11" title="Portable extensions and the bean manager">
+ <assertion id="a" testable="false">
+ <text>A portable extension may integrate with the container by providing its own beans, interceptors and decorators to the container.</text>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>A portable extension may integrate with the container by injecting dependencies into its own objects using the dependency injection service.</text>
+ </assertion>
+
+ <assertion id="c" testable="false">
+ <text>A portable extension may integrate with the container by providing a context implementation for a custom scope.</text>
+ </assertion>
+
+ <assertion id="d" testable="false">
+ <text>Bean definitions provided by a portable extension may be associated with a certain activity.</text>
+ </assertion>
+
+ <assertion id="e" testable="false">
+ <text>Integration with portable extensions is enabled via the important SPI interfaces Bean and BeanManager.</text>
+ </assertion>
+ </section>
+
+ <section id="11.1" title="The Bean interface">
+ <assertion id="a">
+ <text>Implementations of |Bean| must also implement the inherited operations defined by the |Contextual| interface defined in Section 6.1, "The Contextual interface".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The methods |getTypes()|, |getBindings()|, |getScopeType()|, |getDeploymentType()|, |getName()|, |getStereotypes()| and |getInterceptorBindings()| must return the bean types, bindings, scope type, deployment type, EL name, stereotypes and interceptor bindings of the bean, as defined in Chapter 2, Bean definition.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |getInjectionPoints()| returns a set of |InjectionPoint| objects, defined in Section 5.4.9, "Injection point
+metadata", representing injection points of the bean, that will be validated by the container at initialization time.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |isPassivationCapable()| must return |true| if the bean is passivation capable, as defined in Section 6.6.1, "Passivation capable beans", and |false| otherwise.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The method |isNullable()| must return |true| if the method |create()| sometimes returns a |null| value, and |false| otherwise, as defined in Section 5.1.3, "Primitive types and null values".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>An instance of |Bean| exists for every enabled bean in a deployment.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>An application or portable extension may add support for new kinds of beans beyond those defined by the this specification (managed beans, session beans, producer methods and fields, resources and message destinations) by implementing |Bean| and registering beans with the container, using the mechanism defined in Section 11.2.6, "Bean registration".</text>
+ </assertion>
+ </section>
+
+ <section id="11.1.1" title="The Decorator interface">
+ <assertion id="a">
+ <text>The |Bean| object for a decorator must implement the interface |javax.enterprise.inject.spi.Decorator|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |getDecoratedTypes()| returns the decorated types of the decorator.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The methods |getDelegateType()| and |getDelegateBindings()| return the delegate type and bindings of the decorator.</text>
+ </assertion>
+ </section>
+
+ <section id="11.1.2" title="The Interceptor interface">
+ <assertion id="a">
+ <text>The |Bean| object for an interceptor must implement |javax.enterprise.inject.spi.Interceptor|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |getInterceptorBindingTypes()| returns the interceptor bindings of the interceptor.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |intercepts()| returns |true| if the interceptor intercepts callbacks or business methods of the given type, and |false| otherwise.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |intercept()| invokes the specified kind of lifecycle callback or business method upon the given instance.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>An |InterceptionType| identifies the kind of lifecycle callback or business method.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2" title="The BeanManager object">
+ <assertion id="a">
+ <text>The container provides a built-in bean with bean type |BeanManager|, scope |@Dependent|, deployment type |@Standard| and binding |@Current|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable dependencies".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Any bean may obtain an instance of |BeanManager| by injecting it.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A framework may obtain the |BeanManager| object from JNDI. The container must register an instance of |BeanManager| with name |java:app/BeanManager| in JNDI at initialization time.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Any operation of |BeanManager| may be called at any time during the execution of the application.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.1" title="Obtaining a contextual reference for a bean">
+ <assertion id="a">
+ <text>The method |BeanManager.getReference()| returns a contextual reference for a given bean and bean type, as defined in Section 6.5.3, "Contextual reference for a bean".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first parameter is the |Bean| object representing the bean. The second parameter represents the bean type that must be implemented by any client proxy that is returned.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.2" title="Obtaining an injectable reference">
+ <assertion id="a">
+ <text>The method |BeanManager.getInjectableReference()| returns an injectable reference for a given injection point, as defined in Section 5.4.1, "Injectable references".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the |InjectionPoint| represents a decorator delegate injection point, |getInjectableReference()| returns a delegate, as
+defined in Section 8.1.2, "Decorator delegate injection points".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Implementations of |Bean| usually maintain a reference to an instance of |BeanManager|. When the |Bean| implementation performs dependency injection, it must obtain the contextual instances to inject by calling |BeanManager.getInjectableReference()|, passing an instance of |InjectionPoint| that represents the injection point and the instance of |CreationalContext| that was passed to |Bean.create()|.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.3" title="Obtaining a Bean by type">
+ <assertion id="a">
+ <text>The |getBeans()| method of the |BeanManager| interface returns the result of the typesafe resolution algorithm defined in Section 5.1, "Typesafe resolution algorithm".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first parameter is a required bean type. The remaining parameters are required bindings.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If no bindings are passed to |getBeans()|, the default binding |@Current| is assumed.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a parameterized type with a type parameter or wildcard is passed to |getBeans()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If two instances of the same binding type are passed to |getBeans()|, a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If an instance of an annotation that is not a binding type is passed to |getBeans()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.4" title="Obtaining a Bean by name">
+ <assertion id="a">
+ <text>The |getBeans()| method of the |BeanManager| interface returns the result of the name resolution algorithm defined in Section 5.2, "EL name resolution algorithm".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The parameter is a bean EL name.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.5" title="Obtaining the most specialized bean">
+ <assertion id="a">
+ <text>The method |BeanManager.getMostSpecializedBean()| returns the |Bean| object representing the most specialized enabled bean registered with the container that specializes the given bean, as defined in Section 4.3.2, "Most specialized enabled bean for a bean".</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.6" title="Bean registration">
+ <assertion id="a">
+ <text>The |BeanManager.addBean()| method registers a new bean with the container, thereby making it available for injection into other beans.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The |Bean| parameter may represent an interceptor or decorator.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.7" title="Observer registration">
+ <assertion id="a">
+ <text>An observer instance may be registered with the container by calling |BeanManager.addObserver()|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first parameter is the observer object. The second parameter is the observed event type. The remaining parameters are optional observed event bindings. The observer is notified when an event object that is assignable to the observed event type is raised with the observed event bindings.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>An observer instance may be deregistered by calling |BeanManager.removeObserver()|.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If two instances of the same binding type are passed to |addObserver()| or |removeObserver()|, a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an instance of an annotation that is not a binding type is passed to |addObserver()| or |removeObserver()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.8" title="Firing an event">
+ <assertion id="a">
+ <text>The method |BeanManager.fireEvent()| fires an event and notifies observers, according to Section 10.6, "Observer notification".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first argument is the event object. The remaining parameters are event bindings.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the runtime type of the event object passed to |fireEvent()| contains a type variable, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If two instances of the same binding type are passed to |fireEvent()|, a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an instance of an annotation that is not a binding type is passed to |fireEvent()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.9" title="Observer resolution">
+ <assertion id="a">
+ <text>The method |BeanManager.resolveObservers()| resolves observers for an event according to the observer resolution algorithm defined in Section 10.2, "Observer resolution algorithm".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first parameter of |resolveObservers()| is the event object. The remaining parameters are event bindings.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the runtime type of the event object passed to |resolveObservers()| contains a type variable, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If two instances of the same binding type are passed to |resolveObservers()|, a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an instance of an annotation that is not a binding type is passed to |resolveObservers()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.10" title="Decorator resolution">
+ <assertion id="a">
+ <text>The method |BeanManager.resolveDecorators()| returns the ordered list of enabled decorators for a set of bean types and a set of bindings, as defined in Section 8.3, "Decorator resolution".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first argument is the set of bean types of the decorated bean. The annotations are bindings declared by the decorated bean.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If two instances of the same binding type are passed to |resolveDecorators()|, a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If an instance of an annotation that is not a binding type is passed to |resolveDecorators()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the set of bean types is empty, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.11" title="Interceptor resolution">
+ <assertion id="a">
+ <text>The method |BeanManager.resolveInterceptors()| returns the ordered list of enabled interceptors for a set of interceptor bindings, as defined in Section 9.5, "Interceptor resolution".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If two instances of the same interceptor binding type are passed to |resolveInterceptors()|, a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If no interceptor binding type instance is passed to |resolveInterceptors()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If an instance of an annotation that is not an interceptor binding type is passed to |resolveInterceptors()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.12" title="Dependency validation">
+ <assertion id="a">
+ <text>The |BeanManager.validate()| operation validates a dependency.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |validate()| validates the dependency and throws an |InjectionException| if there is a deployment problem (for example, an unsatisfied or ambiguous dependency) associated with the injection point.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.13" title="Enabled deployment types">
+ <assertion id="a">
+ <text>The method |BeanManager.getEnabledDeploymentTypes()| exposes the list of enabled deployment types, in order of lower to higher precedence, as defined by Section 2.5.5, "Enabled deployment types".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Portable extensions may use this method to inspect meta-annotations that appear on the deployment types and thereby discover information about the deployment.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.14" title="Registering a Context">
+ <assertion id="a">
+ <text>A custom implementation of |Context| may be associated with a scope type by calling |BeanManager.addContext()|.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.15" title="Obtaining the active Context for a scope">
+ <assertion id="a">
+ <text>The method |BeanManager.getContext()| retrieves an active context object associated with the a given scope, as defined in Section 6.5.1, "The active context object for a scope".</text>
+ </assertion>
+ </section>
+
+ <section id="11.3" title="Alternative metadata sources">
+ <assertion id="a">
+ <text>The interfaces |AnnotatedType|, |AnnotatedField|, |AnnotatedMethod|, |AnnotatedConstructor| and |AnnotatedParameter| in the package |javax.enterprise.inject.spi| allow a portable extension to specify metadata that overrides the annotations that exist on a bean class. The portable extension is responsible for implementing the interfaces, thereby exposing the metadata to the container.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The interface |Annotated| exposes the overriding annotations and type declarations.</text>
+ </assertion>
+ </section>
+
+ <section id="11.3.18" title="Obtaining the active Context for a scope">
+ <assertion id="a">
+ <text>The method |BeanManager.getContext()| retrieves an active context object associated with the a given scope, as defined in Section 6.5.1, "The active context object for a scope".</text>
+ </assertion>
+ </section>
+
+ <section id="11.4" title="Helper objects for Bean implementations">
+ <assertion id="a">
+ <text>The BeanManager provides access to helper objects which parse and validate the standard metadata defined by this specification and perform injection upon an object according to the standard injection lifecycle defined in Section 5.4.3, "Injection using the bean constructor".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |createInjectionTarget()| returns a container provided instance of |InjectionTarget| for the given type or throws an |IllegalArgumentException| if there is a definition error associated with any injection point of the type.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |createManagedBean()| returns an instance of |ManagedBean| representing the given managed bean type, or throws an |IllegalArgumentException| if there is any kind of definition error associated with the type.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When an |AnnotatedType| is passed to |createInjectionTarget()| or |createManagedBean()| the container ignores the annotations and types declared by the elements of the actual Java class and uses the metadata provided via the |Annotated| interface instead.</text>
+ </assertion>
+ </section>
+
+ <section id="11.4.1" title="The InjectionTarget interface">
+ <assertion id="a">
+ <text>The interface |javax.enterprise.inject.spi.InjectionTarget| provides operations for instantiating and performing dependency injection on instances of a type.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For any container provided implementation of |InjectionTarget| that represents a class, |produce()| calls the constructor annotated |@Initializer| if it exists, or the constructor with no parameters otherwise, as defined in Section 5.4.3, "Injection using the bean constructor".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>For any container provided implementation of |InjectionTarget| that represents a class, |inject()| performs dependency injection upon the given object. First, the container performs Java EE component environment
+injection according to the semantics required by the Java EE platform specification. Next, it sets the value all injected fields, and then calls all the initializer methods, as defined in Section 5.4.4, "Injection of fields and initializer methods". Finally, it calls the |@PostConstruct| callback, if it exists, according to the semantics required by the Java EE platform specification.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>For any container provided implementation of |InjectionTarget| that represents a class, |dispose()| calls the |@PreDestroy| callback, if it exists, according to the semantics required by the Java EE platform
+specification.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>For any container provided implementation of |InjectionTarget| that represents a class, |destroy()| destroys dependent objects of the given instance, as defined in Section 5.4.5, "Destruction of dependent objects".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>For any container provided implementation of |InjectionTarget| that represents a class, |getInjectionPoints()| returns the set of |InjectionPoint| objects representing all injected fields, bean constructor parameters and initializer method parameters.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>For any container provided implementation of |InjectionTarget| that represents a producer method or field, produce() calls the producer method on, or accesses the producer field of, either the given instance or a contextual instance of the most specialized bean that specializes the bean that declares the producer method, as defined in Section 5.4.6, "Invocation of producer or disposal methods".</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>For any container provided implementation of |InjectionTarget| that represents a producer method or field, |inject()| does nothing.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>For any container provided implementation of |InjectionTarget| that represents a producer method or field, |dispose()| calls the disposal method, if it exists, on either the given instance or a contextual instance of the most specialized bean that specializes the bean that declares the producer method, as defined in Section 5.4.6, "Invocation of
+producer or disposal methods".</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>For any container provided implementation of |InjectionTarget| that represents a producer method or field, |destroy()| destroys dependent objects of the given object, as defined in Section 5.4.5, "Destruction of dependent objects".</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>For any container provided implementation of |InjectionTarget| that represents a producer method or field, |getInjectionPoints()| returns the set of |InjectionPoint| objects representing all producer and disposal method parameters.</text>
+ </assertion>
+ </section>
+
+ <section id="11.4.2" title="ManagedBean and ProducerBean">
+ <assertion id="a">
+ <text>The interface |javax.enterprise.inject.spi.ManagedBean| exposes container provided implementations of |Bean| and |InjectionTarget| for a managed bean class.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |getAnnotatedType()| returns the |AnnotatedType| representing the managed bean class.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |getInjectionTarget()| returns a container provided implementation of |InjectionTarget| for the managed bean class.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |getProducerBeans()| returns a set of |ProducerBean| objects representing the producer methods and fields of the managed bean.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The method |getObserverMethods()| returns a set of |ObserverMethod| objects representing the observer methods of the bean.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The |ProducerBean| interface exposes container provided implementations of |Bean| and |InjectionTarget| for a producer method or field.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The methods |getAnnotatedProducer()| and |getAnnotatedDisposer()| return the |AnnotatedMembers| representing the producer method or field and disposal method respectively.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The method |getDeclaringBean()| returns a container provided implementation of |Bean| for the bean class that declares the producer method or field.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The method |getInjectionTarget()| returns a container provided implementation of |InjectionTarget| for the producer method or field.</text>
+ </assertion>
+ </section>
+
+ <section id="11.4.3" title="The ObserverMethod interface">
+ <assertion id="a">
+ <text>The interface |javax.enterprise.inject.spi.ObserverMethod| exposes a container provided implementation of |Observer| for an observer method, as defined in Section 10.6.1, "Observer method notification" along with the observed event type and bindings and an operation for calling the method.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The methods |getAnnotatedMethod()| returns the |AnnotatedMethod| representing the observer method.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |getDeclaringBean()| returns a container provided implementation of |Bean| for the bean class that declares the observer method.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |notify()| calls the observer method, upon the given bean instance as defined in Section 5.4.8, "Invocation of observer methods".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The methods |getObservedEventType()| and |getObservedEventBindings()| return the observed event type and bindings of the observer method.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The method |getInjectionPoints()| returns the set of |InjectionPoint| objects representing all injected method parameters.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5" title="Container lifecycle events">
+ <assertion id="a">
+ <text>During the application initialization process, the container fires a series of events, allowing portable extensions to integrate with the container initialization process defined in Section 12.2, "Application initialization lifecycle".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Observers of these events must be service providers of the service |javax.enterprise.inject.spi.Extension| declared in |META-INF/services|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container instantiates a single instance of each service provider at the beginning of the application initialization process and maintains a reference to it until the application shuts down.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.1" title="BeforeBeanDiscovery event">
+ <assertion id="a">
+ <text>The container must fire an event before it begins the bean discovery process. The event object must be of type |javax.enterprise.inject.spi.BeforeBeanDiscovery|.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>The operations of the |BeforeBeanDiscovery| instance allow a portable extension to declare that any annotation as a _binding type_, scope type, stereotype or interceptor binding type.</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>The operations of the |BeforeBeanDiscovery| instance allow a portable extension to declare that any annotation as a binding type, _scope type_, stereotype or interceptor binding type.</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>The operations of the |BeforeBeanDiscovery| instance allow a portable extension to declare that any annotation as a binding type, scope type, _stereotype_ or interceptor binding type.</text>
+ </assertion>
+
+ <assertion id="bd">
+ <text>The operations of the |BeforeBeanDiscovery| instance allow a portable extension to declare that any annotation as a binding type, scope type, stereotype or _interceptor binding type_.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If any observer method of the |BeforeBeanDiscovery| event throws an exception, the exception is treated as a definition error by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.2" title="AfterBeanDiscovery event">
+ <assertion id="a">
+ <text>The container must fire a second event when it has fully completed the bean discovery process, validated that there are no definition errors relating to the discovered beans, and registered |Bean| and |Observer| objects for the discovered beans, but before detecting deployment problems. The event object must be of type |javax.enterprise.inject.spi.AfterBeanDiscovery|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after all observers have been notified.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If any observer method of the |AfterBeanDiscovery| event throws an exception, the exception is treated as a definition error by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.3" title="AfterDeploymentValidation event">
+ <assertion id="a">
+ <text>The container must fire a third event after it has validated that there are no deployment problems and before creating contexts or processing requests. The event object must be of type |javax.enterprise.inject.spi.AfterDeploymentValidation|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |addDeploymentProblem()| registers a deployment problem with the container, causing the container to abort deployment after all observers have been notified.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If any observer method of the |AfterDeploymentValidation| event throws an exception, the exception is treated as a deployment problem by the container.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must not allow any request to be processed by the deployment until all observers of this event return.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.4" title="BeforeShutdown event">
+ <assertion id="a">
+ <text>The container must fire a final event after it has finished processing requests and destroyed all contexts. The event object must be of type |javax.enterprise.inject.spi.BeforeShutdown|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If any observer method of the |BeforeShutdown| event throws an exception, the exception is treated as a deployment problem by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.5" title="ProcessAnnotatedType event">
+ <assertion id="a">
+ <text>The container must fire an event for each Java class it discovers, before it reads the declared annotations. The event object must be of type |javax.enterprise.inject.spi.ProcessAnnotatedType<X>|, where |X| is the class.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The |getAnnotatedType()|/|setAnnotatedType()| property accessor pair provides access to the |AnnotatedType| object that will be used by the container to read the declared annotations.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Any observer of this event is permitted to wrap and/or replace the |annotatedType| property of |ProcessAnnotatedType|.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must use the final value of this property, after all observers have been called, to read the annotations of this class.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.6" title="ProcessInjectionTarget event">
+ <assertion id="a">
+ <text>The container must fire an event for each managed bean, session bean, Java EE component class supporting injection, producer method or producer field it discovers. The event object must be of type |javax.enterprise.inject.spi.ProcessInjectionTarget<X>|, where |X| is the managed bean class, session bean class or Java EE component class supporting injection.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The |getInjectionTarget()|/|setInjectionTarget()| property accessor pair provides access to the |InjectionTarget| object that will be used by the container to perform injection.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |getAnnotatedType()| returns the |AnnotatedType| representing the managed bean, session bean or other Java EE component class supporting injection.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is complete.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Any observer of this event is permitted to wrap and/or replace the |injectionTarget| property of |ProcessInjectionTarget|. The container must use the final value of this property, after all observers have been called, whenever it performs injection upon the managed bean, session bean or other Java EE component class supporting injection.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.7" title="ProcessBean event">
+ <assertion id="a">
+ <text>The container must fire an event for each bean it discovers, before registering the |Bean| object. The event object must be of type |javax.enterprise.inject.spi.ProcessBean|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For a managed bean with bean class |X|, the container must raise an event of type |ProcessBean<X>|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>For a session bean with bean class local view |X|, the container must raise an event of type |ProcessBean<X>|.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>For a session bean with no bean class local view |X|, the container must raise an event of type |ProcessBean<Object>|.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>For a producer method or field with method return type or field type |X|, the container must raise an event of type |ProcessBean<
+X>|.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The |getBean()|/|setBean()| property accessor pair provides access to the |Bean| object that is about to be registered.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The method |getAnnotated()| returns the |AnnotatedType|, |AnnotatedField| or |AnnotatedMethod|.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The method |addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is complete.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>Any observer of this event is permitted to wrap and/or replace the bean property of |ProcessBean|. When all observers have been called, the container registers the final value of this property. The container must not register any |Bean| object if any observer called |addDefinitionError()|.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.8" title="ProcessObserver event">
+ <assertion id="a">
+ <text>The container must fire an event for each observer method it discovers, before registering the |Observer| object. The event object must be of type |javax.enterprise.inject.spi.ProcessObserver<T>| where |T| is the observed event type.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The |getObserver()|/|setObserver()| property accessor pair provides access to the |Observer| object that is about to be registered.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |getAnnotatedMethod()| returns the |AnnotatedMethod|.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is complete.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Any observer of this event is permitted to wrap and/or replace the observer property of |ProcessObserver|. When all observers have been called, the container registers the final value of this property. The container must not register any |ObserverMethod| object if any observer called |addDefinitionError()|.</text>
+ </assertion>
+ </section>
+
+ <section id="11.6" title="Activities">
+ <assertion id="a">
+ <text>Activities are represented by instances of |BeanManager|. The method |createActivity()| creates a new child activity of an activity.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A child activity inherits all beans, interceptors, decorators, observers, and contexts defined by its direct and indirect parent activities.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Every bean belonging to a parent activity also belongs to the child activity, is eligible for injection into other beans belonging to the child activity and may be obtained by dynamic lookup via the child activity.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Every interceptor and decorator belonging to a parent activity also belongs to the child activity and may be applied to any bean belonging to the child activity.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Every observer belonging to a parent activity also belongs to the child activity and receives events fired via the child activity.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Every context object belonging to the parent activity also belongs to the child activity.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Beans and observers may be registered with an activity by calling |addBean()| or |addObserver()| on the |BeanManager| object that represents the activity.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Beans and observers registered with an activity are visible only to that activity and its children�they are never visible to direct or indirect parent activities, or to other children of the parent activity.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A bean registered with the child activity is not available for injection into any bean registered with a parent activity.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>A bean registered with a child activity is not available for injection into a non-contextual instance.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>A bean registered with a child activity may not be obtained by dynamic lookup via the parent activity.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>An observer registered with the child activity does not receive events fired via a parent activity.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If a bean registered with a child activity has the bean type and all bindings of some injection point of some bean registered with a direct or indirect parent activity, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>Interceptors and decorators may not be registered with a child activity. The |addInterceptor()| and |addDecorator()| methods throw |UnsupportedOperationException| when called on a |BeanManager| object that represents a child activity.</text>
+ </assertion>
+ </section>
+
+ <section id="11.6.1" title="Current activity">
+ <assertion id="a">
+ <text>An activity may be associated with the current context for a normal scope by calling |setCurrent()|, passing the normal scope type.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the given scope is inactive when |setCurrent()| is called, a |ContextNotActiveException| is thrown.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the given scope type is not a normal scope, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>All EL evaluations (as defined Section 5.6, "Integration with Unified EL"), all calls to any injected |BeanManager| object or |BeanManager| object obtained via JNDI lookup (as defined by Section 11.2, "The BeanManager object"), all calls to any injected |Event| object (as defined in Section 10.4.1, "The Event interface") and all calls to any injected Instance object (as defined by Section 5.5.1, "The Instance interface") are processed by the current activity.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the root activity has no active normal scope such that the current context for that scope has an associated activity, the root activity is the current activity.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the root activity has exactly one active normal scope such that the current context for that scope has an associated activity, that activity is the current activity.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Otherwise, there is no well-defined current activity, and the behavior is undefined. Portable frameworks and applications should not depend upon the behavior of the container when two different current contexts have an associated activity.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>A bean registered with an activity is only available to Unified EL expressions that are evaluated when that activity or one of its children is the current activity.</text>
+ </assertion>
+ </section>
+
+ <section id="12" title="Packaging and Deployment">
+
+ </section>
+
+ <section id="12.1" title="Bean deployment archives">
+ <assertion id="a">
+ <text>Bean classes must be deployed in any EAR, JAR, WAR, EJB-JAR or RAR archive or directory in the application classpath that has a file named |beans.xml| in the metadata directory (META-INF, or WEB-INF in the case of a WAR). Any such archive or directory is called a bean deployment archive.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When searching for beans, the container considers any Java class in any bean deployment archive, and any |ejb-jar.xml| file in any bean deployment archive.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a bean is deployed to a location that is not in the application classpath, or does not contain a file named |beans.xml| in the metadata directory, it will not be discovered by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="12.2" title="Application initialization lifecycle">
+ <assertion id="a">
+ <text>When an application is started, the container performs the following steps.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>First, the container must search for service providers for the service |javax.enterprise.inject.spi.Extension| defined in Section 11.5, "Container lifecycle events", instantiate a single instance of each service provider, and search the service provider class for observer methods of initialization events.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Next, the container must fire an event of type |BeforeBeanDiscovery|, as defined in Section 11.5.1, "BeforeBeanDiscovery event".</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Next, the container must perform bean discovery, and abort initialization of the application if any definition errors exist, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Next, the container must fire an event of type |AfterBeanDiscovery|, as defined in Section 11.5.2, "AfterBeanDiscovery event", and abort initialization of the application if any observer registers a definition error.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Next, the container must detect deployment problems by validating bean dependencies and specialization and abort initialization of the application if any deployment problems exist, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Next, the container must fire an event of type |AfterDeploymentValidation|, as defined in Section 11.5.3, "AfterDeploymentValidation event", and abort initialization of the application if any observer registers a deployment problem.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>Finally, the container begins directing requests to the application.</text>
+ </assertion>
+ </section>
+
+ <section id="12.3" title="Bean discovery">
+ <assertion id="a">
+ <text>The container automatically discovers managed beans (according to the rules of Section 3.2.1, "Which Java classes are managed beans?") and session beans in bean deployment archives and searches the bean classes for producer methods, producer fields, disposal methods and observer methods.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For each Java class in any bean deployment archive, the container must create an |AnnotatedType| representing the class and fire an event of type |ProcessAnnotatedType|, as defined in Section
+11.5.5, "ProcessAnnotatedType event".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>For each Java class in any bean deployment archive, the container must inspect the class metadata to determine if it is a bean or other Java EE component class supporting injection.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>For each Java class in any bean deployment archive, the container must detect definition errors by validating the class and its metadata.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>For each Java class in any bean deployment archive, the container must, if the class is a managed bean, session bean, producer method or field, or other Java EE component class supporting injection, create an |InjectionTarget| for the class, as defined in Section 11.4.1, "The InjectionTarget interface", and fire an event of type |ProcessInjectionTarget|, as defined in Section 11.5.6, "ProcessInjectionTarget event"</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>For each Java class in any bean deployment archive, the container must, if the class is a bean, create a |Bean| object that implements the rules defined in Chapter 7, "Bean lifecycle", and fire an event of type |ProcessBean|, as defined in Section 11.5.7, "ProcessBean event".</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the class is a bean, the container must search the class for producer methods and fields, and for each producer method or field create an InjectionTarget, as defined in Section 11.4.1, "The InjectionTarget interface", for the producer method or field and fire an event of type |ProcessInjectionTarget|, as defined in Section 11.5.6, "ProcessInjectionTarget event".</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If the class is a bean, the container must search the class for producer methods and fields, and for each producer method or field create a Bean object that implements the rules defined in Chapter 7, Bean lifecycle and fire an event of type |ProcessBean|, as defined in Section 11.5.7, "ProcessBean event".</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If the class is a bean, the container must search the class for observer methods, and for each observer method create an Observer, as defined in Section 10.6.1, �Observer method notification�, for the observer method and fire an event of type ProcessObserver, as defined in Section 11.5.8, �ProcessObserver event�.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>For each session bean declared in |ejb-jar.xml| in any bean deployment archive the container must create a |Bean| object that implements the rules defined in Chapter 7, "Bean lifecycle" and fire an event of type ProcessBean.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The container determines which beans, interceptors and decorators are enabled, according to the rules defined in Section 2.5.5, "Enabled deployment types", Section 9.4, "Interceptor enablement and ordering" and Section 8.2, "Decorator enablement and ordering", taking into account any <Deploy>, <Interceptors> and <Decorators> declarations in the |beans.xml| files, and registers the |Bean| and |Observer| objects.</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>For each enabled bean that is not an interceptor or decorator, the container creates and registers an instance of |Bean| that implements the rules of Chapter 7, "Bean lifecycle".</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>For each enabled interceptor, the container creates and registers an instance of |Interceptor|, as defined in Section 11.1.2, "The Interceptor interface".</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>For each enabled decorator, the container creates and registers an instance of |Decorator|, as defined in Section 11.1.1, "The Decorator interface".</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>For each observer method of an enabled bean, the container creates and registers an instance of |Observer| that implements the rules of Section 10.6.1, "Observer method notification".</text>
+ </assertion>
+ </section>
+
+ <section id="12.4" title="Problems detected automatically by the container">
+ <assertion id="a">
+ <text>Definition errors may be detected by tooling at development time, and are also detected by the container at initialization time. If a definition error exists in a deployment, initialization will be aborted by the container.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Deployment problems are detected by the container at initialization time. If a deployment problem exists in a deployment, initialization will be aborted by the container.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Execution errors are represented by instances of |javax.enterprise.inject.InjectionException| and its subclasses.</text>
+ </assertion>
+ </section>
+
+</specification>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3070 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-07-16 20:44:35 -0400 (Thu, 16 Jul 2009)
New Revision: 3070
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
fix out of place emphasis marks
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-17 00:23:13 UTC (rev 3069)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-17 00:44:35 UTC (rev 3070)
@@ -573,23 +573,23 @@
</assertion>
<assertion id="ba">
- <text>A bean class may also specify a scope~, name, deployment type, stereotypes and/or bindings~</text>
+ <text>A bean class may also specify a ~scope~, name, deployment type, stereotypes and/or bindings</text>
</assertion>
<assertion id="bb">
- <text>A bean class may also specify a ~scope,~ name~, deployment type, stereotypes and/or bindings~</text>
+ <text>A bean class may also specify a scope~, name~, deployment type, stereotypes and/or bindings</text>
</assertion>
<assertion id="bc">
- <text>A bean class may also specify a ~scope, name, ~deployment type~, stereotypes and/or bindings~</text>
+ <text>A bean class may also specify a scope, name~, deployment type~, stereotypes and/or bindings</text>
</assertion>
<assertion id="bd">
- <text>A bean class may also specify ~a scope, name, deployment type, ~stereotypes~ and/or bindings~</text>
+ <text>A bean class may also specify a scope, name, deployment type~, stereotypes~ and/or bindings</text>
</assertion>
<assertion id="be">
- <text>A bean class may also specify ~a scope, name, deployment type, stereotypes and/or~ bindings</text>
+ <text>A bean class may also specify a scope, name, deployment type, stereotypes~ and/or bindings~</text>
</assertion>
<assertion id="c">
@@ -738,23 +738,23 @@
</assertion>
<assertion id="ba">
- <text>A bean class may also specify a scope~, name, deployment type, stereotypes and/or bindings~</text>
+ <text>A bean class may also specify a ~scope~, name, deployment type, stereotypes and/or bindings</text>
</assertion>
<assertion id="bb">
- <text>A bean class may also specify a ~scope, ~name~, deployment type, stereotypes and/or bindings~</text>
+ <text>A bean class may also specify a scope~, name~, deployment type, stereotypes and/or bindings</text>
</assertion>
<assertion id="bc">
- <text>A bean class may also specify a ~scope, name, ~deployment type~, stereotypes and/or bindings~</text>
+ <text>A bean class may also specify a scope, name~, deployment type~, stereotypes and/or bindings</text>
</assertion>
<assertion id="bd">
- <text>A bean class may also specify a ~scope, name, deployment type, ~stereotypes ~and/or bindings~</text>
+ <text>A bean class may also specify a scope, name, deployment type~, stereotypes~ and/or bindings</text>
</assertion>
<assertion id="be">
- <text>A bean class may also specify a ~scope, name, deployment type, stereotypes and/or~ bindings~</text>
+ <text>A bean class may also specify a scope, name, deployment type, stereotypes~ and/or bindings~</text>
</assertion>
<assertion id="c">
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3069 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: definition/deployment/broken/tooMany/producerMethod and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-07-16 20:23:13 -0400 (Thu, 16 Jul 2009)
New Revision: 3069
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/tooMany/producerMethod/TooManyProducerMethodDeploymentTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/custom/CustomDeploymentTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesMultipleDeploymentTypes/MultipleStereotypesWithMultipleDeploymentTypesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
Log:
matched producer method tests, other misc tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java 2009-07-16 23:33:04 UTC (rev 3068)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java 2009-07-17 00:23:13 UTC (rev 3069)
@@ -18,14 +18,14 @@
import org.testng.annotations.Test;
/**
- * Spec version: 20090519
+ * Spec version: 20090625
*/
@Artifact
@BeansXml("beans.xml")
public class DeploymentTypeDefinitionTest extends AbstractJSR299Test
{
@Test(groups = { "annotationDefinition", "deploymentType" })
- @SpecAssertion(section = "2.5.2", id = "a")
+ @SpecAssertion(section = "review", id = "review")
public void testDeploymentTypeHasCorrectTarget()
{
assert getBeans(BlackWidow.class).size() == 1;
@@ -39,7 +39,7 @@
}
@Test(groups = { "annotationDefinition", "deploymentType" })
- @SpecAssertion(section = "2.5.2", id = "c")
+ @SpecAssertion(section = "review", id = "review")
public void testDeploymentTypeDeclaresDeploymentTypeAnnotation()
{
assert getBeans(BlackWidow.class).size() == 1;
@@ -48,7 +48,7 @@
}
@Test(groups = { "deploymentType" })
- @SpecAssertion(section = "2.5.3", id = "g")
+ @SpecAssertion(section = "review", id = "review")
public void testDeploymentTypeInheritedFromDeclaringBean() throws Exception
{
assert getBeans(BlackWidow.class).size() == 1;
@@ -57,7 +57,7 @@
}
@Test(groups = { "webbeansxml", "deploymentType" })
- @SpecAssertion(section = "2.5.4", id = "aa")
+ @SpecAssertion(section = "review", id = "review")
public void testDefaultDeploymentType()
{
assert getBeans(Tarantula.class).size() == 1;
@@ -66,7 +66,7 @@
}
@Test(groups = { "deploymentType" })
- @SpecAssertion(section = "2.5.4", id = "b")
+ @SpecAssertion(section = "review", id = "review")
public void testHighestPrecedenceDeploymentTypeFromStereotype()
{
assert getBeans(Rhinoceros.class).size() == 1;
@@ -75,7 +75,7 @@
}
@Test(groups = { "beanLifecycle", "deploymentType" }, expectedExceptions = UnsatisfiedResolutionException.class)
- @SpecAssertion(section = "2.5.5", id = "a")
+ @SpecAssertion(section = "review", id = "review")
public void testBeanWithDisabledDeploymentTypeNotInstantiated()
{
getInstanceByType(RedSnapper.class);
@@ -83,8 +83,8 @@
@Test(groups = { "deploymentType" })
@SpecAssertions( {
- @SpecAssertion(section = "2.5.4", id = "c"),
- @SpecAssertion(section = "2.7.2", id = "da")
+ @SpecAssertion(section = "review", id = "review"),
+ @SpecAssertion(section = "review", id = "review")
})
public void testWebBeanDeploymentTypeOverridesStereotype()
{
@@ -94,7 +94,7 @@
}
@Test
- @SpecAssertion(section = "2.5.3", id = "i")
+ @SpecAssertion(section = "review", id = "review")
public void testDeploymentTypeMayBeSpecifiedByStereotype()
{
assert getBeans(Goat.class).size() == 1;
@@ -103,7 +103,7 @@
}
@Test(groups = { "deploymentType" })
- @SpecAssertion(section = "4.1", id = "ca")
+ @SpecAssertion(section = "review", id = "review")
public void testDeploymentTypeDeclaredInheritedIsInherited() throws Exception
{
assert getBeans(BorderCollie.class).size() == 1;
@@ -111,7 +111,7 @@
}
@Test(groups = { "deploymentType" })
- @SpecAssertion(section = "4.1", id = "ca")
+ @SpecAssertion(section = "review", id = "review")
public void testDeploymentTypeNotDeclaredInheritedIsNotInherited()
{
assert getBeans(ShetlandPony.class).size() == 1;
@@ -119,7 +119,7 @@
}
@Test(groups = { "deploymentType" })
- @SpecAssertion(section = "4.1", id = "cc")
+ @SpecAssertion(section = "review", id = "review")
public void testDeploymentTypeDeclaredInheritedIsBlockedByIntermediateDeploymentTypeNotMarkedInherited()
{
assert getBeans(GoldenRetriever.class).size() == 1;
@@ -127,7 +127,7 @@
}
@Test(groups = { "deploymentType" })
- @SpecAssertion(section = "4.1", id = "cc")
+ @SpecAssertion(section = "review", id = "review")
public void testDeploymentTypeDeclaredInheritedIsBlockedByIntermediateDeploymentTypeMarkedInherited()
{
assert getBeans(GoldenLabrador.class).size() == 1;
@@ -135,7 +135,7 @@
}
@Test
- @SpecAssertion(section = "4.1", id = "dab")
+ @SpecAssertion(section = "review", id = "review")
public void testDeploymentTypeIsOverriddenByInheritedDeploymentType()
{
assert getBeans(Cow.class).size() == 1;
@@ -143,7 +143,7 @@
}
@Test
- @SpecAssertion(section = "4.1", id = "dcb")
+ @SpecAssertion(section = "review", id = "review")
public void testDeploymentTypeIsOverriddenByIndirectlyInheritedDeploymentType()
{
assert getBeans(JerseyCow.class).size() == 1;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/tooMany/producerMethod/TooManyProducerMethodDeploymentTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/tooMany/producerMethod/TooManyProducerMethodDeploymentTest.java 2009-07-16 23:33:04 UTC (rev 3068)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/tooMany/producerMethod/TooManyProducerMethodDeploymentTest.java 2009-07-17 00:23:13 UTC (rev 3069)
@@ -10,14 +10,14 @@
/**
* Validate that a producer method declares at most one deployment type.
- * Spec version: 20090519
+ * Spec version: 20090625
*/
@Artifact
@ExpectedDeploymentException(DefinitionError.class)
public class TooManyProducerMethodDeploymentTest extends AbstractJSR299Test
{
@Test(groups = { "deploymentType" })
- @SpecAssertion(section = "2.5.3", id = "ea")
+ @SpecAssertion(section = "review", id = "review")
public void testTooManyDeploymentTypes()
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/custom/CustomDeploymentTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/custom/CustomDeploymentTypeTest.java 2009-07-16 23:33:04 UTC (rev 3068)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/custom/CustomDeploymentTypeTest.java 2009-07-17 00:23:13 UTC (rev 3069)
@@ -11,7 +11,7 @@
/**
*
- * Spec version: 20090519
+ * Spec version: 20090625
*
*/
@Artifact
@@ -20,10 +20,10 @@
{
@SuppressWarnings("unchecked")
- @Test(groups="rewrite")
+ @Test(groups={"rewrite", "deployment"})
@SpecAssertions({
- @SpecAssertion(section = "2.5.5", id = "b"),
- @SpecAssertion(section = "2.5.2", id = "d")
+ @SpecAssertion(section = "review", id = "review"),
+ @SpecAssertion(section = "review", id = "review") // deployment types removed from spec
})
// Note new wording around @Standard not being explicitly needed
public void testCustomDeploymentTypes()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesMultipleDeploymentTypes/MultipleStereotypesWithMultipleDeploymentTypesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesMultipleDeploymentTypes/MultipleStereotypesWithMultipleDeploymentTypesTest.java 2009-07-16 23:33:04 UTC (rev 3068)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/multipleStereotypesMultipleDeploymentTypes/MultipleStereotypesWithMultipleDeploymentTypesTest.java 2009-07-17 00:23:13 UTC (rev 3069)
@@ -8,14 +8,14 @@
import org.testng.annotations.Test;
/**
- * Spec version: 20090519
+ * Spec version: 20090625
*/
@Artifact
@BeansXml("beans.xml")
public class MultipleStereotypesWithMultipleDeploymentTypesTest extends AbstractJSR299Test
{
@Test
- @SpecAssertions( { @SpecAssertion(section = "2.7.2", id = "e"), @SpecAssertion(section = "2.5.4", id = "b") })
+ @SpecAssertions( { @SpecAssertion(section = "2.7.2", id = "e"), @SpecAssertion(section = "review", id = "review") })
public void testMultipleStereotypesWithMultipleDeploymentTypes()
{
assert getBeans(Goat.class).size() == 1;
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-07-16 23:33:04 UTC (rev 3068)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-07-17 00:23:13 UTC (rev 3069)
@@ -20,7 +20,7 @@
/**
*
- * Spec version: 20090519
+ * Spec version: 20090625
*
*/
@Artifact
@@ -33,8 +33,8 @@
@Test(groups = "producerMethod")
@SpecAssertions( {
- @SpecAssertion(section = "2.5.3", id = "g"),
- @SpecAssertion(section = "3.4.3", id = "c")
+ @SpecAssertion(section = "review", id = "review"),
+ @SpecAssertion(section = "3.3.3", id = "c")
} )
public void testProducerMethodInheritsDeploymentTypeOfDeclaringWebBean() throws Exception
{
@@ -44,8 +44,8 @@
@Test(groups = "producerMethod")
@SpecAssertions( {
- @SpecAssertion(section = "3.4", id = "b"),
- @SpecAssertion(section = "7.5", id = "a")
+ @SpecAssertion(section = "3.3", id = "b"),
+ @SpecAssertion(section = "7.3.4", id = "a")
} )
public void testStaticMethod() throws Exception
{
@@ -55,7 +55,7 @@
@Test(groups = { "producerMethod" })
@SpecAssertions( {
- @SpecAssertion(section = "3.4", id = "a")
+ @SpecAssertion(section = "3.3", id = "a")
} )
public void testProducerOnNonBean() throws Exception
{
@@ -64,9 +64,9 @@
@Test(groups = "producerMethod")
@SpecAssertions( {
- @SpecAssertion(section = "3.4.5", id = "b")
+ @SpecAssertion(section = "3.3.5", id = "b")
} )
- public void testStaticDisposalMethod() throws Exception
+ public void testStaticDisposerMethod() throws Exception
{
assert getBeans(String.class).size() == 1;
String aString = getInstanceByType(String.class);
@@ -77,7 +77,7 @@
}
@Test(groups = "producerMethod")
- @SpecAssertion(section = "3.4", id = "ga")
+ @SpecAssertion(section = "3.3", id = "ga")
public void testParameterizedReturnType() throws Exception
{
assert getBeans(new TypeLiteral<FunnelWeaver<Spider>>() {}).size() == 1;
@@ -85,8 +85,8 @@
@Test(groups = "producerMethod")
@SpecAssertions({
- @SpecAssertion(section = "3.4", id = "c"),
- @SpecAssertion(section = "3.4.2", id = "a"),
+ @SpecAssertion(section = "3.3", id = "c"),
+ @SpecAssertion(section = "3.3.2", id = "a"),
@SpecAssertion(section = "2.3.1", id = "a0"),
@SpecAssertion(section = "2.3.1", id = "aa")
})
@@ -100,7 +100,7 @@
@Test(groups = "producerMethod")
@SpecAssertions({
- @SpecAssertion(section = "3.4.1", id = "c"),
+ @SpecAssertion(section = "3.3.1", id = "c"),
@SpecAssertion(section="2.2", id = "l")
})
public void testApiTypeForClassReturn() throws Exception
@@ -118,7 +118,7 @@
}
@Test(groups = "producerMethod")
- @SpecAssertion(section = "3.4.1", id = "a")
+ @SpecAssertion(section = "3.3.1", id = "a")
public void testApiTypeForInterfaceReturn() throws Exception
{
assert getBeans(Bite.class).size() == 1;
@@ -129,7 +129,7 @@
}
@Test(groups = "producerMethod")
- @SpecAssertion(section = "3.4.1", id = "b")
+ @SpecAssertion(section = "3.3.1", id = "b")
public void testApiTypeForPrimitiveReturn() throws Exception
{
assert getBeans(Integer.class).size() == 1;
@@ -141,7 +141,7 @@
@Test(groups = "producerMethod")
@SpecAssertions({
- @SpecAssertion(section = "3.4.1", id = "b"),
+ @SpecAssertion(section = "3.3.1", id = "b"),
@SpecAssertion(section = "2.2", id = "j")
})
public void testApiTypeForArrayTypeReturn() throws Exception
@@ -155,8 +155,8 @@
@Test(groups = "producerMethod")
@SpecAssertions({
- @SpecAssertion(section = "3.4.2", id = "be"),
- @SpecAssertion(section = "3.4", id = "k")
+ @SpecAssertion(section = "3.3.2", id = "be"),
+ @SpecAssertion(section = "3.3", id = "k")
})
public void testBindingType() throws Exception
{
@@ -168,8 +168,8 @@
@Test(groups = "producerMethod")
@SpecAssertions({
- @SpecAssertion(section = "3.4.2", id = "ba"),
- @SpecAssertion(section = "3.4", id = "k")
+ @SpecAssertion(section = "3.3.2", id = "ba"),
+ @SpecAssertion(section = "3.3", id = "k")
})
public void testScopeType() throws Exception
{
@@ -180,8 +180,8 @@
@Test(groups = "producerMethod")
@SpecAssertions({
- @SpecAssertion(section = "3.4.2", id = "bc"),
- @SpecAssertion(section = "2.5.3", id = "b")
+ @SpecAssertion(section = "3.3.2", id = "bc"),
+ @SpecAssertion(section = "review", id = "review")
})
public void testDeploymentType() throws Exception
{
@@ -192,8 +192,8 @@
@Test(groups = "producerMethod")
@SpecAssertions({
- @SpecAssertion(section = "3.4.2", id = "bb"),
- @SpecAssertion(section = "2.6.1", id = "b")
+ @SpecAssertion(section = "3.3.2", id = "bb"),
+ @SpecAssertion(section = "2.5.1", id = "b")
})
public void testNamedMethod() throws Exception
{
@@ -204,9 +204,9 @@
@Test(groups = "producerMethod")
@SpecAssertions({
- @SpecAssertion(section = "3.4.2", id = "bb"),
- @SpecAssertion(section = "2.6.1", id = "d"),
- @SpecAssertion(section = "3.4.12", id = "a")
+ @SpecAssertion(section = "3.3.2", id = "bb"),
+ @SpecAssertion(section = "2.5.1", id = "d"),
+ @SpecAssertion(section = "3.3.10", id = "a")
})
public void testDefaultNamedMethod() throws Exception
{
@@ -222,9 +222,9 @@
@Test(groups = "producerMethod")
@SpecAssertions({
@SpecAssertion(section = "2.7.2", id = "b"),
- @SpecAssertion(section = "3.4.2", id = "ba"),
- @SpecAssertion(section = "2.4.5", id = "c"),
- @SpecAssertion(section = "3.4.2", id = "bd")
+ @SpecAssertion(section = "3.3.2", id = "ba"),
+ @SpecAssertion(section = "2.4.4", id = "c"),
+ @SpecAssertion(section = "3.3.2", id = "bd")
})
public void testStereotypeSpecifiesScope() throws Exception
{
@@ -253,7 +253,7 @@
}
@Test
- @SpecAssertion(section = "2.3.6", id = "a")
+ @SpecAssertion(section = "2.3.5", id = "a")
public void testBindingTypesAppliedToProducerMethodParameters()
{
Bean<Tarantula> tarantula = getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
@@ -263,14 +263,14 @@
}
@Test
- @SpecAssertion(section = "3.4", id = "e")
+ @SpecAssertion(section = "3.3", id = "e")
public void testDependentProducerReturnsNullValue()
{
assert getInstanceByType(Acorn.class) == null;
}
@Test(groups = { "ri-broken" }, expectedExceptions = { IllegalProductException.class })
- @SpecAssertion(section = "3.4", id = "f")
+ @SpecAssertion(section = "3.3", id = "f")
public void testNonDependentProducerReturnsNullValue()
{
getInstanceByType(Pollen.class);
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3068 - tck/trunk/doc/reference/en-US.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-07-16 19:33:04 -0400 (Thu, 16 Jul 2009)
New Revision: 3068
Modified:
tck/trunk/doc/reference/en-US/executing.xml
Log:
add note about incontainer-debug profile
Modified: tck/trunk/doc/reference/en-US/executing.xml
===================================================================
--- tck/trunk/doc/reference/en-US/executing.xml 2009-07-16 19:20:03 UTC (rev 3067)
+++ tck/trunk/doc/reference/en-US/executing.xml 2009-07-16 23:33:04 UTC (rev 3068)
@@ -22,8 +22,10 @@
<programlisting><webbeans_install_dir>/jboss-as/local.build.properties</programlisting>
<para>Then, add the <literal>incontainer</literal> property to the command that launches the Maven 2 life cycle:</para>
<programlisting>mvn test -Dincontainer</programlisting>
- <para>The presence of the <literal>incontainer</literal> property activates a Maven 2 profile that assigns the <literal>org.jboss.testharness.standalone</literal> system property to <literal>false</literal> and the <literal>org.jboss.testharness.runIntegrationTests</literal> system property to <literal>true</literal>, hence activing the in-container test mode.</para>
- <para>When the Maven 2 life cycle is run with the <literal>incontainer</literal> property present, all the test artifacts in the test suite are executed. The in-container mode uses the <literal>Containers</literal> SPI to deploy the test artifact to the container and execute the test in a true Java EE life cycle. The JBoss TCK runner has a dependency on the library that provides an implementation of this interface for JBoss AS 5.1.</para>
+ <para>The presence of the <literal>incontainer</literal> property activates a Maven 2 profile that assigns the <literal>org.jboss.testharness.standalone</literal> system property to <literal>false</literal> and the <literal>org.jboss.testharness.runIntegrationTests</literal> system property to <literal>true</literal>, hence activing the in-container test mode. This time, all the test artifacts in the test suite are executed.</para>
+ <para>The in-container profile will also start and stop the application server automatically by setting the <literal>org.jboss.testharness.container.forceRestart</literal> to <literal>true</literal>. If you want to connect to an instance that is already running, activate in-container mode using the <literal>incontainer-debug</literal> command line property instead.</para>
+ <programlisting>mvn test -Dincontainer-debug</programlisting>
+ <para>The in-container mode uses the <literal>Containers</literal> SPI to deploy the test artifact to the container and execute the test in a true Java EE life cycle. The JBoss TCK runner has a dependency on the library that provides an implementation of this interface for JBoss AS 5.1.</para>
<para>Since in-container tests are executed in a remote JVM, the results of the test must be communicated back to the runner over a container-supported protocol. The JBoss Test Harness provides servlet-based communication over HTTP as described in section 3.3.</para>
</section>
<section>
15 years, 4 months