[webbeans-commits] Webbeans SVN: r1514 - ri/trunk/jboss-tck-runner/src/main/java/org/jboss/webbeans/tck/integration/jbossas and 12 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Sat Feb 14 18:19:09 EST 2009
Author: pete.muir at jboss.org
Date: 2009-02-14 18:19:09 -0500 (Sat, 14 Feb 2009)
New Revision: 1514
Added:
tck/trunk/api/src/main/java/org/jboss/jsr299/tck/api/DeploymentException.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ExpectedException.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ExpectedDeploymentException.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/DisableIntegrationTestsMethodSelector.java
tck/trunk/impl/src/main/resources/tck-audit.xml
tck/trunk/impl/src/main/resources/tck-tests.xml
Removed:
tck/trunk/impl/ri.classpath
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ExpectedDeploymentExceptions.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/ForwardingITestNGMethod.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/ForwardingITestResult.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/SaneITestNGMethod.java
tck/trunk/impl/src/main/resources/tck-unit-tests.xml
tck/trunk/impl/tck-audit.xml
tck/trunk/impl/tck-audit.xsd
Modified:
ri/trunk/jboss-tck-runner/pom.xml
ri/trunk/jboss-tck-runner/src/main/java/org/jboss/webbeans/tck/integration/jbossas/JBossTestServicesContainersImpl.java
ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java
tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Containers.java
tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/StandaloneContainers.java
tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/helpers/ForwardingContainers.java
tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/helpers/ForwardingStandaloneContainers.java
tck/trunk/impl/pom.xml
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractDeclarativeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ArtifactDescriptor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ArtifactGenerator.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/broken/BrokenDeploymentTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/broken/tooMany/TooManyDeploymentTypesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/simple/SimpleBeanDefinitionTest.java
Log:
WBTCK-19, and support deployment exceptions (JBoss AS runner is throwing the wrong exception still), and add a selector to disable integration tests when they aren't requested
Modified: ri/trunk/jboss-tck-runner/pom.xml
===================================================================
--- ri/trunk/jboss-tck-runner/pom.xml 2009-02-14 02:10:10 UTC (rev 1513)
+++ ri/trunk/jboss-tck-runner/pom.xml 2009-02-14 23:19:09 UTC (rev 1514)
@@ -55,10 +55,6 @@
</dependencies>
- <properties>
- <restartJBoss>false</restartJBoss>
- </properties>
-
<build>
<plugins>
<plugin>
@@ -138,6 +134,12 @@
<suiteXmlFiles>
<suiteXmlFile>${project.build.directory}/dependency/jsr299-tck-impl-suite.xml</suiteXmlFile>
</suiteXmlFiles>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.jboss.jsr299.tck.impl.testng.AlwaysRunAnnotationTransformer</value>
+ </property>
+ </properties>
<systemProperties>
<property>
<name>org.jboss.jsr299.tck.standalone</name>
Modified: ri/trunk/jboss-tck-runner/src/main/java/org/jboss/webbeans/tck/integration/jbossas/JBossTestServicesContainersImpl.java
===================================================================
--- ri/trunk/jboss-tck-runner/src/main/java/org/jboss/webbeans/tck/integration/jbossas/JBossTestServicesContainersImpl.java 2009-02-14 02:10:10 UTC (rev 1513)
+++ ri/trunk/jboss-tck-runner/src/main/java/org/jboss/webbeans/tck/integration/jbossas/JBossTestServicesContainersImpl.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -1,8 +1,10 @@
package org.jboss.webbeans.tck.integration.jbossas;
import java.io.File;
+import java.io.IOException;
import java.io.InputStream;
import org.apache.log4j.Logger;
+import org.jboss.jsr299.tck.api.DeploymentException;
import org.jboss.test.JBossTestServices;
@@ -24,19 +26,33 @@
tmpdir.deleteOnExit();
}
- public void deploy(InputStream archiveStream, String name) throws Exception
+ public void deploy(InputStream archiveStream, String name) throws DeploymentException, IOException
{
File archive = new File(tmpdir, name);
archive.deleteOnExit();
copy(archiveStream, archive);
- testServices.deploy(getTmpArchiveName(name));
+ try
+ {
+ testServices.deploy(getTmpArchiveName(name));
+ }
+ catch (Exception e)
+ {
+ throw new DeploymentException("Error deploying " + name, e);
+ }
}
- public void undeploy(String name) throws Exception
+ public void undeploy(String name) throws DeploymentException, IOException
{
- testServices.undeploy(getTmpArchiveName(name));
try
{
+ testServices.undeploy(getTmpArchiveName(name));
+ }
+ catch (Exception e)
+ {
+ throw new DeploymentException("Error deploying " + name, e);
+ }
+ try
+ {
// Give the app a chance to undeploy
Thread.sleep(1000);
}
Modified: ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java
===================================================================
--- ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java 2009-02-14 02:10:10 UTC (rev 1513)
+++ ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -5,6 +5,7 @@
import javax.inject.manager.Manager;
+import org.jboss.jsr299.tck.api.DeploymentException;
import org.jboss.jsr299.tck.spi.StandaloneContainers;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.mock.MockBootstrap;
@@ -13,20 +14,27 @@
public class StandaloneContainersImpl implements StandaloneContainers
{
- public Manager deploy(List<Class<? extends Annotation>> enabledDeploymentTypes, Class<?>... classes)
+ public Manager deploy(List<Class<? extends Annotation>> enabledDeploymentTypes, Class<?>... classes) throws DeploymentException
{
- MockBootstrap bootstrap = new MockBootstrap();
- ManagerImpl manager = bootstrap.getManager();
- if (enabledDeploymentTypes != null)
+ try
{
- manager.setEnabledDeploymentTypes(enabledDeploymentTypes);
+ MockBootstrap bootstrap = new MockBootstrap();
+ ManagerImpl manager = bootstrap.getManager();
+ if (enabledDeploymentTypes != null)
+ {
+ manager.setEnabledDeploymentTypes(enabledDeploymentTypes);
+ }
+ bootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(classes));
+ bootstrap.boot();
+ return manager;
}
- bootstrap.setWebBeanDiscovery(new MockWebBeanDiscovery(classes));
- bootstrap.boot();
- return manager;
+ catch (Exception e)
+ {
+ throw new DeploymentException("Error deploying beans", e);
+ }
}
- public Manager deploy(java.lang.Class<?>... classes)
+ public Manager deploy(java.lang.Class<?>... classes) throws DeploymentException
{
return deploy(null, classes);
}
Added: tck/trunk/api/src/main/java/org/jboss/jsr299/tck/api/DeploymentException.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/jsr299/tck/api/DeploymentException.java (rev 0)
+++ tck/trunk/api/src/main/java/org/jboss/jsr299/tck/api/DeploymentException.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -0,0 +1,32 @@
+package org.jboss.jsr299.tck.api;
+
+/**
+ * Wraps the deployment exception, which can be obtained using
+ * {@link #getCause()}
+ * @author Pete Muir
+ *
+ */
+public class DeploymentException extends Exception
+{
+
+ public DeploymentException()
+ {
+ super();
+ }
+
+ public DeploymentException(String arg0, Throwable arg1)
+ {
+ super(arg0, arg1);
+ }
+
+ public DeploymentException(String arg0)
+ {
+ super(arg0);
+ }
+
+ public DeploymentException(Throwable arg0)
+ {
+ super(arg0);
+ }
+
+}
Property changes on: tck/trunk/api/src/main/java/org/jboss/jsr299/tck/api/DeploymentException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Containers.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Containers.java 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Containers.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -3,6 +3,8 @@
import java.io.IOException;
import java.io.InputStream;
+import org.jboss.jsr299.tck.api.DeploymentException;
+
public interface Containers
{
@@ -16,9 +18,9 @@
* @param archive
* @return
*/
- public void deploy(InputStream archive, String name) throws Exception, IOException;
+ public void deploy(InputStream archive, String name) throws DeploymentException, IOException;
- public void undeploy(String name) throws Exception, IOException;
+ public void undeploy(String name) throws DeploymentException, IOException;
public void setup() throws IOException;
Modified: tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/StandaloneContainers.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/StandaloneContainers.java 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/StandaloneContainers.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -5,6 +5,8 @@
import javax.inject.manager.Manager;
+import org.jboss.jsr299.tck.api.DeploymentException;
+
/**
* Standalone container related operations
*
@@ -40,7 +42,7 @@
* @param classes the classes to deploy
* @return the manager created as a result of initializing the container
*/
- public Manager deploy(List<Class<? extends Annotation>> enabledDeploymentTypes, Class<?>...classes);
+ public Manager deploy(List<Class<? extends Annotation>> enabledDeploymentTypes, Class<?>...classes) throws DeploymentException;
- public Manager deploy(Class<?>...classes);
+ public Manager deploy(Class<?>...classes) throws DeploymentException;
}
Modified: tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/helpers/ForwardingContainers.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/helpers/ForwardingContainers.java 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/helpers/ForwardingContainers.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -3,6 +3,7 @@
import java.io.IOException;
import java.io.InputStream;
+import org.jboss.jsr299.tck.api.DeploymentException;
import org.jboss.jsr299.tck.spi.Containers;
public abstract class ForwardingContainers implements Containers
@@ -10,12 +11,12 @@
protected abstract Containers delegate();
- public void deploy(InputStream archive, String name) throws IOException, Exception
+ public void deploy(InputStream archive, String name) throws IOException, DeploymentException
{
delegate().deploy(archive, name);
}
- public void undeploy(String name) throws IOException, Exception
+ public void undeploy(String name) throws IOException, DeploymentException
{
delegate().undeploy(name);
}
Modified: tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/helpers/ForwardingStandaloneContainers.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/helpers/ForwardingStandaloneContainers.java 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/helpers/ForwardingStandaloneContainers.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -5,6 +5,7 @@
import javax.inject.manager.Manager;
+import org.jboss.jsr299.tck.api.DeploymentException;
import org.jboss.jsr299.tck.spi.StandaloneContainers;
public abstract class ForwardingStandaloneContainers implements StandaloneContainers
@@ -12,12 +13,12 @@
protected abstract StandaloneContainers delegate();
- public Manager deploy(List<Class<? extends Annotation>> enabledDeploymentTypes, Class<?>... classes)
+ public Manager deploy(List<Class<? extends Annotation>> enabledDeploymentTypes, Class<?>... classes) throws DeploymentException
{
return delegate().deploy(enabledDeploymentTypes, classes);
}
- public Manager deploy(Class<?>... classes)
+ public Manager deploy(Class<?>... classes) throws DeploymentException
{
return delegate().deploy(classes);
}
Modified: tck/trunk/impl/pom.xml
===================================================================
--- tck/trunk/impl/pom.xml 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/impl/pom.xml 2009-02-14 23:19:09 UTC (rev 1514)
@@ -106,10 +106,20 @@
<configuration>
<artifacts>
<artifact>
- <file>${basedir}/src/main/resources/tck-unit-tests.xml</file>
+ <file>${basedir}/src/main/resources/tck-tests.xml</file>
<type>xml</type>
<classifier>suite</classifier>
</artifact>
+ <artifact>
+ <file>${basedir}/src/main/resources/tck-audit.xml</file>
+ <type>xml</type>
+ <classifier>audit</classifier>
+ </artifact>
+ <artifact>
+ <file>${basedir}/src/main/resources/tck-audit.xsd</file>
+ <type>xsd</type>
+ <classifier>audit</classifier>
+ </artifact>
</artifacts>
</configuration>
</execution>
@@ -169,7 +179,7 @@
<configuration>
<source>1.6</source>
<target>1.6</target>
- <compilerArgument>-AauditXml=${basedir}/tck-audit.xml</compilerArgument>
+ <compilerArgument>-AauditXml=${basedir}/src/main/resources/tck-audit.xml</compilerArgument>
</configuration>
</plugin>
<plugin>
Deleted: tck/trunk/impl/ri.classpath
===================================================================
--- tck/trunk/impl/ri.classpath 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/impl/ri.classpath 2009-02-14 23:19:09 UTC (rev 1514)
@@ -1,10 +0,0 @@
- <!-- Add these entries to your tck eclipse classpath to allow you to run RI tests from the TCK eclipse project -->
-
- <classpathentry kind="lib" path="/org.jboss.webbeans.webbeans-ri/target/test-classes"/>
- <classpathentry kind="lib" path="/org.jboss.webbeans.webbeans-ri/src/test/resources"/>
- <classpathentry kind="lib" path="/org.jboss.webbeans.webbeans-ri-spi/target/classes"/>
- <classpathentry kind="lib" path="/org.jboss.webbeans.webbeans-ri/target/classes"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-log4j/2.0.5.GA/jboss-logging-log4j-2.0.5.GA.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/google/collections/google-collections/0.8/google-collections-0.8.jar" sourcepath="M2_REPO/com/google/collections/google-collections/0.8/google-collections-0.8-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA.jar" sourcepath="M2_REPO/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA-sources.jar"/>
-
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractDeclarativeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractDeclarativeTest.java 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractDeclarativeTest.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -4,12 +4,14 @@
import java.lang.reflect.Method;
import java.util.Set;
+import org.jboss.jsr299.tck.api.DeploymentException;
import org.jboss.jsr299.tck.api.TestResult;
import org.jboss.jsr299.tck.api.TestResult.Status;
import org.jboss.jsr299.tck.impl.packaging.ArtifactGenerator;
import org.jboss.jsr299.tck.impl.packaging.jsr299.TCKArtifactDescriptor;
import org.testng.IHookCallBack;
import org.testng.IHookable;
+import org.testng.ITestContext;
import org.testng.ITestResult;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
@@ -36,6 +38,7 @@
}
private TCKArtifactDescriptor artifact;
+ private DeploymentException deploymentException;
private boolean isSuiteDeployingTestsToContainer()
{
@@ -69,9 +72,8 @@
return !isInContainer() && artifact != null && ((getCurrentConfiguration().isStandalone() && !artifact.isUnit()) || !getCurrentConfiguration().isStandalone());
}
- private void deployArtifact() throws Throwable
+ private void deployArtifact()
{
- Throwable throwable = null;
try
{
if (isDeployToContainerNeeded())
@@ -92,22 +94,29 @@
}
}
}
- catch (Throwable e)
+ catch (IOException e)
{
- throwable = e;
+ throw new RuntimeException("Error connecting to the container", e);
}
+ catch (DeploymentException e)
+ {
+ deploymentException = e;
+ }
if (artifact != null && artifact.getExpectedDeploymentException() != null)
{
- if (isThrowablePresent(artifact.getExpectedDeploymentException(), throwable))
+ if (deploymentException != null)
{
- // Correct, so swallow
- return;
+ if (isThrowablePresent(artifact.getExpectedDeploymentException(), deploymentException.getCause()))
+ {
+ // We expect this exception, so ignore it
+ deploymentException = null;
+ }
}
+ else
+ {
+ this.deploymentException = new DeploymentException(new ExpectedException("Expected exception " + artifact.getExpectedDeploymentException() + " but none was thrown"));
+ }
}
- if (throwable != null)
- {
- throw throwable;
- }
}
private void undeployArtifact() throws Exception
@@ -131,12 +140,12 @@
}
if (!assertionsEnabled)
{
- throw new IllegalArgumentException("Assertions must be enabled!");
+ throw new IllegalStateException("Assertions must be enabled!");
}
}
- @BeforeSuite
- public void beforeSuite() throws Exception
+ @BeforeSuite(alwaysRun=true)
+ public void beforeSuite(ITestContext context) throws Exception
{
if (isSuiteDeployingTestsToContainer())
{
@@ -146,7 +155,7 @@
}
- @AfterSuite
+ @AfterSuite(alwaysRun=true)
public void afterSuite() throws Exception
{
if (isSuiteDeployingTestsToContainer())
@@ -155,7 +164,7 @@
}
}
- @BeforeClass
+ @BeforeClass(alwaysRun=true)
public final void beforeClass() throws Throwable
{
generateArtifact();
@@ -163,14 +172,15 @@
}
- @AfterClass
+ @AfterClass(alwaysRun=true)
public void afterClass() throws Exception
{
undeployArtifact();
this.artifact = null;
+ this.deploymentException = null;
}
- @BeforeMethod
+ @BeforeMethod(alwaysRun=true)
public final void beforeMethod(Method method)
{
if (!isInContainer() && artifact == null)
@@ -181,7 +191,7 @@
setCurrentManager(getCurrentConfiguration().getManagers().getManager());
}
- @AfterMethod
+ @AfterMethod(alwaysRun=true)
public void afterMethod()
{
setCurrentManager(null);
@@ -190,7 +200,11 @@
public void run(IHookCallBack callback, ITestResult testResult)
{
- if (!isDeployToContainerNeeded())
+ if (deploymentException != null)
+ {
+ testResult.setThrowable(deploymentException.getCause());
+ }
+ else if (!isDeployToContainerNeeded())
{
callback.runTestMethod(testResult);
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractTest.java 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractTest.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -21,6 +21,7 @@
import javax.inject.manager.Manager;
import org.jboss.jsr299.tck.api.Configuration;
+import org.jboss.jsr299.tck.api.DeploymentException;
import org.jboss.jsr299.tck.impl.ConfigurationImpl;
import org.jboss.jsr299.tck.impl.util.MockCreationalContext;
@@ -107,11 +108,39 @@
if (getEnabledDeploymentTypes().size() > 0)
{
- getCurrentConfiguration().getStandaloneContainers().deploy(getEnabledDeploymentTypes(), classes);
+ try
+ {
+ getCurrentConfiguration().getStandaloneContainers().deploy(getEnabledDeploymentTypes(), classes);
+ }
+ catch (DeploymentException e)
+ {
+ if (e.getCause() instanceof RuntimeException)
+ {
+ throw (RuntimeException) e.getCause();
+ }
+ else
+ {
+ throw new RuntimeException(e.getCause());
+ }
+ }
}
else
{
- getCurrentConfiguration().getStandaloneContainers().deploy(classes);
+ try
+ {
+ getCurrentConfiguration().getStandaloneContainers().deploy(classes);
+ }
+ catch (DeploymentException e)
+ {
+ if (e.getCause() instanceof RuntimeException)
+ {
+ throw (RuntimeException) e.getCause();
+ }
+ else
+ {
+ throw new RuntimeException(e.getCause());
+ }
+ }
}
setCurrentManager(getCurrentConfiguration().getManagers().getManager());
}
@@ -204,13 +233,13 @@
protected static boolean isThrowablePresent(Class<? extends Throwable> throwableType, Throwable throwable)
{
- if (throwableType.isAssignableFrom(throwableType.getClass()))
+ if (throwable == null)
{
- return true;
+ return false;
}
- else if (throwable.getClass().equals(Throwable.class))
+ else if (throwableType.isAssignableFrom(throwable.getClass()))
{
- return false;
+ return true;
}
else
{
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ExpectedException.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ExpectedException.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ExpectedException.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -0,0 +1,34 @@
+package org.jboss.jsr299.tck;
+
+/**
+ * Thrown if an exception was expected, but non occurred
+ *
+ * @author Pete Muir
+ *
+ */
+public class ExpectedException extends RuntimeException
+{
+
+ public ExpectedException()
+ {
+ super();
+ }
+
+ public ExpectedException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public ExpectedException(String message)
+ {
+ super(message);
+ }
+
+ public ExpectedException(Throwable cause)
+ {
+ super(cause);
+ }
+
+
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ExpectedException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ArtifactDescriptor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ArtifactDescriptor.java 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ArtifactDescriptor.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -1,8 +1,5 @@
package org.jboss.jsr299.tck.impl.packaging;
-import static org.jboss.jsr299.tck.impl.packaging.PackagingType.EAR;
-import static org.jboss.jsr299.tck.impl.packaging.PackagingType.UNSPECIFIED;
-import static org.jboss.jsr299.tck.impl.packaging.PackagingType.WAR;
import static org.jboss.jsr299.tck.impl.util.Reflections.loadClass;
import static org.jboss.jsr299.tck.impl.util.Reflections.loadResourceAsStream;
import static org.jboss.jsr299.tck.impl.util.Reflections.loadResources;
@@ -13,22 +10,15 @@
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
-import java.io.FileNotFoundException;
import java.io.FileOutputStream;
-import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
import java.util.Enumeration;
import java.util.HashSet;
-import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.zip.ZipEntry;
@@ -37,9 +27,6 @@
import java.util.zip.ZipOutputStream;
import org.apache.log4j.Logger;
-import org.jboss.jsr299.tck.impl.packaging.jsr299.BeansXml;
-import org.jboss.jsr299.tck.impl.packaging.jsr299.TCKArtifactDescriptor;
-import org.jboss.jsr299.tck.impl.packaging.war.WarArtifactDescriptor;
import org.jboss.jsr299.tck.impl.util.Files;
public class ArtifactDescriptor
@@ -212,204 +199,7 @@
}
}
-
- private static class DeclarativeArtifact
- {
-
- private static final Logger log = Logger.getLogger(DeclarativeArtifact.class);
-
- private final boolean unit;
- private final boolean ejbs;
- private final boolean addDeclaringPackage;
- private final String beansXml;
- private final PackagingType packagingType;
- private final Collection<ResourceDescriptor> resources;
- private final Collection<Class<?>> classes;
- private final Set<ResourceDescriptor> extraLibraries;
- private final Class<? extends Throwable> expectedDeploymentException;
-
- private final Class<?> declaringClass;
- private final boolean standalone;
-
- public DeclarativeArtifact(Class<?> declaringClass, boolean standalone, String extraLibrariesDirectory)
- {
- this.standalone = standalone;
- this.declaringClass = declaringClass;
-
- if (declaringClass.isAnnotationPresent(Artifact.class))
- {
- this.addDeclaringPackage = declaringClass.getAnnotation(Artifact.class).addCurrentPackage();
- this.ejbs = false;
- }
- else if (declaringClass.isAnnotationPresent(EjbArtifact.class))
- {
- this.addDeclaringPackage = declaringClass.getAnnotation(EjbArtifact.class).addCurrentPackage();
- this.ejbs = true;
- }
- else
- {
- throw new IllegalStateException("Unable to find @Artifact on " + declaringClass);
- }
-
- if (declaringClass.isAnnotationPresent(BeansXml.class))
- {
- this.beansXml = asAbsolutePath(declaringClass.getAnnotation(BeansXml.class).value());
- }
- else
- {
- this.beansXml = null;
- }
-
- if (declaringClass.isAnnotationPresent(Packaging.class))
- {
- this.packagingType = declaringClass.getAnnotation(Packaging.class).value();
- }
- else
- {
- this.packagingType = UNSPECIFIED;
- }
-
- if (declaringClass.isAnnotationPresent(IntegrationTest.class))
- {
- this.unit = false;
- }
- else
- {
- this.unit = true;
- }
-
- if (unit && (packagingType.equals(WAR) || packagingType.equals(EAR)))
- {
- throw new IllegalArgumentException("Cannot specify @Packaging(WAR) or @Packaging(EAR) if @Integration test is not present");
- }
-
- if (declaringClass.isAnnotationPresent(Resources.class))
- {
- this.resources = asResourceDescriptors(declaringClass.getAnnotation(Resources.class).value());
- }
- else
- {
- this.resources = Collections.emptyList();
- }
-
- if (declaringClass.isAnnotationPresent(Classes.class))
- {
- this.classes = Arrays.asList(declaringClass.getAnnotation(Classes.class).value());
- }
- else
- {
- this.classes = Collections.emptyList();
- }
- if (declaringClass.isAnnotationPresent(ExpectedDeploymentExceptions.class))
- {
- this.expectedDeploymentException = declaringClass.getAnnotation(ExpectedDeploymentExceptions.class).value();
- }
- else
- {
- this.expectedDeploymentException = null;
- }
- if (extraLibrariesDirectory != null)
- {
- File directory = new File(extraLibrariesDirectory);
- this.extraLibraries = new HashSet<ResourceDescriptor>();
- if (directory.isDirectory())
- {
- for (File file : directory.listFiles(new FilenameFilter()
- {
-
- public boolean accept(File dir, String name)
- {
- return name.endsWith(".jar");
- }
-
- }))
- {
- try
- {
- this.extraLibraries.add(new ResourceDescriptor(file.getName(), new FileInputStream(file)));
- }
- catch (FileNotFoundException e)
- {
- log.warn("Unable to load extra library", e);
- }
- }
- }
- }
- else
- {
- this.extraLibraries = Collections.emptySet();
- }
- }
-
- public TCKArtifactDescriptor createArtifact()
- {
- final TCKArtifactDescriptor artifact = newArtifact(packagingType, declaringClass, beansXml, standalone, ejbs, addDeclaringPackage);
- artifact.setEjbs(ejbs);
- artifact.setUnit(unit);
- artifact.setExpectedDeploymentException(expectedDeploymentException);
- artifact.getClasses().addAll(classes);
- artifact.getResources().addAll(resources);
- artifact.getLibraries().addAll(extraLibraries);
- return artifact;
- }
-
- private Collection<ResourceDescriptor> asResourceDescriptors(Resource[] resources)
- {
- List<ResourceDescriptor> resourceDescriptors = new ArrayList<ResourceDescriptor>();
- for (Resource resource : resources)
- {
- resourceDescriptors.add(new ResourceDescriptor(resource.destination(), asAbsolutePath(resource.source())));
- }
- return resourceDescriptors;
- }
-
- private String asAbsolutePath(String path)
- {
- if (path.startsWith("/"))
- {
- return path.substring(1);
- }
- else
- {
- return declaringClass.getPackage().getName().replace(".", "/") + "/" + path;
- }
- }
-
- public static TCKArtifactDescriptor newArtifact(PackagingType packagingType, Class<?> declaringClass, String beansXml, boolean standalone, boolean ejbs, boolean addDeclaringPackage)
- {
- TCKArtifactDescriptor artifact;
- if (packagingType.equals(WAR))
- {
- artifact = new WarArtifactDescriptor(declaringClass, beansXml);
- }
- else if (packagingType.equals(EAR))
- {
- throw new UnsupportedOperationException();
- }
- else if (!standalone && ejbs)
- {
- throw new UnsupportedOperationException();
- }
- else if (!standalone)
- {
- artifact = new WarArtifactDescriptor(declaringClass, beansXml);
- }
- else
- {
- artifact = new TCKArtifactDescriptor(declaringClass, beansXml);
- }
-
- if (addDeclaringPackage)
- {
- artifact.addPackage(declaringClass.getPackage());
- }
- return artifact;
- }
-
- }
-
-
public static final Random random = new Random(System.currentTimeMillis());
private final Set<Class<?>> classes;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ArtifactGenerator.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ArtifactGenerator.java 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ArtifactGenerator.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -38,8 +38,10 @@
private final PackagingType packagingType;
private final Collection<ResourceDescriptor> resources;
private final Collection<Class<?>> classes;
+ private final Class<? extends Throwable> expectedDeploymentException;
private final Set<ResourceDescriptor> extraLibraries;
+
private final Class<?> declaringClass;
private final boolean standalone;
@@ -112,6 +114,14 @@
{
this.classes = Collections.emptyList();
}
+ if (declaringClass.isAnnotationPresent(ExpectedDeploymentException.class))
+ {
+ this.expectedDeploymentException = declaringClass.getAnnotation(ExpectedDeploymentException.class).value();
+ }
+ else
+ {
+ this.expectedDeploymentException = null;
+ }
if (extraLibrariesDirectory != null)
{
File directory = new File(extraLibrariesDirectory);
@@ -150,6 +160,7 @@
final TCKArtifactDescriptor artifact = newArtifact(packagingType, declaringClass, beansXml, standalone, ejbs, addDeclaringPackage);
artifact.setEjbs(ejbs);
artifact.setUnit(unit);
+ artifact.setExpectedDeploymentException(expectedDeploymentException);
artifact.getClasses().addAll(classes);
artifact.getResources().addAll(resources);
artifact.getLibraries().addAll(extraLibraries);
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ExpectedDeploymentException.java (from rev 1511, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ExpectedDeploymentExceptions.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ExpectedDeploymentException.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ExpectedDeploymentException.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -0,0 +1,25 @@
+package org.jboss.jsr299.tck.impl.packaging;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Mark this artifact as expecting to fail a deployment with the given exception
+ * or some subtype of it.
+ *
+ * @author Pete Muir
+ *
+ */
+ at Documented
+ at Retention(RUNTIME)
+ at Target(TYPE)
+public @interface ExpectedDeploymentException
+{
+
+ Class<? extends Throwable> value();
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ExpectedDeploymentException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ExpectedDeploymentExceptions.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ExpectedDeploymentExceptions.java 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/ExpectedDeploymentExceptions.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -1,25 +0,0 @@
-package org.jboss.jsr299.tck.impl.packaging;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Mark this artifact as expecting to fail a deployment with the given exception
- * or some subtype of it.
- *
- * @author Pete Muir
- *
- */
- at Documented
- at Retention(RUNTIME)
- at Target(TYPE)
-public @interface ExpectedDeploymentExceptions
-{
-
- Class<? extends Throwable> value();
-
-}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/DisableIntegrationTestsMethodSelector.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/DisableIntegrationTestsMethodSelector.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/DisableIntegrationTestsMethodSelector.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -0,0 +1,31 @@
+package org.jboss.jsr299.tck.impl.testng;
+
+import java.util.List;
+
+import org.jboss.jsr299.tck.impl.ConfigurationImpl;
+import org.jboss.jsr299.tck.impl.packaging.IntegrationTest;
+import org.testng.IMethodSelector;
+import org.testng.IMethodSelectorContext;
+import org.testng.ITestNGMethod;
+
+public class DisableIntegrationTestsMethodSelector implements IMethodSelector
+{
+
+ public boolean includeMethod(IMethodSelectorContext context, ITestNGMethod method, boolean isTestMethod)
+ {
+ if (!ConfigurationImpl.get().isRunIntegrationTests() && method.getMethod().getDeclaringClass().isAnnotationPresent(IntegrationTest.class))
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+
+ public void setTestMethods(List<ITestNGMethod> testMethods)
+ {
+
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/DisableIntegrationTestsMethodSelector.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/ForwardingITestNGMethod.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/ForwardingITestNGMethod.java 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/ForwardingITestNGMethod.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -1,277 +0,0 @@
-package org.jboss.jsr299.tck.impl.testng;
-
-import java.lang.reflect.Method;
-
-import org.testng.IClass;
-import org.testng.IRetryAnalyzer;
-import org.testng.ITestClass;
-import org.testng.ITestNGMethod;
-
-public abstract class ForwardingITestNGMethod implements ITestNGMethod
-{
-
- private static final long serialVersionUID = 2534386487509877598L;
-
- protected abstract ITestNGMethod delegate();
-
- @Override
- public ITestNGMethod clone()
- {
- return delegate().clone();
- }
-
- public void addMethodDependedUpon(String methodName)
- {
- delegate().addMethodDependedUpon(methodName);
- }
-
- public boolean canRunFromClass(IClass testClass)
- {
- return delegate().canRunFromClass(testClass);
- }
-
- public String[] getAfterGroups()
- {
- return delegate().getAfterGroups();
- }
-
- public String[] getBeforeGroups()
- {
- return delegate().getBeforeGroups();
- }
-
- public int getCurrentInvocationCount()
- {
- return delegate().getCurrentInvocationCount();
- }
-
- public long getDate()
- {
- return delegate().getDate();
- }
-
- public String getDescription()
- {
- return delegate().getDescription();
- }
-
- public String[] getGroups()
- {
- return delegate().getGroups();
- }
-
- public String[] getGroupsDependedUpon()
- {
- return delegate().getGroupsDependedUpon();
- }
-
- public String getId()
- {
- return delegate().getId();
- }
-
- public long[] getInstanceHashCodes()
- {
- return delegate().getInstanceHashCodes();
- }
-
- public Object[] getInstances()
- {
- return delegate().getInstances();
- }
-
- public int getInvocationCount()
- {
- return delegate().getInvocationCount();
- }
-
- public Method getMethod()
- {
- return delegate().getMethod();
- }
-
- public String getMethodName()
- {
- return delegate().getMethodName();
- }
-
- public String[] getMethodsDependedUpon()
- {
- return delegate().getMethodsDependedUpon();
- }
-
- public String getMissingGroup()
- {
- return delegate().getMissingGroup();
- }
-
- public int getParameterInvocationCount()
- {
- return delegate().getParameterInvocationCount();
- }
-
- @SuppressWarnings("unchecked")
- public Class getRealClass()
- {
- return delegate().getRealClass();
- }
-
- public IRetryAnalyzer getRetryAnalyzer()
- {
- return delegate().getRetryAnalyzer();
- }
-
- public int getSuccessPercentage()
- {
- return delegate().getSuccessPercentage();
- }
-
- public ITestClass getTestClass()
- {
- return delegate().getTestClass();
- }
-
- public int getThreadPoolSize()
- {
- return delegate().getThreadPoolSize();
- }
-
- public long getTimeOut()
- {
- return delegate().getTimeOut();
- }
-
- public void incrementCurrentInvocationCount()
- {
- delegate().incrementCurrentInvocationCount();
- }
-
- public boolean isAfterClassConfiguration()
- {
- return delegate().isAfterClassConfiguration();
- }
-
- public boolean isAfterGroupsConfiguration()
- {
- return delegate().isAfterGroupsConfiguration();
- }
-
- public boolean isAfterMethodConfiguration()
- {
- return delegate().isAfterMethodConfiguration();
- }
-
- public boolean isAfterSuiteConfiguration()
- {
- return delegate().isAfterSuiteConfiguration();
- }
-
- public boolean isAfterTestConfiguration()
- {
- return delegate().isAfterTestConfiguration();
- }
-
- public boolean isAlwaysRun()
- {
- return delegate().isAlwaysRun();
- }
-
- public boolean isBeforeClassConfiguration()
- {
- return delegate().isBeforeClassConfiguration();
- }
-
- public boolean isBeforeGroupsConfiguration()
- {
- return delegate().isBeforeGroupsConfiguration();
- }
-
- public boolean isBeforeMethodConfiguration()
- {
- return delegate().isBeforeMethodConfiguration();
- }
-
- public boolean isBeforeSuiteConfiguration()
- {
- return delegate().isBeforeSuiteConfiguration();
- }
-
- public boolean isBeforeTestConfiguration()
- {
- return delegate().isBeforeTestConfiguration();
- }
-
- public boolean isTest()
- {
- return delegate().isTest();
- }
-
- public void setDate(long date)
- {
- delegate().setDate(date);
- }
-
- public void setId(String id)
- {
- delegate().setId(id);
- }
-
- public void setInvocationCount(int count)
- {
- delegate().setInvocationCount(count);
- }
-
- public void setMissingGroup(String group)
- {
- delegate().setMissingGroup(group);
- }
-
- public void setParameterInvocationCount(int n)
- {
- delegate().setParameterInvocationCount(n);
- }
-
- public void setRetryAnalyzer(IRetryAnalyzer retryAnalyzer)
- {
- delegate().setRetryAnalyzer(retryAnalyzer);
- }
-
- public void setSkipFailedInvocations(boolean skip)
- {
- delegate().setSkipFailedInvocations(skip);
- }
-
- public void setTestClass(ITestClass cls)
- {
- delegate().setTestClass(cls);
- }
-
- public void setThreadPoolSize(int threadPoolSize)
- {
- delegate().setThreadPoolSize(threadPoolSize);
- }
-
- public boolean skipFailedInvocations()
- {
- return delegate().skipFailedInvocations();
- }
-
- @SuppressWarnings("unchecked")
- public int compareTo(Object arg0)
- {
- return delegate().compareTo(arg0);
- }
-
- @Override
- public boolean equals(Object obj)
- {
- return delegate().equals(obj);
- }
-
- @Override
- public int hashCode()
- {
- return delegate().hashCode();
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/ForwardingITestResult.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/ForwardingITestResult.java 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/ForwardingITestResult.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -1,82 +0,0 @@
-package org.jboss.jsr299.tck.impl.testng;
-
-import org.testng.IClass;
-import org.testng.ITestNGMethod;
-import org.testng.ITestResult;
-
-public abstract class ForwardingITestResult implements ITestResult
-{
-
- protected abstract ITestResult delegate();
-
- public long getEndMillis()
- {
- return delegate().getEndMillis();
- }
-
- public String getHost()
- {
- return delegate().getHost();
- }
-
- public ITestNGMethod getMethod()
- {
- return new SaneITestNGMethod(delegate().getMethod());
- }
-
- public String getName()
- {
- return delegate().getName();
- }
-
- public Object[] getParameters()
- {
- return delegate().getParameters();
- }
-
- public long getStartMillis()
- {
- return delegate().getStartMillis();
- }
-
- public int getStatus()
- {
- return delegate().getStatus();
- }
-
- public IClass getTestClass()
- {
- return delegate().getTestClass();
- }
-
- public Throwable getThrowable()
- {
- return delegate().getThrowable();
- }
-
- public boolean isSuccess()
- {
- return delegate().isSuccess();
- }
-
- public void setEndMillis(long millis)
- {
- delegate().setEndMillis(millis);
- }
-
- public void setParameters(Object[] parameters)
- {
- delegate().setParameters(parameters);
- }
-
- public void setStatus(int status)
- {
- delegate().setStatus(status);
- }
-
- public void setThrowable(Throwable throwable)
- {
- delegate().setThrowable(throwable);
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/SaneITestNGMethod.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/SaneITestNGMethod.java 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/testng/SaneITestNGMethod.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -1,49 +0,0 @@
-/**
- *
- */
-package org.jboss.jsr299.tck.impl.testng;
-
-import org.testng.ITestNGMethod;
-
-public class SaneITestNGMethod extends ForwardingITestNGMethod
-{
- private final ITestNGMethod method;
-
- public SaneITestNGMethod(ITestNGMethod method)
- {
- this.method = method;
- }
-
- @Override
- protected ITestNGMethod delegate()
- {
- return method;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (obj instanceof ITestNGMethod && method != null)
- {
- ITestNGMethod other = (ITestNGMethod) method;
- return method.getMethodName().equals(other.getMethodName()) && method.getTestClass().equals(other.getTestClass());
- }
- else
- {
- return false;
- }
- }
-
- @Override
- public int hashCode()
- {
- if (method != null && method.getMethodName() != null)
- {
- return method.getMethodName().hashCode();
- }
- else
- {
- return 0;
- }
- }
-}
\ No newline at end of file
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/broken/BrokenDeploymentTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/broken/BrokenDeploymentTypeTest.java 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/broken/BrokenDeploymentTypeTest.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -2,14 +2,15 @@
import javax.inject.DeploymentException;
+import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractDeclarativeTest;
-import org.hibernate.tck.annotations.SpecAssertion;
import org.testng.annotations.Test;
/**
*
* Spec version: PRD2
*/
+ at Test(alwaysRun=true)
public class BrokenDeploymentTypeTest extends AbstractDeclarativeTest
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/broken/tooMany/TooManyDeploymentTypesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/broken/tooMany/TooManyDeploymentTypesTest.java 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/deployment/broken/tooMany/TooManyDeploymentTypesTest.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -22,14 +22,14 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractDeclarativeTest;
import org.jboss.jsr299.tck.impl.packaging.Artifact;
-import org.jboss.jsr299.tck.impl.packaging.ExpectedDeploymentExceptions;
+import org.jboss.jsr299.tck.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
/**
* Single test for a bean with too many deployment types.
*/
@Artifact
- at ExpectedDeploymentExceptions(DefinitionException.class)
+ at ExpectedDeploymentException(DefinitionException.class)
public class TooManyDeploymentTypesTest extends AbstractDeclarativeTest
{
/**
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/simple/SimpleBeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/simple/SimpleBeanDefinitionTest.java 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/simple/SimpleBeanDefinitionTest.java 2009-02-14 23:19:09 UTC (rev 1514)
@@ -6,8 +6,8 @@
import javax.inject.DefinitionException;
import javax.inject.manager.Bean;
+import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractDeclarativeTest;
-import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.impl.util.MockCreationalContext;
import org.jboss.jsr299.tck.unit.implementation.simple.OuterBean_Broken.InnerBean_Broken;
import org.jboss.jsr299.tck.unit.implementation.simple.OuterBean_Broken.StaticInnerBean_Broken;
Copied: tck/trunk/impl/src/main/resources/tck-audit.xml (from rev 1513, tck/trunk/impl/tck-audit.xml)
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-02-14 23:19:09 UTC (rev 1514)
@@ -0,0 +1,1654 @@
+<specification xmlns="http://jboss.com/products/webbeans/tck/audit"
+ name="JSR-299: Java Contexts and Dependency Injection"
+ version="Revised Public Review Draft">
+
+ <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="f">
+ <text>A bean comprises of a set of interceptor bindings</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="b">
+ <text>A bean type may be a parameterized type with an actual type parameter. For the purposes of the typesafe resolution algorithm defined in Section 5.9, "Typesafe resolution algorithm", parameterized bean types are considered identical by the container only if both the type and the type parameters (if any) are identical</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Bean types may not declare a type variable or wildcard. If the type of an injection point is a parameterized type with a type variable or wildcard, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A bean type may be an interface</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A bean type may be a concrete class</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A bean type may be an abstract class</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A bean type may be declared final</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>A bean type may have final methods</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 types. Primitive types are considered to be identical to their corresponding wrapper types in java.lang.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>All beans have the bean type java.lang.Object</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>A client of a bean may typecast its reference to any instance of the bean to any bean type of the bean</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.3.1" title="Default binding type">
+
+ <assertion id="a">
+ <text>If a bean does not explicitly declare a binding, the bean has exactly one binding, of type @javax.inject.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="a">
+ <text>A binding type is a Java annotation defined as @Target({METHOD, FIELD, PARAMETER, TYPE}) and @Retention(RUNTIME).</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A binding type may be declared by specifying the @javax.inject.BindingType meta-annotation</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The @BindingType meta-annotation may be omitted, and the binding type may be declared in beans.xml</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A binding type may define annotation members</text>
+ </assertion>
+ </section>
+
+ <section id="2.3.3" title="Declaring the bindings of a bean using annotations">
+
+ <assertion id="a">
+ <text>A bean's bindings are declared by annotating the bean class or producer method or field with the binding types</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Any bean may declare multiple binding types</text>
+ </assertion>
+ </section>
+
+ <section id="2.3.4" title="Declaring the bindings of a bean using XML">
+
+ <assertion id="a">
+ <text>If a bean is declared in beans.xml, bindings may be specified using the binding type names</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.3.5" 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>
+
+ <assertion id="c">
+ <text>For a bean defined in XML, the bindings of a field may be specified using XML</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When the bindings of a field are specified using XML, any binding annotations of the field are ignored</text>
+ </assertion>
+ </section>
+
+ <section id="2.3.6" title="Specifying bindings of a method or constructor parameter">
+ <assertion id="a">
+ <text>Binding types may be applied to parameters of producer methods, initializer methods, disposal methods or 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>
+
+ <assertion id="b">
+ <text>For a bean defined in XML, the bindings of a method parameter may be specified using XML</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>When the bindings of a parameter are specified using XML, any binding annotations of the parameter are ignored</text>
+ </assertion>
+ </section>
+
+ <section id="2.4" title="Scopes">
+
+ <assertion id="a">
+ <text>All beans have a scope</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A scope type is represented by an annotation type.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The set of scope types is extensible</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.5.1" title="Built-in deployment types">
+
+ <assertion id="a">
+ <text>All standard beans defined by this specification, and provided by the container, are defined using the @Standard deployment type</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>No bean may be declared with the @Standard deployment type unless explicitly required by this specification</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Application beans may be defined using the @Production deployment type</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="b">
+ <text>A deployment type is a Java annotation defined with @Retention(RUNTIME)</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>All deployment types must also specify the @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 using annotations">
+
+ <assertion id="a">
+ <text>The deployment type of the bean is declared by annotating the bean class or producer method or field</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An bean class or producer method or field may specify at most one deployment type. If multiple deployment type annotations are specified, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>By default, if no deployment type annotation is explicitly specified, a producer method or field inherits the deployment type of the bean in which it is defined.</text>
+ </assertion>
+
+ <assertion id="d">
+ <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="Declaring the deployment type of a bean using XML">
+ <assertion id="a">
+ <text>When a bean is declared in beans.xml, the deployment type may be specified using a tag with the annotation type name</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If more than one deployment type is specified in XML, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A deployment type may be specified using a stereotype declared in XML, as defined in Section 2.7.3, "Declaring the stereotypes for a bean using XML".</text>
+ </assertion>
+ </section>
+
+ <section id="2.5.5" title="Default deployment type">
+
+ <assertion id="a">
+ <text>The default deployment type for a bean which does not explicitly declare a deployment type depends upon its declared stereotypes - if a bean does not declare any stereotype with a declared default deployment type, then the default deployment type is
+ at 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>
+ <note>This assertion relates to assertion 2.5.5.b</note>
+ </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.6" 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>
+
+ </section>
+
+ <section id="2.6" title="Bean names">
+
+ <assertion id="a">
+ <text>A valid bean name is a period-separated list of valid EL identifiers</text>
+ </assertion>
+ </section>
+
+ <section id="2.6.1" title="Declaring the bean name using annotations">
+
+ <assertion id="a">
+ <text>To specify the name of a bean, the @javax.annotation.Named annotation is applied to the bean class or producer method or field.</text>
+ </assertion>
+
+ <assertion id="b">
+ <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="Declaring the bean name using XML">
+
+ <assertion id="a">
+ <text>If the bean is declared in beans.xml, the name may be specified using <Named></text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the <Named> element is empty, the default name is assumed</text>
+ </assertion>
+ </section>
+
+ <section id="2.6.3" title="Default bean names">
+
+ <assertion id="a">
+ <text>A default name must be assigned by the container when a bean class or producer method or field of a bean defined using annotations declares a @Named annotation and no name is explicitly specified by the value member</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A default name must be assigned by the container when an empty <Named> element is specified by a bean defined in XML</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A default 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 a name.</text>
+ </assertion>
+ </section>
+
+ <section id="2.6.4" title="Beans with no name">
+
+ <assertion id="a">
+ <text>If neither <Named> nor @Named is specified, by the bean or its stereotypes, a bean has no name</text>
+ </assertion>
+ </section>
+
+ <section id="2.7" title="Stereotypes">
+
+ <assertion id="a">
+ <text>A stereotype may also specify that all beans with the stereotype have defaulted bean names</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A bean may declare zero, one or multiple stereotypes</text>
+ </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">
+ <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="Simple beans">
+ <assertion id="a">
+ <text>The bean class of a simple bean may not be a non-static inner class or a parameterized type</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The bean class of a simple bean may not be an abstract class, unless the simple bean is a decorator</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean class of a simple bean is annotated with both the @Interceptor and @Decorator stereotypes, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Multiple simple beans may share the same bean class. This occurs when beans are defined using XML. Only one simple bean per bean class may be defined using annotations.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a simple bean has a public field, it must have scope @Dependent. If a simple bean with a public field declares any scope other than @Dependent, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.2.1" title="Which Java classes are beans?">
+ <assertion id="a">
+ <text>A top-level Java class is not a simple bean if it is a parameterized type</text>
+ </assertion>
+ <assertion id="b">
+ <text>A top-level Java class is not a simple bean if it is a non-static inner class</text>
+ </assertion>
+ <assertion id="c">
+ <text>A top-level Java class is only a simple bean if it is a concrete class, or annotated @Decorator.</text>
+ </assertion>
+ <assertion id="d">
+ <text>A top-level Java class is not a simple bean if it is annotated with the JPA @Entity annotation</text>
+ </assertion>
+ <assertion id="e">
+ <text>A top-level Java class is not a simple bean if it is annotated with any of the EJB component-defining annotations</text>
+ </assertion>
+ <assertion id="f">
+ <text>A top-level Java class is not a simple bean if it implements the javax.servlet.Servlet interface</text>
+ </assertion>
+ <assertion id="g">
+ <text>A top-level Java class is not a simple bean if it implements the javax.servlet.Filter interface</text>
+ </assertion>
+ <assertion id="h">
+ <text>A top-level Java class is not a simple bean if it implements the javax.servlet.ServletContextListener interface</text>
+ </assertion>
+ <assertion id="i">
+ <text>A top-level Java class is not a simple bean if it implements the javax.servlet.http.HttpSessionListener interface</text>
+ </assertion>
+ <assertion id="j">
+ <text>A top-level Java class is not a simple bean if it implements the javax.servlet.ServletRequestListener interface</text>
+ </assertion>
+ <assertion id="k">
+ <text>A top-level Java class is not a simple bean if it implements the javax.ejb.EnterpriseBean interface</text>
+ </assertion>
+ <assertion id="l">
+ <text>A top-level Java class is not a simple bean if it extends javax.faces.component.UIComponent</text>
+ </assertion>
+ <assertion id="m">
+ <text>A top-level Java class is not a simple bean if it is declared as an EJB bean class in ejb-jar.xml</text>
+ </assertion>
+ <assertion id="n">
+ <text>A top-level Java class is not a simple bean if it is declared as a JPA entity in orm.xml</text>
+ </assertion>
+ <assertion id="o">
+ <text>A top-level Java class is only a simple bean if it has an appropriate constructor - either a constructor with no parameters, or declares a constructor annotated @Initializer</text>
+ </assertion>
+ <assertion id="p">
+ <text>Additional simple beans with the same bean class may be defined using XML, by specifying the class in beans.xml.</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.2.2" title="Bean types of a simple 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 simple bean using annotations">
+ <assertion id="a">
+ <text>A simple bean with a constructor that takes no parameters does not require any special annotations</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A bean class may also specify a scope, name, deployment type, stereotypes and/or bindings</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A simple bean may extend another simple bean</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.4" title="Declaring a simple bean using XML">
+ <assertion id="a">
+ <text>Simple beans may be declared in beans.xml using the bean class name</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A simple bean may even be declared at any injection point declared in XML, as defined in Section 9.9, "Inline bean declarations", in which case no bindings are specified.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean class of a simple bean defined in XML is a parameterized type or a non-static inner class, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the bean class of a simple bean defined in XML is an abstract class, and the simple bean is not a decorator, a DefinitionException
+is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the bean class of a simple bean defined in XML is annotated @Interceptor, then the bean must be explicitly declared as an interceptor in XML, as defined in Section A.3.5.2, "Declaring an interceptor using XML". If a simple bean defined in XML has a bean class annotated @Interceptor and is not declared as an interceptor in XML, a DefinitionException is
+thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the bean class of a simple bean defined in XML is annotated @Interceptor, then the bean must be explicitly declared as an interceptor in XML, as defined in Section A.3.5.2, "Declaring an interceptor using XML". If a simple bean defined in XML has a bean class annotated @Interceptor and is not declared as an interceptor in XML, a DefinitionException is
+thrown by the container at deployment time.</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.5" title="Simple beans with the @New binding">
+ <assertion id="a">
+ <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such simple bean, a second simple bean exists which has the same bean class</text>
+ </assertion>
+ <assertion id="b">
+ <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such simple bean, a second simple bean exists which has the same bean constructor, initializer methods and injected fields defined by annotations</text>
+ </assertion>
+ <assertion id="c">
+ <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such simple bean, a second simple bean exists which has the same interceptor bindings defined by annotations</text>
+ </assertion>
+ <assertion id="d">
+ <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such simple bean, a second simple bean exists which has scope @Dependent</text>
+ </assertion>
+ <assertion id="e">
+ <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such simple bean, a second simple bean exists which has deployment type @Standard</text>
+ </assertion>
+ <assertion id="f">
+ <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such simple bean, a second simple bean exists which has @javax.inject.New as the only binding</text>
+ </assertion>
+ <assertion id="g">
+ <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such simple bean, a second simple bean exists which has no bean name</text>
+ </assertion>
+ <assertion id="h">
+ <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such simple bean, a second simple bean exists which has no stereotypes</text>
+ </assertion>
+ <assertion id="i">
+ <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such simple bean, a second simple bean exists which has no observer methods, producer methods or fields or disposal methods</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.6" title="Bean constructors">
+ <assertion id="a">
+ <text>When the container instantiates a simple bean, it calls the bean constructor. The bean constructor is a constructor of the bean class</text>
+ </assertion>
+ <assertion id="b">
+ <text>The application may call bean constructors directly. However, if the application directly instantiates the bean, no parameters are passed to the constructor by the container; the returned object is not bound to any context; no dependencies are injected by the container; and the lifecycle of the new instance is not managed by the container</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.6.1" title="Declaring a bean constructor using annotations">
+ <assertion id="a">
+ <text>The bean constructor may be identified by annotating the constructor @Initializer</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If a simple bean defined using annotations does not explicitly declare a constructor using @Initializer, the constructor that accepts no parameters is the bean constructor</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a simple bean defined using annotations has more than one constructor annotated @Initializer, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a bean constructor has a parameter annotated @Disposes, or @Observes, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.2.6.2" title="Declaring a bean constructor using XML">
+
+ <assertion id="a">
+ <text>For a simple bean defined using XML, the bean constructor may be specified by listing the parameter types of the constructer, in order, as direct children of the element that declares the bean</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If a simple bean defined using XML does not explicitly declare constructor parameters in XML, the constructor that accepts no parameters is the bean constructor</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a simple bean declared in XML does not have a constructor with the parameter types declared in XML, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When a bean constructor is declared in XML, the container ignores binding annotations applied to Java constructor parameters</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.2.6.3" title="Bean constructor parameters">
+ <assertion id="a">
+ <text>If the bean constructor has parameters, the container calls the method Manager.getInstanceToInject() defined in Section 5.7.1, "Resolving dependencies" to determine a value for each parameter and calls the constructor with those parameter values.</text>
+ </assertion>
+ </section>
+
+ <section id="3.2.7" title="Specializing a simple bean">
+ <assertion id="a">
+ <text>If a bean class of a simple bean X defined using annotations is annotated @Specializes, then the bean class of X must directly extend the bean class of another simple bean Y defined using annotations. Then X inherits all bindings of Y, and if Y has a name, X has the same name as Y.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>We say that X directly specializes Y, and we can be certain that Y will never be instantiated or called by the container if X is enabled.</text>
+ <note>This assertion relates to specialized beans declared using annotations</note>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean class of X does not directly extend the bean class of another simple bean, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a simple bean X defined in XML declares the <Specializes> element, then the bean class of X must be the bean class of another simple bean Y defined using annotations. Then X inherits all bindings of Y, and if Y has a name, X has the same name as Y</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>We say that X directly specializes Y, and we can be certain that Y will never be instantiated or called by the container if X is enabled</text>
+ <note>This assertion relates to specialized beans declared in XML</note>
+ </assertion>
+ </section>
+
+ <section id="3.2.8" title="Default name for a simple bean">
+ <assertion id="a">
+ <text>The default name for a simple 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="a">
+ <text>A session bean is a bean that is implemented by an EJB 3-style session bean</text>
+ </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="d">
+ <text>If a session bean specifies an illegal scope, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Note that multiple session beans may share the same bean class. This occurs when beans are defined using XML</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the bean class of a session bean is annotated @Interceptor or @Decorator, a DefinitionException is thrown by the container at deployment time</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="d">
+ <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. Furthermore, the container ignores the instance instead of destroying it when Bean.destroy() is called, as defined in Section 6.5, "Lifecycle of stateful session beans"</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.3.2" title="Which EJBs are beans?">
+ <assertion id="a">
+ <text>All session beans exposing an EJB 3.x client view and declared via an EJB component defining annotation on the EJB bean class are beans, and thus no special declaration is required. Additional beans for these EJBs may be defined using XML, by specifying the bean class in beans.xml</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>All session beans exposing an EJB 3.x client view and declared in ejb-jar.xml are also beans. Additional beans for these EJBs may be defined using XML, by specifying the bean class and EJB name in beans.xml</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.3" title="Bean types of a session bean">
+
+ <assertion id="a">
+ <text>The set of bean types for a session bean contains all local interfaces of the bean that do not have wildcard type parameters or type variables and their superinterfaces.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the EJB has a bean class local view and the bean class is not a parameterized
+type, 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.4" title="Declaring a session bean using annotations">
+ <assertion id="a">
+ <text>A session bean does not require any special annotations</text>
+ </assertion>
+
+ <assertion id="b">
+ <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.5" title="Declaring a session bean using XML">
+ <assertion id="a">
+ <text>Session beans may be declared in beans.xml using the bean class name (for EJBs defined using a component-defining annotation) or bean class and EJB name (for EJBs defined in ejb-jar.xml)</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The ejbName attribute declares the EJB name of an EJB defined in ejb-jar.xml</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If an entity or message-driven bean class is declared in XML, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.6" title="Session beans with the @New binding">
+
+ <assertion id="a">
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such session bean, a second bean exists which has the same bean class</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such session bean, a second bean exists which has the initializer methods and injected fields defined by annotations</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such session bean, a second bean exists which has the same interceptor bindings defined by annotations</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such session bean, a second bean exists which has scope @Dependent,</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such session bean, a second bean exists which has deployment type @Standard</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such session bean, a second bean exists which has @javax.inject.New as the only binding</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such session bean, a second bean exists which has no bean name</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such session bean, a second bean exists which has no stereotypes</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
+Additionally, for each such session bean, a second bean exists which has no observer methods, producer methods or fields or disposal methods</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.7" title="Specializing a session bean">
+
+ <assertion id="a">
+ <text>If a bean class of a session bean X defined using annotations is annotated @Specializes, then the bean class of X must directly extend the bean class of another session bean Y defined using annotations. Then X inherits all bindings of Y, and if Y has a name, X has the same name as Y. Also, X must support all local interfaces supported by Y, and
+if Y supports a bean-class local view, X must also support a bean-class local view.
+Otherwise, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>We say that X directly specializes Y, and we can be certain that Y will never be instantiated or called by the container if X is enabled</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean class of X does not directly extend the bean class of another session bean, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a session bean X defined in XML declares the <Specializes> element, then the bean class of X must be the bean class of another session bean Y defined using annotations. Then X inherits all bindings of Y, and if Y has a name, X has the same name as Y.</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.8" title="Default name for a session bean">
+ <assertion id="a">
+ <text>The default name for a session 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.9" title="Session bean proxies">
+ <assertion id="a">
+ <text>EJB local object references do not implement all local interfaces of the EJB. A local object reference may not be typecast to different local interface type, as required by Section 2.2, "Bean types". Therefore, the container proxies the local object reference. A session bean proxy implements all local interfaces of the EJB.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>All session bean proxies must be serializable</text>
+ </assertion>
+ </section>
+
+ <section id="3.4" title="Producer methods">
+ <assertion id="a">
+ <text>A producer method must be a method of a simple bean class or session bean class</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A producer method may be either static or non-static</text>
+ </assertion>
+
+ <assertion id="c">
+ <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="d">
+ <text>If a producer method sometimes returns a null value, then the producer method must have scope @Dependent</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a producer method returns a null value at runtime, and the producer method 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.4, "Client proxies".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the producer method return type is a parameterized type, it must specify actual type parameters for each type parameter</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If a producer method return type contains a wildcard type parameter or type variable, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="h">
+ <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="i">
+ <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 using annotations">
+
+ <assertion id="a">
+ <text>A producer method may be declared by annotating a method with the @javax.inject.Produces annotation</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A producer method may also specify scope, name, deployment type, stereotypes and/or bindings</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a producer method is annotated @Initializer, has a parameter annotated @Disposes, or has a parameter annotated @Observes, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a non-static method of a session bean class is annotated @Produces, and the method is not a business method of the EJB, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.3" title="Declaring a producer method using XML">
+
+ <assertion id="a">
+ <text>For a bean defined in XML, a producer method may be declared using the method name, the <Produces> element, the return type, and the parameter types of the method</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When a producer method is declared in XML, the container ignores binding annotations applied to the Java method or method parameters</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean class of a bean declared in XML does not have a method with the name and parameter types declared in XML, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.4" title="Producer method parameters">
+ <assertion id="a">
+ <text>If the producer method has parameters, the container calls the method Manager.getInstanceToInject() defined in Section 5.7.1, "Resolving dependencies" to determine a value for each parameter and calls the producer method with those parameter values</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.5" title="Specializing a producer method">
+
+ <assertion id="a">
+ <text>If a producer method X is annotated @Specializes, then it must be non-static and directly override another producer method Y. Then X inherits all bindings of Y, and if Y has a name, X has the same name as Y.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the method is static or does not directly override another producer method, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.6" title="Disposal methods">
+
+ <assertion id="a">
+ <text>A disposal method must be a method of a simple bean class or session bean class.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A disposal method may be either static or non-static</text>
+ </assertion>
+
+ <assertion id="c">
+ <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="d">
+ <text>A bean may declare multiple disposal methods</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.7" 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="b">
+ <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 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="c">
+ <text>If the disposed parameter does not resolve to any producer method according to the typesafe resolution algorithm, an UnsatisfiedDependencyException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a disposed parameter resolves to a producer method according to the typesafe resolution algorithm, the container must call this method when destroying an instance returned by that producer method</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.8" title="Declaring a disposal method using annotations">
+
+ <assertion id="a">
+ <text>A disposal method may be declared using annotations by annotating a parameter @javax.inject.Disposes. That parameter is the disposed parameter</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If a method has more than one parameter annotated @Disposes, a DefinitionException is thrown by the container</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a disposal method is annotated @Produces, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a disposal method is annotated @Initializer, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a disposal method has a parameter annotated @Observes, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="f">
+ <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 EJB, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.9" title="Declaring a disposal method using XML">
+
+ <assertion id="a">
+ <text>For a bean defined in XML, a disposal method may be declared using the method name, the <Disposes> element, and the parameter types of the method</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When a disposal method is declared in XML, the container ignores binding annotations applied to the Java method parameter</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean class of a bean declared in XML does not have a method with the name and parameter types declared in XML, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.10" 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. The container calls Manager.getInstanceToInject() to determine a value for each parameter of a disposal method and calls the disposal method with those parameter values</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.11" title="Disposal method resolution">
+
+ <assertion id="a">
+ <text>When searching for disposal methods for a producer method, the container searches for disposal methods which are declared by an enabled bean, and for which the disposed parameter must resolve to the producer method, according to the typesafe resolution algorithm</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If there are multiple disposal methods for a producer method, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.12" 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 simple bean class or session bean class</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A producer field may be either static or nonstatic</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a producer field sometimes contains a null value when accessed, then the producer field must have scope @Dependent</text>
+ </assertion>
+
+ <assertion id="d">
+ <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.4, "Client proxies"</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the producer field return type is a parameterized type, it must specify actual type parameters for each type parameter</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If a producer field return type contains a wildcard type parameter or type variable, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="g">
+ <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>
+ </assertion>
+
+ <assertion id="h">
+ <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 @javax.inject.Produces annotation</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A producer field may also specify scope, name, deployment type, stereotypes and/or bindings</text>
+ </assertion>
+ </section>
+
+ <section id="3.5.3" title="Declaring a producer field using XML">
+
+ <assertion id="a">
+ <text>For a bean defined in XML, a producer field may be declared using the field name, the <Produces> element, and the type</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When a producer field is declared in XML, the container ignores binding annotations applied to the Java field</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean class of a bean declared in XML does not have a field with the name and type declared in XML, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.5.4" 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="a">
+ <text>Resources may be declared in beans.xml, allowing direct injection of an EE resource, entity manager, entity manager factory, EJB remote object or web service reference</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The lifecycle of an injected reference is identical to the semantics of Java EE injection using @Resource, @PersistenceContext, @PersistenceUnit, @EJB or @WebServiceRef</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A resource always has scope @Dependent</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Resources are always declared using XML</text>
+ </assertion>
+ </section>
+
+ <section id="3.6.1" title="Declaring a resource using XML">
+
+ <assertion id="a">
+ <text>A resource may be declared in beans.xml using an element that represents the Java type of the resource. For a Java EE resource, the EE resource type must be specified - for example javax.sql.Datasource for a JDBC datasource. The bean type of the resource is this specified type</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A resource may be declared in beans.xml using an element that represents the Java type of the resource. For a persistence context, javax.persistence.EntityManager must be specified. The bean type of the resource is this specified type</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A resource may be declared in beans.xml using an element that represents the Java type of the resource. For a persistence unit, javax.persistence.EntityManagerFactory must be specified. The bean type of the resource is this specified type</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A resource may be declared in beans.xml using an element that represents the Java type of the resource. For a remote EJB, an EJB remote interface type must be specified. The bean type of the resource is this specified type</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A resource may be declared in beans.xml using an element that represents the Java type of the resource. For a web service, a web service type must be specified. The bean type of the resource is this specified type</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Each resource declaration must contain a child <Resource>, <PersistenceContext>, <PersistenceUnit>, <EJB> or
+<WebServiceRef> element. For a Java EE resource, a JNDI name or mapped name must be specified using the <name> or <mappedName> child elements
+of the <Resource> element</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Each resource declaration must contain a child <Resource>, <PersistenceContext>, <PersistenceUnit>, <EJB> or
+<WebServiceRef> element. For a persistence context, a persistence unit name must be specified using the <unitName> child element of the <PersistenceContext> element</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>Each resource declaration must contain a child <Resource>, <PersistenceContext>, <PersistenceUnit>, <EJB> or
+<WebServiceRef> element. For a persistence unit, a persistence unit name must be specified using the <unitName> child element of the <PersistenceUnit> element</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>Each resource declaration must contain a child <Resource>, <PersistenceContext>, <PersistenceUnit>, <EJB> or
+<WebServiceRef> element. For a remote EJB, a JNDI name, mapped name or EJB link must be specified using the <name>, <mappedName> or <ejbLink> child elements of the <EJB> element</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>Each resource declaration must contain a child <Resource>, <PersistenceContext>, <PersistenceUnit>, <EJB> or
+<WebServiceRef> element. For a web service, a JNDI name or mapped name must be specified using the <name> or <mappedName> child elements of the <WebServiceRef> element. Optionally, a URL pointing to a WSDL document may be specified using the <wsdlLocation> child element</text>
+ </assertion>
+
+ <assertion name="k">
+ <text>The JNDI name specified by the <name> element must be a name in the global java:global or application java:app naming context</text>
+ </assertion>
+
+ <assertion name="l">
+ <text>Optionally, one or more bindings may be specified for resources in XML. If no binding is explicitly specified, the default binding @Current is assumed.</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.7" title="JMS resources">
+ <assertion id="a">
+ <text>JMS resources may be declared in beans.xml</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>JMS queue resources must allow the direct injection of the Queue, QueueConnection, QueueSession, QueueReceiver and/or QueueSender</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>JMS topic resources must allow the direct injection of the Topic, TopicConnection, TopicSession, TopicSubscriber and/or TopicPublisher</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The lifecycles of the injected objects are managed by the container, and therefore the application need not explicitly close() any injected JMS object. If the application calls close() on an instance of a JMS resource, an UnsupportedOperationException is thrown by the container.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A JMS resource always has scope @Dependent</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A JMS resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>JMS resources are always declared using XML</text>
+ </assertion>
+ </section>
+
+ <section id="3.7.1" title="Bean types of a JMS resource">
+
+ <assertion id="a">
+ <text>For JMS resources that represent a queue, the bean types are Queue, QueueConnection, QueueSession and QueueSender</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For JMS resources that represent a topic, the bean types are Topic, TopicConnection, TopicSession and TopicPublisher</text>
+ </assertion>
+ </section>
+
+ <section id="3.7.2" title="Declaring a JMS resource using XML">
+
+ <assertion id="a">
+ <text>A JMS resource may be declared using the <Topic> or <Queue> elements in beans.xml</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Each JMS resource declaration must contain a child <Resource> element. A JNDI name or mapped name must be specified using the <name> or <mappedName> child elements of the <Resource> element</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>One or more bindings may be specified. If no binding is explicitly specified, the default binding @Current is assumed</text>
+ </assertion>
+ </section>
+
+ <section id="3.8" title="Injected fields">
+
+ <assertion id="a">
+ <text>An injected field is a non-static, non-final field of a bean class, of a servlet, or of any EJB session or message driven bean class.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Injected fields are initialized by the container immediately after instantiation and before any methods of the instance are invoked. The container calls the method Manager.getInstanceToInject() defined in Section 5.7.1, "Resolving dependencies" to determine a value for each injected field</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Any EJB session or message driven bean may declare injected fields and have those fields injected by the container</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a field is a producer field or a decorator delegate attribute, it is not an injected field</text>
+ </assertion>
+ </section>
+
+ <section id="3.8.1" title="Declaring an injected field using annotations">
+
+ <assertion id="a">
+ <text>An injected field may be declared by annotating the field with any binding type</text>
+ </assertion>
+ </section>
+
+ <section id="3.8.2" title="Declaring an injected field using XML">
+ <assertion id="a">
+ <text>For bean defined in XML, an injected field may be declared using the field name and a child element representing the type of the field</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When an injected field is declared in XML, the container ignores binding annotations applied to the Java field</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the type element does not declare any binding, the default binding @Current is assumed</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the bean class of a bean declared in XML does not have a field with the name and type declared in XML, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="3.9" title="Initializer methods">
+ <assertion id="a">
+ <text>An initializer method is a non-static method of a bean class, of a servlet, or of any EJB session or message driven bean class.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Initializer methods are called by the container immediately after injected fields have been initialized by the container and before any other methods of the instance are invoked.</text>
+ </assertion>
+
+ <assertion id="c">
+ <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="d">
+ <text>Method interceptors are never called when the container calls an initializer method</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A bean class may declare multiple (or zero) initializer methods</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The application may call initializer methods directly, but then no parameters will be passed to the method by the container</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Any EJB session or message driven bean may declare initializer methods and have the methods called by the container</text>
+ </assertion>
+ </section>
+
+ <section id="3.9.1" title="Declaring an initializer method using annotations">
+ <assertion id="a">
+ <text>An initializer method may be declared by annotating the method @javax.inject.Initializer</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If an initializer method is annotated @Produces, has a parameter annotated @Disposes, or has a parameter annotated @Observes, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ </section>
+
+ <section id="3.9.2" title="Declaring an initializer method using XML">
+
+ <assertion id="a">
+ <text>For a bean defined in XML, an initializer method may be declared using the method name, the <Initializer> element and the parameter types of the method</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When an initializer method is declared in XML, the container ignores binding annotations applied to the Java method parameters</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean class of a bean declared in XML does not have a method with the name and parameter types declared in XML, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="3.9.3" title="Initializer method parameters">
+ <assertion id="a">
+ <text>An initializer method may have any number of parameters. If the initializer method has parameters, the container calls Manager.getInstanceToInject() to determine a value for each parameter and calls the initializer method with those parameter values</text>
+ </assertion>
+ </section>
+
+ <section id="3.10" title="Support for Common Annotations">
+ <assertion id="a">
+ <text>Dependency injection via @EJB, @Resource, @PersistenceUnit and @PersistenceContext is provided by the container when annotations are applied to the bean class of a simple bean</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>@PostConstruct and @PreDestroy callbacks are provided by the container when annotations are applied to the bean class of a simple bean</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Interception, as defined in javax.interceptor is provided by the container when annotations are applied to the bean class of a simple bean</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>@PersistenceContext(type=EXTENDED) is not supported for simple beans</text>
+ </assertion>
+ </section>
+
+ <section id="3.11" title="The Bean object for a bean">
+ <assertion id="a">
+ <text>Concrete subclasses of Bean must implement the operations defined by the Contextual interface defined in Section 6.1, "The Contextual interface".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An instance of Bean exists for every enabled bean in a deployment</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>An application or third party framework may add support for new kinds of beans beyond those defined by the this specification (simple beans, session beans, producer methods and fields, resources and JMS resources) by extending Bean and registering beans with the container, using the mechanism defined in Section 11.3, "Bean registration".</text>
+ </assertion>
+ </section>
+
+ <section id="4" title="Inheritance, specialization and realization">
+
+ </section>
+
+ <section id="4.1" title="Inheritance of type-level metadata">
+
+ <assertion id="a">
+ <text>For class X which is extended directly or indirectly by the bean class of a simple or session bean Y, if X is annotated with a binding type, stereotype or interceptor 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="b">
+ <text>For class X which is extended directly or indirectly by the bean class of a simple or session bean Y, if X is annotated with a scope type Z then Y inherits the annotation if and only if Z declares the @Inherited metaannotation 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="c">
+ <text>For class X which is extended directly or indirectly by the bean class of a simple or session 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="d">
+ <text>For class X which is extended directly or indirectly by the bean class of a simple or session bean Y, the scope types and deployment types explicitly declared by and inherited from the class X take precedence over default scopes and deployment types declared by stereotypes.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>For class X which is the bean class of a simple or session bean Y declared using XML, if X is annotated with a binding type, stereotype or interceptor binding type Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and Y does not explicitly declare an annotation of type Z using XML.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>For class X which is the bean class of a simple or session bean Y declared using XML, if X is annotated with a scope type Z then Y inherits the annotation if and only if Z declares the @Inherited metaannotation and Y does not explicitly declare a scope type using XML.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>For class X which is the bean class of a simple or session bean Y declared using XML, 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 explicitly declare a deployment type using XML.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>For class X which is the bean class of a simple or session bean Y declared using XML, the scope types and deployment types explicitly declared by and inherited from the class X take precedence over default scope and deployment types declared by stereotypes.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>For annotations defined by the bean specification, all built-in scope types are declared @Inherited</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>For annotations defined by the bean specification, all built-in stereotypes are declared @Inherited</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>For annotations defined by the bean specification, no built-in binding type is declared @Inherited</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>For annotations defined by the bean specification, the built-in deployment type is not declared @Inherited</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>the @Named annotation is not declared @Inherited and bean names are not inherited unless specialization is used</text>
+ </assertion>
+
+ </section>
+
+ <section id="4.2" title="Inheritance of member-level metadata">
+ <assertion id="a">
+ <text>For class X which is extended directly or indirectly by the bean class of a simple or session bean Y, if X declares an injected field x then Y inherits x.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For class X which is extended directly or indirectly by the bean class of a simple or session bean Y, if X declares an initializer method, @PostConstruct method or @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="c">
+ <text>For class X which is extended directly or indirectly by the bean class of a simple or session bean Y, if X declares a non-static method x() annotated with an interceptor binding type Z then Y inherits the binding 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="d">
+ <text>For class X which is extended directly or indirectly by the bean class of a simple or session bean Y, if X declares a non-static producer, disposal, or observer method x() then Y does not inherit this method unless Y is explicitly declared to specialize or realize X</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>For class X which is extended directly or indirectly by the bean class of a simple or 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 or realize X.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>For class X which is extended directly or indirectly by the bean class of a simple or session bean Y, if Y is a decorator and X declares a delegate attribute 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 defines a delegate attribute</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>For class X which is the bean class of a simple or session bean Y declared using XML, if X declares an injected field x then Y inherits x, unless Y explicitly declares x using XML.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>For class X which is the bean class of a simple or session bean Y declared using XML, if X declares an initializer method, @PostConstruct method or @PreDestroy method x() then Y inherits x(), unless Y explicitly declares x() using XML</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>For class X which is the bean class of a simple or session bean Y declared using XML, if X declares a non-static method x() annotated with an interceptor binding type Z then Y inherits the binding, unless Y explicitly declares x() using XML.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>For class X which is the bean class of a simple or session bean Y declared using XML, if X declares a non-static producer, disposal, or observer method x() then Y does not inherit this method, unless Y is explicitly declared to specialize or realize X.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>For class X which is the bean class of a simple or session bean Y declared using XML, if X declares a non-static producer field x then Y does not inherit this method, unless Y is explicitly declared to specialize or realize X.</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>For class X which is the bean class of a simple or session bean Y declared using XML, if Y is a decorator and X declares a delegate attribute x then Y inherits x, unless Y explicitly declares a delegate attribute using XML.</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="c">
+ <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, 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="Using specialization">
+
+ <assertion id="a">
+ <text>A bean declared using annotations may declare that it specializes a lower-priority bean using the @Specializes annotation</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A bean declared using XML may declare that it specializes a lower-priority bean using the <Specializes> element</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The bindings of a bean X that specializes a lower-priority bean Y include all bindings of Y, together with all bindings declared explicitly by X.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a bean X specializes a lower-priority bean Y with a name, the name of X is the same as the name of Y. If X declares a name explicitly, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>When an enabled bean specializes a lower-priority bean, we can be certain that the lower-priority bean is never instantiated or called by the container. Even if the lower-priority bean defines a producer method, the method will be called upon an instance of the first bean</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Specialization applies only to simple beans, as defined in Section 3.2.7, "Specializing a simple bean", session beans, as defined in Section 3.3.7, "Specializing a session bean" and producer methods, as defined in Section 3.4.5, "Specializing a producer method".</text>
+ </assertion>
+ </section>
+
+ <section id="4.3.2" title="Direct and indirect specialization">
+ <assertion id="a">
+ <text>The @javax.inject.Specializes annotation or <Specializes> XML element is used to indicate that one bean directly specializes another bean</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A bean X is said to specialize another bean Y if X directly specializes Y, or a bean Z exists, such that X directly specializes Z and Z specializes Y</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Any non-static producer methods (see Section 3.4, "Producer methods"), producer fields (see Section 3.5, "Producer fields"), disposal methods (see Section 3.4.6, "Disposal methods") or observer methods (see Section 7.5, "Observer methods") of any bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 6.7, "Lifecycle of producer methods", Section 6.8, "Lifecycle of producer fields" and Section 7.4, "Observer notification".</text>
+ </assertion>
+ </section>
+
+ <section id="4.3.3" title="Inconsistent specialization">
+ <assertion id="a">
+ <text>If, in a particular deployment, either some enabled bean X specializes another enabled bean Y and X does not have a higher precedence than Y, or more than one enabled bean directly specializes the same bean we say that inconsistent specialization exists, and an InconsistentSpecializationException is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="4.4" title="Realization">
+ <assertion id="a">
+ <text>Any bean that extends a generic class may directly extend the generic class, in the case of a bean declared using annotations</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Any bean that extends a generic class may declare that the generic class is the bean class, in the case of a bean declared using XML, and then explicitly declare that it realizes the generic class.</text>
+ </assertion>
+
+ </section>
+
+ <section id="4.4.1" title="Using realization">
+ <assertion id="a">
+ <text>A bean declared using annotations may declare that it realizes a generic class by annotating the bean class with the @javax.inject.Realizes annotation</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A bean declared using XML may declare that it realizes a generic class using the <Realizes> element.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a generic class Y declares a non-static producer method or field with a certain combination of scope, stereotypes, bindings and interceptor bindings, then every bean X that realizes Y also has a producer method or field with the same scope, stereotypes and interceptor bindings. The bindings for this inherited producer method or field consist of all bindings declared by the producer method or field of Y, excluding all bindings of Y, together with the bindings declared explicitly by X. The deployment type of the inherited producer method or field is the deployment type of X</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a generic class Y declares a non-static disposal method with a disposed parameter with a certain combination of bindings, then every bean X that realizes Y also has a disposal method. The bindings of the disposed parameter of this
+inherited disposal method consist of all bindings declared by the disposed parameter of the disposal method of Y, excluding all bindings of Y, together with the bindings declared explicitly by X.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a generic class Y declares a non-static observer method with an event parameter with a certain combination of event bindings, then every bean X that realizes Y also has an observer method. The event bindings of the event parameter of
+this inherited observer method consist of all event bindings declared by the event parameter of the observer method of Y.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Realization applies only to simple beans and session beans</text>
+ </assertion>
+ </section>
+
+ <section id="5" title="Lookup, dependency injection and EL resolution">
+ <assertion id="a">
+ <text>The container is required to ensure that any injected reference to a contextual instance of a bean may be cast to any bean type of the bean.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The container is required to support circularities in the bean dependency graph</text>
+ </assertion>
+ </section>
+
+ <section id="5.1" title="Unsatisfied and ambiguous dependencies">
+ <assertion id="a">
+ <text>The container must validate all injection points of all enabled beans at deployment time to ensure that there are no unsatisfied or ambiguous dependencies. If an unsatisfied or ambiguous dependency exists, an UnsatisfiedDependencyException
+or AmbiguousDependencyException is thrown by the container at deployment time, as defined in Section 5.7.1, "Resolving dependencies".</text>
+ </assertion>
+ </section>
+
+ <section id="5.2" title="Primitive types and null values">
+ <assertion id="a">
+ <text>If an injection point of primitive type resolves to a bean that may be null, such as a producer method with a nonprimitive return type or a producer field with a non-primitive type, a NullableDependencyException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method Bean.isNullable() may be used to detect if a bean has null values</text>
+ </assertion>
+ </section>
+
+ <section id="5.3" title="Injected 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="5.4" title="Client proxies">
+
+ </section>
+
+ <section id="5.4.1" title="Unproxyable bean types">
+
+ </section>
+
+ <section id="5.4.2" title="Client proxy invocation">
+
+ </section>
+
+ <section id="5.5" title="The default binding at injection points">
+
+ </section>
+
+ <section id="5.6" title="Injection point metadata">
+
+ </section>
+
+ <section id="5.6.1" title="Injecting InjectionPoint">
+
+ </section>
+
+ <section id="5.7" title="The Manager object">
+
+ </section>
+
+ <section id="5.7.1" title="Resolving dependencies">
+
+ </section>
+
+ <section id="5.7.2" title="Obtaining contextual instances">
+
+ </section>
+
+ <section id="5.8" title="Dynamic lookup">
+
+ </section>
+
+ <section id="5.9" title="Typesafe resolution algorithm">
+
+ </section>
+
+
+
+
+</specification>
Copied: tck/trunk/impl/src/main/resources/tck-tests.xml (from rev 1513, tck/trunk/impl/src/main/resources/tck-unit-tests.xml)
===================================================================
--- tck/trunk/impl/src/main/resources/tck-tests.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/tck-tests.xml 2009-02-14 23:19:09 UTC (rev 1514)
@@ -0,0 +1,46 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="JSR-299 TCK" verbose="2" >
+ <test name="JSR-299 TCK" >
+ <method-selectors>
+ <method-selector>
+ <selector-class name="org.jboss.jsr299.tck.impl.testng.DisableIntegrationTestsMethodSelector" />
+ </method-selector>
+ </method-selectors>
+ <groups >
+ <run>
+<!--
+ <exclude name="specialization" />
+ <exclude name="deployment" />
+ <exclude name="disposalMethod" />
+
+ <exclude name="observerMethod" />
+ <exclude name="deferredEvent" />
+ <exclude name="ejb3" />
+ <exclude name="webservice" />
+ <exclude name="annotationDefinition" />
+ <exclude name="webbeansxml" />
+ <exclude name="el" />
+ <exclude name="jms" />
+ <exclude name="interceptors" />
+ <exclude name="decorators" />
+ <exclude name="servlet" />
+
+ <exclude name="passivation" />
+ <exclude name="singletons" />
+ <exclude name="ejbjarxml" />
+ <exclude name="beanDestruction" />
+ <exclude name="commonAnnotations" />
+-->
+ <exclude name="stub" />
+ <exclude name="broken" />
+ <exclude name="underInvestigation" />
+ </run>
+ </groups>
+ <packages>
+ <package name="org.jboss.jsr299.tck.unit" />
+ <package name="org.jboss.jsr299.tck.integration" />
+ </packages>
+ </test>
+
+</suite>
\ No newline at end of file
Deleted: tck/trunk/impl/src/main/resources/tck-unit-tests.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-unit-tests.xml 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/impl/src/main/resources/tck-unit-tests.xml 2009-02-14 23:19:09 UTC (rev 1514)
@@ -1,42 +0,0 @@
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
-
-<suite name="JSR-299 TCK" verbose="2" >
-
- <test name="JSR-299 TCK" >
- <groups >
- <run>
-<!--
- <exclude name="specialization" />
- <exclude name="deployment" />
- <exclude name="disposalMethod" />
-
- <exclude name="observerMethod" />
- <exclude name="deferredEvent" />
- <exclude name="ejb3" />
- <exclude name="webservice" />
- <exclude name="annotationDefinition" />
- <exclude name="webbeansxml" />
- <exclude name="el" />
- <exclude name="jms" />
- <exclude name="interceptors" />
- <exclude name="decorators" />
- <exclude name="servlet" />
-
- <exclude name="passivation" />
- <exclude name="singletons" />
- <exclude name="ejbjarxml" />
- <exclude name="beanDestruction" />
- <exclude name="commonAnnotations" />
--->
- <exclude name="stub" />
- <exclude name="broken" />
- <exclude name="underInvestigation" />
- </run>
- </groups>
- <packages>
- <package name="org.jboss.jsr299.tck.unit" />
- <package name="org.jboss.jsr299.tck.integration" />
- </packages>
- </test>
-
-</suite>
\ No newline at end of file
Deleted: tck/trunk/impl/tck-audit.xml
===================================================================
--- tck/trunk/impl/tck-audit.xml 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/impl/tck-audit.xml 2009-02-14 23:19:09 UTC (rev 1514)
@@ -1,1654 +0,0 @@
-<specification xmlns="http://jboss.com/products/webbeans/tck/audit"
- name="JSR-299: Java Contexts and Dependency Injection"
- version="Revised Public Review Draft">
-
- <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="f">
- <text>A bean comprises of a set of interceptor bindings</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="b">
- <text>A bean type may be a parameterized type with an actual type parameter. For the purposes of the typesafe resolution algorithm defined in Section 5.9, "Typesafe resolution algorithm", parameterized bean types are considered identical by the container only if both the type and the type parameters (if any) are identical</text>
- </assertion>
-
- <assertion id="c">
- <text>Bean types may not declare a type variable or wildcard. If the type of an injection point is a parameterized type with a type variable or wildcard, a DefinitionException is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="d">
- <text>A bean type may be an interface</text>
- </assertion>
-
- <assertion id="e">
- <text>A bean type may be a concrete class</text>
- </assertion>
-
- <assertion id="f">
- <text>A bean type may be an abstract class</text>
- </assertion>
-
- <assertion id="g">
- <text>A bean type may be declared final</text>
- </assertion>
-
- <assertion id="h">
- <text>A bean type may have final methods</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 types. Primitive types are considered to be identical to their corresponding wrapper types in java.lang.</text>
- </assertion>
-
- <assertion id="k">
- <text>All beans have the bean type java.lang.Object</text>
- </assertion>
-
- <assertion id="l">
- <text>A client of a bean may typecast its reference to any instance of the bean to any bean type of the bean</text>
- </assertion>
-
- </section>
-
- <section id="2.3.1" title="Default binding type">
-
- <assertion id="a">
- <text>If a bean does not explicitly declare a binding, the bean has exactly one binding, of type @javax.inject.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="a">
- <text>A binding type is a Java annotation defined as @Target({METHOD, FIELD, PARAMETER, TYPE}) and @Retention(RUNTIME).</text>
- </assertion>
-
- <assertion id="b">
- <text>A binding type may be declared by specifying the @javax.inject.BindingType meta-annotation</text>
- </assertion>
-
- <assertion id="c">
- <text>The @BindingType meta-annotation may be omitted, and the binding type may be declared in beans.xml</text>
- </assertion>
-
- <assertion id="d">
- <text>A binding type may define annotation members</text>
- </assertion>
- </section>
-
- <section id="2.3.3" title="Declaring the bindings of a bean using annotations">
-
- <assertion id="a">
- <text>A bean's bindings are declared by annotating the bean class or producer method or field with the binding types</text>
- </assertion>
-
- <assertion id="b">
- <text>Any bean may declare multiple binding types</text>
- </assertion>
- </section>
-
- <section id="2.3.4" title="Declaring the bindings of a bean using XML">
-
- <assertion id="a">
- <text>If a bean is declared in beans.xml, bindings may be specified using the binding type names</text>
- </assertion>
-
- </section>
-
- <section id="2.3.5" 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>
-
- <assertion id="c">
- <text>For a bean defined in XML, the bindings of a field may be specified using XML</text>
- </assertion>
-
- <assertion id="d">
- <text>When the bindings of a field are specified using XML, any binding annotations of the field are ignored</text>
- </assertion>
- </section>
-
- <section id="2.3.6" title="Specifying bindings of a method or constructor parameter">
- <assertion id="a">
- <text>Binding types may be applied to parameters of producer methods, initializer methods, disposal methods or 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>
-
- <assertion id="b">
- <text>For a bean defined in XML, the bindings of a method parameter may be specified using XML</text>
- </assertion>
-
- <assertion id="c">
- <text>When the bindings of a parameter are specified using XML, any binding annotations of the parameter are ignored</text>
- </assertion>
- </section>
-
- <section id="2.4" title="Scopes">
-
- <assertion id="a">
- <text>All beans have a scope</text>
- </assertion>
-
- <assertion id="b">
- <text>A scope type is represented by an annotation type.</text>
- </assertion>
-
- <assertion id="c">
- <text>The set of scope types is extensible</text>
- </assertion>
-
- </section>
-
- <section id="2.5.1" title="Built-in deployment types">
-
- <assertion id="a">
- <text>All standard beans defined by this specification, and provided by the container, are defined using the @Standard deployment type</text>
- </assertion>
-
- <assertion id="b">
- <text>No bean may be declared with the @Standard deployment type unless explicitly required by this specification</text>
- </assertion>
-
- <assertion id="c">
- <text>Application beans may be defined using the @Production deployment type</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="b">
- <text>A deployment type is a Java annotation defined with @Retention(RUNTIME)</text>
- </assertion>
-
- <assertion id="c">
- <text>All deployment types must also specify the @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 using annotations">
-
- <assertion id="a">
- <text>The deployment type of the bean is declared by annotating the bean class or producer method or field</text>
- </assertion>
-
- <assertion id="b">
- <text>An bean class or producer method or field may specify at most one deployment type. If multiple deployment type annotations are specified, a DefinitionException is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="c">
- <text>By default, if no deployment type annotation is explicitly specified, a producer method or field inherits the deployment type of the bean in which it is defined.</text>
- </assertion>
-
- <assertion id="d">
- <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="Declaring the deployment type of a bean using XML">
- <assertion id="a">
- <text>When a bean is declared in beans.xml, the deployment type may be specified using a tag with the annotation type name</text>
- </assertion>
-
- <assertion id="b">
- <text>If more than one deployment type is specified in XML, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="c">
- <text>A deployment type may be specified using a stereotype declared in XML, as defined in Section 2.7.3, "Declaring the stereotypes for a bean using XML".</text>
- </assertion>
- </section>
-
- <section id="2.5.5" title="Default deployment type">
-
- <assertion id="a">
- <text>The default deployment type for a bean which does not explicitly declare a deployment type depends upon its declared stereotypes - if a bean does not declare any stereotype with a declared default deployment type, then the default deployment type is
- at 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>
- <note>This assertion relates to assertion 2.5.5.b</note>
- </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.6" 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>
-
- </section>
-
- <section id="2.6" title="Bean names">
-
- <assertion id="a">
- <text>A valid bean name is a period-separated list of valid EL identifiers</text>
- </assertion>
- </section>
-
- <section id="2.6.1" title="Declaring the bean name using annotations">
-
- <assertion id="a">
- <text>To specify the name of a bean, the @javax.annotation.Named annotation is applied to the bean class or producer method or field.</text>
- </assertion>
-
- <assertion id="b">
- <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="Declaring the bean name using XML">
-
- <assertion id="a">
- <text>If the bean is declared in beans.xml, the name may be specified using <Named></text>
- </assertion>
-
- <assertion id="b">
- <text>If the <Named> element is empty, the default name is assumed</text>
- </assertion>
- </section>
-
- <section id="2.6.3" title="Default bean names">
-
- <assertion id="a">
- <text>A default name must be assigned by the container when a bean class or producer method or field of a bean defined using annotations declares a @Named annotation and no name is explicitly specified by the value member</text>
- </assertion>
-
- <assertion id="b">
- <text>A default name must be assigned by the container when an empty <Named> element is specified by a bean defined in XML</text>
- </assertion>
-
- <assertion id="c">
- <text>A default 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 a name.</text>
- </assertion>
- </section>
-
- <section id="2.6.4" title="Beans with no name">
-
- <assertion id="a">
- <text>If neither <Named> nor @Named is specified, by the bean or its stereotypes, a bean has no name</text>
- </assertion>
- </section>
-
- <section id="2.7" title="Stereotypes">
-
- <assertion id="a">
- <text>A stereotype may also specify that all beans with the stereotype have defaulted bean names</text>
- </assertion>
-
- <assertion id="b">
- <text>A bean may declare zero, one or multiple stereotypes</text>
- </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">
- <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="Simple beans">
- <assertion id="a">
- <text>The bean class of a simple bean may not be a non-static inner class or a parameterized type</text>
- </assertion>
-
- <assertion id="b">
- <text>The bean class of a simple bean may not be an abstract class, unless the simple bean is a decorator</text>
- </assertion>
-
- <assertion id="c">
- <text>If the bean class of a simple bean is annotated with both the @Interceptor and @Decorator stereotypes, a DefinitionException is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="d">
- <text>Multiple simple beans may share the same bean class. This occurs when beans are defined using XML. Only one simple bean per bean class may be defined using annotations.</text>
- </assertion>
-
- <assertion id="e">
- <text>If a simple bean has a public field, it must have scope @Dependent. If a simple bean with a public field declares any scope other than @Dependent, a DefinitionException is thrown by the container at deployment time.</text>
- </assertion>
-
- </section>
-
- <section id="3.2.1" title="Which Java classes are beans?">
- <assertion id="a">
- <text>A top-level Java class is not a simple bean if it is a parameterized type</text>
- </assertion>
- <assertion id="b">
- <text>A top-level Java class is not a simple bean if it is a non-static inner class</text>
- </assertion>
- <assertion id="c">
- <text>A top-level Java class is only a simple bean if it is a concrete class, or annotated @Decorator.</text>
- </assertion>
- <assertion id="d">
- <text>A top-level Java class is not a simple bean if it is annotated with the JPA @Entity annotation</text>
- </assertion>
- <assertion id="e">
- <text>A top-level Java class is not a simple bean if it is annotated with any of the EJB component-defining annotations</text>
- </assertion>
- <assertion id="f">
- <text>A top-level Java class is not a simple bean if it implements the javax.servlet.Servlet interface</text>
- </assertion>
- <assertion id="g">
- <text>A top-level Java class is not a simple bean if it implements the javax.servlet.Filter interface</text>
- </assertion>
- <assertion id="h">
- <text>A top-level Java class is not a simple bean if it implements the javax.servlet.ServletContextListener interface</text>
- </assertion>
- <assertion id="i">
- <text>A top-level Java class is not a simple bean if it implements the javax.servlet.http.HttpSessionListener interface</text>
- </assertion>
- <assertion id="j">
- <text>A top-level Java class is not a simple bean if it implements the javax.servlet.ServletRequestListener interface</text>
- </assertion>
- <assertion id="k">
- <text>A top-level Java class is not a simple bean if it implements the javax.ejb.EnterpriseBean interface</text>
- </assertion>
- <assertion id="l">
- <text>A top-level Java class is not a simple bean if it extends javax.faces.component.UIComponent</text>
- </assertion>
- <assertion id="m">
- <text>A top-level Java class is not a simple bean if it is declared as an EJB bean class in ejb-jar.xml</text>
- </assertion>
- <assertion id="n">
- <text>A top-level Java class is not a simple bean if it is declared as a JPA entity in orm.xml</text>
- </assertion>
- <assertion id="o">
- <text>A top-level Java class is only a simple bean if it has an appropriate constructor - either a constructor with no parameters, or declares a constructor annotated @Initializer</text>
- </assertion>
- <assertion id="p">
- <text>Additional simple beans with the same bean class may be defined using XML, by specifying the class in beans.xml.</text>
- </assertion>
-
- </section>
-
- <section id="3.2.2" title="Bean types of a simple 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 simple bean using annotations">
- <assertion id="a">
- <text>A simple bean with a constructor that takes no parameters does not require any special annotations</text>
- </assertion>
-
- <assertion id="b">
- <text>A bean class may also specify a scope, name, deployment type, stereotypes and/or bindings</text>
- </assertion>
-
- <assertion id="c">
- <text>A simple bean may extend another simple bean</text>
- </assertion>
- </section>
-
- <section id="3.2.4" title="Declaring a simple bean using XML">
- <assertion id="a">
- <text>Simple beans may be declared in beans.xml using the bean class name</text>
- </assertion>
-
- <assertion id="b">
- <text>A simple bean may even be declared at any injection point declared in XML, as defined in Section 9.9, "Inline bean declarations", in which case no bindings are specified.</text>
- </assertion>
-
- <assertion id="c">
- <text>If the bean class of a simple bean defined in XML is a parameterized type or a non-static inner class, a DefinitionException is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="d">
- <text>If the bean class of a simple bean defined in XML is an abstract class, and the simple bean is not a decorator, a DefinitionException
-is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="e">
- <text>If the bean class of a simple bean defined in XML is annotated @Interceptor, then the bean must be explicitly declared as an interceptor in XML, as defined in Section A.3.5.2, "Declaring an interceptor using XML". If a simple bean defined in XML has a bean class annotated @Interceptor and is not declared as an interceptor in XML, a DefinitionException is
-thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="f">
- <text>If the bean class of a simple bean defined in XML is annotated @Interceptor, then the bean must be explicitly declared as an interceptor in XML, as defined in Section A.3.5.2, "Declaring an interceptor using XML". If a simple bean defined in XML has a bean class annotated @Interceptor and is not declared as an interceptor in XML, a DefinitionException is
-thrown by the container at deployment time.</text>
- </assertion>
- </section>
-
- <section id="3.2.5" title="Simple beans with the @New binding">
- <assertion id="a">
- <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such simple bean, a second simple bean exists which has the same bean class</text>
- </assertion>
- <assertion id="b">
- <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such simple bean, a second simple bean exists which has the same bean constructor, initializer methods and injected fields defined by annotations</text>
- </assertion>
- <assertion id="c">
- <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such simple bean, a second simple bean exists which has the same interceptor bindings defined by annotations</text>
- </assertion>
- <assertion id="d">
- <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such simple bean, a second simple bean exists which has scope @Dependent</text>
- </assertion>
- <assertion id="e">
- <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such simple bean, a second simple bean exists which has deployment type @Standard</text>
- </assertion>
- <assertion id="f">
- <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such simple bean, a second simple bean exists which has @javax.inject.New as the only binding</text>
- </assertion>
- <assertion id="g">
- <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such simple bean, a second simple bean exists which has no bean name</text>
- </assertion>
- <assertion id="h">
- <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such simple bean, a second simple bean exists which has no stereotypes</text>
- </assertion>
- <assertion id="i">
- <text>Every class that satisfies the requirements of Section 3.2.1, "Which Java classes are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such simple bean, a second simple bean exists which has no observer methods, producer methods or fields or disposal methods</text>
- </assertion>
- </section>
-
- <section id="3.2.6" title="Bean constructors">
- <assertion id="a">
- <text>When the container instantiates a simple bean, it calls the bean constructor. The bean constructor is a constructor of the bean class</text>
- </assertion>
- <assertion id="b">
- <text>The application may call bean constructors directly. However, if the application directly instantiates the bean, no parameters are passed to the constructor by the container; the returned object is not bound to any context; no dependencies are injected by the container; and the lifecycle of the new instance is not managed by the container</text>
- </assertion>
- </section>
-
- <section id="3.2.6.1" title="Declaring a bean constructor using annotations">
- <assertion id="a">
- <text>The bean constructor may be identified by annotating the constructor @Initializer</text>
- </assertion>
-
- <assertion id="b">
- <text>If a simple bean defined using annotations does not explicitly declare a constructor using @Initializer, the constructor that accepts no parameters is the bean constructor</text>
- </assertion>
-
- <assertion id="c">
- <text>If a simple bean defined using annotations has more than one constructor annotated @Initializer, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>If a bean constructor has a parameter annotated @Disposes, or @Observes, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- </section>
-
- <section id="3.2.6.2" title="Declaring a bean constructor using XML">
-
- <assertion id="a">
- <text>For a simple bean defined using XML, the bean constructor may be specified by listing the parameter types of the constructer, in order, as direct children of the element that declares the bean</text>
- </assertion>
-
- <assertion id="b">
- <text>If a simple bean defined using XML does not explicitly declare constructor parameters in XML, the constructor that accepts no parameters is the bean constructor</text>
- </assertion>
-
- <assertion id="c">
- <text>If a simple bean declared in XML does not have a constructor with the parameter types declared in XML, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>When a bean constructor is declared in XML, the container ignores binding annotations applied to Java constructor parameters</text>
- </assertion>
-
- </section>
-
- <section id="3.2.6.3" title="Bean constructor parameters">
- <assertion id="a">
- <text>If the bean constructor has parameters, the container calls the method Manager.getInstanceToInject() defined in Section 5.7.1, "Resolving dependencies" to determine a value for each parameter and calls the constructor with those parameter values.</text>
- </assertion>
- </section>
-
- <section id="3.2.7" title="Specializing a simple bean">
- <assertion id="a">
- <text>If a bean class of a simple bean X defined using annotations is annotated @Specializes, then the bean class of X must directly extend the bean class of another simple bean Y defined using annotations. Then X inherits all bindings of Y, and if Y has a name, X has the same name as Y.</text>
- </assertion>
-
- <assertion id="b">
- <text>We say that X directly specializes Y, and we can be certain that Y will never be instantiated or called by the container if X is enabled.</text>
- <note>This assertion relates to specialized beans declared using annotations</note>
- </assertion>
-
- <assertion id="c">
- <text>If the bean class of X does not directly extend the bean class of another simple bean, a DefinitionException is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="d">
- <text>If a simple bean X defined in XML declares the <Specializes> element, then the bean class of X must be the bean class of another simple bean Y defined using annotations. Then X inherits all bindings of Y, and if Y has a name, X has the same name as Y</text>
- </assertion>
-
- <assertion id="e">
- <text>We say that X directly specializes Y, and we can be certain that Y will never be instantiated or called by the container if X is enabled</text>
- <note>This assertion relates to specialized beans declared in XML</note>
- </assertion>
- </section>
-
- <section id="3.2.8" title="Default name for a simple bean">
- <assertion id="a">
- <text>The default name for a simple 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="a">
- <text>A session bean is a bean that is implemented by an EJB 3-style session bean</text>
- </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="d">
- <text>If a session bean specifies an illegal scope, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="e">
- <text>Note that multiple session beans may share the same bean class. This occurs when beans are defined using XML</text>
- </assertion>
-
- <assertion id="f">
- <text>If the bean class of a session bean is annotated @Interceptor or @Decorator, a DefinitionException is thrown by the container at deployment time</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="d">
- <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. Furthermore, the container ignores the instance instead of destroying it when Bean.destroy() is called, as defined in Section 6.5, "Lifecycle of stateful session beans"</text>
- </assertion>
-
- </section>
-
- <section id="3.3.2" title="Which EJBs are beans?">
- <assertion id="a">
- <text>All session beans exposing an EJB 3.x client view and declared via an EJB component defining annotation on the EJB bean class are beans, and thus no special declaration is required. Additional beans for these EJBs may be defined using XML, by specifying the bean class in beans.xml</text>
- </assertion>
-
- <assertion id="b">
- <text>All session beans exposing an EJB 3.x client view and declared in ejb-jar.xml are also beans. Additional beans for these EJBs may be defined using XML, by specifying the bean class and EJB name in beans.xml</text>
- </assertion>
- </section>
-
- <section id="3.3.3" title="Bean types of a session bean">
-
- <assertion id="a">
- <text>The set of bean types for a session bean contains all local interfaces of the bean that do not have wildcard type parameters or type variables and their superinterfaces.</text>
- </assertion>
-
- <assertion id="b">
- <text>If the EJB has a bean class local view and the bean class is not a parameterized
-type, 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.4" title="Declaring a session bean using annotations">
- <assertion id="a">
- <text>A session bean does not require any special annotations</text>
- </assertion>
-
- <assertion id="b">
- <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.5" title="Declaring a session bean using XML">
- <assertion id="a">
- <text>Session beans may be declared in beans.xml using the bean class name (for EJBs defined using a component-defining annotation) or bean class and EJB name (for EJBs defined in ejb-jar.xml)</text>
- </assertion>
-
- <assertion id="b">
- <text>The ejbName attribute declares the EJB name of an EJB defined in ejb-jar.xml</text>
- </assertion>
-
- <assertion id="c">
- <text>If an entity or message-driven bean class is declared in XML, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="3.3.6" title="Session beans with the @New binding">
-
- <assertion id="a">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has the same bean class</text>
- </assertion>
-
- <assertion id="b">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has the initializer methods and injected fields defined by annotations</text>
- </assertion>
-
- <assertion id="c">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has the same interceptor bindings defined by annotations</text>
- </assertion>
-
- <assertion id="d">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has scope @Dependent,</text>
- </assertion>
-
- <assertion id="e">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has deployment type @Standard</text>
- </assertion>
-
- <assertion id="f">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has @javax.inject.New as the only binding</text>
- </assertion>
-
- <assertion id="g">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has no bean name</text>
- </assertion>
-
- <assertion id="h">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has no stereotypes</text>
- </assertion>
-
- <assertion id="i">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has no observer methods, producer methods or fields or disposal methods</text>
- </assertion>
- </section>
-
- <section id="3.3.7" title="Specializing a session bean">
-
- <assertion id="a">
- <text>If a bean class of a session bean X defined using annotations is annotated @Specializes, then the bean class of X must directly extend the bean class of another session bean Y defined using annotations. Then X inherits all bindings of Y, and if Y has a name, X has the same name as Y. Also, X must support all local interfaces supported by Y, and
-if Y supports a bean-class local view, X must also support a bean-class local view.
-Otherwise, a DefinitionException is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="b">
- <text>We say that X directly specializes Y, and we can be certain that Y will never be instantiated or called by the container if X is enabled</text>
- </assertion>
-
- <assertion id="c">
- <text>If the bean class of X does not directly extend the bean class of another session bean, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>If a session bean X defined in XML declares the <Specializes> element, then the bean class of X must be the bean class of another session bean Y defined using annotations. Then X inherits all bindings of Y, and if Y has a name, X has the same name as Y.</text>
- </assertion>
- </section>
-
- <section id="3.3.8" title="Default name for a session bean">
- <assertion id="a">
- <text>The default name for a session 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.9" title="Session bean proxies">
- <assertion id="a">
- <text>EJB local object references do not implement all local interfaces of the EJB. A local object reference may not be typecast to different local interface type, as required by Section 2.2, "Bean types". Therefore, the container proxies the local object reference. A session bean proxy implements all local interfaces of the EJB.</text>
- </assertion>
-
- <assertion id="b">
- <text>All session bean proxies must be serializable</text>
- </assertion>
- </section>
-
- <section id="3.4" title="Producer methods">
- <assertion id="a">
- <text>A producer method must be a method of a simple bean class or session bean class</text>
- </assertion>
-
- <assertion id="b">
- <text>A producer method may be either static or non-static</text>
- </assertion>
-
- <assertion id="c">
- <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="d">
- <text>If a producer method sometimes returns a null value, then the producer method must have scope @Dependent</text>
- </assertion>
-
- <assertion id="e">
- <text>If a producer method returns a null value at runtime, and the producer method 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.4, "Client proxies".</text>
- </assertion>
-
- <assertion id="f">
- <text>If the producer method return type is a parameterized type, it must specify actual type parameters for each type parameter</text>
- </assertion>
-
- <assertion id="g">
- <text>If a producer method return type contains a wildcard type parameter or type variable, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="h">
- <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="i">
- <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 using annotations">
-
- <assertion id="a">
- <text>A producer method may be declared by annotating a method with the @javax.inject.Produces annotation</text>
- </assertion>
-
- <assertion id="b">
- <text>A producer method may also specify scope, name, deployment type, stereotypes and/or bindings</text>
- </assertion>
-
- <assertion id="c">
- <text>If a producer method is annotated @Initializer, has a parameter annotated @Disposes, or has a parameter annotated @Observes, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>If a non-static method of a session bean class is annotated @Produces, and the method is not a business method of the EJB, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="3.4.3" title="Declaring a producer method using XML">
-
- <assertion id="a">
- <text>For a bean defined in XML, a producer method may be declared using the method name, the <Produces> element, the return type, and the parameter types of the method</text>
- </assertion>
-
- <assertion id="b">
- <text>When a producer method is declared in XML, the container ignores binding annotations applied to the Java method or method parameters</text>
- </assertion>
-
- <assertion id="c">
- <text>If the bean class of a bean declared in XML does not have a method with the name and parameter types declared in XML, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="3.4.4" title="Producer method parameters">
- <assertion id="a">
- <text>If the producer method has parameters, the container calls the method Manager.getInstanceToInject() defined in Section 5.7.1, "Resolving dependencies" to determine a value for each parameter and calls the producer method with those parameter values</text>
- </assertion>
- </section>
-
- <section id="3.4.5" title="Specializing a producer method">
-
- <assertion id="a">
- <text>If a producer method X is annotated @Specializes, then it must be non-static and directly override another producer method Y. Then X inherits all bindings of Y, and if Y has a name, X has the same name as Y.</text>
- </assertion>
-
- <assertion id="b">
- <text>If the method is static or does not directly override another producer method, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="3.4.6" title="Disposal methods">
-
- <assertion id="a">
- <text>A disposal method must be a method of a simple bean class or session bean class.</text>
- </assertion>
-
- <assertion id="b">
- <text>A disposal method may be either static or non-static</text>
- </assertion>
-
- <assertion id="c">
- <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="d">
- <text>A bean may declare multiple disposal methods</text>
- </assertion>
- </section>
-
- <section id="3.4.7" 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="b">
- <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 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="c">
- <text>If the disposed parameter does not resolve to any producer method according to the typesafe resolution algorithm, an UnsatisfiedDependencyException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>If a disposed parameter resolves to a producer method according to the typesafe resolution algorithm, the container must call this method when destroying an instance returned by that producer method</text>
- </assertion>
- </section>
-
- <section id="3.4.8" title="Declaring a disposal method using annotations">
-
- <assertion id="a">
- <text>A disposal method may be declared using annotations by annotating a parameter @javax.inject.Disposes. That parameter is the disposed parameter</text>
- </assertion>
-
- <assertion id="b">
- <text>If a method has more than one parameter annotated @Disposes, a DefinitionException is thrown by the container</text>
- </assertion>
-
- <assertion id="c">
- <text>If a disposal method is annotated @Produces, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>If a disposal method is annotated @Initializer, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="e">
- <text>If a disposal method has a parameter annotated @Observes, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="f">
- <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 EJB, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="3.4.9" title="Declaring a disposal method using XML">
-
- <assertion id="a">
- <text>For a bean defined in XML, a disposal method may be declared using the method name, the <Disposes> element, and the parameter types of the method</text>
- </assertion>
-
- <assertion id="b">
- <text>When a disposal method is declared in XML, the container ignores binding annotations applied to the Java method parameter</text>
- </assertion>
-
- <assertion id="c">
- <text>If the bean class of a bean declared in XML does not have a method with the name and parameter types declared in XML, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="3.4.10" 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. The container calls Manager.getInstanceToInject() to determine a value for each parameter of a disposal method and calls the disposal method with those parameter values</text>
- </assertion>
- </section>
-
- <section id="3.4.11" title="Disposal method resolution">
-
- <assertion id="a">
- <text>When searching for disposal methods for a producer method, the container searches for disposal methods which are declared by an enabled bean, and for which the disposed parameter must resolve to the producer method, according to the typesafe resolution algorithm</text>
- </assertion>
-
- <assertion id="b">
- <text>If there are multiple disposal methods for a producer method, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="3.4.12" 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 simple bean class or session bean class</text>
- </assertion>
-
- <assertion id="b">
- <text>A producer field may be either static or nonstatic</text>
- </assertion>
-
- <assertion id="c">
- <text>If a producer field sometimes contains a null value when accessed, then the producer field must have scope @Dependent</text>
- </assertion>
-
- <assertion id="d">
- <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.4, "Client proxies"</text>
- </assertion>
-
- <assertion id="e">
- <text>If the producer field return type is a parameterized type, it must specify actual type parameters for each type parameter</text>
- </assertion>
-
- <assertion id="f">
- <text>If a producer field return type contains a wildcard type parameter or type variable, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="g">
- <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>
- </assertion>
-
- <assertion id="h">
- <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 @javax.inject.Produces annotation</text>
- </assertion>
-
- <assertion id="b">
- <text>A producer field may also specify scope, name, deployment type, stereotypes and/or bindings</text>
- </assertion>
- </section>
-
- <section id="3.5.3" title="Declaring a producer field using XML">
-
- <assertion id="a">
- <text>For a bean defined in XML, a producer field may be declared using the field name, the <Produces> element, and the type</text>
- </assertion>
-
- <assertion id="b">
- <text>When a producer field is declared in XML, the container ignores binding annotations applied to the Java field</text>
- </assertion>
-
- <assertion id="c">
- <text>If the bean class of a bean declared in XML does not have a field with the name and type declared in XML, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- </section>
-
- <section id="3.5.4" 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="a">
- <text>Resources may be declared in beans.xml, allowing direct injection of an EE resource, entity manager, entity manager factory, EJB remote object or web service reference</text>
- </assertion>
-
- <assertion id="b">
- <text>The lifecycle of an injected reference is identical to the semantics of Java EE injection using @Resource, @PersistenceContext, @PersistenceUnit, @EJB or @WebServiceRef</text>
- </assertion>
-
- <assertion id="c">
- <text>A resource always has scope @Dependent</text>
- </assertion>
-
- <assertion id="d">
- <text>A resource may not declare a bean name</text>
- </assertion>
-
- <assertion id="e">
- <text>Resources are always declared using XML</text>
- </assertion>
- </section>
-
- <section id="3.6.1" title="Declaring a resource using XML">
-
- <assertion id="a">
- <text>A resource may be declared in beans.xml using an element that represents the Java type of the resource. For a Java EE resource, the EE resource type must be specified - for example javax.sql.Datasource for a JDBC datasource. The bean type of the resource is this specified type</text>
- </assertion>
-
- <assertion id="b">
- <text>A resource may be declared in beans.xml using an element that represents the Java type of the resource. For a persistence context, javax.persistence.EntityManager must be specified. The bean type of the resource is this specified type</text>
- </assertion>
-
- <assertion id="c">
- <text>A resource may be declared in beans.xml using an element that represents the Java type of the resource. For a persistence unit, javax.persistence.EntityManagerFactory must be specified. The bean type of the resource is this specified type</text>
- </assertion>
-
- <assertion id="d">
- <text>A resource may be declared in beans.xml using an element that represents the Java type of the resource. For a remote EJB, an EJB remote interface type must be specified. The bean type of the resource is this specified type</text>
- </assertion>
-
- <assertion id="e">
- <text>A resource may be declared in beans.xml using an element that represents the Java type of the resource. For a web service, a web service type must be specified. The bean type of the resource is this specified type</text>
- </assertion>
-
- <assertion id="f">
- <text>Each resource declaration must contain a child <Resource>, <PersistenceContext>, <PersistenceUnit>, <EJB> or
-<WebServiceRef> element. For a Java EE resource, a JNDI name or mapped name must be specified using the <name> or <mappedName> child elements
-of the <Resource> element</text>
- </assertion>
-
- <assertion id="g">
- <text>Each resource declaration must contain a child <Resource>, <PersistenceContext>, <PersistenceUnit>, <EJB> or
-<WebServiceRef> element. For a persistence context, a persistence unit name must be specified using the <unitName> child element of the <PersistenceContext> element</text>
- </assertion>
-
- <assertion id="h">
- <text>Each resource declaration must contain a child <Resource>, <PersistenceContext>, <PersistenceUnit>, <EJB> or
-<WebServiceRef> element. For a persistence unit, a persistence unit name must be specified using the <unitName> child element of the <PersistenceUnit> element</text>
- </assertion>
-
- <assertion id="i">
- <text>Each resource declaration must contain a child <Resource>, <PersistenceContext>, <PersistenceUnit>, <EJB> or
-<WebServiceRef> element. For a remote EJB, a JNDI name, mapped name or EJB link must be specified using the <name>, <mappedName> or <ejbLink> child elements of the <EJB> element</text>
- </assertion>
-
- <assertion id="j">
- <text>Each resource declaration must contain a child <Resource>, <PersistenceContext>, <PersistenceUnit>, <EJB> or
-<WebServiceRef> element. For a web service, a JNDI name or mapped name must be specified using the <name> or <mappedName> child elements of the <WebServiceRef> element. Optionally, a URL pointing to a WSDL document may be specified using the <wsdlLocation> child element</text>
- </assertion>
-
- <assertion name="k">
- <text>The JNDI name specified by the <name> element must be a name in the global java:global or application java:app naming context</text>
- </assertion>
-
- <assertion name="l">
- <text>Optionally, one or more bindings may be specified for resources in XML. If no binding is explicitly specified, the default binding @Current is assumed.</text>
- </assertion>
-
- </section>
-
- <section id="3.7" title="JMS resources">
- <assertion id="a">
- <text>JMS resources may be declared in beans.xml</text>
- </assertion>
-
- <assertion id="b">
- <text>JMS queue resources must allow the direct injection of the Queue, QueueConnection, QueueSession, QueueReceiver and/or QueueSender</text>
- </assertion>
-
- <assertion id="c">
- <text>JMS topic resources must allow the direct injection of the Topic, TopicConnection, TopicSession, TopicSubscriber and/or TopicPublisher</text>
- </assertion>
-
- <assertion id="d">
- <text>The lifecycles of the injected objects are managed by the container, and therefore the application need not explicitly close() any injected JMS object. If the application calls close() on an instance of a JMS resource, an UnsupportedOperationException is thrown by the container.</text>
- </assertion>
-
- <assertion id="e">
- <text>A JMS resource always has scope @Dependent</text>
- </assertion>
-
- <assertion id="f">
- <text>A JMS resource may not declare a bean name</text>
- </assertion>
-
- <assertion id="g">
- <text>JMS resources are always declared using XML</text>
- </assertion>
- </section>
-
- <section id="3.7.1" title="Bean types of a JMS resource">
-
- <assertion id="a">
- <text>For JMS resources that represent a queue, the bean types are Queue, QueueConnection, QueueSession and QueueSender</text>
- </assertion>
-
- <assertion id="b">
- <text>For JMS resources that represent a topic, the bean types are Topic, TopicConnection, TopicSession and TopicPublisher</text>
- </assertion>
- </section>
-
- <section id="3.7.2" title="Declaring a JMS resource using XML">
-
- <assertion id="a">
- <text>A JMS resource may be declared using the <Topic> or <Queue> elements in beans.xml</text>
- </assertion>
-
- <assertion id="b">
- <text>Each JMS resource declaration must contain a child <Resource> element. A JNDI name or mapped name must be specified using the <name> or <mappedName> child elements of the <Resource> element</text>
- </assertion>
-
- <assertion id="c">
- <text>One or more bindings may be specified. If no binding is explicitly specified, the default binding @Current is assumed</text>
- </assertion>
- </section>
-
- <section id="3.8" title="Injected fields">
-
- <assertion id="a">
- <text>An injected field is a non-static, non-final field of a bean class, of a servlet, or of any EJB session or message driven bean class.</text>
- </assertion>
-
- <assertion id="b">
- <text>Injected fields are initialized by the container immediately after instantiation and before any methods of the instance are invoked. The container calls the method Manager.getInstanceToInject() defined in Section 5.7.1, "Resolving dependencies" to determine a value for each injected field</text>
- </assertion>
-
- <assertion id="c">
- <text>Any EJB session or message driven bean may declare injected fields and have those fields injected by the container</text>
- </assertion>
-
- <assertion id="d">
- <text>If a field is a producer field or a decorator delegate attribute, it is not an injected field</text>
- </assertion>
- </section>
-
- <section id="3.8.1" title="Declaring an injected field using annotations">
-
- <assertion id="a">
- <text>An injected field may be declared by annotating the field with any binding type</text>
- </assertion>
- </section>
-
- <section id="3.8.2" title="Declaring an injected field using XML">
- <assertion id="a">
- <text>For bean defined in XML, an injected field may be declared using the field name and a child element representing the type of the field</text>
- </assertion>
-
- <assertion id="b">
- <text>When an injected field is declared in XML, the container ignores binding annotations applied to the Java field</text>
- </assertion>
-
- <assertion id="c">
- <text>If the type element does not declare any binding, the default binding @Current is assumed</text>
- </assertion>
-
- <assertion id="d">
- <text>If the bean class of a bean declared in XML does not have a field with the name and type declared in XML, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="3.9" title="Initializer methods">
- <assertion id="a">
- <text>An initializer method is a non-static method of a bean class, of a servlet, or of any EJB session or message driven bean class.</text>
- </assertion>
-
- <assertion id="b">
- <text>Initializer methods are called by the container immediately after injected fields have been initialized by the container and before any other methods of the instance are invoked.</text>
- </assertion>
-
- <assertion id="c">
- <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="d">
- <text>Method interceptors are never called when the container calls an initializer method</text>
- </assertion>
-
- <assertion id="e">
- <text>A bean class may declare multiple (or zero) initializer methods</text>
- </assertion>
-
- <assertion id="f">
- <text>The application may call initializer methods directly, but then no parameters will be passed to the method by the container</text>
- </assertion>
-
- <assertion id="g">
- <text>Any EJB session or message driven bean may declare initializer methods and have the methods called by the container</text>
- </assertion>
- </section>
-
- <section id="3.9.1" title="Declaring an initializer method using annotations">
- <assertion id="a">
- <text>An initializer method may be declared by annotating the method @javax.inject.Initializer</text>
- </assertion>
-
- <assertion id="b">
- <text>If an initializer method is annotated @Produces, has a parameter annotated @Disposes, or has a parameter annotated @Observes, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- </section>
-
- <section id="3.9.2" title="Declaring an initializer method using XML">
-
- <assertion id="a">
- <text>For a bean defined in XML, an initializer method may be declared using the method name, the <Initializer> element and the parameter types of the method</text>
- </assertion>
-
- <assertion id="b">
- <text>When an initializer method is declared in XML, the container ignores binding annotations applied to the Java method parameters</text>
- </assertion>
-
- <assertion id="c">
- <text>If the bean class of a bean declared in XML does not have a method with the name and parameter types declared in XML, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="3.9.3" title="Initializer method parameters">
- <assertion id="a">
- <text>An initializer method may have any number of parameters. If the initializer method has parameters, the container calls Manager.getInstanceToInject() to determine a value for each parameter and calls the initializer method with those parameter values</text>
- </assertion>
- </section>
-
- <section id="3.10" title="Support for Common Annotations">
- <assertion id="a">
- <text>Dependency injection via @EJB, @Resource, @PersistenceUnit and @PersistenceContext is provided by the container when annotations are applied to the bean class of a simple bean</text>
- </assertion>
-
- <assertion id="b">
- <text>@PostConstruct and @PreDestroy callbacks are provided by the container when annotations are applied to the bean class of a simple bean</text>
- </assertion>
-
- <assertion id="c">
- <text>Interception, as defined in javax.interceptor is provided by the container when annotations are applied to the bean class of a simple bean</text>
- </assertion>
-
- <assertion id="d">
- <text>@PersistenceContext(type=EXTENDED) is not supported for simple beans</text>
- </assertion>
- </section>
-
- <section id="3.11" title="The Bean object for a bean">
- <assertion id="a">
- <text>Concrete subclasses of Bean must implement the operations defined by the Contextual interface defined in Section 6.1, "The Contextual interface".</text>
- </assertion>
-
- <assertion id="b">
- <text>An instance of Bean exists for every enabled bean in a deployment</text>
- </assertion>
-
- <assertion id="c">
- <text>An application or third party framework may add support for new kinds of beans beyond those defined by the this specification (simple beans, session beans, producer methods and fields, resources and JMS resources) by extending Bean and registering beans with the container, using the mechanism defined in Section 11.3, "Bean registration".</text>
- </assertion>
- </section>
-
- <section id="4" title="Inheritance, specialization and realization">
-
- </section>
-
- <section id="4.1" title="Inheritance of type-level metadata">
-
- <assertion id="a">
- <text>For class X which is extended directly or indirectly by the bean class of a simple or session bean Y, if X is annotated with a binding type, stereotype or interceptor 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="b">
- <text>For class X which is extended directly or indirectly by the bean class of a simple or session bean Y, if X is annotated with a scope type Z then Y inherits the annotation if and only if Z declares the @Inherited metaannotation 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="c">
- <text>For class X which is extended directly or indirectly by the bean class of a simple or session 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="d">
- <text>For class X which is extended directly or indirectly by the bean class of a simple or session bean Y, the scope types and deployment types explicitly declared by and inherited from the class X take precedence over default scopes and deployment types declared by stereotypes.</text>
- </assertion>
-
- <assertion id="e">
- <text>For class X which is the bean class of a simple or session bean Y declared using XML, if X is annotated with a binding type, stereotype or interceptor binding type Z then Y inherits the annotation if and only if Z declares the @Inherited meta-annotation and Y does not explicitly declare an annotation of type Z using XML.</text>
- </assertion>
-
- <assertion id="f">
- <text>For class X which is the bean class of a simple or session bean Y declared using XML, if X is annotated with a scope type Z then Y inherits the annotation if and only if Z declares the @Inherited metaannotation and Y does not explicitly declare a scope type using XML.</text>
- </assertion>
-
- <assertion id="g">
- <text>For class X which is the bean class of a simple or session bean Y declared using XML, 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 explicitly declare a deployment type using XML.</text>
- </assertion>
-
- <assertion id="h">
- <text>For class X which is the bean class of a simple or session bean Y declared using XML, the scope types and deployment types explicitly declared by and inherited from the class X take precedence over default scope and deployment types declared by stereotypes.</text>
- </assertion>
-
- <assertion id="i">
- <text>For annotations defined by the bean specification, all built-in scope types are declared @Inherited</text>
- </assertion>
-
- <assertion id="j">
- <text>For annotations defined by the bean specification, all built-in stereotypes are declared @Inherited</text>
- </assertion>
-
- <assertion id="k">
- <text>For annotations defined by the bean specification, no built-in binding type is declared @Inherited</text>
- </assertion>
-
- <assertion id="l">
- <text>For annotations defined by the bean specification, the built-in deployment type is not declared @Inherited</text>
- </assertion>
-
- <assertion id="m">
- <text>the @Named annotation is not declared @Inherited and bean names are not inherited unless specialization is used</text>
- </assertion>
-
- </section>
-
- <section id="4.2" title="Inheritance of member-level metadata">
- <assertion id="a">
- <text>For class X which is extended directly or indirectly by the bean class of a simple or session bean Y, if X declares an injected field x then Y inherits x.</text>
- </assertion>
-
- <assertion id="b">
- <text>For class X which is extended directly or indirectly by the bean class of a simple or session bean Y, if X declares an initializer method, @PostConstruct method or @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="c">
- <text>For class X which is extended directly or indirectly by the bean class of a simple or session bean Y, if X declares a non-static method x() annotated with an interceptor binding type Z then Y inherits the binding 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="d">
- <text>For class X which is extended directly or indirectly by the bean class of a simple or session bean Y, if X declares a non-static producer, disposal, or observer method x() then Y does not inherit this method unless Y is explicitly declared to specialize or realize X</text>
- </assertion>
-
- <assertion id="e">
- <text>For class X which is extended directly or indirectly by the bean class of a simple or 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 or realize X.</text>
- </assertion>
-
- <assertion id="f">
- <text>For class X which is extended directly or indirectly by the bean class of a simple or session bean Y, if Y is a decorator and X declares a delegate attribute 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 defines a delegate attribute</text>
- </assertion>
-
- <assertion id="g">
- <text>For class X which is the bean class of a simple or session bean Y declared using XML, if X declares an injected field x then Y inherits x, unless Y explicitly declares x using XML.</text>
- </assertion>
-
- <assertion id="h">
- <text>For class X which is the bean class of a simple or session bean Y declared using XML, if X declares an initializer method, @PostConstruct method or @PreDestroy method x() then Y inherits x(), unless Y explicitly declares x() using XML</text>
- </assertion>
-
- <assertion id="i">
- <text>For class X which is the bean class of a simple or session bean Y declared using XML, if X declares a non-static method x() annotated with an interceptor binding type Z then Y inherits the binding, unless Y explicitly declares x() using XML.</text>
- </assertion>
-
- <assertion id="j">
- <text>For class X which is the bean class of a simple or session bean Y declared using XML, if X declares a non-static producer, disposal, or observer method x() then Y does not inherit this method, unless Y is explicitly declared to specialize or realize X.</text>
- </assertion>
-
- <assertion id="k">
- <text>For class X which is the bean class of a simple or session bean Y declared using XML, if X declares a non-static producer field x then Y does not inherit this method, unless Y is explicitly declared to specialize or realize X.</text>
- </assertion>
-
- <assertion id="l">
- <text>For class X which is the bean class of a simple or session bean Y declared using XML, if Y is a decorator and X declares a delegate attribute x then Y inherits x, unless Y explicitly declares a delegate attribute using XML.</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="c">
- <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, 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="Using specialization">
-
- <assertion id="a">
- <text>A bean declared using annotations may declare that it specializes a lower-priority bean using the @Specializes annotation</text>
- </assertion>
-
- <assertion id="b">
- <text>A bean declared using XML may declare that it specializes a lower-priority bean using the <Specializes> element</text>
- </assertion>
-
- <assertion id="c">
- <text>The bindings of a bean X that specializes a lower-priority bean Y include all bindings of Y, together with all bindings declared explicitly by X.</text>
- </assertion>
-
- <assertion id="d">
- <text>If a bean X specializes a lower-priority bean Y with a name, the name of X is the same as the name of Y. If X declares a name explicitly, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="e">
- <text>When an enabled bean specializes a lower-priority bean, we can be certain that the lower-priority bean is never instantiated or called by the container. Even if the lower-priority bean defines a producer method, the method will be called upon an instance of the first bean</text>
- </assertion>
-
- <assertion id="f">
- <text>Specialization applies only to simple beans, as defined in Section 3.2.7, "Specializing a simple bean", session beans, as defined in Section 3.3.7, "Specializing a session bean" and producer methods, as defined in Section 3.4.5, "Specializing a producer method".</text>
- </assertion>
- </section>
-
- <section id="4.3.2" title="Direct and indirect specialization">
- <assertion id="a">
- <text>The @javax.inject.Specializes annotation or <Specializes> XML element is used to indicate that one bean directly specializes another bean</text>
- </assertion>
-
- <assertion id="b">
- <text>A bean X is said to specialize another bean Y if X directly specializes Y, or a bean Z exists, such that X directly specializes Z and Z specializes Y</text>
- </assertion>
-
- <assertion id="c">
- <text>Any non-static producer methods (see Section 3.4, "Producer methods"), producer fields (see Section 3.5, "Producer fields"), disposal methods (see Section 3.4.6, "Disposal methods") or observer methods (see Section 7.5, "Observer methods") of any bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 6.7, "Lifecycle of producer methods", Section 6.8, "Lifecycle of producer fields" and Section 7.4, "Observer notification".</text>
- </assertion>
- </section>
-
- <section id="4.3.3" title="Inconsistent specialization">
- <assertion id="a">
- <text>If, in a particular deployment, either some enabled bean X specializes another enabled bean Y and X does not have a higher precedence than Y, or more than one enabled bean directly specializes the same bean we say that inconsistent specialization exists, and an InconsistentSpecializationException is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="4.4" title="Realization">
- <assertion id="a">
- <text>Any bean that extends a generic class may directly extend the generic class, in the case of a bean declared using annotations</text>
- </assertion>
-
- <assertion id="b">
- <text>Any bean that extends a generic class may declare that the generic class is the bean class, in the case of a bean declared using XML, and then explicitly declare that it realizes the generic class.</text>
- </assertion>
-
- </section>
-
- <section id="4.4.1" title="Using realization">
- <assertion id="a">
- <text>A bean declared using annotations may declare that it realizes a generic class by annotating the bean class with the @javax.inject.Realizes annotation</text>
- </assertion>
-
- <assertion id="b">
- <text>A bean declared using XML may declare that it realizes a generic class using the <Realizes> element.</text>
- </assertion>
-
- <assertion id="c">
- <text>If a generic class Y declares a non-static producer method or field with a certain combination of scope, stereotypes, bindings and interceptor bindings, then every bean X that realizes Y also has a producer method or field with the same scope, stereotypes and interceptor bindings. The bindings for this inherited producer method or field consist of all bindings declared by the producer method or field of Y, excluding all bindings of Y, together with the bindings declared explicitly by X. The deployment type of the inherited producer method or field is the deployment type of X</text>
- </assertion>
-
- <assertion id="d">
- <text>If a generic class Y declares a non-static disposal method with a disposed parameter with a certain combination of bindings, then every bean X that realizes Y also has a disposal method. The bindings of the disposed parameter of this
-inherited disposal method consist of all bindings declared by the disposed parameter of the disposal method of Y, excluding all bindings of Y, together with the bindings declared explicitly by X.</text>
- </assertion>
-
- <assertion id="e">
- <text>If a generic class Y declares a non-static observer method with an event parameter with a certain combination of event bindings, then every bean X that realizes Y also has an observer method. The event bindings of the event parameter of
-this inherited observer method consist of all event bindings declared by the event parameter of the observer method of Y.</text>
- </assertion>
-
- <assertion id="f">
- <text>Realization applies only to simple beans and session beans</text>
- </assertion>
- </section>
-
- <section id="5" title="Lookup, dependency injection and EL resolution">
- <assertion id="a">
- <text>The container is required to ensure that any injected reference to a contextual instance of a bean may be cast to any bean type of the bean.</text>
- </assertion>
-
- <assertion id="b">
- <text>The container is required to support circularities in the bean dependency graph</text>
- </assertion>
- </section>
-
- <section id="5.1" title="Unsatisfied and ambiguous dependencies">
- <assertion id="a">
- <text>The container must validate all injection points of all enabled beans at deployment time to ensure that there are no unsatisfied or ambiguous dependencies. If an unsatisfied or ambiguous dependency exists, an UnsatisfiedDependencyException
-or AmbiguousDependencyException is thrown by the container at deployment time, as defined in Section 5.7.1, "Resolving dependencies".</text>
- </assertion>
- </section>
-
- <section id="5.2" title="Primitive types and null values">
- <assertion id="a">
- <text>If an injection point of primitive type resolves to a bean that may be null, such as a producer method with a nonprimitive return type or a producer field with a non-primitive type, a NullableDependencyException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="b">
- <text>The method Bean.isNullable() may be used to detect if a bean has null values</text>
- </assertion>
- </section>
-
- <section id="5.3" title="Injected 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="5.4" title="Client proxies">
-
- </section>
-
- <section id="5.4.1" title="Unproxyable bean types">
-
- </section>
-
- <section id="5.4.2" title="Client proxy invocation">
-
- </section>
-
- <section id="5.5" title="The default binding at injection points">
-
- </section>
-
- <section id="5.6" title="Injection point metadata">
-
- </section>
-
- <section id="5.6.1" title="Injecting InjectionPoint">
-
- </section>
-
- <section id="5.7" title="The Manager object">
-
- </section>
-
- <section id="5.7.1" title="Resolving dependencies">
-
- </section>
-
- <section id="5.7.2" title="Obtaining contextual instances">
-
- </section>
-
- <section id="5.8" title="Dynamic lookup">
-
- </section>
-
- <section id="5.9" title="Typesafe resolution algorithm">
-
- </section>
-
-
-
-
-</specification>
Deleted: tck/trunk/impl/tck-audit.xsd
===================================================================
--- tck/trunk/impl/tck-audit.xsd 2009-02-14 02:10:10 UTC (rev 1513)
+++ tck/trunk/impl/tck-audit.xsd 2009-02-14 23:19:09 UTC (rev 1514)
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- targetNamespace="http://jboss.com/products/webbeans/tck/audit"
- xmlns:audit="http://jboss.com/products/webbeans/tck/audit">
-
- <xs:element name="specification">
- <xs:annotation>
- <xs:documentation> The specification tag is the root element for tck-audit.xml. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="audit:section"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="section">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" maxOccurs="unbounded" ref="audit:assertion"/>
- </xs:sequence>
- <xs:attributeGroup ref="audit:attlist.section"/>
- </xs:complexType>
- </xs:element>
-
- <xs:attributeGroup name="attlist.section">
- <xs:attribute name="id" type="xs:string"/>
- <xs:attribute name="title" type="xs:string"/>
- </xs:attributeGroup>
-
- <xs:element name="assertion">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" ref="audit:text"/>
- <xs:element minOccurs="0" maxOccurs="1" ref="audit:note"/>
- </xs:sequence>
- <xs:attributeGroup ref="audit:attlist.assertion"/>
- </xs:complexType>
- </xs:element>
-
- <xs:attributeGroup name="attlist.assertion">
- <xs:attribute name="id" type="xs:string"/>
- </xs:attributeGroup>
-
- <xs:element name="text">
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string"/>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="note">
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string"/>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
-
-</xs:schema>
\ No newline at end of file
More information about the weld-commits
mailing list