Author: pete.muir(a)jboss.org
Date: 2009-03-08 20:18:30 -0400 (Sun, 08 Mar 2009)
New Revision: 1853
Added:
tck/tags/1.0.0.ALPHA2/
tck/tags/1.0.0.ALPHA2/api/pom.xml
tck/tags/1.0.0.ALPHA2/impl/pom.xml
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
tck/tags/1.0.0.ALPHA2/impl/src/main/resources/tck-audit.xml
tck/tags/1.0.0.ALPHA2/pom.xml
Removed:
tck/tags/1.0.0.ALPHA2/api/pom.xml
tck/tags/1.0.0.ALPHA2/impl/pom.xml
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
tck/tags/1.0.0.ALPHA2/impl/src/main/resources/tck-audit.xml
tck/tags/1.0.0.ALPHA2/pom.xml
Log:
[maven-release-plugin] copy for tag 1.0.0.ALPHA2
Copied: tck/tags/1.0.0.ALPHA2 (from rev 1823, tck/trunk)
Deleted: tck/tags/1.0.0.ALPHA2/api/pom.xml
===================================================================
--- tck/trunk/api/pom.xml 2009-03-08 22:37:17 UTC (rev 1823)
+++ tck/tags/1.0.0.ALPHA2/api/pom.xml 2009-03-09 00:18:30 UTC (rev 1853)
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-JBoss, Home of Professional Open Source
-Copyright 2008, Red Hat Middleware LLC, and individual contributors
-by the @authors tag. See the copyright.txt in the distribution for a
-full listing of individual contributors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-http://www.apache.org/licenses/LICENSE-2.0
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.jboss.jsr299.tck</groupId>
- <artifactId>parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </parent>
-
- <groupId>org.jboss.jsr299.tck</groupId>
- <artifactId>jsr299-tck-api</artifactId>
- <packaging>jar</packaging>
- <name>JSR-299 TCK API</name>
- <
url>http://www.seamframework.org/WebBeans</url>
-
- <dependencies>
-
- <dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>jsr299-api</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.2</version>
- <configuration>
- <archive>
- <manifest>
- <mainClass>org.jboss.jsr299.tck.api.TCK</mainClass>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
Copied: tck/tags/1.0.0.ALPHA2/api/pom.xml (from rev 1852, tck/trunk/api/pom.xml)
===================================================================
--- tck/tags/1.0.0.ALPHA2/api/pom.xml (rev 0)
+++ tck/tags/1.0.0.ALPHA2/api/pom.xml 2009-03-09 00:18:30 UTC (rev 1853)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.jboss.jsr299.tck</groupId>
+ <artifactId>parent</artifactId>
+ <version>1.0.0.ALPHA2</version>
+ </parent>
+
+ <groupId>org.jboss.jsr299.tck</groupId>
+ <artifactId>jsr299-tck-api</artifactId>
+ <packaging>jar</packaging>
+ <name>JSR-299 TCK API</name>
+ <
url>http://www.seamframework.org/WebBeans</url>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>jsr299-api</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>org.jboss.jsr299.tck.api.TCK</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Deleted: tck/tags/1.0.0.ALPHA2/impl/pom.xml
===================================================================
--- tck/trunk/impl/pom.xml 2009-03-08 22:37:17 UTC (rev 1823)
+++ tck/tags/1.0.0.ALPHA2/impl/pom.xml 2009-03-09 00:18:30 UTC (rev 1853)
@@ -1,304 +0,0 @@
-<?xml version="1.0"?>
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>parent</artifactId>
- <groupId>org.jboss.jsr299.tck</groupId>
- <version>1.0.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.jsr299.tck</groupId>
- <artifactId>jsr299-tck-impl</artifactId>
- <name>JSR-299 TCK tests and harness</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>jsr299-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.jsr299.tck</groupId>
- <artifactId>jsr299-tck-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <classifier>jdk15</classifier>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>tck-utils-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.ejb3</groupId>
- <artifactId>jboss-ejb3-api</artifactId>
- <exclusions>
- <exclusion>
- <artifactId>jboss-jaxrpc</artifactId>
- <groupId>jbossws</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jboss-transaction-api</artifactId>
- <groupId>org.jboss.javaee</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jboss-jaxrpc</artifactId>
- <groupId>jboss.jbossws</groupId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
-
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>persistence-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- </dependency>
-
- <dependency>
- <groupId>net.sourceforge.htmlunit</groupId>
- <artifactId>htmlunit</artifactId>
- </dependency>
-
- </dependencies>
-
- <build>
- <defaultGoal>install</defaultGoal>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.2</version>
- <executions>
- <execution>
- <id>attach-artifacts</id>
- <phase>package</phase>
- <goals>
- <goal>attach-artifact</goal>
- </goals>
- <configuration>
- <artifacts>
- <artifact>
-
<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>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-in-container-dependencies</id>
- <phase>compile</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
-
<outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
- <stripVersion>true</stripVersion>
- <artifactItems>
- <artifactItem>
- <groupId>org.jboss.jsr299.tck</groupId>
- <artifactId>jsr299-tck-api</artifactId>
- <overWrite>true</overWrite>
- </artifactItem>
- <artifactItem>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <classifier>jdk15</classifier>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>tck-audit</id>
- <activation>
- <property>
- <name>tck-audit</name>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>tck-utils-impl</artifactId>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
-
<compilerArgument>-AauditXml=${basedir}/src/main/resources/tck-audit.xml</compilerArgument>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <executions>
- <execution>
- <id>enforce-versions</id>
- <goals>
- <goal>enforce</goal>
- </goals>
- <configuration>
- <rules>
- <requireJavaVersion>
- <version>1.6</version>
- </requireJavaVersion>
- </rules>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- <defaultGoal>compile</defaultGoal>
- </build>
- </profile>
-
- <profile>
- <id>write-artifacts-to-disk</id>
- <activation>
- <property>
- <name>dumpArtifacts</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>generate-jsr-299-artifacts</id>
- <phase>package</phase>
- <goals>
- <goal>java</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <mainClass>org.jboss.jsr299.tck.api.TCK</mainClass>
- <systemProperties>
- <systemProperty>
- <key>dumpArtifacts</key>
- <value>true</value>
- </systemProperty>
- <systemProperty>
- <key>org.jboss.jsr299.tck.outputDirectory</key>
- <value>target/jsr299-artifacts</value>
- </systemProperty>
- <systemProperty>
- <key>org.jboss.jsr299.tck.libraryDirectory</key>
- <value>${libaryDir}</value>
- </systemProperty>
- </systemProperties>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>attach-audit</id>
- <activation>
- <property>
- <name>attach-audit</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.2</version>
- <executions>
- <execution>
- <id>attach-artifacts</id>
- <phase>package</phase>
- <goals>
- <goal>attach-artifact</goal>
- </goals>
- <configuration>
- <artifacts>
- <artifact>
-
<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>../target/coverage.html</file>
- <type>html</type>
- <classifier>coverage</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
Copied: tck/tags/1.0.0.ALPHA2/impl/pom.xml (from rev 1852, tck/trunk/impl/pom.xml)
===================================================================
--- tck/tags/1.0.0.ALPHA2/impl/pom.xml (rev 0)
+++ tck/tags/1.0.0.ALPHA2/impl/pom.xml 2009-03-09 00:18:30 UTC (rev 1853)
@@ -0,0 +1,304 @@
+<?xml version="1.0"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>parent</artifactId>
+ <groupId>org.jboss.jsr299.tck</groupId>
+ <version>1.0.0.ALPHA2</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.jsr299.tck</groupId>
+ <artifactId>jsr299-tck-impl</artifactId>
+ <name>JSR-299 TCK tests and harness</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>jsr299-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jsr299.tck</groupId>
+ <artifactId>jsr299-tck-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <classifier>jdk15</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>tck-utils-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-api</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>jboss-jaxrpc</artifactId>
+ <groupId>jbossws</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jboss-transaction-api</artifactId>
+ <groupId>org.jboss.javaee</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>jboss-jaxrpc</artifactId>
+ <groupId>jboss.jbossws</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.2</version>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+
<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>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-in-container-dependencies</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+
<outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
+ <stripVersion>true</stripVersion>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.jsr299.tck</groupId>
+ <artifactId>jsr299-tck-api</artifactId>
+ <overWrite>true</overWrite>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <classifier>jdk15</classifier>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>tck-audit</id>
+ <activation>
+ <property>
+ <name>tck-audit</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>tck-utils-impl</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+
<compilerArgument>-AauditXml=${basedir}/src/main/resources/tck-audit.xml</compilerArgument>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>enforce-versions</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireJavaVersion>
+ <version>1.6</version>
+ </requireJavaVersion>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <defaultGoal>compile</defaultGoal>
+ </build>
+ </profile>
+
+ <profile>
+ <id>write-artifacts-to-disk</id>
+ <activation>
+ <property>
+ <name>dumpArtifacts</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-jsr-299-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <mainClass>org.jboss.jsr299.tck.api.TCK</mainClass>
+ <systemProperties>
+ <systemProperty>
+ <key>dumpArtifacts</key>
+ <value>true</value>
+ </systemProperty>
+ <systemProperty>
+ <key>org.jboss.jsr299.tck.outputDirectory</key>
+ <value>target/jsr299-artifacts</value>
+ </systemProperty>
+ <systemProperty>
+ <key>org.jboss.jsr299.tck.libraryDirectory</key>
+ <value>${libaryDir}</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>attach-audit</id>
+ <activation>
+ <property>
+ <name>attach-audit</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.2</version>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+
<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>../target/coverage.html</file>
+ <type>html</type>
+ <classifier>coverage</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
Deleted:
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java 2009-03-08
22:37:17 UTC (rev 1823)
+++
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java 2009-03-09
00:18:30 UTC (rev 1853)
@@ -1,143 +0,0 @@
-package org.jboss.jsr299.tck.tests.definition.deployment;
-
-import javax.inject.DeploymentException;
-import javax.inject.Production;
-import javax.inject.UnsatisfiedDependencyException;
-import javax.inject.manager.Bean;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.hibernate.tck.annotations.SpecAssertions;
-import org.jboss.jsr299.tck.AbstractDeclarativeTest;
-import org.jboss.jsr299.tck.impl.packaging.Artifact;
-import org.jboss.jsr299.tck.impl.packaging.jsr299.BeansXml;
-import org.testng.annotations.Test;
-
-/**
- *
- * Spec version: Public Release Draft 2
- *
- */
-@Artifact
-(a)BeansXml("beans.xml")
-public class DeploymentTypeDefinitionTest extends AbstractDeclarativeTest
-{
-
- /**
- *
- * TODO This text is not really a testable assertion
- */
- @Test(groups = { "stub", "annotationDefinition",
"deploymentType" })
- @SpecAssertion(section = "2.5.2", id = "a")
- public void testDeploymentTypeHasCorrectTarget()
- {
- assert false;
- }
-
- /**
- *
- * TODO This text is not really a testable assertion
- */
- @Test(groups = { "stub", "annotationDefinition",
"deploymentType" })
- @SpecAssertion(section = "2.5.2", id = "c")
- public void testDeploymentTypeDeclaresDeploymentTypeAnnotation()
- {
- assert false;
- }
-
- @Test(groups = { "deploymentType" })
- @SpecAssertion(section = "2.5.3", id = "c")
- public void testDeploymentTypeInhertitedFromDeclaringBean() throws Exception
- {
- assert getCurrentManager().resolveByType(BlackWidow.class).size() == 1;
- Bean<BlackWidow> blackWidowSpiderModel =
getCurrentManager().resolveByType(BlackWidow.class).iterator().next();
- assert
blackWidowSpiderModel.getDeploymentType().equals(AnotherDeploymentType.class);
- }
-
- /**
- *
- * TODO Section 2.5.4 does not claim that XML overrides Java for deployment
- * types
- */
- @Test(groups = { "stub", "webbeansxml", "deploymentType"
})
- @SpecAssertion(section = "2.5.4", id = "a")
- public void testXmlDeploymentTypeElement()
- {
- assert false;
- }
-
- @Test(groups = { "webbeansxml", "deploymentType" })
- @SpecAssertion(section = "2.5.5", id = "a")
- public void testDefaultDeploymentType()
- {
- assert getCurrentManager().resolveByType(Tarantula.class).size() == 1;
- Bean<Tarantula> bean =
getCurrentManager().resolveByType(Tarantula.class).iterator().next();
- assert bean.getDeploymentType().equals(Production.class);
- }
-
- @Test(groups = { "deploymentType" })
- @SpecAssertion(section = "2.5.5", id = "b")
- public void testHighestPrecedenceDeploymentTypeFromStereotype()
- {
- assert getCurrentManager().resolveByType(Rhinoceros.class).size() == 1;
- Bean<?> bean =
getCurrentManager().resolveByType(Rhinoceros.class).iterator().next();
- assert bean.getDeploymentType().equals(HornedAnimalDeploymentType.class);
- }
-
- @Test(groups = { "beanLifecycle", "deploymentType" },
expectedExceptions = UnsatisfiedDependencyException.class)
- @SpecAssertion(section = "2.5.6", id = "a")
- public void testBeanWithDisabledDeploymentTypeNotInstantiated()
- {
- getCurrentManager().getInstanceByType(RedSnapper.class);
- }
-
- @Test(groups = { "stub", "webbeansxml", "deploymentType"
}, expectedExceptions = DeploymentException.class)
- @SpecAssertion(section = "2.5.4", id = "b")
- public void testMultipleDeployElementsCannotBeDefined()
- {
- assert false;
- }
-
- @Test(groups = { "deploymentType" })
- @SpecAssertions( { @SpecAssertion(section = "2.5.5", id = "c"),
- @SpecAssertion(section = "2.7.2", id = "da"),
- @SpecAssertion(section = "4.1", id = "da") })
- public void testWebBeanDeploymentTypeOverridesStereotype()
- {
- assert getCurrentManager().resolveByType(Reindeer.class).size() == 1;
- Bean<Reindeer> bean =
getCurrentManager().resolveByType(Reindeer.class).iterator().next();
- assert bean.getDeploymentType().equals(Production.class);
- }
-
- @Test(groups = { "deploymentType" })
- @SpecAssertion(section = "4.1", id = "ca")
- public void testDeploymentTypeDeclaredInheritedIsInherited() throws Exception
- {
- assert getCurrentManager().resolveByType(BorderCollie.class).size() == 1;
- assert
getCurrentManager().resolveByType(BorderCollie.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
- }
-
- @Test(groups = { "deploymentType" })
- @SpecAssertion(section = "4.1", id = "ca")
- public void testDeploymentTypeNotDeclaredInheritedIsNotInherited()
- {
- assert getCurrentManager().resolveByType(ShetlandPony.class).size() == 1;
- assert
getCurrentManager().resolveByType(ShetlandPony.class).iterator().next().getDeploymentType().equals(Production.class);
- }
-
- @Test(groups = { "deploymentType" })
- @SpecAssertion(section = "4.1", id = "ca")
- public void
testDeploymentTypeDeclaredInheritedIsBlockedByIntermediateDeploymentTypeNotMarkedInherited()
- {
- assert getCurrentManager().resolveByType(GoldenRetriever.class).size() == 1;
- assert
getCurrentManager().resolveByType(GoldenRetriever.class).iterator().next().getDeploymentType().equals(Production.class);
- }
-
- @Test(groups = { "deploymentType" })
- @SpecAssertion(section = "4.1", id = "ca")
- public void
testDeploymentTypeDeclaredInheritedIsBlockedByIntermediateDeploymentTypeMarkedInherited()
- {
- assert getCurrentManager().resolveByType(GoldenLabrador.class).size() == 1;
- assert
getCurrentManager().resolveByType(GoldenLabrador.class).iterator().next().getDeploymentType().equals(InheritedDeploymentType.class);
- }
-
-}
Copied:
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java
(from rev 1840,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java)
===================================================================
---
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java
(rev 0)
+++
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java 2009-03-09
00:18:30 UTC (rev 1853)
@@ -0,0 +1,144 @@
+package org.jboss.jsr299.tck.tests.definition.deployment;
+
+import javax.inject.DeploymentException;
+import javax.inject.Production;
+import javax.inject.UnsatisfiedDependencyException;
+import javax.inject.manager.Bean;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractDeclarativeTest;
+import org.jboss.jsr299.tck.impl.packaging.Artifact;
+import org.jboss.jsr299.tck.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: Public Release Draft 2
+ *
+ */
+@Artifact
+(a)BeansXml("beans.xml")
+public class DeploymentTypeDefinitionTest extends AbstractDeclarativeTest
+{
+
+ /**
+ *
+ * TODO This text is not really a testable assertion
+ */
+ @Test(groups = { "stub", "annotationDefinition",
"deploymentType" })
+ @SpecAssertion(section = "2.5.2", id = "a")
+ public void testDeploymentTypeHasCorrectTarget()
+ {
+ assert false;
+ }
+
+ /**
+ *
+ * TODO This text is not really a testable assertion
+ */
+ @Test(groups = { "stub", "annotationDefinition",
"deploymentType" })
+ @SpecAssertion(section = "2.5.2", id = "c")
+ public void testDeploymentTypeDeclaresDeploymentTypeAnnotation()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "deploymentType" })
+ @SpecAssertion(section = "2.5.3", id = "c")
+ public void testDeploymentTypeInhertitedFromDeclaringBean() throws Exception
+ {
+ assert getCurrentManager().resolveByType(BlackWidow.class).size() == 1;
+ Bean<BlackWidow> blackWidowSpiderModel =
getCurrentManager().resolveByType(BlackWidow.class).iterator().next();
+ assert
blackWidowSpiderModel.getDeploymentType().equals(AnotherDeploymentType.class);
+ }
+
+ /**
+ *
+ * TODO Section 2.5.4 does not claim that XML overrides Java for deployment
+ * types
+ */
+ @Test(groups = { "stub", "webbeansxml", "deploymentType"
})
+ @SpecAssertion(section = "2.5.4", id = "a")
+ public void testXmlDeploymentTypeElement()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "webbeansxml", "deploymentType" })
+ @SpecAssertion(section = "2.5.5", id = "a")
+ public void testDefaultDeploymentType()
+ {
+ assert getCurrentManager().resolveByType(Tarantula.class).size() == 1;
+ Bean<Tarantula> bean =
getCurrentManager().resolveByType(Tarantula.class).iterator().next();
+ assert bean.getDeploymentType().equals(Production.class);
+ }
+
+ @Test(groups = { "deploymentType" })
+ @SpecAssertion(section = "2.5.5", id = "b")
+ public void testHighestPrecedenceDeploymentTypeFromStereotype()
+ {
+ assert getCurrentManager().resolveByType(Rhinoceros.class).size() == 1;
+ Bean<?> bean =
getCurrentManager().resolveByType(Rhinoceros.class).iterator().next();
+ assert bean.getDeploymentType().equals(HornedAnimalDeploymentType.class);
+ }
+
+ @Test(groups = { "beanLifecycle", "deploymentType" },
expectedExceptions = UnsatisfiedDependencyException.class)
+ @SpecAssertion(section = "2.5.6", id = "a")
+ public void testBeanWithDisabledDeploymentTypeNotInstantiated()
+ {
+ getCurrentManager().getInstanceByType(RedSnapper.class);
+ }
+
+ @Test(groups = { "stub", "webbeansxml", "deploymentType"
}, expectedExceptions = DeploymentException.class)
+ @SpecAssertion(section = "2.5.4", id = "b")
+ public void testMultipleDeployElementsCannotBeDefined()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "deploymentType" })
+ @SpecAssertions( {
+ @SpecAssertion(section = "2.5.5", id = "c"),
+ @SpecAssertion(section = "2.7.2", id = "da")
+ })
+ public void testWebBeanDeploymentTypeOverridesStereotype()
+ {
+ assert getCurrentManager().resolveByType(Reindeer.class).size() == 1;
+ Bean<Reindeer> bean =
getCurrentManager().resolveByType(Reindeer.class).iterator().next();
+ assert bean.getDeploymentType().equals(Production.class);
+ }
+
+ @Test(groups = { "deploymentType" })
+ @SpecAssertion(section = "4.1", id = "ca")
+ public void testDeploymentTypeDeclaredInheritedIsInherited() throws Exception
+ {
+ assert getCurrentManager().resolveByType(BorderCollie.class).size() == 1;
+ assert
getCurrentManager().resolveByType(BorderCollie.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+ }
+
+ @Test(groups = { "deploymentType" })
+ @SpecAssertion(section = "4.1", id = "ca")
+ public void testDeploymentTypeNotDeclaredInheritedIsNotInherited()
+ {
+ assert getCurrentManager().resolveByType(ShetlandPony.class).size() == 1;
+ assert
getCurrentManager().resolveByType(ShetlandPony.class).iterator().next().getDeploymentType().equals(Production.class);
+ }
+
+ @Test(groups = { "deploymentType" })
+ @SpecAssertion(section = "4.1", id = "ca")
+ public void
testDeploymentTypeDeclaredInheritedIsBlockedByIntermediateDeploymentTypeNotMarkedInherited()
+ {
+ assert getCurrentManager().resolveByType(GoldenRetriever.class).size() == 1;
+ assert
getCurrentManager().resolveByType(GoldenRetriever.class).iterator().next().getDeploymentType().equals(Production.class);
+ }
+
+ @Test(groups = { "deploymentType" })
+ @SpecAssertion(section = "4.1", id = "ca")
+ public void
testDeploymentTypeDeclaredInheritedIsBlockedByIntermediateDeploymentTypeMarkedInherited()
+ {
+ assert getCurrentManager().resolveByType(GoldenLabrador.class).size() == 1;
+ assert
getCurrentManager().resolveByType(GoldenLabrador.class).iterator().next().getDeploymentType().equals(InheritedDeploymentType.class);
+ }
+
+}
Deleted:
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-03-08
22:37:17 UTC (rev 1823)
+++
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-03-09
00:18:30 UTC (rev 1853)
@@ -1,776 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-import java.lang.annotation.Annotation;
-import java.util.ArrayList;
-import java.util.Set;
-
-import javax.context.Dependent;
-import javax.event.Event;
-import javax.event.Observer;
-import javax.inject.DuplicateBindingTypeException;
-import javax.inject.Standard;
-import javax.inject.manager.Bean;
-import javax.inject.manager.Manager;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.hibernate.tck.annotations.SpecAssertions;
-import org.jboss.jsr299.tck.AbstractDeclarativeTest;
-import org.jboss.jsr299.tck.impl.packaging.Artifact;
-import org.jboss.jsr299.tck.impl.packaging.jsr299.BeansXml;
-import org.testng.annotations.Test;
-
-/**
- * Event bus tests
- *
- * @author Nicklas Karlsson
- * @author David Allen
- *
- * Spec version: Public Release Draft 2
- */
-@Artifact
-(a)BeansXml("beans.xml")
-public class EventTest extends AbstractDeclarativeTest
-{
-
- public static class AnEventType
- {
- }
-
- public static class ATemplatedEventType<T>
- {
- }
-
- public static class AnObserver implements Observer<AnEventType>
- {
- public boolean wasNotified = false;
-
- public void notify(AnEventType event)
- {
- wasNotified = true;
- }
- }
-
- public static class AListObserver implements Observer<ArrayList<String>>
- {
- public boolean wasNotified = false;
-
- public void notify(ArrayList<String> event)
- {
- wasNotified = true;
- }
- }
-
- public static class AnotherListObserver implements
Observer<ArrayList<Integer>>
- {
- public boolean wasNotified = false;
-
- public void notify(ArrayList<Integer> event)
- {
- wasNotified = true;
- }
- }
-
- public static class AnObserverWithException implements Observer<AnEventType>
- {
- public boolean wasNotified = false;
- public RuntimeException theException = new RuntimeException("RE1");
-
- public void notify(AnEventType event)
- {
- wasNotified = true;
- throw theException;
- }
- }
-
- /**
- * An event binding type is a Java annotation defined as @Target({FIELD,
- * PARAMETER}) ~or @Target({METHOD, FIELD, PARAMETER, TYPE}) and
- *
- * @Retention(RUNTIME)~
- */
- @Test(groups = { "events", "stub" })
- @SpecAssertions( { @SpecAssertion(section = "7.1", id = "d") })
- public void testEventBindingTypeTargetMostAndRuntime()
- {
-
- }
-
- /**
- * An event binding type is a Java annotation defined as ~@Target({FIELD,
- * PARAMETER}) or~ @Target({METHOD, FIELD, PARAMETER, TYPE}) ~and
- *
- * @Retention(RUNTIME)~
- */
- @Test(groups = { "events", "stub" })
- @SpecAssertions( { @SpecAssertion(section = "7.1", id = "e") })
- public void testEventBindingTypeTargetsFieldParameterAndRuntime()
- {
-
- }
-
- /**
- * An event binding type is a Java annotation defined as ~@Target({FIELD,
- * PARAMETER}) or @Target({METHOD, FIELD, PARAMETER, TYPE}) and
- * ~@Retention(RUNTIME) TODO If the binding does not have RUNTIME retention,
- * it cannot be tested
- */
- @Test(groups = { "events", "broken" })
- @SpecAssertions( { @SpecAssertion(section = "7.1", id = "f") })
- public void testEventBindingTypeNotRuntime()
- {
-
- }
-
- // TODO How to test all annotations w/o BindingType are not event bindings
- @Test(groups = { "events", "broken" })
- @SpecAssertions( { @SpecAssertion(section = "7.1", id = "g") })
- public void testEventBindingTypesSpecifyBinding()
- {
-
- }
-
- @Test(groups = { "events" }, expectedExceptions = {
IllegalArgumentException.class })
- @SpecAssertions( { @SpecAssertion(section = "7.1", id = "a"),
@SpecAssertion(section = "7.2", id = "b") })
- public void testManagerFireEventWithEventTypeParametersFails()
- {
- ATemplatedEventType<String> anEvent = new
ATemplatedEventType<String>();
- getCurrentManager().fireEvent(anEvent);
- }
-
- @Test(groups = { "events" }, expectedExceptions = {
IllegalArgumentException.class })
- @SpecAssertions( { @SpecAssertion(section = "7.1", id = "b"),
@SpecAssertion(section = "7.2", id = "c") })
- public void testManagerFireEventWithEventTypeWildcardsFails()
- {
- // Although the above test is really the same as with a wildcard,
- // we will test it anyhow since the specification calls it out separately.
- ATemplatedEventType<?> anEventOnAnyType = new
ATemplatedEventType<String>();
- getCurrentManager().fireEvent(anEventOnAnyType);
- }
-
- @Test(groups = { "events" })
- @SpecAssertions( { @SpecAssertion(section = "7.2", id = "a") })
- public void testManagerInterfaceForFireEventMethod() throws Exception
- {
- assert Manager.class.getDeclaredMethod("fireEvent", Object.class,
Annotation[].class) != null;
- }
-
- @Test(groups = { "events" }, expectedExceptions = {
IllegalArgumentException.class })
- @SpecAssertions( { @SpecAssertion(section = "7.2", id = "d") })
- public void testManagerFireEventWithNonBindingAnnotationsFails()
- {
- // The specs are not exactly clear on what is supposed to happen here,
- // but borrowing from Section 8.3, we'll expect the same behavior here
- // for a consistent API.
- // TODO Verify that fireEvent should fail on non-binding annotations
- AnEventType anEvent = new AnEventType();
- getCurrentManager().fireEvent(anEvent, new AnimalStereotypeAnnotationLiteral());
- }
-
- /**
- * The Manager interface provides a method for firing events:
- */
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.2", id = "a")
- public void testManagerFireEvent()
- {
- // First a simple event with no bindings is fired
- AnEventType anEvent = new AnEventType();
- getCurrentManager().fireEvent(anEvent);
-
- // Next an event with some event bindings is fired
- getCurrentManager().fireEvent(anEvent, new RoleBinding("Admin"));
- }
-
- // TODO This is not an assertion but a definition which is circular
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.3", id = "a")
- public void testObserversImplementObserverInterface()
- {
- Observer<String> observer = new Observer<String>()
- {
- public void notify(String event)
- {
- }
- };
- assert observer != null;
- }
-
- @Test(groups = { "events", "broken" }, expectedExceptions = {
IllegalArgumentException.class })
- @SpecAssertions( { @SpecAssertion(section = "7.3", id = "f") })
- public void testManagerAddObserverWithEventTypeParametersFails()
- {
- assert false;
- // ATemplatedEventType<String> anEvent = new
- // ATemplatedEventType<String>();
- // Observer<AnEventType> observer = new AnObserver();
- // getCurrentManager().addObserver(observer, anEvent.getClass());
- }
-
- @Test(groups = { "events", "broken" }, expectedExceptions = {
IllegalArgumentException.class })
- @SpecAssertions( { @SpecAssertion(section = "7.3", id = "g") })
- public void testManagerAddObserverWithEventTypeWildcardsFails()
- {
- // Although the above test is really the same as with a wildcard,
- // we will test it anyhow since the specification calls it out separately.
- ATemplatedEventType<?> anEventOnAnyType = new
ATemplatedEventType<String>();
- assert false;
- }
-
- @Test(groups = { "events", "broken" }, expectedExceptions = {
IllegalArgumentException.class })
- @SpecAssertions( { @SpecAssertion(section = "7.3", id = "h") })
- public void testManagerRemoveObserverWithEventTypeParametersFails()
- {
- assert false;
- // ATemplatedEventType<String> anEvent = new
- // ATemplatedEventType<String>();
- // Observer<AnEventType> observer = new AnObserver();
- // getCurrentManager().addObserver(observer, anEvent.getClass());
- }
-
- @Test(groups = { "events", "stub" }, expectedExceptions = {
IllegalArgumentException.class })
- @SpecAssertions( { @SpecAssertion(section = "7.3", id = "i") })
- public void testManagerRemoveObserverWithEventTypeWildcardsFails()
- {
- // Although the above test is really the same as with a wildcard,
- // we will test it anyhow since the specification calls it out separately.
- ATemplatedEventType<?> anEventOnAnyType = new
ATemplatedEventType<String>();
- assert false;
- }
-
- @Test(groups = { "events", "stub" })
- @SpecAssertions( { @SpecAssertion(section = "7.4", id = "a") })
- public void testObserverNotificationCallsResolveObservers()
- {
- assert false;
- }
-
- @Test(groups = { "events" })
- @SpecAssertions( { @SpecAssertion(section = "7.5", id = "a"),
@SpecAssertion(section = "7.5.2", id = "a")} )
- public void testObserverMethodAutomaticallyRegistered()
- {
- assert !getCurrentManager().resolveObservers("event").isEmpty();
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.5", id = "e")
- public void testMultipleObserverMethodsForSameEventOK()
- {
- assert getCurrentManager().resolveObservers("event").size() > 1;
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.5", id = "f")
- public void testMultipleObserverMethodsOnBeanOK()
- {
- // Resolve the observers for types 1 and 2
- Set<Observer<ObservedType1>> resolvedStringObservers =
getCurrentManager().resolveObservers(new ObservedType1());
- assert resolvedStringObservers.size() == 1;
-
- Set<Observer<ObservedType2>> resolvedIntegerObservers =
getCurrentManager().resolveObservers(new ObservedType2());
- assert resolvedIntegerObservers.size() == 1;
- }
-
- @Test(groups = { "events", "ejb" })
- @SpecAssertion(section = "7.5", id = "d")
- public void testObserverMethodOnEnterpriseBeanIsBusinessMethodOrStatic()
- {
- Set<Observer<EJBEvent>> observers =
getCurrentManager().resolveObservers(new EJBEvent());
- assert observers.size() == 2;
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.5.1", id = "b")
- public void testObserverMethodWithoutBindingTypesObservesEventsWithoutBindingTypes()
- {
- // Resolve registered observers with an event containing no binding types
- Set<Observer<SimpleEventType>> resolvedObservers =
getCurrentManager().resolveObservers(new SimpleEventType());
- assert resolvedObservers.size() == 2;
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.5.2", id = "g")
- public void testObserverMethodMayHaveMultipleBindingTypes()
- {
- Set<Bean<Object>> beans =
getCurrentManager().resolveByType(Object.class);
- assert beans != null;
- // If we can resolve the observer with the two binding types,
- // then it worked
- Set<Observer<MultiBindingType>> resolvedObservers =
getCurrentManager().resolveObservers(new MultiBindingType(), new
RoleBinding("Admin"), new TameAnnotationLiteral());
- assert resolvedObservers.size() == 1;
-
- }
-
- @Test(groups = { "stub", "events", "webbeansxml" })
- @SpecAssertions( { @SpecAssertion(section = "7.5.3", id = "a"),
@SpecAssertion(section = "7.5.3", id = "b") } )
- public void testXMLDefinedObserverMethodIgnoresBindingAnnotations()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "events", "webbeansxml" })
- @SpecAssertion(section = "7.5.3", id = "c")
- public void testXMLDefinedObserverNotFindingImplementationMethodFails()
- {
- assert false;
- }
-
- /**
- * In addition to the event parameter, observer methods may declare
- * additional parameters, which may declare bindings. The container calls the
- * method Manager.getInstanceToInject() defined in Section 5.7.1, "Resolving
- * dependencies" to determine a value for each parameter of an observer
- * method and calls the observer method with those parameter values.
- *
- * To invoke an observer method, the container must pass the event object to
- * the event parameter and the object returned by
- * Manager.getInstanceToInject() to each of the other parameters.
- */
- @Test(groups = { "events" })
- @SpecAssertions( { @SpecAssertion(section = "7.5.4", id = "a"),
@SpecAssertion(section = "7.5.8", id = "j") })
- public void testObserverMethodReceivesInjectionsOnNonObservesParameters()
- {
- Set<Bean<Object>> beans =
getCurrentManager().resolveByType(Object.class);
- assert beans != null;
- }
-
- @Test(groups = { "events" })
- @SpecAssertions( { @SpecAssertion(section = "7.5.5", id = "a"),
@SpecAssertion(section = "7.5.5", id = "b")} )
- public void testConditionalObserver() throws Exception
- {
- RecluseSpider.notified = false;
- getCurrentManager().fireEvent(new ConditionalEvent());
- // Should not be notified since bean is not instantiated yet
- assert !RecluseSpider.notified;
-
- // Now instantiate the bean and fire another event
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- RecluseSpider bean =
getCurrentManager().getInstanceByType(RecluseSpider.class);
- assert bean != null;
- // Must invoke a method to really create the instance
- assert !bean.isNotified();
-
- getCurrentManager().fireEvent(new ConditionalEvent());
- assert bean.isNotified();
- }
-
- }.run();
- }
-
- @Test(groups = { "events", "stub" })
- @SpecAssertions( { @SpecAssertion(section = "7.5.5", id = "c") }
)
- public void testConditionalObserverDefinedByXML()
- {
- assert false;
- }
-
- @Test(groups = { "events" })
- @SpecAssertions( { @SpecAssertion(section = "7.5.7", id = "a"),
@SpecAssertion(section = "7.5.8", id = "c"), @SpecAssertion(section =
"7.5.8", id = "g")} )
- public void testAsynchronousObserverIsAsynchronous() throws Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- getCurrentManager().fireEvent(new Boolean(true));
- Thread.sleep(200);
- assert
!AsynchronousObserver.getThreadObservingEvent().equals(Thread.currentThread());
- }
-
- }.run();
- }
-
- @Test(groups = { "stub", "events", "webbeansxml" })
- @SpecAssertion(section = "7.5.7", id = "b")
- public void testAsynchronousObserverDeclaredByXML()
- {
- assert false;
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.5.8", id = "a")
- public void testObserverMethodRegistration()
- {
- // Resolve registered observers with an event containing no binding types
- Set<Observer<SimpleEventType>> resolvedObservers =
getCurrentManager().resolveObservers(new SimpleEventType());
- assert resolvedObservers.size() == 2;
- }
-
- @Test(groups = { "stub", "events" })
- @SpecAssertions( { @SpecAssertion(section = "7.5.8", id = "b"),
@SpecAssertion(section = "7.5.8", id = "h")} )
- public void testObserverMethodCalledImmediately()
- {
-
- assert false;
- }
-
- @Test(groups = { "events" })
- @SpecAssertions( { @SpecAssertion(section = "7.5", id = "c"),
@SpecAssertion(section = "7.5.8", id = "k")} )
- public void testStaticObserverMethodInvoked()
- {
- getCurrentManager().fireEvent(new Delivery());
- assert StaticObserver.isDeliveryReceived();
- }
-
- /**
- * Otherwise, if the observer method is non-static, the container must:
- *
- * • obtain the Bean object for the most specialized bean that specializes
- * the bean which declares the observer method, and then
- *
- */
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.5.8", id = "l")
- public void testObserverCalledOnMostSpecializedInstance()
- {
- Shop.deliveryObservedBy = null;
- getCurrentManager().fireEvent(new Delivery());
- assert Shop.deliveryObservedBy.equals(FarmShop.class.getName());
- }
-
- /**
- * obtain the context object by calling Manager.getContext(), passing the
- * bean scope, then
- */
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.8", id = "m")
- public void testObserverContextRetrieved()
- {
- assert false;
- }
-
- /**
- * obtain an instance of the bean by calling Context.get(), passing the Bean
- * instance representing the bean, together with a CreationalContext unless
- * this observer method is a conditional observer method, and then
- */
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.8", id = "n")
- public void testObserverInstanceRetrievedFromContext()
- {
- assert false;
- }
-
- /**
- * if the get() method returned a non-null value, invoke the observer method
- * on the returned instance
- */
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.8", id = "o")
- public void testObserverMethodInvokedOnReturnedInstanceFromContext()
- {
- assert false;
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.5.8", id = "p")
- public void testAsynchronousObserverThrowsExceptionIsLogged() throws Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- getCurrentManager().fireEvent('a');
- Thread.sleep(200);
- //TODO How can we assert that the exception was logged?
- }
-
- }.run();
- }
-
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.9", id = "a")
- public void testAsynchronousObserverMethodContexts()
- {
- assert false;
- }
-
- @Test(groups = { "events" }, expectedExceptions = {
DuplicateBindingTypeException.class })
- @SpecAssertion(section = "7.6", id = "g")
- public void testDuplicateBindingsToFireFails() throws Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- SweeWaxbill bean = getCurrentManager().getInstanceByType(SweeWaxbill.class);
- bean.methodThatFiresEvent();
- }
-
- }.run();
- }
-
- @Test(groups = { "events" }, expectedExceptions = {
DuplicateBindingTypeException.class })
- @SpecAssertion(section = "7.6", id = "g")
- public void testDuplicateBindingsToObservesFails() throws Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- SweeWaxbill bean = getCurrentManager().getInstanceByType(SweeWaxbill.class);
- bean.methodThatRegistersObserver();
- }
-
- }.run();
- }
-
- @Test(groups = { "events" }, expectedExceptions = {
IllegalArgumentException.class })
- @SpecAssertion(section = "7.6", id = "h")
- public void testNonBindingTypePassedToFireFails() throws Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- OwlFinch_Broken bean =
getCurrentManager().getInstanceByType(OwlFinch_Broken.class);
- bean.methodThatFiresEvent();
- }
-
- }.run();
- }
-
- @Test(groups = { "events" }, expectedExceptions = {
IllegalArgumentException.class })
- @SpecAssertion(section = "7.6", id = "h")
- public void testNonBindingTypePassedToObservesFails() throws Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- OwlFinch_Broken bean =
getCurrentManager().getInstanceByType(OwlFinch_Broken.class);
- bean.methodThatRegistersObserver();
- }
-
- }.run();
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.6", id = "n")
- public void testImplicitEventBeanMatchesAPITypeOfInectionPoint() throws Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- // Retrieve the implicit event bean from the manager only by
- // its API type
- Set<?> eventBeans = getCurrentManager().resolveByType(Event.class, new
FiresBinding());
- assert !eventBeans.isEmpty();
- }
-
- }.run();
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.6", id = "n")
- public void testImplicitEventBeanMatchesBindingAnnotationsOfInjectionPoint() throws
Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- // Retrieve the implicit event bean from the manager
- // by its binding types (uses OrangeCheekedWaxbill)
- Set<?> eventBeans = getCurrentManager().resolveByType(Event.class, new
FiresBinding(), new TameAnnotationLiteral(), new RoleBinding("Admin"));
- assert !eventBeans.isEmpty();
- }
-
- }.run();
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.6", id = "o")
- public void testImplicitEventBeanHasStandardDeploymentType() throws Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- // Retrieve the implicit event bean from the manager
- // only by its API type (uses BlueFacedParrotFinch)
- Set<?> eventBeans = getCurrentManager().resolveByType(Event.class, new
FiresBinding());
- assert eventBeans.size() == 1;
- Bean<?> eventBean = (Bean<?>) eventBeans.iterator().next();
- assert eventBean.getDeploymentType().equals(Standard.class);
- }
-
- }.run();
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.6", id = "p")
- public void testImplicitEventBeanHasDependentScope() throws Exception
- {
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- // Retrieve the implicit event bean from the manager only
- // by its API type (uses BlueFacedParrotFinch)
- Set<?> eventBeans = getCurrentManager().resolveByType(Event.class, new
FiresBinding());
- assert eventBeans.size() == 1;
- Bean<?> eventBean = (Bean<?>) eventBeans.iterator().next();
- assert eventBean.getScopeType().equals(Dependent.class);
- }
- }.run();
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.6", id = "q")
- public void testImplicitEventBeanHasNoName() throws Exception
- {
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- // Retrieve the implicit event bean from the manager only
- // by its API type (uses BlueFacedParrotFinch)
- Set<?> eventBeans = getCurrentManager().resolveByType(Event.class, new
FiresBinding());
- assert eventBeans.size() == 1;
- Bean<?> eventBean = (Bean<?>) eventBeans.iterator().next();
- assert eventBean.getName() == null;
- }
- }.run();
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.6", id = "r")
- public void testImplicitEventBeanProvidedByContainer() throws Exception
- {
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- // Retrieve the implicit event bean from the manager only
- // by its API type (uses BlueFacedParrotFinch)
- Set<?> eventBeans = getCurrentManager().resolveByType(Event.class, new
FiresBinding());
- assert eventBeans.size() == 1;
- }
- }.run();
- }
-
- // TODO The manager related tests require intercepting all calls
- // to it to verify that the correct calls are made.
- @Test(groups = { "events", "underInvestigation" })
- @SpecAssertion(section = "7.6", id = "s")
- public void testFireMethodCallsManagerFireWithEventObject()
- {
- assert false;
- }
-
- @Test(groups = { "events", "underInvestigation" })
- @SpecAssertion(section = "7.6", id = "s")
- public void testFireMethodCallsManagerFireWithBindingAnnotationsExceptFires()
- {
- assert false;
- }
-
- @Test(groups = { "events", "underInvestigation" })
- @SpecAssertion(section = "7.6", id = "s")
- public void testFireMethodCallsManagerFireWithAllBindingAnnotationInstances()
- {
- assert false;
- }
-
- @Test(groups = { "events", "underInvestigation" })
- @SpecAssertions( { @SpecAssertion(section = "7.5.8", id = "s"),
@SpecAssertion(section = "7.6", id = "u")} )
- public void testObserverMethodCallsManagerAddObserverWithObserverObject()
- {
- assert false;
- }
-
- @Test(groups = { "events", "underInvestigation" })
- @SpecAssertion(section = "7.6", id = "u")
- public void
testObserverMethodCallsManagerAddObserverWithAllBindingAnnotationsExceptFires()
- {
- assert false;
- }
-
- @Test(groups = { "events", "underInvestigation" })
- @SpecAssertion(section = "7.6", id = "u")
- public void
testObserverMethodCallsManagerAddObserverWithAllBindingAnnotationInstance()
- {
- assert false;
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.7", id = "b")
- public void testEventObjectContainsTypeVariablesWhenResolvingFails()
- {
- eventObjectContainsTypeVariables(new ArrayList<String>());
- }
-
- private <E> void eventObjectContainsTypeVariables(ArrayList<E>
eventToFire)
- {
- getCurrentManager().resolveObservers(eventToFire);
- }
-
- @Test(groups = { "broken", "events" }, expectedExceptions = {
IllegalArgumentException.class })
- @SpecAssertion(section = "7.7", id = "c")
- public void testEventObjectContainsWildcardsWhenResolvingFails()
- {
- eventObjectContainsWildcards(new ArrayList<String>());
- }
-
- private void eventObjectContainsWildcards(ArrayList<?> eventToFire)
- {
- // TODO There does not seem to be a way to get wildcarded types passed
- getCurrentManager().resolveObservers(eventToFire);
- }
-
- /**
- * By default, Java implementation reuse is assumed. In this case, the
- * producer, disposal and observer methods of the first bean are not
- * inherited by the second bean.
- *
- * @throws Exception
- */
- @Test(groups = { "events", "inheritance" })
- @SpecAssertion(section = "4", id = "a")
- public void testNonStaticObserverMethodNotInherited() throws Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- Set<Observer<Egg>> observers =
getCurrentManager().resolveObservers(new Egg());
- assert observers.size() == 1;
-
- // Notify the observer so we can confirm that it
- // is a method only on Farmer, and not LazyFarmer
- observers.iterator().next().notify(new Egg());
- assert Farmer.getObserverClazz().equals(Farmer.class);
- }
-
- }.run();
- }
-
-}
Copied:
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
(from rev 1840,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java)
===================================================================
---
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
(rev 0)
+++
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-03-09
00:18:30 UTC (rev 1853)
@@ -0,0 +1,779 @@
+package org.jboss.jsr299.tck.tests.event;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.Set;
+
+import javax.context.Dependent;
+import javax.event.Event;
+import javax.event.Observer;
+import javax.inject.DuplicateBindingTypeException;
+import javax.inject.Standard;
+import javax.inject.manager.Bean;
+import javax.inject.manager.Manager;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractDeclarativeTest;
+import org.jboss.jsr299.tck.impl.packaging.Artifact;
+import org.jboss.jsr299.tck.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ * Event bus tests
+ *
+ * @author Nicklas Karlsson
+ * @author David Allen
+ *
+ * Spec version: Public Release Draft 2
+ */
+@Artifact
+(a)BeansXml("beans.xml")
+public class EventTest extends AbstractDeclarativeTest
+{
+
+ public static class AnEventType
+ {
+ }
+
+ public static class ATemplatedEventType<T>
+ {
+ }
+
+ public static class AnObserver implements Observer<AnEventType>
+ {
+ public boolean wasNotified = false;
+
+ public void notify(AnEventType event)
+ {
+ wasNotified = true;
+ }
+ }
+
+ public static class AListObserver implements Observer<ArrayList<String>>
+ {
+ public boolean wasNotified = false;
+
+ public void notify(ArrayList<String> event)
+ {
+ wasNotified = true;
+ }
+ }
+
+ public static class AnotherListObserver implements
Observer<ArrayList<Integer>>
+ {
+ public boolean wasNotified = false;
+
+ public void notify(ArrayList<Integer> event)
+ {
+ wasNotified = true;
+ }
+ }
+
+ public static class AnObserverWithException implements Observer<AnEventType>
+ {
+ public boolean wasNotified = false;
+ public RuntimeException theException = new RuntimeException("RE1");
+
+ public void notify(AnEventType event)
+ {
+ wasNotified = true;
+ throw theException;
+ }
+ }
+
+ /**
+ * An event binding type is a Java annotation defined as @Target({FIELD,
+ * PARAMETER}) ~or @Target({METHOD, FIELD, PARAMETER, TYPE}) and
+ *
+ * @Retention(RUNTIME)~
+ */
+ @Test(groups = { "events", "stub" })
+ @SpecAssertions( { @SpecAssertion(section = "7.1", id = "d") })
+ public void testEventBindingTypeTargetMostAndRuntime()
+ {
+
+ }
+
+ /**
+ * An event binding type is a Java annotation defined as ~@Target({FIELD,
+ * PARAMETER}) or~ @Target({METHOD, FIELD, PARAMETER, TYPE}) ~and
+ *
+ * @Retention(RUNTIME)~
+ */
+ @Test(groups = { "events", "stub" })
+ @SpecAssertions( { @SpecAssertion(section = "7.1", id = "e") })
+ public void testEventBindingTypeTargetsFieldParameterAndRuntime()
+ {
+
+ }
+
+ /**
+ * An event binding type is a Java annotation defined as ~@Target({FIELD,
+ * PARAMETER}) or @Target({METHOD, FIELD, PARAMETER, TYPE}) and
+ * ~@Retention(RUNTIME) TODO If the binding does not have RUNTIME retention,
+ * it cannot be tested
+ */
+ @Test(groups = { "events", "broken" })
+ @SpecAssertions( { @SpecAssertion(section = "7.1", id = "f") })
+ public void testEventBindingTypeNotRuntime()
+ {
+
+ }
+
+ // TODO How to test all annotations w/o BindingType are not event bindings
+ @Test(groups = { "events", "broken" })
+ @SpecAssertions( { @SpecAssertion(section = "7.1", id = "g") })
+ public void testEventBindingTypesSpecifyBinding()
+ {
+
+ }
+
+ @Test(groups = { "events" }, expectedExceptions = {
IllegalArgumentException.class })
+ @SpecAssertions( { @SpecAssertion(section = "7.1", id = "a"),
@SpecAssertion(section = "7.2", id = "b") })
+ public void testManagerFireEventWithEventTypeParametersFails()
+ {
+ ATemplatedEventType<String> anEvent = new
ATemplatedEventType<String>();
+ getCurrentManager().fireEvent(anEvent);
+ }
+
+ @Test(groups = { "events" }, expectedExceptions = {
IllegalArgumentException.class })
+ @SpecAssertions( { @SpecAssertion(section = "7.1", id = "b"),
@SpecAssertion(section = "7.2", id = "c") })
+ public void testManagerFireEventWithEventTypeWildcardsFails()
+ {
+ // Although the above test is really the same as with a wildcard,
+ // we will test it anyhow since the specification calls it out separately.
+ ATemplatedEventType<?> anEventOnAnyType = new
ATemplatedEventType<String>();
+ getCurrentManager().fireEvent(anEventOnAnyType);
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertions( { @SpecAssertion(section = "7.2", id = "a") })
+ public void testManagerInterfaceForFireEventMethod() throws Exception
+ {
+ assert Manager.class.getDeclaredMethod("fireEvent", Object.class,
Annotation[].class) != null;
+ }
+
+ @Test(groups = { "events" }, expectedExceptions = {
IllegalArgumentException.class })
+ @SpecAssertions( { @SpecAssertion(section = "7.2", id = "d") })
+ public void testManagerFireEventWithNonBindingAnnotationsFails()
+ {
+ // The specs are not exactly clear on what is supposed to happen here,
+ // but borrowing from Section 8.3, we'll expect the same behavior here
+ // for a consistent API.
+ // TODO Verify that fireEvent should fail on non-binding annotations
+ AnEventType anEvent = new AnEventType();
+ getCurrentManager().fireEvent(anEvent, new AnimalStereotypeAnnotationLiteral());
+ }
+
+ /**
+ * The Manager interface provides a method for firing events:
+ */
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "7.2", id = "a")
+ public void testManagerFireEvent()
+ {
+ // First a simple event with no bindings is fired
+ AnEventType anEvent = new AnEventType();
+ getCurrentManager().fireEvent(anEvent);
+
+ // Next an event with some event bindings is fired
+ getCurrentManager().fireEvent(anEvent, new RoleBinding("Admin"));
+ }
+
+ // TODO This is not an assertion but a definition which is circular
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "7.3", id = "a")
+ public void testObserversImplementObserverInterface()
+ {
+ Observer<String> observer = new Observer<String>()
+ {
+ public void notify(String event)
+ {
+ }
+ };
+ assert observer != null;
+ }
+
+ @Test(groups = { "events", "broken" }, expectedExceptions = {
IllegalArgumentException.class })
+ @SpecAssertions( { @SpecAssertion(section = "7.3", id = "f") })
+ public void testManagerAddObserverWithEventTypeParametersFails()
+ {
+ assert false;
+ // ATemplatedEventType<String> anEvent = new
+ // ATemplatedEventType<String>();
+ // Observer<AnEventType> observer = new AnObserver();
+ // getCurrentManager().addObserver(observer, anEvent.getClass());
+ }
+
+ @Test(groups = { "events", "broken" }, expectedExceptions = {
IllegalArgumentException.class })
+ @SpecAssertions( { @SpecAssertion(section = "7.3", id = "g") })
+ public void testManagerAddObserverWithEventTypeWildcardsFails()
+ {
+ // Although the above test is really the same as with a wildcard,
+ // we will test it anyhow since the specification calls it out separately.
+ ATemplatedEventType<?> anEventOnAnyType = new
ATemplatedEventType<String>();
+ assert false;
+ }
+
+ @Test(groups = { "events", "broken" }, expectedExceptions = {
IllegalArgumentException.class })
+ @SpecAssertions( { @SpecAssertion(section = "7.3", id = "h") })
+ public void testManagerRemoveObserverWithEventTypeParametersFails()
+ {
+ assert false;
+ // ATemplatedEventType<String> anEvent = new
+ // ATemplatedEventType<String>();
+ // Observer<AnEventType> observer = new AnObserver();
+ // getCurrentManager().addObserver(observer, anEvent.getClass());
+ }
+
+ @Test(groups = { "events", "stub" }, expectedExceptions = {
IllegalArgumentException.class })
+ @SpecAssertions( { @SpecAssertion(section = "7.3", id = "i") })
+ public void testManagerRemoveObserverWithEventTypeWildcardsFails()
+ {
+ // Although the above test is really the same as with a wildcard,
+ // we will test it anyhow since the specification calls it out separately.
+ ATemplatedEventType<?> anEventOnAnyType = new
ATemplatedEventType<String>();
+ assert false;
+ }
+
+ @Test(groups = { "events", "stub" })
+ @SpecAssertions( { @SpecAssertion(section = "7.4", id = "a") })
+ public void testObserverNotificationCallsResolveObservers()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertions( { @SpecAssertion(section = "7.5", id = "a"),
@SpecAssertion(section = "7.5.2", id = "a")} )
+ public void testObserverMethodAutomaticallyRegistered()
+ {
+ assert !getCurrentManager().resolveObservers("event").isEmpty();
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "7.5", id = "e")
+ public void testMultipleObserverMethodsForSameEventOK()
+ {
+ assert getCurrentManager().resolveObservers("event").size() > 1;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "7.5", id = "f")
+ public void testMultipleObserverMethodsOnBeanOK()
+ {
+ // Resolve the observers for types 1 and 2
+ Set<Observer<ObservedType1>> resolvedStringObservers =
getCurrentManager().resolveObservers(new ObservedType1());
+ assert resolvedStringObservers.size() == 1;
+
+ Set<Observer<ObservedType2>> resolvedIntegerObservers =
getCurrentManager().resolveObservers(new ObservedType2());
+ assert resolvedIntegerObservers.size() == 1;
+ }
+
+ @Test(groups = { "events", "ejb" })
+ @SpecAssertion(section = "7.5", id = "d")
+ public void testObserverMethodOnEnterpriseBeanIsBusinessMethodOrStatic()
+ {
+ Set<Observer<EJBEvent>> observers =
getCurrentManager().resolveObservers(new EJBEvent());
+ assert observers.size() == 2;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "7.5.1", id = "b")
+ public void testObserverMethodWithoutBindingTypesObservesEventsWithoutBindingTypes()
+ {
+ // Resolve registered observers with an event containing no binding types
+ Set<Observer<SimpleEventType>> resolvedObservers =
getCurrentManager().resolveObservers(new SimpleEventType());
+ assert resolvedObservers.size() == 2;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "7.5.2", id = "g")
+ public void testObserverMethodMayHaveMultipleBindingTypes()
+ {
+ Set<Bean<Object>> beans =
getCurrentManager().resolveByType(Object.class);
+ assert beans != null;
+ // If we can resolve the observer with the two binding types,
+ // then it worked
+ Set<Observer<MultiBindingType>> resolvedObservers =
getCurrentManager().resolveObservers(new MultiBindingType(), new
RoleBinding("Admin"), new TameAnnotationLiteral());
+ assert resolvedObservers.size() == 1;
+
+ }
+
+ @Test(groups = { "stub", "events", "webbeansxml" })
+ @SpecAssertions( { @SpecAssertion(section = "7.5.3", id = "a"),
@SpecAssertion(section = "7.5.3", id = "b") } )
+ public void testXMLDefinedObserverMethodIgnoresBindingAnnotations()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "stub", "events", "webbeansxml" })
+ @SpecAssertion(section = "7.5.3", id = "c")
+ public void testXMLDefinedObserverNotFindingImplementationMethodFails()
+ {
+ assert false;
+ }
+
+ /**
+ * In addition to the event parameter, observer methods may declare
+ * additional parameters, which may declare bindings. The container calls the
+ * method Manager.getInstanceToInject() defined in Section 5.7.1, "Resolving
+ * dependencies" to determine a value for each parameter of an observer
+ * method and calls the observer method with those parameter values.
+ *
+ * To invoke an observer method, the container must pass the event object to
+ * the event parameter and the object returned by
+ * Manager.getInstanceToInject() to each of the other parameters.
+ */
+ @Test(groups = { "events" })
+ @SpecAssertions( { @SpecAssertion(section = "7.5.4", id = "a"),
@SpecAssertion(section = "7.5.8", id = "j") })
+ public void testObserverMethodReceivesInjectionsOnNonObservesParameters()
+ {
+ Set<Bean<Object>> beans =
getCurrentManager().resolveByType(Object.class);
+ assert beans != null;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertions( { @SpecAssertion(section = "7.5.5", id = "a"),
@SpecAssertion(section = "7.5.5", id = "b")} )
+ public void testConditionalObserver() throws Exception
+ {
+ RecluseSpider.notified = false;
+ getCurrentManager().fireEvent(new ConditionalEvent());
+ // Should not be notified since bean is not instantiated yet
+ assert !RecluseSpider.notified;
+
+ // Now instantiate the bean and fire another event
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ RecluseSpider bean =
getCurrentManager().getInstanceByType(RecluseSpider.class);
+ assert bean != null;
+ // Must invoke a method to really create the instance
+ assert !bean.isNotified();
+
+ getCurrentManager().fireEvent(new ConditionalEvent());
+ assert bean.isNotified();
+ }
+
+ }.run();
+ }
+
+ @Test(groups = { "events", "stub" })
+ @SpecAssertions( { @SpecAssertion(section = "7.5.5", id = "c") }
)
+ public void testConditionalObserverDefinedByXML()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertions( { @SpecAssertion(section = "7.5.7", id = "a"),
@SpecAssertion(section = "7.5.8", id = "c"), @SpecAssertion(section =
"7.5.8", id = "g")} )
+ public void testAsynchronousObserverIsAsynchronous() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ getCurrentManager().fireEvent(new Boolean(true));
+ Thread.sleep(200);
+ assert
!AsynchronousObserver.getThreadObservingEvent().equals(Thread.currentThread());
+ }
+
+ }.run();
+ }
+
+ @Test(groups = { "stub", "events", "webbeansxml" })
+ @SpecAssertion(section = "7.5.7", id = "b")
+ public void testAsynchronousObserverDeclaredByXML()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "7.5.8", id = "a")
+ public void testObserverMethodRegistration()
+ {
+ // Resolve registered observers with an event containing no binding types
+ Set<Observer<SimpleEventType>> resolvedObservers =
getCurrentManager().resolveObservers(new SimpleEventType());
+ assert resolvedObservers.size() == 2;
+ }
+
+ @Test(groups = { "stub", "events" })
+ @SpecAssertions( { @SpecAssertion(section = "7.5.8", id = "b"),
@SpecAssertion(section = "7.5.8", id = "h")} )
+ public void testObserverMethodCalledImmediately()
+ {
+
+ assert false;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertions( { @SpecAssertion(section = "7.5", id = "c"),
@SpecAssertion(section = "7.5.8", id = "k")} )
+ public void testStaticObserverMethodInvoked()
+ {
+ getCurrentManager().fireEvent(new Delivery());
+ assert StaticObserver.isDeliveryReceived();
+ }
+
+ /**
+ * Otherwise, if the observer method is non-static, the container must:
+ *
+ * • obtain the Bean object for the most specialized bean that specializes
+ * the bean which declares the observer method, and then
+ *
+ */
+ @Test(groups = { "events" })
+ @SpecAssertions({
+ @SpecAssertion(section = "7.5.8", id = "l"),
+ @SpecAssertion(section = "4.3.2", id = "f")
+ })
+ public void testObserverCalledOnMostSpecializedInstance()
+ {
+ Shop.deliveryObservedBy = null;
+ getCurrentManager().fireEvent(new Delivery());
+ assert Shop.deliveryObservedBy.equals(FarmShop.class.getName());
+ }
+
+ /**
+ * obtain the context object by calling Manager.getContext(), passing the
+ * bean scope, then
+ */
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "7.5.8", id = "m")
+ public void testObserverContextRetrieved()
+ {
+ assert false;
+ }
+
+ /**
+ * obtain an instance of the bean by calling Context.get(), passing the Bean
+ * instance representing the bean, together with a CreationalContext unless
+ * this observer method is a conditional observer method, and then
+ */
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "7.5.8", id = "n")
+ public void testObserverInstanceRetrievedFromContext()
+ {
+ assert false;
+ }
+
+ /**
+ * if the get() method returned a non-null value, invoke the observer method
+ * on the returned instance
+ */
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "7.5.8", id = "o")
+ public void testObserverMethodInvokedOnReturnedInstanceFromContext()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "7.5.8", id = "p")
+ public void testAsynchronousObserverThrowsExceptionIsLogged() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ getCurrentManager().fireEvent('a');
+ Thread.sleep(200);
+ //TODO How can we assert that the exception was logged?
+ }
+
+ }.run();
+ }
+
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "7.5.9", id = "a")
+ public void testAsynchronousObserverMethodContexts()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "events" }, expectedExceptions = {
DuplicateBindingTypeException.class })
+ @SpecAssertion(section = "7.6", id = "g")
+ public void testDuplicateBindingsToFireFails() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ SweeWaxbill bean = getCurrentManager().getInstanceByType(SweeWaxbill.class);
+ bean.methodThatFiresEvent();
+ }
+
+ }.run();
+ }
+
+ @Test(groups = { "events" }, expectedExceptions = {
DuplicateBindingTypeException.class })
+ @SpecAssertion(section = "7.6", id = "g")
+ public void testDuplicateBindingsToObservesFails() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ SweeWaxbill bean = getCurrentManager().getInstanceByType(SweeWaxbill.class);
+ bean.methodThatRegistersObserver();
+ }
+
+ }.run();
+ }
+
+ @Test(groups = { "events" }, expectedExceptions = {
IllegalArgumentException.class })
+ @SpecAssertion(section = "7.6", id = "h")
+ public void testNonBindingTypePassedToFireFails() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ OwlFinch_Broken bean =
getCurrentManager().getInstanceByType(OwlFinch_Broken.class);
+ bean.methodThatFiresEvent();
+ }
+
+ }.run();
+ }
+
+ @Test(groups = { "events" }, expectedExceptions = {
IllegalArgumentException.class })
+ @SpecAssertion(section = "7.6", id = "h")
+ public void testNonBindingTypePassedToObservesFails() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ OwlFinch_Broken bean =
getCurrentManager().getInstanceByType(OwlFinch_Broken.class);
+ bean.methodThatRegistersObserver();
+ }
+
+ }.run();
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "7.6", id = "n")
+ public void testImplicitEventBeanMatchesAPITypeOfInectionPoint() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ // Retrieve the implicit event bean from the manager only by
+ // its API type
+ Set<?> eventBeans = getCurrentManager().resolveByType(Event.class, new
FiresBinding());
+ assert !eventBeans.isEmpty();
+ }
+
+ }.run();
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "7.6", id = "n")
+ public void testImplicitEventBeanMatchesBindingAnnotationsOfInjectionPoint() throws
Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ // Retrieve the implicit event bean from the manager
+ // by its binding types (uses OrangeCheekedWaxbill)
+ Set<?> eventBeans = getCurrentManager().resolveByType(Event.class, new
FiresBinding(), new TameAnnotationLiteral(), new RoleBinding("Admin"));
+ assert !eventBeans.isEmpty();
+ }
+
+ }.run();
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "7.6", id = "o")
+ public void testImplicitEventBeanHasStandardDeploymentType() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ // Retrieve the implicit event bean from the manager
+ // only by its API type (uses BlueFacedParrotFinch)
+ Set<?> eventBeans = getCurrentManager().resolveByType(Event.class, new
FiresBinding());
+ assert eventBeans.size() == 1;
+ Bean<?> eventBean = (Bean<?>) eventBeans.iterator().next();
+ assert eventBean.getDeploymentType().equals(Standard.class);
+ }
+
+ }.run();
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "7.6", id = "p")
+ public void testImplicitEventBeanHasDependentScope() throws Exception
+ {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ // Retrieve the implicit event bean from the manager only
+ // by its API type (uses BlueFacedParrotFinch)
+ Set<?> eventBeans = getCurrentManager().resolveByType(Event.class, new
FiresBinding());
+ assert eventBeans.size() == 1;
+ Bean<?> eventBean = (Bean<?>) eventBeans.iterator().next();
+ assert eventBean.getScopeType().equals(Dependent.class);
+ }
+ }.run();
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "7.6", id = "q")
+ public void testImplicitEventBeanHasNoName() throws Exception
+ {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ // Retrieve the implicit event bean from the manager only
+ // by its API type (uses BlueFacedParrotFinch)
+ Set<?> eventBeans = getCurrentManager().resolveByType(Event.class, new
FiresBinding());
+ assert eventBeans.size() == 1;
+ Bean<?> eventBean = (Bean<?>) eventBeans.iterator().next();
+ assert eventBean.getName() == null;
+ }
+ }.run();
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "7.6", id = "r")
+ public void testImplicitEventBeanProvidedByContainer() throws Exception
+ {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ // Retrieve the implicit event bean from the manager only
+ // by its API type (uses BlueFacedParrotFinch)
+ Set<?> eventBeans = getCurrentManager().resolveByType(Event.class, new
FiresBinding());
+ assert eventBeans.size() == 1;
+ }
+ }.run();
+ }
+
+ // TODO The manager related tests require intercepting all calls
+ // to it to verify that the correct calls are made.
+ @Test(groups = { "events", "underInvestigation" })
+ @SpecAssertion(section = "7.6", id = "s")
+ public void testFireMethodCallsManagerFireWithEventObject()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "events", "underInvestigation" })
+ @SpecAssertion(section = "7.6", id = "s")
+ public void testFireMethodCallsManagerFireWithBindingAnnotationsExceptFires()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "events", "underInvestigation" })
+ @SpecAssertion(section = "7.6", id = "s")
+ public void testFireMethodCallsManagerFireWithAllBindingAnnotationInstances()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "events", "underInvestigation" })
+ @SpecAssertions( { @SpecAssertion(section = "7.5.8", id = "s"),
@SpecAssertion(section = "7.6", id = "u")} )
+ public void testObserverMethodCallsManagerAddObserverWithObserverObject()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "events", "underInvestigation" })
+ @SpecAssertion(section = "7.6", id = "u")
+ public void
testObserverMethodCallsManagerAddObserverWithAllBindingAnnotationsExceptFires()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "events", "underInvestigation" })
+ @SpecAssertion(section = "7.6", id = "u")
+ public void
testObserverMethodCallsManagerAddObserverWithAllBindingAnnotationInstance()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "7.7", id = "b")
+ public void testEventObjectContainsTypeVariablesWhenResolvingFails()
+ {
+ eventObjectContainsTypeVariables(new ArrayList<String>());
+ }
+
+ private <E> void eventObjectContainsTypeVariables(ArrayList<E>
eventToFire)
+ {
+ getCurrentManager().resolveObservers(eventToFire);
+ }
+
+ @Test(groups = { "broken", "events" }, expectedExceptions = {
IllegalArgumentException.class })
+ @SpecAssertion(section = "7.7", id = "c")
+ public void testEventObjectContainsWildcardsWhenResolvingFails()
+ {
+ eventObjectContainsWildcards(new ArrayList<String>());
+ }
+
+ private void eventObjectContainsWildcards(ArrayList<?> eventToFire)
+ {
+ // TODO There does not seem to be a way to get wildcarded types passed
+ getCurrentManager().resolveObservers(eventToFire);
+ }
+
+ /**
+ * By default, Java implementation reuse is assumed. In this case, the
+ * producer, disposal and observer methods of the first bean are not
+ * inherited by the second bean.
+ *
+ * @throws Exception
+ */
+ @Test(groups = { "events", "inheritance" })
+ @SpecAssertion(section = "4.2", id = "dc")
+ public void testNonStaticObserverMethodNotInherited() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ Set<Observer<Egg>> observers =
getCurrentManager().resolveObservers(new Egg());
+ assert observers.size() == 1;
+
+ // Notify the observer so we can confirm that it
+ // is a method only on Farmer, and not LazyFarmer
+ observers.iterator().next().notify(new Egg());
+ assert Farmer.getObserverClazz().equals(Farmer.class);
+ }
+
+ }.run();
+ }
+
+}
Deleted:
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java 2009-03-08
22:37:17 UTC (rev 1823)
+++
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java 2009-03-09
00:18:30 UTC (rev 1853)
@@ -1,210 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.jsr299.tck.tests.event.transactionalObservers;
-
-import static org.jboss.jsr299.tck.impl.packaging.PackagingType.EAR;
-
-import java.lang.annotation.Annotation;
-import java.math.BigInteger;
-
-import javax.inject.AnnotationLiteral;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.hibernate.tck.annotations.SpecAssertions;
-import org.jboss.jsr299.tck.AbstractDeclarativeTest;
-import org.jboss.jsr299.tck.impl.packaging.Artifact;
-import org.jboss.jsr299.tck.impl.packaging.IntegrationTest;
-import org.jboss.jsr299.tck.impl.packaging.Packaging;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- * Integration tests for Web Bean events.
- *
- * @author David Allen
- *
- * Spec version: Public Release Draft 2
- *
- */
-@Artifact
-@Packaging(EAR)
-@IntegrationTest
-public class EventTest extends AbstractDeclarativeTest
-{
-
- private static final Annotation TAME_LITERAL = new AnnotationLiteral<Tame>()
- {
- };
- private PomeranianInterface dog;
-
- @BeforeMethod(alwaysRun = true,dependsOnMethods="beforeMethod")
- public void setupTest()
- {
- dog = (PomeranianInterface)
getCurrentManager().getInstanceByName("Teddy");
- }
-
-// @AfterMethod(alwaysRun = true)
-// public void teardownTest()
-// {
-// try
-// {
-// dog.removeSessionBean();
-// }
-// catch (Exception e)
-// {
-// // Not important since the bean is now gone one way or the other
-// }
-// }
-
- @Test(groups = { "events", "integration" })
- @SpecAssertion(section = "7.5.6", id = "a")
- public void testTransactionalObserverNotifiedImmediatelyWhenNoTransactionInProgress()
- {
- dog.setCorrectContext(false);
- dog.setCorrectTransactionState(false);
- Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
- assert dogAgent != null;
- dogAgent.sendOutsideTransaction(BigInteger.TEN);
- assert dog.isCorrectTransactionState();
- // TODO Fix the security contexts
- // assert dog.isCorrectContext();
- }
-
- @Test(groups = { "events", "integration" })
- @SpecAssertions( { @SpecAssertion(section = "7.5.6", id = "c"),
@SpecAssertion(section = "7.5.6", id = "f"), @SpecAssertion(section =
"7.5.6", id = "i"), @SpecAssertion(section = "7.5.8", id =
"f") })
- public void testAfterTransactionCompletionObserver()
- {
- dog.setCorrectContext(false);
- dog.setCorrectTransactionState(false);
- assert !getCurrentManager().resolveObservers("event").isEmpty();
- Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
- dogAgent.sendInTransaction("event");
- assert dog.isCorrectTransactionState();
- }
-
- @Test(groups = { "events", "integration", "broken" })
- @SpecAssertions( { @SpecAssertion(section = "7.5.6", id = "d"),
@SpecAssertion(section = "7.5.6", id = "j") })
- public void testAfterTransactionSuccessObserver()
- {
- dog.setCorrectContext(false);
- dog.setCorrectTransactionState(false);
- Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
- dogAgent.sendInTransaction(new Integer(4));
- assert dog.isCorrectTransactionState();
- }
-
- @Test(groups = { "events", "integration" })
- @SpecAssertions( { @SpecAssertion(section = "7.5.6", id = "e"),
@SpecAssertion(section = "7.5.6", id = "k") })
- public void testAfterTransactionFailureObserver()
- {
- dog.setCorrectContext(false);
- dog.setCorrectTransactionState(false);
- Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
- dogAgent.sendInTransaction(new Float(4.0));
- assert dog.isCorrectTransactionState();
- }
-
- @Test(groups = { "events", "integration" })
- @SpecAssertions( { @SpecAssertion(section = "7.5.6", id = "b"),
@SpecAssertion(section = "7.5.6", id = "h") })
- public void testBeforeTransactionCompletionObserver()
- {
- dog.setCorrectContext(false);
- dog.setCorrectTransactionState(false);
- Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
- dogAgent.sendInTransaction(new Double(4.0));
- assert dog.isCorrectTransactionState();
- }
-
- @Test(groups = { "stub", "events", "integration" })
- @SpecAssertions( { @SpecAssertion(section = "7.5.6", id = "g") })
- public void testTransactionalObserverDefinedByXML()
- {
- assert false;
- }
-
- @Test(groups = { "events", "broken" })
- @SpecAssertion(section = "7.5.7", id = "c")
- public void testAsynchronousObserverAlsoTransactional()
- {
- dog.setCorrectContext(false);
- dog.setCorrectTransactionState(false);
- Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
- dogAgent.sendInTransaction('a');
- assert dog.isCorrectTransactionState();
- }
-
- /**
- * If the observer method is an asynchronous transactional observer method
- * and there is currently a JTA transaction in progress, the observer object
- * calls the observer method asynchronously during the after transaction
- * completion phase.
- */
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.8", id = "e")
- public void testAsynchronousTransactionalObserverCalledAfterCompletion()
- {
- assert false;
- }
-
- @Test(groups = { "broken", "events", "integration" })
- @SpecAssertion(section = "7.5.8", id = "p")
- public void testTransactionalObserverThrownExceptionIsCaughtAndLogged()
- {
- // TODO There really is no way to verify that something is logged
- assert false;
- }
-
- /**
- * Otherwise, the observer method is called in the same transaction context,
- * client security context and lifecycle contexts as the invocation of
- * Event.fire().
- */
- @Test(groups = { "stub", "events", "integration" })
- @SpecAssertion(section = "7.5.9", id = "d")
- public void testObserverMethodCalledInSameContexts()
- {
- assert false;
- }
-
- /**
- * Otherwise, if the observer method is a @BeforeTransactionCompletion
- * transactional observer method, it is called within the context of the
- * transaction that is about to complete and with the same client security
- * context and lifecycle contexts.
- */
- @Test(groups = { "stub", "events", "integration" })
- @SpecAssertion(section = "7.5.9", id = "b")
- public void testBeforeTransactionCompletionObserverMethodContexts()
- {
- assert false;
- }
-
- /**
- * Otherwise, if the observer method is any other kind of transactional
- * observer method, it is called in an unspecified transaction context, but
- * with the same client security context and lifecycle contexts as the
- * transaction that just completed.
- */
- @Test(groups = { "stub", "events", "integration" })
- @SpecAssertion(section = "7.5.9", id = "c")
- public void testOtherTransactionalObserverMethodContexts()
- {
- assert false;
- }
-}
Copied:
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java
(from rev 1824,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java)
===================================================================
---
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java
(rev 0)
+++
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java 2009-03-09
00:18:30 UTC (rev 1853)
@@ -0,0 +1,216 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.jsr299.tck.tests.event.transactionalObservers;
+
+import static org.jboss.jsr299.tck.impl.packaging.PackagingType.EAR;
+
+import java.lang.annotation.Annotation;
+import java.math.BigInteger;
+
+import javax.inject.AnnotationLiteral;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractDeclarativeTest;
+import org.jboss.jsr299.tck.impl.packaging.Artifact;
+import org.jboss.jsr299.tck.impl.packaging.IntegrationTest;
+import org.jboss.jsr299.tck.impl.packaging.Packaging;
+import org.testng.annotations.Test;
+
+/**
+ * Integration tests for Web Bean events.
+ *
+ * @author David Allen
+ *
+ * Spec version: Public Release Draft 2
+ *
+ */
+@Artifact
+@Packaging(EAR)
+@IntegrationTest
+public class EventTest extends AbstractDeclarativeTest
+{
+
+ private static final Annotation TAME_LITERAL = new AnnotationLiteral<Tame>()
+ {
+ };
+ private PomeranianInterface dog;
+
+ public void setupTest()
+ {
+ dog = (PomeranianInterface)
getCurrentManager().getInstanceByName("Teddy");
+ }
+
+// @AfterMethod(alwaysRun = true)
+// public void teardownTest()
+// {
+// try
+// {
+// dog.removeSessionBean();
+// }
+// catch (Exception e)
+// {
+// // Not important since the bean is now gone one way or the other
+// }
+// }
+
+ @Test(groups = { "events", "integration" })
+ @SpecAssertion(section = "7.5.6", id = "a")
+ public void testTransactionalObserverNotifiedImmediatelyWhenNoTransactionInProgress()
+ {
+ setupTest();
+ dog.setCorrectContext(false);
+ dog.setCorrectTransactionState(false);
+ Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
+ assert dogAgent != null;
+ dogAgent.sendOutsideTransaction(BigInteger.TEN);
+ assert dog.isCorrectTransactionState();
+ // TODO Fix the security contexts
+ // assert dog.isCorrectContext();
+ }
+
+ @Test(groups = { "events", "integration" })
+ @SpecAssertions( { @SpecAssertion(section = "7.5.6", id = "c"),
@SpecAssertion(section = "7.5.6", id = "f"), @SpecAssertion(section =
"7.5.6", id = "i"), @SpecAssertion(section = "7.5.8", id =
"f") })
+ public void testAfterTransactionCompletionObserver()
+ {
+ setupTest();
+ dog.setCorrectContext(false);
+ dog.setCorrectTransactionState(false);
+ assert !getCurrentManager().resolveObservers("event").isEmpty();
+ Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
+ dogAgent.sendInTransaction("event");
+ assert dog.isCorrectTransactionState();
+ }
+
+ @Test(groups = { "events", "integration", "broken" })
+ @SpecAssertions( { @SpecAssertion(section = "7.5.6", id = "d"),
@SpecAssertion(section = "7.5.6", id = "j") })
+ public void testAfterTransactionSuccessObserver()
+ {
+ setupTest();
+ dog.setCorrectContext(false);
+ dog.setCorrectTransactionState(false);
+ Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
+ dogAgent.sendInTransaction(new Integer(4));
+ assert dog.isCorrectTransactionState();
+ }
+
+ @Test(groups = { "events", "integration", "ri-broken"
})
+ @SpecAssertions({
+ @SpecAssertion(section = "7.5.6", id = "e"),
+ @SpecAssertion(section = "7.5.6", id = "k")
+ })
+ public void testAfterTransactionFailureObserver()
+ {
+ setupTest();
+ dog.setCorrectContext(false);
+ dog.setCorrectTransactionState(false);
+ Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
+ dogAgent.sendInTransaction(new Float(4.0));
+ assert dog.isCorrectTransactionState();
+ }
+
+ @Test(groups = { "events", "integration" })
+ @SpecAssertions( { @SpecAssertion(section = "7.5.6", id = "b"),
@SpecAssertion(section = "7.5.6", id = "h") })
+ public void testBeforeTransactionCompletionObserver()
+ {
+ setupTest();
+ dog.setCorrectContext(false);
+ dog.setCorrectTransactionState(false);
+ Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
+ dogAgent.sendInTransaction(new Double(4.0));
+ assert dog.isCorrectTransactionState();
+ }
+
+ @Test(groups = { "stub", "events", "integration" })
+ @SpecAssertions( { @SpecAssertion(section = "7.5.6", id = "g") })
+ public void testTransactionalObserverDefinedByXML()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "events", "broken" })
+ @SpecAssertion(section = "7.5.7", id = "c")
+ public void testAsynchronousObserverAlsoTransactional()
+ {
+ setupTest();
+ dog.setCorrectContext(false);
+ dog.setCorrectTransactionState(false);
+ Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
+ dogAgent.sendInTransaction('a');
+ assert dog.isCorrectTransactionState();
+ }
+
+ /**
+ * If the observer method is an asynchronous transactional observer method
+ * and there is currently a JTA transaction in progress, the observer object
+ * calls the observer method asynchronously during the after transaction
+ * completion phase.
+ */
+ @Test(groups = { "stub", "events" })
+ @SpecAssertion(section = "7.5.8", id = "e")
+ public void testAsynchronousTransactionalObserverCalledAfterCompletion()
+ {
+ assert false;
+ }
+
+ @Test(groups = { "broken", "events", "integration" })
+ @SpecAssertion(section = "7.5.8", id = "p")
+ public void testTransactionalObserverThrownExceptionIsCaughtAndLogged()
+ {
+ // TODO There really is no way to verify that something is logged
+ assert false;
+ }
+
+ /**
+ * Otherwise, the observer method is called in the same transaction context,
+ * client security context and lifecycle contexts as the invocation of
+ * Event.fire().
+ */
+ @Test(groups = { "stub", "events", "integration" })
+ @SpecAssertion(section = "7.5.9", id = "d")
+ public void testObserverMethodCalledInSameContexts()
+ {
+ assert false;
+ }
+
+ /**
+ * Otherwise, if the observer method is a @BeforeTransactionCompletion
+ * transactional observer method, it is called within the context of the
+ * transaction that is about to complete and with the same client security
+ * context and lifecycle contexts.
+ */
+ @Test(groups = { "stub", "events", "integration" })
+ @SpecAssertion(section = "7.5.9", id = "b")
+ public void testBeforeTransactionCompletionObserverMethodContexts()
+ {
+ assert false;
+ }
+
+ /**
+ * Otherwise, if the observer method is any other kind of transactional
+ * observer method, it is called in an unspecified transaction context, but
+ * with the same client security context and lifecycle contexts as the
+ * transaction that just completed.
+ */
+ @Test(groups = { "stub", "events", "integration" })
+ @SpecAssertion(section = "7.5.9", id = "c")
+ public void testOtherTransactionalObserverMethodContexts()
+ {
+ assert false;
+ }
+}
Deleted:
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java 2009-03-08
22:37:17 UTC (rev 1823)
+++
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java 2009-03-09
00:18:30 UTC (rev 1853)
@@ -1,125 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.producer.field.lifecycle;
-
-import javax.inject.IllegalProductException;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.hibernate.tck.annotations.SpecAssertions;
-import org.jboss.jsr299.tck.AbstractDeclarativeTest;
-import org.jboss.jsr299.tck.impl.packaging.Artifact;
-import org.jboss.jsr299.tck.impl.packaging.jsr299.BeansXml;
-import org.testng.annotations.Test;
-
-/**
- *
- * Spec version: PRD2
- *
- */
-@Artifact
-(a)BeansXml("beans.xml")
-public class ProducerFieldLifecycleTest extends AbstractDeclarativeTest
-{
-
- @Test(groups = { "producerField" })
- @SpecAssertions({
- @SpecAssertion(section = "6.8", id = "h"),
- @SpecAssertion(section = "3.5", id = "b")
- })
- public void testProducerStaticFieldBean()
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- TarantulaConsumer tarantulaConsumer =
getCurrentManager().getInstanceByType(TarantulaConsumer.class);
- assert
tarantulaConsumer.getConsumedTarantula().equals(StaticTarantulaProducer.produceTarantula);
- }
- };
- }
-
- @Test(groups = { "producerField" })
- @SpecAssertions({
- @SpecAssertion(section = "6.8", id = "k"),
- @SpecAssertion(section = "6.8", id = "l"),
- @SpecAssertion(section = "6", id = "c"),
- @SpecAssertion(section = "6.8", id = "a"),
- @SpecAssertion(section = "6.8", id = "g")
- })
- public void testProducerFieldBeanCreate() throws Exception
- {
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- BlackWidowConsumer spiderConsumer =
getCurrentManager().getInstanceByType(BlackWidowConsumer.class);
- assert
spiderConsumer.getInjectedSpider().equals(BlackWidowProducer.blackWidow);
- }
- }.run();
- }
-
- @Test(groups = { "producerField", "specialization" })
- @SpecAssertion(section = "6.8", id = "i")
- public void testSpecializedBeanAlwaysUsed() throws Exception
- {
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- TarantulaConsumer spiderConsumer =
getCurrentManager().getInstanceByType(TarantulaConsumer.class);
- assert spiderConsumer.getConsumedTarantula() != null;
- assert spiderConsumer.getConsumedTarantula() instanceof DefangedTarantula;
- }
- }.run();
- }
-
- @Test(groups = { "producerField" })
- @SpecAssertions({
- @SpecAssertion(section = "3.5", id = "d"),
- @SpecAssertion(section = "6.8", id = "m")
- })
- public void testProducerFieldReturnsNullIsDependent() throws Exception
- {
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- NullSpiderConsumer consumerBean =
getCurrentManager().getInstanceByType(NullSpiderConsumer.class);
- assert consumerBean.getInjectedSpider() == null;
- }
- }.run();
- }
-
- @Test(groups = { "producerField" }, expectedExceptions =
IllegalProductException.class)
- @SpecAssertions({
- @SpecAssertion(section = "3.5", id = "e"),
- @SpecAssertion(section = "6.8", id = "n")
- })
- public void testProducerFieldReturnsNullIsNotDependent() throws Exception
- {
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- NullSpiderConsumerForBrokenProducer consumer =
getCurrentManager().getInstanceByType(NullSpiderConsumerForBrokenProducer.class);
- // The injected spider is proxied since it is in the request scope.
- // So to actually create the bean instance, we need to invoke
- // some method on the proxy.
- if (consumer.getInjectedSpider() == null)
- {
- // No proxy in this impl, and no exception = fail
- }
- else
- {
- // Proxy is assumed, so invoke some method
- consumer.getInjectedSpider().bite();
- }
- }
- }.run();
- }
-
-}
Copied:
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java
(from rev 1840,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java)
===================================================================
---
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java
(rev 0)
+++
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java 2009-03-09
00:18:30 UTC (rev 1853)
@@ -0,0 +1,128 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.field.lifecycle;
+
+import javax.inject.IllegalProductException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractDeclarativeTest;
+import org.jboss.jsr299.tck.impl.packaging.Artifact;
+import org.jboss.jsr299.tck.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: PRD2
+ *
+ */
+@Artifact
+(a)BeansXml("beans.xml")
+public class ProducerFieldLifecycleTest extends AbstractDeclarativeTest
+{
+
+ @Test(groups = { "producerField" })
+ @SpecAssertions({
+ @SpecAssertion(section = "6.8", id = "h"),
+ @SpecAssertion(section = "3.5", id = "b")
+ })
+ public void testProducerStaticFieldBean()
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ TarantulaConsumer tarantulaConsumer =
getCurrentManager().getInstanceByType(TarantulaConsumer.class);
+ assert
tarantulaConsumer.getConsumedTarantula().equals(StaticTarantulaProducer.produceTarantula);
+ }
+ };
+ }
+
+ @Test(groups = { "producerField" })
+ @SpecAssertions({
+ @SpecAssertion(section = "6.8", id = "k"),
+ @SpecAssertion(section = "6.8", id = "l"),
+ @SpecAssertion(section = "6", id = "c"),
+ @SpecAssertion(section = "6.8", id = "a"),
+ @SpecAssertion(section = "6.8", id = "g")
+ })
+ public void testProducerFieldBeanCreate() throws Exception
+ {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ BlackWidowConsumer spiderConsumer =
getCurrentManager().getInstanceByType(BlackWidowConsumer.class);
+ assert
spiderConsumer.getInjectedSpider().equals(BlackWidowProducer.blackWidow);
+ }
+ }.run();
+ }
+
+ @Test(groups = { "producerField", "specialization" })
+ @SpecAssertions({
+ @SpecAssertion(section = "6.8", id = "i"),
+ @SpecAssertion(section = "4.3.2", id = "d")
+ })
+ public void testSpecializedBeanAlwaysUsed() throws Exception
+ {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ TarantulaConsumer spiderConsumer =
getCurrentManager().getInstanceByType(TarantulaConsumer.class);
+ assert spiderConsumer.getConsumedTarantula() != null;
+ assert spiderConsumer.getConsumedTarantula() instanceof DefangedTarantula;
+ }
+ }.run();
+ }
+
+ @Test(groups = { "producerField" })
+ @SpecAssertions({
+ @SpecAssertion(section = "3.5", id = "d"),
+ @SpecAssertion(section = "6.8", id = "m")
+ })
+ public void testProducerFieldReturnsNullIsDependent() throws Exception
+ {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ NullSpiderConsumer consumerBean =
getCurrentManager().getInstanceByType(NullSpiderConsumer.class);
+ assert consumerBean.getInjectedSpider() == null;
+ }
+ }.run();
+ }
+
+ @Test(groups = { "producerField" }, expectedExceptions =
IllegalProductException.class)
+ @SpecAssertions({
+ @SpecAssertion(section = "3.5", id = "e"),
+ @SpecAssertion(section = "6.8", id = "n")
+ })
+ public void testProducerFieldReturnsNullIsNotDependent() throws Exception
+ {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ NullSpiderConsumerForBrokenProducer consumer =
getCurrentManager().getInstanceByType(NullSpiderConsumerForBrokenProducer.class);
+ // The injected spider is proxied since it is in the request scope.
+ // So to actually create the bean instance, we need to invoke
+ // some method on the proxy.
+ if (consumer.getInjectedSpider() == null)
+ {
+ // No proxy in this impl, and no exception = fail
+ }
+ else
+ {
+ // Proxy is assumed, so invoke some method
+ consumer.getInjectedSpider().bite();
+ }
+ }
+ }.run();
+ }
+
+}
Deleted:
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-03-08
22:37:17 UTC (rev 1823)
+++
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-03-09
00:18:30 UTC (rev 1853)
@@ -1,126 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
-
-import javax.context.CreationalContext;
-import javax.inject.AnnotationLiteral;
-import javax.inject.CreationException;
-import javax.inject.IllegalProductException;
-import javax.inject.manager.Bean;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.hibernate.tck.annotations.SpecAssertions;
-import org.jboss.jsr299.tck.AbstractDeclarativeTest;
-import org.jboss.jsr299.tck.impl.packaging.Artifact;
-import org.jboss.jsr299.tck.impl.packaging.jsr299.BeansXml;
-import org.testng.annotations.Test;
-
-/**
- *
- * Spec version: PRD2
- *
- */
-@Artifact
-(a)BeansXml("beans.xml")
-public class ProducerMethodLifecycleTest extends AbstractDeclarativeTest
-{
-
- @Test(groups = { "producerMethod", "broken" })
- @SpecAssertions({
- @SpecAssertion(section = "3.4", id = "c"),
- @SpecAssertion(section = "3.4", id = "k"),
- @SpecAssertion(section = "3.4.2", id = "a"),
- @SpecAssertion(section = "6", id = "a"),
- @SpecAssertion(section = "6.7", id = "e")
- })
- public void testProducerMethodBeanCreate() throws Exception
- {
- assert getCurrentManager().getInstanceByType(Tarantula.class) != null;
- }
-
- @Test(groups = { "specialization" })
- @SpecAssertions({
- @SpecAssertion(section = "6.7", id = "g")
- })
- public void testSpecializedBeanAlwaysUsed() throws Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- Egg egg = getCurrentManager().getInstanceByType(Egg.class);
- assert egg != null;
- assert egg.equals(AndalusianChicken.egg);
- }
-
- }.run();
- }
-
- @Test(groups = { "stub", "disposalMethod",
"beanLifecycle" })
- @SpecAssertion(section = "6.7", id = "m")
- public void testDisposalMethodCalled()
- {
- // TODO Placeholder
- assert false;
- }
-
- @Test(groups = { "producerMethod", "broken" })
- @SpecAssertions({
- @SpecAssertion(section = "3.4", id = "e"),
- @SpecAssertion(section = "6.7", id = "k")
- })
- public void testProducerMethodReturnsNullIsDependent() throws Exception
- {
- assert getCurrentManager().getInstanceByType(Spider.class, new
AnnotationLiteral<Null>() {}) == null;
- }
-
- @Test(groups = "producerMethod", expectedExceptions =
IllegalProductException.class)
- @SpecAssertions({
- @SpecAssertion(section = "3.4", id = "f"),
- @SpecAssertion(section = "6.7", id = "l")
- })
- public void testProducerMethodReturnsNullIsNotDependent() throws Exception
- {
- assert getCurrentManager().resolveByType(Spider.class, new
AnnotationLiteral<Request>() {}).size() == 1;
- Bean<Spider> spider = getCurrentManager().resolveByType(Spider.class, new
AnnotationLiteral<Request>() {}).iterator().next();
- // Do the create ourselves, otherwise we may get a proxy back...
- spider.create(new CreationalContext<Spider>() {
-
- public void push(Spider incompleteInstance)
- {
- // TODO Auto-generated method stub
-
- }});
- }
-
- @Test(expectedExceptions = CreationException.class)
- @SpecAssertion(section="6.2", id="h")
- public void testCreationExceptionWrapsCheckedExceptionThrownFromCreate() throws
Exception
- {
- new RunInDependentContext()
- {
-
- protected void execute() throws Exception
- {
- getCurrentManager().getInstanceByType(Lorry.class);
- }
-
- }.run();
- }
-
- @Test(expectedExceptions = FooException.class)
- @SpecAssertion(section="6.2", id="g")
- public void testUncheckedExceptionThrownFromCreateNotWrapped() throws Exception
- {
- new RunInDependentContext()
- {
-
- protected void execute() throws Exception
- {
- getCurrentManager().getInstanceByType(Ship.class);
- }
-
- }.run();
- }
-
-}
Copied:
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
(from rev 1840,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java)
===================================================================
---
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
(rev 0)
+++
tck/tags/1.0.0.ALPHA2/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-03-09
00:18:30 UTC (rev 1853)
@@ -0,0 +1,127 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
+
+import javax.context.CreationalContext;
+import javax.inject.AnnotationLiteral;
+import javax.inject.CreationException;
+import javax.inject.IllegalProductException;
+import javax.inject.manager.Bean;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractDeclarativeTest;
+import org.jboss.jsr299.tck.impl.packaging.Artifact;
+import org.jboss.jsr299.tck.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: PRD2
+ *
+ */
+@Artifact
+(a)BeansXml("beans.xml")
+public class ProducerMethodLifecycleTest extends AbstractDeclarativeTest
+{
+
+ @Test(groups = { "producerMethod", "broken" })
+ @SpecAssertions({
+ @SpecAssertion(section = "3.4", id = "c"),
+ @SpecAssertion(section = "3.4", id = "k"),
+ @SpecAssertion(section = "3.4.2", id = "a"),
+ @SpecAssertion(section = "6", id = "a"),
+ @SpecAssertion(section = "6.7", id = "e")
+ })
+ public void testProducerMethodBeanCreate() throws Exception
+ {
+ assert getCurrentManager().getInstanceByType(Tarantula.class) != null;
+ }
+
+ @Test(groups = { "specialization" })
+ @SpecAssertions({
+ @SpecAssertion(section = "6.7", id = "g"),
+ @SpecAssertion(section = "4.3.2", id = "c")
+ })
+ public void testSpecializedBeanAlwaysUsed() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ Egg egg = getCurrentManager().getInstanceByType(Egg.class);
+ assert egg != null;
+ assert egg.equals(AndalusianChicken.egg);
+ }
+
+ }.run();
+ }
+
+ @Test(groups = { "stub", "disposalMethod",
"beanLifecycle" })
+ @SpecAssertion(section = "6.7", id = "m")
+ public void testDisposalMethodCalled()
+ {
+ // TODO Placeholder
+ assert false;
+ }
+
+ @Test(groups = { "producerMethod", "broken" })
+ @SpecAssertions({
+ @SpecAssertion(section = "3.4", id = "e"),
+ @SpecAssertion(section = "6.7", id = "k")
+ })
+ public void testProducerMethodReturnsNullIsDependent() throws Exception
+ {
+ assert getCurrentManager().getInstanceByType(Spider.class, new
AnnotationLiteral<Null>() {}) == null;
+ }
+
+ @Test(groups = "producerMethod", expectedExceptions =
IllegalProductException.class)
+ @SpecAssertions({
+ @SpecAssertion(section = "3.4", id = "f"),
+ @SpecAssertion(section = "6.7", id = "l")
+ })
+ public void testProducerMethodReturnsNullIsNotDependent() throws Exception
+ {
+ assert getCurrentManager().resolveByType(Spider.class, new
AnnotationLiteral<Request>() {}).size() == 1;
+ Bean<Spider> spider = getCurrentManager().resolveByType(Spider.class, new
AnnotationLiteral<Request>() {}).iterator().next();
+ // Do the create ourselves, otherwise we may get a proxy back...
+ spider.create(new CreationalContext<Spider>() {
+
+ public void push(Spider incompleteInstance)
+ {
+ // TODO Auto-generated method stub
+
+ }});
+ }
+
+ @Test(expectedExceptions = CreationException.class)
+ @SpecAssertion(section="6.2", id="h")
+ public void testCreationExceptionWrapsCheckedExceptionThrownFromCreate() throws
Exception
+ {
+ new RunInDependentContext()
+ {
+
+ protected void execute() throws Exception
+ {
+ getCurrentManager().getInstanceByType(Lorry.class);
+ }
+
+ }.run();
+ }
+
+ @Test(expectedExceptions = FooException.class)
+ @SpecAssertion(section="6.2", id="g")
+ public void testUncheckedExceptionThrownFromCreateNotWrapped() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ protected void execute() throws Exception
+ {
+ getCurrentManager().getInstanceByType(Ship.class);
+ }
+
+ }.run();
+ }
+
+}
Deleted: tck/tags/1.0.0.ALPHA2/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-03-08 22:37:17 UTC (rev 1823)
+++ tck/tags/1.0.0.ALPHA2/impl/src/main/resources/tck-audit.xml 2009-03-09 00:18:30 UTC
(rev 1853)
@@ -1,5677 +0,0 @@
-<specification
-
xmlns="http://jboss.com/products/webbeans/tck/audit"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://jboss.com/products/webbeans/tck/audit
http://snapshots.jboss.org/maven2/org/hibernate/tck-utils-api/0.9-SNAPSHO...
- name="JSR-299: Java Contexts and Dependency Injection"
- version="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="ba">
- <text>A bean type may be a parameterized type with an actual type
parameter.</text>
- </assertion>
-
- <assertion id="bb">
- <text>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. If the type of an injection
point is a parameterized type with a type variable, a DefinitionException is thrown by the
container at deployment time.</text>
- </assertion>
-
- <assertion id="d">
- <text>Bean types may not declare a wildcard. If the type of an injection
point is a parameterized type with a wildcard, a DefinitionException is thrown by the
container at deployment time.</text>
- </assertion>
-
- <assertion id="e">
- <text>A bean type may be an interface</text>
- </assertion>
-
- <assertion id="f">
- <text>A bean type may be a concrete class</text>
- </assertion>
-
- <assertion id="g">
- <text>A bean type may be an abstract class</text>
- </assertion>
-
- <assertion id="h">
- <text>A bean type may be declared final</text>
- </assertion>
-
- <assertion id="i">
- <text>A bean type may have final methods</text>
- </assertion>
-
- <assertion id="j">
- <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="k">
- <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="l">
- <text>All beans have the bean type java.lang.Object</text>
- </assertion>
-
- <assertion id="m">
- <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" title="Bindings">
-
- </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="aa">
- <text>A binding type is a Java annotation defined as @Target({METHOD, FIELD,
PARAMETER, TYPE})~ and @Retention(RUNTIME)~.</text>
- </assertion>
-
- <assertion id="ab" testable="false">
- <text>A binding type is a Java annotation defined as ~@Target({METHOD, FIELD,
PARAMETER, TYPE}) and ~(a)Retention(RUNTIME).</text>
- <note>Non-runtime retention annotations are discarded by the
compiler</note>
- </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" testable="false">
- <text>A binding type may define annotation members</text>
- <note>This is true by default in the JLS</note>
- </assertion>
- </section>
-
- <section id="2.3.3" title="Declaring the bindings of a bean using
annotations">
-
- <assertion id="a">
- <text>A bean's bindings are declared by annotating the bean class with
the binding types</text>
- </assertion>
-
- <assertion id="b">
- <text>A bean's bindings are declared by annotating the producer method
with the binding types</text>
- </assertion>
-
- <assertion id="c">
- <text>A bean's bindings are declared by annotating the producer field
with the binding types</text>
- </assertion>
-
- <assertion id="d">
- <text>Any bean may declare multiple binding types</text>
- </assertion>
- </section>
-
- <section id="2.3.4" title="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 (see
Chapter 3, Bean implementation) to determine the bean instance that is passed when the
method is called by the container</text>
- </assertion>
-
- <assertion id="b">
- <text>Binding types may be applied to parameters of initializer methods (see
Chapter 3, Bean implementation) to determine the bean instance that is passed when the
method is called by the container</text>
- </assertion>
-
- <assertion id="c">
- <text>Binding types may be applied to parameters of disposal methods (see
Chapter 3, Bean implementation) to determine the bean instance that is passed when the
method is called by the container</text>
- </assertion>
-
- <assertion id="d">
- <text>Binding types may be applied to parameters of bean constructors (see
Chapter 3, Bean implementation) to determine the bean instance that is passed when the
method is called by the container</text>
- </assertion>
-
- <assertion id="e">
- <text>For a bean defined in XML, the bindings of a method parameter may be
specified using XML</text>
- </assertion>
-
- <assertion id="f">
- <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" testable="false">
- <text>A scope type is represented by an annotation type.</text>
- <note>This is a statement of intent</note>
- </assertion>
-
- <assertion id="c" testable="false">
- <text>The set of scope types is extensible</text>
- <note>This is a statement of intent</note>
- </assertion>
-
- </section>
-
- <section id="2.4.1" title="Built-in scope types">
- <assertion id="a" testable="false">
- <text>The @RequestScoped, @ApplicationScoped and @SessionScoped annotations
defined in Section 8.5, "Context management for built-in scopes" represent the
standard scopes defined by the Java Servlets specification</text>
- <note>This is a statement of intent</note>
- </assertion>
-
- <assertion id="b" testable="false">
- <text>The @ConversationScoped annotation represents the conversation scope
defined in Section 8.5.4, "Conversation context lifecycle".</text>
- <note>This is a statement of intent</note>
- </assertion>
-
- <assertion id="c" testable="false">
- <text>The @Dependent pseudo-scope is for dependent objects, as defined in
Section 8.3, "Dependent pseudo-scope"</text>
- <note>This is a statement of intent</note>
- </assertion>
- </section>
-
- <section id="2.4.2" title="Defining new scope types">
- <assertion id="aa">
- <text>A scope type is a Java annotation defined as @Target({TYPE, METHOD,
FIELD})~ and @Retention(RUNTIME)~</text>
- </assertion>
-
- <assertion id="ab" testable="false">
- <text>A scope type is a Java annotation defined as ~@Target({TYPE, METHOD,
FIELD}) and ~@Retention(RUNTIME)</text>
- <note>Non-runtime retention annotations are discarded by the
compiler</note>
- </assertion>
-
-
-
- <assertion id="b">
- <text>All scope types must specify the @javax.context.ScopeType
meta-annotation</text>
- </assertion>
-
- </section>
-
- <section id="2.4.3" title="Declaring the bean scope using
annotations">
- <assertion id="a">
- <text>The bean's scope is defined by annotating the bean class or
producer method or field with a scope type</text>
- </assertion>
-
- <assertion id="b">
- <text>A bean class or producer method or field may specify at most one scope
type annotation. If a bean class or producer method or field specifies multiple scope type
annotations, a DefinitionException is thrown by the container at deployment
time</text>
- </assertion>
-
- <assertion id="c">
- <text>A scope type may be specified using a stereotype annotation, as defined
in Section 2.7.2, "Declaring the stereotypes for a bean using
annotations"</text>
- </assertion>
- </section>
-
- <section id="2.4.4" title="Declaring the bean scope using
XML">
- <assertion id="a">
- <text>If the bean is declared in beans.xml, the scope may be specified using
the scope annotation type name</text>
- </assertion>
-
- <assertion id="b">
- <text>If more than one scope type is specified in XML, a DefinitionException
is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="c">
- <text>A scope 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.4.5" title="Default scope">
- <assertion id="a">
- <text>When no scope is explicitly declared by annotating the bean class or
producer method or field, or by using XML, the scope of a bean is defaulted</text>
- </assertion>
-
- <assertion id="b">
- <text>If the bean does not declare any stereotype with a declared default
scope, the default scope for the bean is @Dependent</text>
- </assertion>
-
- <assertion id="c">
- <text>If all stereotypes declared by the bean that have some declared default
scope have the same default scope, then that scope is the default scope for the
bean</text>
- </assertion>
-
- <assertion id="d">
- <text>If there are two different stereotypes declared by the bean that
declare different default scopes, then there is no default scope and the bean must
explicitly declare a scope. If it does not explicitly declare a scope, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="e">
- <text>If a bean explicitly declares a scope, any default scopes declared by
stereotypes are ignored</text>
- </assertion>
- </section>
-
- <section id="2.5" title="Deployment types">
- <assertion id="a" testable="false">
- <text>The set of deployment types is extensible</text>
- <note>This is a statement of intent</note>
- </assertion>
- </section>
-
- <section id="2.5.1" title="Built-in deployment types">
-
- <assertion id="a">
- <text>All standard beans defined by this specification, and provided by the
container, are defined using the @Standard deployment type</text>
- <note>This is tested in the test for each bean defined. See 5.6.1.za,
5.7.2.ca, 8.5.4.i</note>
- </assertion>
-
- <assertion id="b">
- <text>No bean may be declared with the @Standard deployment type unless
explicitly required by this specification</text>
- </assertion>
-
- <assertion id="c" testable="false">
- <text>Application beans may be defined using the @Production deployment
type</text>
- <note>This is a statement of intent</note>
- </assertion>
-
- </section>
-
- <section id="2.5.2" title="Defining new deployment types">
-
- <assertion id="a">
- <text>A deployment type is a Java annotation defined as @Target({TYPE,
METHOD, FIELD})</text>
- </assertion>
-
- <assertion id="bb" testable="false">
- <text>A deployment type is a Java annotation defined with
@Retention(RUNTIME)</text>
- <note>Non-runtime retention annotations are discarded by the
compiler</note>
- </assertion>
-
- <assertion id="c">
- <text>All deployment types must also specify the @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</text>
- </assertion>
-
- <assertion id="b">
- <text>The deployment type of the bean is declared by annotating the producer
method</text>
- </assertion>
-
- <assertion id="c">
- <text>The deployment type of the bean is declared by annotating the
field</text>
- </assertion>
-
- <assertion id="d">
- <text>An bean class 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="e">
- <text>A producer method 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="f">
- <text>A 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="g">
- <text>By default, if no deployment type annotation is explicitly specified, a
producer method inherits the deployment type of the bean in which it is
defined.</text>
- </assertion>
-
- <assertion id="h">
- <text>By default, if no deployment type annotation is explicitly specified, a
producer field inherits the deployment type of the bean in which it is
defined.</text>
- </assertion>
-
- <assertion id="i">
- <text>a deployment type may be specified using a stereotype annotation, as
defined in Section 2.7.2, "Declaring the stereotypes for a bean using
annotations".</text>
- </assertion>
-
- </section>
-
- <section id="2.5.4" title="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@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>
-
- <assertion id="b">
- <text>If a <Deploy> element is specified, only the explicitly
declared deployment types are enabled.</text>
- </assertion>
-
- <assertion id="c">
- <text>The @Standard deployment type must be declared. If the @Standard
deployment type is not declared, a DeploymentException is thrown by the container at
deployment time.</text>
- </assertion>
-
- <assertion id="d">
- <text>If no <Deploy> element is specified in any beans.xml
file, only the @Standard and @Production deployment types are enabled.</text>
- </assertion>
-
- <assertion id="e">
- <text>If the <Deploy> element is specified in more than one
beans.xml document, a DeploymentException is thrown by the container at deployment time.
</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.</text>
- </assertion>
-
- <assertion id="b">
- <text>To specify the name of a bean, the @javax.annotation.Named annotation
is applied to the producer method.</text>
- </assertion>
-
- <assertion id="c">
- <text>To specify the name of a bean, the @javax.annotation.Named annotation
is applied to the producer field.</text>
- </assertion>
-
- <assertion id="d">
- <text>If the @Named annotation does not specify the value member, the default
name is assumed</text>
- </assertion>
- </section>
-
- <section id="2.6.2" title="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
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 a producer method
of a bean defined using annotations declares a @Named annotation and no name is explicitly
specified by the value member</text>
- </assertion>
-
- <assertion id="c">
- <text>A default name must be assigned by the container when a producer 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="d">
- <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="e">
- <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 specify that all beans with the stereotype have
defaulted bean names</text>
- </assertion>
-
- <assertion id="b" testable="false">
- <text>A bean may declare zero stereotypes</text>
- <note>I can't see how to test this</note>
- </assertion>
-
- <assertion id="c">
- <text>A bean may declare one stereotype</text>
- </assertion>
-
- <assertion id="d">
- <text>A bean may declare multiple stereotypes</text>
- </assertion>
-
- </section>
-
- <section id="2.7.1" title="Defining new stereotypes">
- <assertion id="aa">
- <text>A beans stereotype is a Java annotation defined as @Target({TYPE,
METHOD, FIELD})~, @Target(TYPE), @Target(METHOD), @Target(FIELD) or @Target({METHOD,
FIELD}) and @Retention(RUNTIME)~</text>
- </assertion>
-
- <assertion id="ab">
- <text>A beans stereotype is a Java annotation defined as ~@Target({TYPE,
METHOD, FIELD}),~ @Target(TYPE)~, @Target(METHOD), @Target(FIELD) or @Target({METHOD,
FIELD}) and @Retention(RUNTIME)~</text>
- </assertion>
-
- <assertion id="ac">
- <text>A beans stereotype is a Java annotation defined as ~@Target({TYPE,
METHOD, FIELD}), @Target(TYPE), @Target(METHOD), ~@Target(FIELD) ~or @Target({METHOD,
FIELD}) and @Retention(RUNTIME)~</text>
- </assertion>
-
- <assertion id="ad">
- <text>A beans stereotype is a Java annotation defined as ~@Target({TYPE,
METHOD, FIELD}), @Target(TYPE), @Target(METHOD), @Target(FIELD) or~ @Target({METHOD,
FIELD})~ and @Retention(RUNTIME)~</text>
- </assertion>
-
- <assertion id="ae" testable="false">
- <text>A beans stereotype is a Java annotation defined as ~@Target({TYPE,
METHOD, FIELD}), @Target(TYPE), @Target(METHOD), @Target(FIELD) or @Target({METHOD,
FIELD}) and~ @Retention(RUNTIME)</text>
- <note>Non-runtime retention annotations are discarded by the
compiler</note>
- </assertion>
-
-
-
- <assertion id="b">
- <text>A stereotype may be declared by specifying the
@javax.annotation.Stereotype meta-annotation</text>
- </assertion>
-
- <assertion id="c">
- <text>The @Stereotype meta-annotation may be omitted, and the stereotype may
be declared in beans.xml</text>
- </assertion>
-
- <assertion id="d">
- <text>A stereotype may not declare any binding annotation. If a stereotype
declares a binding annotation, a DefinitionException is thrown by the container at
deployment time</text>
- </assertion>
- </section>
-
- <section id="2.7.1.1" title="Declaring the default scope and
deployment type for a stereotype">
- <assertion id="a">
- <text>A stereotype may declare at most one scope. If a stereotype declares
more than one scope, a DefinitionException is thrown by the container at deployment
time</text>
- </assertion>
-
- <assertion id="b">
- <text>A stereotype may declare at most one deployment type. If a stereotype
declares more than one deployment type, a DefinitionException is thrown by the container
at deployment time</text>
- </assertion>
- </section>
-
- <section id="2.7.1.2" title="Specifying interceptor bindings for a
stereotype">
-
- <assertion id="a">
- <text>A stereotype may declare zero interceptor bindings</text>
- </assertion>
-
- <assertion id="b">
- <text>A stereotype may declare one interceptor binding</text>
- </assertion>
-
- <assertion id="c">
- <text>A stereotype may declare multiple interceptor bindings</text>
- </assertion>
-
- </section>
-
- <section id="2.7.1.3" title="Specifying name defaulting for a
stereotype">
- <assertion id="a">
- <text>A stereotype may declare an empty @Named annotation. If a stereotype
declares a non-empty @Named annotation, a DefinitionException is thrown by the container
at deployment time</text>
- </assertion>
-
- <assertion id="b">
- <text>A stereotype may specify that every bean with the stereotype has a
defaulted name when a name is not explicitly specified by the bean</text>
- </assertion>
- </section>
-
- <section id="2.7.1.4" title="Restricting bean scopes and types using
a stereotype">
- <assertion id="a">
- <text>Bean scopes may be restricted using a stereotype</text>
- </assertion>
-
- <assertion id="b">
- <text>Bean types may be restricted using a stereotype</text>
- </assertion>
-
- <assertion id="c">
- <text>Scope and type restrictions may not be specified when a stereotype is
declared in XML</text>
- </assertion>
- </section>
-
- <section id="2.7.1.5" title="Stereotypes with additional
stereotypes">
- <assertion id="a">
- <text>A stereotype may declare other stereotypes</text>
- </assertion>
-
- <assertion id="b">
- <text>Stereotype declarations are transitive - a stereotype declared by a
second stereotype is inherited by all beans and other stereotypes that declare the second
stereotype</text>
- </assertion>
-
- <assertion id="c" >
- <text>Stereotypes declared @Target(TYPE) may not be applied to stereotypes
declared @Target({TYPE, METHOD, FIELD})</text>
- </assertion>
-
- <assertion id="d">
- <text>Stereotypes declared @Target(TYPE) may not be applied to stereotypes
declared @Target(METHOD)</text>
- </assertion>
-
- <assertion id="e">
- <text>Stereotypes declared @Target(TYPE) may not be applied to stereotypes
declared @Target(FIELD)</text>
- </assertion>
-
- <assertion id="f">
- <text>Stereotypes declared @Target(TYPE) may not be applied to stereotypes
declared @Target({METHOD, FIELD})</text>
- </assertion>
-
- </section>
-
- <section id="2.7.2" title="Declaring the stereotypes for a bean using
annotations">
- <assertion id="a">
- <text>Stereotype annotations may be applied to a bean class</text>
- </assertion>
-
- <assertion id="b">
- <text>Stereotype annotations may be applied to a producer
method</text>
- </assertion>
-
- <assertion id="c">
- <text>Stereotype annotations may be applied to a producer field</text>
- </assertion>
-
- <assertion id="da">
- <text>The default deployment type declared by the stereotype may be
overridden by the bean</text>
- </assertion>
-
- <assertion id="db">
- <text>The default scope declared by the stereotype may be overridden by the
bean</text>
- </assertion>
-
- <assertion id="e">
- <text>Multiple stereotypes may be applied to the same bean</text>
- </assertion>
- </section>
-
- <section id="2.7.3" title="Declaring the stereotypes for a bean using
XML">
- <assertion id="a">
- <text>If the bean is declared in beans.xml, stereotypes may be declared using
the stereotype annotation type name</text>
- </assertion>
- </section>
-
- <section id="2.7.4" title="Stereotype restrictions">
- <assertion id="a">
- <text>If a stereotype declares a requiredType, and the bean types do not
include the type, a DefinitionException is thrown by the container at deployment
time</text>
- </assertion>
-
- <assertion id="b">
- <text>If a stereotype explicitly declares a set of scope types using
supportedScopes, and the bean scope is not in that set, a DefinitionException is thrown by
the container at deployment time</text>
- </assertion>
-
- <assertion id="c">
- <text>If a bean declares multiple stereotypes, it must satisfy every
restriction declared by every declared stereotype</text>
- </assertion>
- </section>
-
- <section id="2.7.5" title="Built-in stereotypes">
- <assertion id="a" testable="false">
- <text>The built-in @Model stereotype is intended for use with beans that
define the model layer of an MVC web application architecture such as JSF</text>
- <note>Tested by API signature test</note>
- </assertion>
-
- </section>
-
- <section id="3" title="Bean Implementation">
-
- </section>
-
- <section id="3.1" title="Restriction upon bean
instantiation">
- <assertion id="a">
- <text>The bean class is a concrete class and is not required to implement any
special interface or extend any special superclass</text>
- </assertion>
-
- <assertion id="b" testable="false">
- <text>If the application calls a producer method directly, instead of letting
the container call it, the returned object is not a contextual instance and the
capabilities listed in Section 2.1, "Functionality provided by the container to the
bean" will not be available to the returned object.</text>
- </assertion>
- </section>
-
- <section id="3.2" title="Simple beans">
- <assertion id="a">
- <text>The bean class of a simple bean may not be a non-static inner
class</text>
- </assertion>
-
- <assertion id="b">
- <text>The bean class of a simple bean may not be a parameterized
type</text>
- </assertion>
-
- <assertion id="ca">
- <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="cb">
- <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="d">
- <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="e">
- <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="fa">
- <text>If a simple bean has a public field, it must have scope
@Dependent.</text>
- <note>Check that a dependent scoped bean with a public field does
work</note>
- </assertion>
-
- <assertion id="fb">
- <text>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="ba">
- <text>A top-level Java class that is a static inner class can be a simple
bean</text>
- </assertion>
- <assertion id="ca">
- <text>A top-level Java class is not a simple bean if it is an abstract
class</text>
- </assertion>
- <assertion id="cb">
- <text>A top-level Java class is not a simple bean if it is an
interface</text>
- </assertion>
- <assertion id="cc">
- <text>A top-level Java class can be a simple bean if it is static inner
class</text>
- </assertion>
- <assertion id="da">
- <text>A top-level abstract Java class is a simple bean if it is annotated
@Decorator.</text>
- </assertion>
- <assertion id="db">
- <text>A top-level interface Java class is a simple bean if it is annotated
@Decorator.</text>
- </assertion>
- <assertion id="e">
- <text>A top-level Java class is not a simple bean if it is annotated with the
JPA @Entity annotation</text>
- </assertion>
- <assertion id="f">
- <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="g">
- <text>A top-level Java class is not a simple bean if it implements the
javax.servlet.Servlet interface</text>
- </assertion>
- <assertion id="h">
- <text>A top-level Java class is not a simple bean if it implements the
javax.servlet.Filter interface</text>
- </assertion>
- <assertion id="i">
- <text>A top-level Java class is not a simple bean if it implements the
javax.servlet.ServletContextListener interface</text>
- </assertion>
- <assertion id="j">
- <text>A top-level Java class is not a simple bean if it implements the
javax.servlet.http.HttpSessionListener interface</text>
- </assertion>
- <assertion id="k">
- <text>A top-level Java class is not a simple bean if it implements the
javax.servlet.ServletRequestListener interface</text>
- </assertion>
- <assertion id="l">
- <text>A top-level Java class is not a simple bean if it implements the
javax.ejb.EnterpriseBean interface</text>
- </assertion>
- <assertion id="m">
- <text>A top-level Java class is not a simple bean if it extends
javax.faces.component.UIComponent</text>
- </assertion>
- <assertion id="n">
- <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="o">
- <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="p">
- <text>A top-level Java class is only a simple bean if it has an appropriate
constructor - a constructor with no parameters</text>
- </assertion>
- <assertion id="q">
- <text>A top-level Java class is only a simple bean if it has an appropriate
constructor - a constructor annotated @Initializer</text>
- </assertion>
- <assertion id="r">
- <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="ba">
- <text>A bean class may also specify a scope~, name, deployment type,
stereotypes and/or bindings~</text>
- </assertion>
-
- <assertion id="bb">
- <text>A bean class may also specify a ~scope,~ name~, deployment type,
stereotypes and/or bindings~</text>
- </assertion>
-
- <assertion id="bc">
- <text>A bean class may also specify a ~scope, name, ~deployment type~,
stereotypes and/or bindings~</text>
- </assertion>
-
- <assertion id="bd">
- <text>A bean class may also specify ~a scope, name, deployment type,
~stereotypes~ and/or bindings~</text>
- </assertion>
-
- <assertion id="be">
- <text>A bean class may also specify ~a scope, name, deployment type,
stereotypes and/or~ bindings</text>
- </assertion>
-
- <assertion id="c">
- <text>A 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 , 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 a non-static inner
class, a DefinitionException is thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="da">
- <text>If the bean class of a simple bean defined in XML is a static inner
class, a DefinitionException is not thrown.</text>
- </assertion>
-
- <assertion id="e">
- <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="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>
-
- <assertion id="g">
- <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="ba">
- <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 defined by annotations</text>
- </assertion>
- <assertion id="bb">
- <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 initializer methods defined by annotations</text>
- </assertion>
- <assertion id="bc">
- <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
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</text>
- </assertion>
- <assertion id="j">
- <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
producer methods</text>
- </assertion>
- <assertion id="k">
- <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
producer fields</text>
- </assertion>
- <assertion id="l">
- <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
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>
-
- </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, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="e">
- <text>If a bean constructor has a parameter annotated @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 by the container if X is enabled.</text>
- <note>This assertion relates to specialized beans declared using
annotations</note>
- </assertion>
-
- <assertion id="c">
- <text>We say that X directly specializes Y, and we can be certain that Y will
never be called by the container if X is enabled.</text>
- <note>This assertion relates to specialized beans declared using
annotations</note>
- </assertion>
-
- <assertion id="d">
- <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="e">
- <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>
- </section>
-
- <section id="3.2.8" title="Default name for a simple bean">
- <assertion id="a" testable="false">
- <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>
- <note>This is a reference to the EJB specification</note>
- </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, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="g">
- <text>If the bean class of a session bean is annotated @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="da">
- <text>If the application directly calls an EJB remove method of an instance
of a session bean that is a stateful session bean and has scope @Dependent then no
parameters are passed to the method by the container.</text>
- </assertion>
-
- <assertion id="db">
- <text>If the application directly calls an EJB remove method of an instance
of a session bean that is a stateful session bean and has scope @Dependent then the
container ignores the instance instead of destroying it when 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="ba">
- <text>A bean class may also specify a scope~, name, deployment type,
stereotypes and/or bindings~</text>
- </assertion>
-
- <assertion id="bb">
- <text>A bean class may also specify a ~scope, ~name~, deployment type,
stereotypes and/or bindings~</text>
- </assertion>
-
- <assertion id="bc">
- <text>A bean class may also specify a ~scope, name, ~deployment type~,
stereotypes and/or bindings~</text>
- </assertion>
-
- <assertion id="bd">
- <text>A bean class may also specify a ~scope, name, deployment type,
~stereotypes ~and/or bindings~</text>
- </assertion>
-
- <assertion id="be">
- <text>A bean class may also specify a ~scope, name, deployment type,
stereotypes and/or~ bindings~</text>
- </assertion>
-
- <assertion id="c">
- <text>A session bean class may extend another bean class</text>
- </assertion>
- </section>
-
- <section id="3.3.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 bean class is declared in XML, a DefinitionException is
thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>If a 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="aa">
- <text>Check that all enterprise beans have a @New bean</text>
- <note>Sanity check</note>
- </assertion>
-
- <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</text>
- </assertion>
-
- <assertion id="j">
- <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
producer methods</text>
- </assertion>
-
- <assertion id="k">
- <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
producer fields</text>
- </assertion>
-
- <assertion id="l">
- <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
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 by the container if X is enabled</text>
- </assertion>
-
- <assertion id="c">
- <text>We say that X directly specializes Y, and we can be certain that Y will
never be called by the container if X is enabled</text>
- </assertion>
-
- <assertion id="d">
- <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="e">
- <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 static</text>
- </assertion>
-
- <assertion id="c">
- <text>A producer method may be non-static</text>
- </assertion>
-
- <assertion id="d">
- <text>If the bean is a session bean, the producer method must be either a
business method of the EJB or a static method of the bean class</text>
- </assertion>
-
- <assertion id="e">
- <text>If a producer method sometimes returns a null value, then the producer
method must have scope @Dependent</text>
- </assertion>
-
- <assertion id="f">
- <text>If a producer method returns a null value at runtime, and the producer
method declares 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="g">
- <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="h">
- <text>If a producer method return type contains a wildcard type parameter, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="i">
- <text>If a producer method return type contains a type variable, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="j" testable="false">
- <text>The application may call producer methods directly. However, if the
application calls a producer method directly, no parameters will be passed to the producer
method by the container; the returned object is not bound to any context; and its
lifecycle is not managed by the container</text>
- </assertion>
-
- <assertion id="k">
- <text>A bean may declare multiple producer methods</text>
- </assertion>
- </section>
-
- <section id="3.4.1" title="Bean types of a producer method">
-
- <assertion id="a">
- <text>If the return type of a producer method is an interface, the set of
bean types contains the return type, all interfaces it extends directly or indirectly and
java.lang.Object</text>
- </assertion>
-
- <assertion id="b">
- <text>If a return type of a producer method is primitive or is a Java array
type, the set of bean types contains exactly two types: the method return type and
java.lang.Object</text>
- </assertion>
-
- <assertion id="c">
- <text>If the return type of a producer method is a class, the set of bean
types contains the return type, every superclass and all interfaces it implements directly
or indirectly</text>
- </assertion>
- </section>
-
- <section id="3.4.2" title="Declaring a producer method 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="ba">
- <text>A producer method may specify a scope</text>
- </assertion>
-
- <assertion id="bb">
- <text>A producer method may specify a name</text>
- </assertion>
-
- <assertion id="bc">
- <text>A producer method may specify a deployment type</text>
- </assertion>
-
- <assertion id="bd">
- <text>A producer method may specify stereotypes</text>
- </assertion>
-
- <assertion id="be">
- <text>A producer method may specify a binding type</text>
- </assertion>
-
- <assertion id="c">
- <text>If a producer method is annotated @Initializer, a DefinitionException
is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>If a producer method has a parameter annotated @Disposes, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="e">
- <text>If a producer 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 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, a DefinitionException is thrown by the
container at deployment time</text>
- </assertion>
-
- <assertion id="c">
- <text>If the method 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 static</text>
- </assertion>
-
- <assertion id="c">
- <text>A disposal method may be non-static</text>
- </assertion>
-
- <assertion id="d">
- <text>If the bean is a session bean, the disposal method must be a business
method of the EJB or a static method of the bean class</text>
- </assertion>
-
- <assertion id="e">
- <text>A bean may declare multiple disposal methods</text>
- </assertion>
- </section>
-
- <section id="3.4.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 static</text>
- </assertion>
-
- <assertion id="c">
- <text>A producer field may be nonstatic</text>
- </assertion>
-
- <assertion id="d">
- <text>If a producer field sometimes contains a null value when accessed, then
the producer field must have scope @Dependent</text>
- </assertion>
-
- <assertion id="e">
- <text>If a producer method contains a null value at runtime, and the producer
field declares any other scope, an IllegalProductException is thrown by the container.
This restriction allows the container to use a client proxy, as defined in Section 5.4,
"Client proxies"</text>
- </assertion>
-
- <assertion id="f">
- <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="g">
- <text>If a producer field return type contains a wildcard type parameter, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="h">
- <text>If a producer field return type contains a type variable, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="i" testable="false">
- <text>The application may access producer fields directly. However, if the
application accesses a producer field directly, the returned object is not bound to any
context; and its lifecycle is not managed by the container</text>
- <note>This is a statement of intent</note>
- </assertion>
-
- <assertion id="j">
- <text>A bean may declare multiple producer fields</text>
- </assertion>
- </section>
-
- <section id="3.5.1" title="Bean types of a producer field">
-
- <assertion id="a">
- <text>The bean types of a producer field depend upon the field type. If the
field type is an interface, the set of bean types contains the field type, all interfaces
it extends directly or indirectly and java.lang.Object</text>
- </assertion>
-
- <assertion id="b">
- <text>The bean types of a producer field depend upon the field type. If a
field type is primitive or is a Java array type, the set of bean types contains exactly
two types: the field type and java.lang.Object</text>
- </assertion>
-
- <assertion id="c">
- <text>The bean types of a producer field depend upon the field type. If the
field type is a class, the set of bean types contains the field type, every superclass and
all interfaces it implements directly or indirectly</text>
- </assertion>
- </section>
-
- <section id="3.5.2" title="Declaring a producer field using
annotations">
-
- <assertion id="a">
- <text>A producer field may be declared by annotating a field with the
@javax.inject.Produces annotation</text>
- </assertion>
-
- <assertion id="b">
- <text>A producer field may specify a scope</text>
- </assertion>
-
- <assertion id="c">
- <text>A producer field may specify a name</text>
- </assertion>
-
- <assertion id="d">
- <text>A producer field may specify a deployment type</text>
- </assertion>
-
- <assertion id="e">
- <text>A producer field may specify stereotypes</text>
- </assertion>
-
- <assertion id="f">
- <text>A producer field may specify bindings</text>
- </assertion>
- </section>
-
- <section id="3.5.3" title="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</text>
- </assertion>
-
- <assertion id="b">
- <text>Resources may be declared in beans.xml, allowing direct injection of an
entity manager</text>
- </assertion>
-
- <assertion id="c">
- <text>Resources may be declared in beans.xml, allowing direct injection of an
entity manager factory</text>
- </assertion>
-
- <assertion id="d">
- <text>Resources may be declared in beans.xml, allowing direct injection of an
EJB remote object</text>
- </assertion>
-
- <assertion id="e">
- <text>Resources may be declared in beans.xml, allowing direct injection of a
web service reference</text>
- </assertion>
-
- <assertion id="f">
- <text>The lifecycle of an injected reference is identical to the semantics of
Java EE injection using @Resource</text>
- </assertion>
-
- <assertion id="g">
- <text>The lifecycle of an injected reference is identical to the semantics of
Java EE injection using @PersistenceContext</text>
- </assertion>
-
- <assertion id="h">
- <text>The lifecycle of an injected reference is identical to the semantics of
Java EE injection using @PersistenceUnit</text>
- </assertion>
-
- <assertion id="i">
- <text>The lifecycle of an injected reference is identical to the semantics of
Java EE injection using @EJB</text>
- </assertion>
-
- <assertion id="j">
- <text>The lifecycle of an injected reference is identical to the semantics of
Java EE injection using @WebServiceRef</text>
- </assertion>
-
- <assertion id="k">
- <text>A resource always has scope @Dependent</text>
- </assertion>
-
- <assertion id="l">
- <text>A resource may not declare a bean name</text>
- </assertion>
-
- <assertion id="m" testable="false">
- <text>Resources are always declared using XML</text>
- <note>This is a statement of intent</note>
- </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 id="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 id="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</text>
- </assertion>
-
- <assertion id="c">
- <text>JMS queue resources must allow the direct injection of the
QueueConnection</text>
- </assertion>
-
- <assertion id="d">
- <text>JMS queue resources must allow the direct injection of the
QueueSession</text>
- </assertion>
-
- <assertion id="e">
- <text>JMS queue resources must allow the direct injection of the
QueueReceiver</text>
- </assertion>
-
- <assertion id="f">
- <text>JMS queue resources must allow the direct injection of the
QueueSender</text>
- </assertion>
-
- <assertion id="g">
- <text>JMS topic resources must allow the direct injection of the
Topic</text>
- </assertion>
-
- <assertion id="h">
- <text>JMS topic resources must allow the direct injection of the
TopicConnection</text>
- </assertion>
-
- <assertion id="i">
- <text>JMS topic resources must allow the direct injection of the
TopicSession</text>
- </assertion>
-
- <assertion id="j">
- <text>JMS topic resources must allow the direct injection of the
TopicSubscriber</text>
- </assertion>
-
- <assertion id="k">
- <text>JMS topic resources must allow the direct injection of the
TopicPublisher</text>
- </assertion>
-
- <assertion id="l">
- <text>If the application calls close() on an instance of a QueueConnection,
an UnsupportedOperationException is thrown by the container.</text>
- </assertion>
-
- <assertion id="m">
- <text>If the application calls close() on an instance of a QueueSession, an
UnsupportedOperationException is thrown by the container.</text>
- </assertion>
-
- <assertion id="n">
- <text>If the application calls close() on an instance of a QueueReceiver, an
UnsupportedOperationException is thrown by the container.</text>
- </assertion>
-
- <assertion id="o">
- <text>If the application calls close() on an instance of a QueueSender, an
UnsupportedOperationException is thrown by the container.</text>
- </assertion>
-
- <assertion id="p">
- <text>If the application calls close() on an instance of a TopicConnection,
an UnsupportedOperationException is thrown by the container.</text>
- </assertion>
-
- <assertion id="q">
- <text>If the application calls close() on an instance of a TopicSession, an
UnsupportedOperationException is thrown by the container.</text>
- </assertion>
-
- <assertion id="r">
- <text>If the application calls close() on an instance of a TopicSubscriber,
an UnsupportedOperationException is thrown by the container.</text>
- </assertion>
-
- <assertion id="s">
- <text>If the application calls close() on an instance of a TopicPublisher, an
UnsupportedOperationException is thrown by the container.</text>
- </assertion>
-
- <assertion id="t">
- <text>A JMS Queue resource always has scope @Dependent</text>
- </assertion>
-
- <assertion id="u">
- <text>A JMS QueueConnection resource always has scope
@Dependent</text>
- </assertion>
-
- <assertion id="v">
- <text>A JMS QueueSession resource always has scope @Dependent</text>
- </assertion>
-
- <assertion id="w">
- <text>A JMS QueueReceiver resource always has scope @Dependent</text>
- </assertion>
-
- <assertion id="x">
- <text>A JMS QueueSender resource always has scope @Dependent</text>
- </assertion>
-
- <assertion id="y">
- <text>A JMS Topic resource always has scope @Dependent</text>
- </assertion>
-
- <assertion id="z">
- <text>A JMS TopicConnection resource always has scope
@Dependent</text>
- </assertion>
-
- <assertion id="aa">
- <text>A JMS TopicSession resource always has scope @Dependent</text>
- </assertion>
-
- <assertion id="ab">
- <text>A JMS TopicSubscriber resource always has scope
@Dependent</text>
- </assertion>
-
- <assertion id="ac">
- <text>A JMS TopicPublisher resource always has scope @Dependent</text>
- </assertion>
-
- <assertion id="ad">
- <text>A JMS Queue resource may not declare a bean name</text>
- </assertion>
-
- <assertion id="ae">
- <text>A JMS QueueConnection resource may not declare a bean
name</text>
- </assertion>
-
- <assertion id="af">
- <text>A JMS QueueSession resource may not declare a bean name</text>
- </assertion>
-
- <assertion id="ag">
- <text>A JMS QueueReceiver resource may not declare a bean name</text>
- </assertion>
-
- <assertion id="ah">
- <text>A JMS QueueSender resource may not declare a bean name</text>
- </assertion>
-
- <assertion id="ai">
- <text>A JMS Topic resource may not declare a bean name</text>
- </assertion>
-
- <assertion id="aj">
- <text>A JMS TopicConnection resource may not declare a bean
name</text>
- </assertion>
-
- <assertion id="ak">
- <text>A JMS TopicSession resource may not declare a bean name</text>
- </assertion>
-
- <assertion id="al">
- <text>A JMS TopicSubscriber resource may not declare a bean
name</text>
- </assertion>
-
- <assertion id="am">
- <text>A JMS TopicPublisher resource may not declare a bean name</text>
- </assertion>
-
- <assertion id="an">
- <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="aa">
- <text>An injected field is a non-static~, non-final~ field of a bean
class.</text>
- </assertion>
-
- <assertion id="ab">
- <text>An injected field is a ~non-static, ~non-final field of a bean
class.</text>
- </assertion>
-
- <assertion id="b">
- <text>An injected field is a non-static, non-final field of a
servlet.</text>
- <note>Test needs to check that static and final fields aren't injected
and also that no exception is thrown when you have them</note>
- </assertion>
-
- <assertion id="c">
- <text>An injected field is a non-static, non-final field of any EJB session
bean class.</text>
- </assertion>
-
- <assertion id="d">
- <text>An injected field is a non-static, non-final field of any message
driven bean class.</text>
- </assertion>
-
- <assertion id="e">
- <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="f">
- <text>Any EJB session bean may declare injected fields and have those fields
injected by the container</text>
- </assertion>
-
- <assertion id="g">
- <text>Any EJB message driven bean may declare injected fields and have those
fields injected by the container</text>
- </assertion>
-
- <assertion id="h">
- <text>If a field is a producer field, it is not an injected
field</text>
- </assertion>
-
- <assertion id="i">
- <text>If a field is 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>
-
- <assertion id="e">
- <text>Check fields declared in XML and Java injected</text>
- <note>Sanity check</note>
- </assertion>
- </section>
-
- <section id="3.9" title="Initializer methods">
- <assertion id="aa">
- <text>An initializer method is a non-static method of a bean
class.</text>
- </assertion>
-
- <assertion id="ab">
- <text>An initializer method is a non-static method of a
servlet.</text>
- </assertion>
-
- <assertion id="b">
- <text>An initializer method is a non-static method of any EJB session bean
class.</text>
- </assertion>
-
- <assertion id="c">
- <text>An initializer method is a non-static method of a of any EJB message
driven bean class.</text>
- </assertion>
-
- <assertion id="d">
- <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="e">
- <text>If the bean is a session bean, the initializer method is not required
to be a business method of the session bean</text>
- </assertion>
-
- <assertion id="f">
- <text>Method interceptors are never called when the container calls an
initializer method</text>
- </assertion>
-
- <assertion id="g">
- <text>A bean class may declare multiple (or zero) initializer
methods</text>
- </assertion>
-
- <assertion id="h" testable="false">
- <text>The application may call initializer methods directly, but then no
parameters will be passed to the method by the container</text>
- <note>This is a statement of intent</note>
- </assertion>
-
- <assertion id="i">
- <text>Any EJB session bean may declare initializer methods and have the
methods called by the container</text>
- </assertion>
-
- <assertion id="j">
- <text>Any EJB 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, a DefinitionException
is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="c">
- <text>If an initializer method has a parameter annotated @Disposes, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>If an initializer method 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 is provided by the container when
annotations are applied to the bean class of a simple bean</text>
- </assertion>
-
- <assertion id="b">
- <text>Dependency injection via @Resource is provided by the container when
annotations are applied to the bean class of a simple bean</text>
- </assertion>
-
- <assertion id="c">
- <text>Dependency injection via @PersistenceUnit is provided by the container
when annotations are applied to the bean class of a simple bean</text>
- </assertion>
-
- <assertion id="d">
- <text>Dependency injection via @PersistenceContext is provided by the
container when annotations are applied to the bean class of a simple bean</text>
- </assertion>
-
- <assertion id="e">
- <text>@PostConstruct callbacks are provided by the container when annotations
are applied to the bean class of a simple bean</text>
- </assertion>
-
- <assertion id="f">
- <text>@PreDestroy callbacks are provided by the container when annotations
are applied to the bean class of a simple bean</text>
- </assertion>
-
- <assertion id="g">
- <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="h">
- <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" testable="false">
- <text>Concrete subclasses of Bean must implement the operations defined by
the Contextual interface defined in Section 6.1, "The Contextual
interface".</text>
- <note>This is asserted by the JLS</note>
- </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">
- <assertion id="a">
- <text>By default, Java implementation reuse is assumed</text>
- </assertion>
- </section>
-
- <section id="4.1" title="Inheritance of type-level
metadata">
-
- <assertion id="aa">
- <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation
if and only if Z declares the @Inherited meta-annotation and neither Y nor any
intermediate class that is a subclass of X and a superclass of Y declares an annotation of
type Z.</text>
- </assertion>
-
- <assertion id="ab">
- <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if
and only if Z declares the @Inherited meta-annotation and neither Y nor any intermediate
class that is a subclass of X and a superclass of Y declares an annotation of type
Z.</text>
- </assertion>
-
- <assertion id="ac">
- <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X is annotated with a _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="ad">
- <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation
if and only if Z declares the @Inherited meta-annotation and neither Y nor any
intermediate class that is a subclass of X and a superclass of Y declares an annotation of
type Z.</text>
- </assertion>
-
- <assertion id="ae">
- <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation
if and only if Z declares the @Inherited meta-annotation and neither Y nor any
intermediate class that is a subclass of X and a superclass of Y declares an annotation of
type Z.</text>
- </assertion>
-
- <assertion id="af">
- <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X is annotated with a _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="ag">
- <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation
if and only if Z declares the @Inherited meta-annotation and neither Y nor any
intermediate class that is a subclass of X and a superclass of Y declares an annotation of
type Z.</text>
- </assertion>
-
- <assertion id="ah">
- <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if
and only if Z declares the @Inherited meta-annotation and neither Y nor any intermediate
class that is a subclass of X and a superclass of Y declares an annotation of type
Z.</text>
- </assertion>
-
- <assertion id="ai">
- <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X is annotated with a _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="aj">
- <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation
if and only if Z declares the @Inherited meta-annotation and neither Y nor any
intermediate class that is a subclass of X and a superclass of Y declares an annotation of
type Z.</text>
- </assertion>
-
- <assertion id="ak">
- <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation
if and only if Z declares the @Inherited meta-annotation and neither Y nor any
intermediate class that is a subclass of X and a superclass of Y declares an annotation of
type Z.</text>
- </assertion>
-
- <assertion id="al">
- <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X is annotated with a _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="ba">
- <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X is annotated with a scope type Z then Y inherits the annotation if
and only if Z declares the @Inherited meta-annotation and neither Y nor any intermediate
class that is a subclass of X and a superclass of Y declares a scope type.</text>
- </assertion>
-
- <assertion id="bb">
- <text>For class X which is extended _directly_ by the bean class of a
_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 meta-annotation and neither Y nor any intermediate
class that is a subclass of X and a superclass of Y declares a scope type.</text>
- </assertion>
-
- <assertion id="bc">
- <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X is annotated with a scope type Z then Y inherits the annotation if
and only if Z declares the @Inherited meta-annotation and neither Y nor any intermediate
class that is a subclass of X and a superclass of Y declares a scope type.</text>
- </assertion>
-
- <assertion id="bd">
- <text>For class X which is extended _indirectly_ by the bean class of a
_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 meta-annotation and neither Y nor any intermediate
class that is a subclass of X and a superclass of Y declares a scope type.</text>
- </assertion>
-
- <assertion id="ca">
- <text>For class X which is extended _directly_ by the bean class of a
_simple_ 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="cb">
- <text>For class X which is extended _directly_ by the bean class of a
_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="cc">
- <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X is annotated with a deployment type Z then Y inherits the annotation
if and only if Z declares the @Inherited meta-annotation and neither Y nor any
intermediate class that is a subclass of X and a superclass of Y declares a deployment
type.</text>
- </assertion>
-
- <assertion id="cd">
- <text>For class X which is extended _indirectly_ by the bean class of a
_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="da">
- <text>For class X which is extended _directly_ by the bean class of a
_simple_ 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="db">
- <text>For class X which is extended _directly_ by the bean class of a
_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="dc">
- <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ 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="dd">
- <text>For class X which is extended _indirectly_ by the bean class of a
_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="ea">
- <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only
if Z declares the @Inherited meta-annotation and Y does not explicitly declare an
annotation of type Z using XML.</text>
- </assertion>
-
- <assertion id="eb">
- <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if
Z declares the @Inherited meta-annotation and Y does not explicitly declare an annotation
of type Z using XML.</text>
- </assertion>
-
- <assertion id="ec">
- <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X is annotated with an _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="ed">
- <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X is annotated with a _binding type_ Z then Y inherits the annotation if and
only if Z declares the @Inherited meta-annotation and Y does not explicitly declare an
annotation of type Z using XML.</text>
- </assertion>
-
- <assertion id="ee">
- <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and
only if Z declares the @Inherited meta-annotation and Y does not explicitly declare an
annotation of type Z using XML.</text>
- </assertion>
-
- <assertion id="ef">
- <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X is annotated with an _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="fa">
- <text>For class X which is the bean class of a _simple_ 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 meta-annotation and Y does not explicitly declare a scope type
using XML.</text>
- </assertion>
-
- <assertion id="fb">
- <text>For class X which is the bean class of a _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 meta-annotation and Y does not explicitly declare a
scope type using XML.</text>
- </assertion>
-
- <assertion id="ga">
- <text>For class X which is the bean class of a _simple_ 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="gb">
- <text>For class X which is the bean class of a _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="ha">
- <text>For class X which is the bean class of a _simple_ 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="hb">
- <text>For class X which is the bean class of a _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="aa">
- <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X declares an injected field x then Y inherits x.</text>
- </assertion>
-
- <assertion id="ab">
- <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X declares an injected field x then Y inherits x.</text>
- </assertion>
-
- <assertion id="ac">
- <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X declares an injected field x then Y inherits x.</text>
- </assertion>
-
- <assertion id="ad">
- <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X declares an injected field x then Y inherits x.</text>
- </assertion>
-
- <assertion id="baa">
- <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X declares a _@PostConstruct_ method x() then Y inherits x() if and
only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y
overrides the method x()</text>
- </assertion>
-
- <assertion id="bab">
- <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X declares a _@PostConstruct_ method x() then Y inherits x() if and
only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y
overrides the method x()</text>
- </assertion>
-
- <assertion id="bac">
- <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X declares a _@PostConstruct_ method x() then Y inherits x() if and
only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y
overrides the method x()</text>
- </assertion>
-
- <assertion id="bad">
- <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X declares a _@PostConstruct_ method x() then Y inherits x() if and
only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y
overrides the method x()</text>
- </assertion>
-
- <assertion id="bba">
- <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X declares a _@PreDestroy_ method x() then Y inherits x() if and only
if neither Y nor any intermediate class that is a subclass of X and a superclass of Y
overrides the method x()</text>
- </assertion>
-
- <assertion id="bbb">
- <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X declares a _@PreDestroy_ method x() then Y inherits x() if and only
if 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="bbc">
- <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X declares a _@PreDestroy_ method x() then Y inherits x() if and only
if neither Y nor any intermediate class that is a subclass of X and a superclass of Y
overrides the method x()</text>
- </assertion>
-
- <assertion id="bbd">
- <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X declares a _@PreDestroy_ method x() then Y inherits x() if and only
if neither Y nor any intermediate class that is a subclass of X and a superclass of Y
overrides the method x()</text>
- </assertion>
-
- <assertion id="ca">
- <text>For class X which is extended _directly_ by the bean class of a
_simple_ 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="cb">
- <text>For class X which is extended _directly_ by the bean class of a
_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="cc">
- <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ 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="cd">
- <text>For class X which is extended _indirectly_ by the bean class of a
_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="da">
- <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
- </assertion>
-
- <assertion id="db">
- <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
- </assertion>
-
- <assertion id="dc">
- <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
- </assertion>
-
- <assertion id="dd">
- <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
- </assertion>
-
- <assertion id="de">
- <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
- </assertion>
-
- <assertion id="df">
- <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
- </assertion>
-
- <assertion id="dg">
- <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
- </assertion>
-
- <assertion id="dh">
- <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
- </assertion>
-
- <assertion id="di">
- <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
- </assertion>
-
- <assertion id="dj">
- <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
- </assertion>
-
- <assertion id="dk">
- <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
- </assertion>
-
- <assertion id="dl">
- <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
- </assertion>
-
- <assertion id="ea">
- <text>For class X which is extended _directly_ by the bean class of a
_simple_ 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="eb">
- <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit
this field unless Y is explicitly declared to specialize or realize X.</text>
- </assertion>
-
- <assertion id="ec">
- <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ 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="ed">
- <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit
this field unless Y is explicitly declared to specialize or realize X.</text>
- </assertion>
-
- <assertion id="fa">
- <text>For class X which is extended _directly_ by the bean class of a
_simple_ 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="fb">
- <text>For class X which is extended _directly_ by the bean class of a
_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="fc">
- <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ 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="fd">
- <text>For class X which is extended _indirectly_ by the bean class of a
_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="ga">
- <text>For class X which is the bean class of a _simple_ 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="gb">
- <text>For class X which is the bean class of a _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="ha">
- <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares an _initializer method_ x() then Y inherits x(), unless Y explicitly
declares x() using XML</text>
- </assertion>
-
- <assertion id="hb">
- <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a _@PostConstruct method_ x() then Y inherits x(), unless Y explicitly
declares x() using XML</text>
- </assertion>
-
- <assertion id="hc">
- <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a _@PreDestroy method_ x() then Y inherits x(), unless Y explicitly
declares x() using XML</text>
- </assertion>
-
- <assertion id="hd">
- <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares an _initializer method_ x() then Y inherits x(), unless Y
explicitly declares x() using XML</text>
- </assertion>
-
- <assertion id="he">
- <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a _@PostConstruct method_ x() then Y inherits x(), unless Y
explicitly declares x() using XML</text>
- </assertion>
-
- <assertion id="hf">
- <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a _@PreDestroy method_ x() then Y inherits x(), unless Y
explicitly declares x() using XML</text>
- </assertion>
-
- <assertion id="ia">
- <text>For class X which is the bean class of a _simple_ 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="ib">
- <text>For class X which is the bean class of a _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="ja">
- <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a non-static _producer method_ x() then Y does not inherit this method,
unless Y is explicitly declared to _specialize_ X.</text>
- </assertion>
-
- <assertion id="jb">
- <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a non-static _producer method_ x() then Y does not inherit this method,
unless Y is explicitly declared to _realize_ X.</text>
- </assertion>
-
- <assertion id="jc">
- <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a non-static _disposal method_ x() then Y does not inherit this method,
unless Y is explicitly declared to _specialize_ X.</text>
- </assertion>
-
- <assertion id="jd">
- <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a non-static _disposal method_ x() then Y does not inherit this method,
unless Y is explicitly declared to _realize_ X.</text>
- </assertion>
-
- <assertion id="je">
- <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a non-static _observer method_ x() then Y does not inherit this method,
unless Y is explicitly declared to _specialize_ X.</text>
- </assertion>
-
- <assertion id="jf">
- <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a non-static _observer method_ x() then Y does not inherit this method,
unless Y is explicitly declared to _realize_ X.</text>
- </assertion>
-
- <assertion id="jg">
- <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a non-static _producer method_ x() then Y does not inherit this
method, unless Y is explicitly declared to _specialize_ X.</text>
- </assertion>
-
- <assertion id="jh">
- <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a non-static _producer method_ x() then Y does not inherit this
method, unless Y is explicitly declared to _realize_ X.</text>
- </assertion>
-
- <assertion id="ji">
- <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a non-static _disposal method_ x() then Y does not inherit this
method, unless Y is explicitly declared to _specialize_ X.</text>
- </assertion>
-
- <assertion id="jj">
- <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a non-static _disposal method_ x() then Y does not inherit this
method, unless Y is explicitly declared to _realize_ X.</text>
- </assertion>
-
- <assertion id="jk">
- <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a non-static _observer method_ x() then Y does not inherit this
method, unless Y is explicitly declared to _specialize_ X.</text>
- </assertion>
-
- <assertion id="jl">
- <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a non-static _observer method_ x() then Y does not inherit this
method, unless Y is explicitly declared to _realize_ X.</text>
- </assertion>
-
- <assertion id="ka">
- <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a non-static producer field x then Y does not inherit this field,
unless Y is explicitly declared to _specialize_ X.</text>
- </assertion>
-
- <assertion id="kb">
- <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a non-static producer field x then Y does not inherit this field,
unless Y is explicitly declared to _realize_ X.</text>
- </assertion>
-
- <assertion id="kc">
- <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a non-static producer field x then Y does not inherit this field,
unless Y is explicitly declared to _specialize_ X.</text>
- </assertion>
-
- <assertion id="kd">
- <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a non-static producer field x then Y does not inherit this field,
unless Y is explicitly declared to _realize_ X.</text>
- </assertion>
-
- <assertion id="la">
- <text>For class X which is the bean class of a _simple_ 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>
-
- <assertion id="lb">
- <text>For class X which is the bean class of a _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.</text>
- </assertion>
-
- <assertion id="e">
- <text>If a bean X specializes a lower-priority bean Y with a name, and X
declares a name explicitly, a DefinitionException is thrown by the container at deployment
time</text>
- </assertion>
-
- <assertion id="f">
- <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.</text>
- </assertion>
-
- <assertion id="g">
- <text>Even if the lower-priority bean defines a producer method, the method
will be called upon an instance of the specializing bean</text>
- </assertion>
-
- <assertion id="h" testable="false">
- <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>
- <note>This is a statement of intent</note>
- </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") 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".</text>
- </assertion>
-
- <assertion id="d">
- <text>Any non-static producer fields (see Section 3.5, "Producer
fields") of any bean are invoked upon an instance of the most specialized enabled
bean that specializes the bean, as defined by Section 6.8, "Lifecycle of producer
fields".</text>
- </assertion>
-
- <assertion id="e">
- <text>Any non-static disposal methods (see Section 3.4.6, "Disposal
methods") of any bean are invoked upon an instance of the most specialized enabled
bean that specializes the bean.</text>
- </assertion>
-
- <assertion id="f">
- <text>Any non-static 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 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="ca">
- <text>If a generic class Y declares a non-static _producer method_ with a
certain combination of scope, stereotypes, bindings and interceptor bindings, then every
bean X that realizes Y also has a _producer method_ with the same scope, stereotypes and
interceptor bindings. The bindings for this inherited _producer method_ consist of all
bindings declared by the _producer method_ of Y, excluding all bindings of Y, together
with the bindings declared explicitly by X. The deployment type of the inherited _producer
method_ is the deployment type of X</text>
- </assertion>
-
- <assertion id="cb">
- <text>If a generic class Y declares a non-static _producer field_ with a
certain combination of scope, stereotypes, bindings and interceptor bindings, then every
bean X that realizes Y also has a _producer field_ with the same scope, stereotypes and
interceptor bindings. The bindings for this inherited _producer field_ consist of all
bindings declared by the _producer field_ of Y, excluding all bindings of Y, together with
the bindings declared explicitly by X. The deployment type of the inherited _producer
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>
- <note>The RI has unit tests for this atm</note>
- </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>
- <note>These need expanding out - one for each assertion that results in an
exception in 5.7.1</note>
- </assertion>
- </section>
-
- <section id="5.2" title="Primitive types and null values">
-
-
- <assertion id="aa">
- <text>If necessary, the container performs boxing ~or unboxing~ when it
injects a value to a field or parameter of primitive or wrapper type.</text>
- </assertion>
- <assertion id="ab">
- <text>If necessary, the container performs ~boxing or~ unboxing when it
injects a value to a field or parameter of primitive or wrapper type.</text>
- </assertion>
-
- <assertion id="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">
- <assertion id="a">
- <text>Client proxies are never required for a bean whose scope is a
pseudo-scope such as @Dependent</text>
- </assertion>
-
- <assertion id="b">
- <text>Client proxies are used for normal scoped beans</text>
- </assertion>
-
- <assertion id="c">
- <text>All client proxies must be serializable</text>
- </assertion>
-
- <assertion id="d">
- <text>The container must guarantee that when any valid injected reference to
a bean of normal scope is invoked, the invocation is always processed by the current
instance of the injected bean.</text>
- </assertion>
- </section>
-
- <section id="5.4.1" title="Unproxyable bean types">
- <assertion id="a">
- <text>Classes without a non-private constructor with no parameters cannot be
proxied by the container. If an injection point whose declared type cannot be proxied by
the container resolves to a bean with a normal scope, an UnproxyableDependencyException is
thrown by the container at deployment time.</text>
- </assertion>
-
- <assertion id="ba">
- <text>Classes which are declared final ~or have final methods~ cannot be
proxied by the container. If an injection point whose declared type cannot be proxied by
the container resolves to a bean with a normal scope, an UnproxyableDependencyException is
thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="bb">
- <text>Classes which ~are declared final or ~have final methods cannot be
proxied by the container. If an injection point whose declared type cannot be proxied by
the container resolves to a bean with a normal scope, an UnproxyableDependencyException is
thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="c">
- <text>Primitive types cannot be proxied by the container. If an injection
point whose declared type cannot be proxied by the container resolves to a bean with a
normal scope, an UnproxyableDependencyException is thrown by the container at deployment
time</text>
- </assertion>
-
- <assertion id="d">
- <text>Array types cannot be proxied by the container. If an injection point
whose declared type cannot be proxied by the container resolves to a bean with a normal
scope, an UnproxyableDependencyException is thrown by the container at deployment
time</text>
- </assertion>
- </section>
-
- <section id="5.4.2" title="Client proxy invocation">
- <assertion id="a">
- <text>Every time a method of the bean is invoked upon a client proxy, the
client proxy must obtain the context object by calling Manager.getContext(), passing the
bean scope, then obtain an instance of the bean by calling Context.get(), passing the Bean
instance representing the bean and an instance of CreationalContext, and invoke the method
upon the bean</text>
- </assertion>
-
- <assertion id="b">
- <text>The behavior of all methods declared by java.lang.Object, except for
toString(), is undefined for a client proxy</text>
- </assertion>
-
- </section>
-
- <section id="5.5" title="The default binding at injection
points">
- <assertion id="a">
- <text>If an injection point declares no binding, the default binding @Current
is assumed</text>
- </assertion>
- </section>
-
- <section id="5.6" title="Injection point metadata">
- <assertion id="a">
- <text>The javax.inject.manager.InjectionPoint.getBean() method returns the
Bean object representing the bean that defines the injection point</text>
- </assertion>
-
- <assertion id="ba">
- <text>The javax.inject.manager.InjectionPoint.getType() method returns the
declared type of the injection point.</text>
- </assertion>
-
- <assertion id="bb">
- <text>An injection point declared in XML has it's type determined
according to Section 9.10, "Specifying bean types and bindings"</text>
- </assertion>
-
- <assertion id="bc">
- <text>The javax.inject.manager.InjectionPoint.getBindings() method returns
the declared bindings of the injection point.</text>
- </assertion>
-
- <assertion id="bd">
- <text>An injection point declared in XML has it's bindings determined
according to Section 9.10, "Specifying bean types and bindings"</text>
- </assertion>
-
- <assertion id="ca">
- <text>The javax.inject.manager.InjectionPoint.getMember() method returns the
Field object in the case of field injection</text>
- </assertion>
-
- <assertion id="cb">
- <text>The javax.inject.manager.InjectionPoint.getMember() method returns the
Method object in the case of method parameter injection</text>
- </assertion>
-
- <assertion id="cc">
- <text>The javax.inject.manager.InjectionPoint.getMember() method returns the
Constructor object in the case of constructor parameter injection</text>
- </assertion>
-
- <assertion id="da">
- <text>The javax.inject.manager.InjectionPoint.getAnnotation() method returns
annotations of the field in the case of field injection</text>
- </assertion>
-
- <assertion id="db">
- <text>The javax.inject.manager.InjectionPoint.getAnnotation() method returns
annotations of the parameter in the case of method parameter</text>
- </assertion>
-
- <assertion id="dc">
- <text>The javax.inject.manager.InjectionPoint.getAnnotation() method returns
annotations annotations of the parameter in the case of constructor parameter
injection.</text>
- </assertion>
-
- <assertion id="dd">
- <text>The javax.inject.manager.InjectionPoint.getAnnotations() method returns
annotations of the field in the case of field injection</text>
- </assertion>
-
- <assertion id="de">
- <text>The javax.inject.manager.InjectionPoint.getAnnotations() method returns
annotations of the parameter in the case of method parameter</text>
- </assertion>
-
- <assertion id="df">
- <text>The javax.inject.manager.InjectionPoint.getAnnotations() method returns
annotations annotations of the parameter in the case of constructor parameter
injection.</text>
- </assertion>
-
- <assertion id="dg">
- <text>getAnnotation() returns a null value if no annotation of the given type
exists at the field injection point</text>
- </assertion>
-
- <assertion id="dh">
- <text>getAnnotation() returns a null value if no annotation of the given type
exists at the method parameter injection point</text>
- </assertion>
-
- <assertion id="di">
- <text>getAnnotation() returns a null value if no annotation of the given type
exists at the constructor injection point</text>
- </assertion>
-
- </section>
-
- <section id="5.6.1" title="Injecting InjectionPoint">
-
- <assertion id="za">
- <text>The container must provide a bean with deployment type
@Standard.</text>
- </assertion>
-
- <assertion id="zb">
- <text>The container must provide a bean with scope @Dependent.</text>
- </assertion>
-
- <assertion id="zc">
- <text>The container must provide a bean with bean type
InjectionPoint.</text>
- </assertion>
-
- <assertion id="zd">
- <text>The container must provide a bean with binding @Current.</text>
- </assertion>
-
- <assertion id="a">
- <text>Whenever a @Dependent scoped object is instantiated by the container
for injection into a second bean, any injection point of type InjectionPoint and binding
@Current receives an instance of InjectionPoint that represents the injection point of the
second bean</text>
- </assertion>
-
- <assertion id="b">
- <text>When a @Dependent scoped object is instantiated by the container to
receive a producer method, any injection point of type InjectionPoint and binding @Current
receives a null value</text>
- </assertion>
-
- <assertion id="c">
- <text>When a @Dependent scoped object is instantiated by the container to
receive a producer field, any injection point of type InjectionPoint and binding @Current
receives a null value</text>
- </assertion>
-
- <assertion id="d">
- <text>When a @Dependent scoped object is instantiated by the container to
receive an observer , any injection point of type InjectionPoint and binding @Current
receives a null value</text>
- </assertion>
-
- <assertion id="e">
- <text>When a @Dependent scoped object is instantiated by the container to
receive a disposal method invocation, any injection point of type InjectionPoint and
binding @Current receives a null value</text>
- </assertion>
-
- <assertion id="f">
- <text>When a @Dependent scoped object is instantiated by the container during
EL expression evaluation, any injection point of type InjectionPoint and binding @Current
receives a null value</text>
- </assertion>
-
- <assertion id="g">
- <text>When a @Dependent scoped object is instantiated by the container as a
result of a direct call to the Manager API, any injection point of type InjectionPoint and
binding @Current receives a null value</text>
- </assertion>
-
- <assertion id="h">
- <text>If a bean that declares any scope other than @Dependent has an
injection point of type InjectionPoint and binding @Current, a DefinitionException is
thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="i">
- <text>If an object that is not a bean has an injection point of type
InjectionPoint and binding @Current, a DefinitionException is thrown by the container at
deployment time</text>
- </assertion>
- </section>
-
- <section id="5.7" title="The Manager object">
-
- </section>
-
- <section id="5.7.1" title="Resolving dependencies">
- <assertion id="a">
- <text>Implementations of Bean maintain a reference to an instance of
Manager</text>
- </assertion>
-
- <assertion id="b">
- <text>When the Bean implementation performs dependency injection, it must
obtain the contextual instances to inject by calling Manager.getInstanceToInject(),
passing an instance of InjectionPoint that represents the injection point and the instance
of CreationalContext that was passed to Bean.create()</text>
- </assertion>
-
- <assertion id="c">
- <text>Manager.getInstanceToInject() returns a contextual instance or client
proxy to be injected to the given injection point</text>
- </assertion>
-
- <assertion id="d">
- <text>The Manager.getInstanceToInject() method must Identify the bean by
calling Manager.resolveByType(), passing the type and bindings of the injection
point</text>
- </assertion>
-
- <assertion id="e">
- <text>The Manager.getInstanceToInject() method must throw an
UnsatisfiedDependencyException if resolveByType() did not return a bean</text>
- </assertion>
-
- <assertion id="f">
- <text>The Manager.getInstanceToInject() method must throw an
AmbiguousDependencyException if resolveByType() returned more than one bean</text>
- </assertion>
-
- <assertion id="g">
- <text>The Manager.getInstanceToInject() method must throw an
UnproxyableDependencyExceptionif the bean has a normal scope and the type cannot be
proxied by the container, as defined in Section 5.4.1, "Unproxyable bean
types"</text>
- </assertion>
-
- <assertion id="h">
- <text>The Manager.getInstanceToInject() method must obtain an instance of the
bean (or a client proxy) by calling Manager.getInstance(), passing the Bean object
representing the bean, and return it. Alternatively, return an incompletely initialized
instance of the bean that was
-registered by calling CreationalContext.push(), as defined in Section 6.1, "The
Contextual interface"</text>
- </assertion>
- </section>
-
- <section id="5.7.2" title="Obtaining contextual instances">
- <assertion id="a">
- <text>Any bean may obtain an instance of Manager by injecting
it</text>
- </assertion>
-
- <assertion id="aa">
- <text>The container provides a built-in bean with bean type
Manager</text>
- </assertion>
-
- <assertion id="ab">
- <text>The container provides a built-in bean with scope
@Dependent</text>
- </assertion>
-
- <assertion id="ac">
- <text>The container provides a built-in bean with deployment type
@Standard</text>
- </assertion>
-
- <assertion id="ad">
- <text>The container provides a built-in bean with binding
@Current.</text>
- </assertion>
-
- <assertion id="b">
- <text>The application may obtain the Manager object from JNDI. The container
must register an instance of Manager with name java:app/Manager in JNDI at deployment
time</text>
- </assertion>
-
- <assertion id="c">
- <text>A contextual instance of a bean may be obtained by calling
Manager.getInstance(), passing the Bean object representing the bean</text>
- </assertion>
-
- <assertion id="d">
- <text>Manager.getInstance() returns a contextual instance or client proxy for
the given bean</text>
- </assertion>
-
- <assertion id="e">
- <text>If the given Bean instance represents a bean with a normal scope, as
defined in Section 8.2, "Normal scopes and pseudo-scopes", Manager.getInstance()
must return a client proxy</text>
- </assertion>
-
- <assertion id="f">
- <text>If the Bean instance represents a bean with a pseudo-scope, as defined
in Section 8.2, "Normal scopes and pseudo-scopes", Manager.getInstance() must
obtain the context object by calling Manager.getContext(), passing the bean scope, then
obtain an instance of the bean by calling Context.get(), passing the Bean instance
representing the bean and an instance of CreationalContext</text>
- </assertion>
-
- <assertion id="g" testable="false">
- <text>The Manager.getInstanceByType() methods obtain a contextual instance of
a bean</text>
- <note>A statement of intent</note>
- </assertion>
-
- <assertion id="h">
- <text>If no bindings are passed to Manager.getInstanceByType(), the default
binding @Current is assumed</text>
- </assertion>
-
- <assertion id="ia">
- <text>If a parameterized type with a type parameter ~or wildcard~ is passed
to resolveByType(), an IllegalArgumentException is thrown</text>
- </assertion>
-
- <assertion id="ib">
- <text>If a parameterized type with a ~type parameter or~ wildcard is passed
to resolveByType(), an IllegalArgumentException is thrown</text>
- </assertion>
-
- <assertion id="j">
- <text>If two instances of the same binding type are passed to
getInstanceByType(), a DuplicateBindingTypeException is thrown</text>
- </assertion>
-
- <assertion id="k">
- <text>If an instance of an annotation that is not a binding type is passed to
getInstanceByType(), an IllegalArgumentException is thrown</text>
- </assertion>
-
- <assertion id="l">
- <text>The getInstanceByType() method must identify the bean by calling
Manager.resolveByType(), passing the given type and bindings</text>
- </assertion>
-
- <assertion id="m">
- <text>The getInstanceByType() method must throw an
UnsatisfiedDependencyException if resolveByType() did not return a bean</text>
- </assertion>
-
- <assertion id="n">
- <text>The getInstanceByType() method must throw an
AmbiguousDependencyException if resolveByType() returned more than one bean</text>
- </assertion>
-
- <assertion id="o">
- <text>The getInstanceByType() method must obtain an instance of the bean (or
a client proxy) by calling Manager.getInstance(), passing the Bean object representing the
bean, and return it</text>
- </assertion>
- </section>
-
- <section id="5.8" title="Dynamic lookup">
-
- <assertion id="a">
- <text>An instance of the javax.inject.Instance interface may be injected via
use of the
-(a)javax.inject.Obtains binding</text>
- </assertion>
-
- <assertion id="b">
- <text>Additional bindings may be specified at the injection
point</text>
- </assertion>
-
- <assertion id="c">
- <text>The Instance interface provides a method for obtaining instances of
beans of a specific type</text>
- </assertion>
-
- <assertion id="d">
- <text>If two instances of the same binding type are passed to Instance.get(),
a DuplicateBindingTypeException is thrown</text>
- </assertion>
-
- <assertion id="e">
- <text>If an instance of an annotation that is not a binding type is passed to
Instance.get(), an IllegalArgumentException is thrown</text>
- </assertion>
-
- <assertion id="f">
- <text>The @Obtains annotation or <Obtains> element may be
applied to any injection point of type Instance where an actual type parameter is
specified</text>
- </assertion>
-
- <assertion id="g">
- <text>If the type of the injection point is not of type Instance a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="h">
- <text>If no actual type parameter is specified a DefinitionException is
thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="i">
- <text>If the type parameter contains a type variable a DefinitionException is
thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="j">
- <text>If the type parameter contains a wildcard a DefinitionException is
thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="k">
- <text>Whenever the @Obtains annotation appears at an injection point, an
implicit bean exists with exactly the bean type and bindings that appear at the injection
point</text>
- </assertion>
-
- <assertion id="l">
- <text>Whenever the @Obtains annotation appears at an injection point, an
implicit bean exists with deployment type @Standard</text>
- </assertion>
-
- <assertion id="m">
- <text>Whenever the @Obtains annotation appears at an injection point, an
implicit bean exists with @Dependent scope</text>
- </assertion>
-
- <assertion id="n">
- <text>Whenever the @Obtains annotation appears at an injection point, an
implicit bean exists with no bean name</text>
- </assertion>
-
- <assertion id="o">
- <text>Whenever the @Obtains annotation appears at an injection point, an
implicit bean exists with an implementation provided automatically by the
container</text>
- </assertion>
-
- <assertion id="p">
- <text>The get() method of the provided implementation of Instance must call
Manager.getInstanceByType(), passing all bindings declared at the injection point, except
@Obtains, and all bindings passed to Instance.get()</text>
- </assertion>
-
- <assertion id="q">
- <text>The application may obtain a contextual instance by calling the
Instance.get() method</text>
- </assertion>
-
- <assertion id="r">
- <text>When the application calls Instance.get() to obtain a contextual
instance dynamically, it may need to pass instances of binding annotation
types</text>
- </assertion>
- </section>
-
- <section id="5.9" title="Typesafe resolution algorithm">
- <assertion id="a">
- <text>The resolveByType() method of the Manager interface returns the result
of the typesafe resolution</text>
- <note>Here we just do a general test that resolveByType() is producing
sensible results</note>
- </assertion>
-
- <assertion id="b">
- <text>If no bindings are passed to Manager.resolveByType(), the default
binding @Current is assumed</text>
- </assertion>
-
- <assertion id="ca">
- <text>If a parameterized type with a type parameter ~or wildcard~ is passed
to Manager.resolveByType(), an IllegalArgumentException is thrown</text>
- </assertion>
-
- <assertion id="cb">
- <text>If a parameterized type with a ~type parameter or~ wildcard is passed
to Manager.resolveByType(), an IllegalArgumentException is thrown</text>
- </assertion>
-
- <assertion id="d">
- <text>If two instances of the same binding type are passed to
Manager.resolveByType(), a DuplicateBindingTypeException is thrown</text>
- </assertion>
-
- <assertion id="e">
- <text>If an instance of an annotation that is not a binding type is passed to
Manager.resolveByType(), an IllegalArgumentException is thrown</text>
- </assertion>
-
- <assertion id="fa">
- <text>When the container is resolving a bean by type, it identifies the set
of matching enabled beans which have the given bean type.</text>
- </assertion>
-
- <assertion id="fb">
- <text>When the container is resolving a bean by type~, it identifies the set
of matching enabled beans which have the given bean type~. For this purpose, primitive
types are considered to be identical to their corresponding wrapper types in java.lang~,
array types are considered identical only if their element types are identical and
parameterized types are considered identical only if both the type and all type parameters
are identical~</text>
- </assertion>
-
- <assertion id="fc">
- <text>When the container is resolving a bean by type~, it identifies the set
of matching enabled beans which have the given bean type~. For this purpose, ~primitive
types are considered to be identical to their corresponding wrapper types in java.lang,~
array types are considered identical only if their element types are identical~ and
parameterized types are considered identical only if both the type and all type parameters
are identical~</text>
- </assertion>
-
- <assertion id="fd">
- <text>When the container is resolving a bean by type~, it identifies the set
of matching enabled beans which have the given bean type~. For this purpose, ~primitive
types are considered to be identical to their corresponding wrapper types in java.lang,
array types are considered identical only if their element types are identical and~
parameterized types are considered identical only if both the type and all type parameters
are identical</text>
- </assertion>
-
- <assertion id="ga">
- <text>When the container is resolving a bean by type, it considers the given
bindings. _If no bindings were passed to resolveByType(), the container assumes the
binding @Current_. </text>
- </assertion>
-
- <assertion id="gb">
- <text>When the container is resolving a bean by type, it considers the given
bindings. ~If no bindings were passed to resolveByType(), the container assumes the
binding @Current~. The container narrows the set of matching beans to just those where for
each given binding, the bean declares a binding with _(a) the same type_ and (b) the same
annotation member value for each member which is not annotated @NonBinding (see Section
5.9.1, "Binding annotations with members")</text>
- </assertion>
-
- <assertion id="gc">
- <text>When the container is resolving a bean by type, it considers the given
bindings. ~If no bindings were passed to resolveByType(), the container assumes the
binding @Current~. The container narrows the set of matching beans to just those where for
each given binding, the bean declares a binding with (a) the same type and _(b) the same
annotation member value for each member_ which is not annotated @NonBinding (see Section
5.9.1, "Binding annotations with members")</text>
- </assertion>
-
- <assertion id="gd">
- <text>When the container is resolving a bean by type, it considers the given
bindings. ~If no bindings were passed to resolveByType(), the container assumes the
binding @Current~. The container narrows the set of matching beans to just those where for
each given binding, the bean declares a binding with (a) the same type and (b) the same
annotation member value for each member which is _not annotated @NonBinding_ (see Section
5.9.1, "Binding annotations with members")</text>
- </assertion>
-
- <assertion id="ha">
- <text>When the container is resolving a bean by type, it examines the
deployment types of the matching beans, as defined in Section 2.5.7, "Deployment type
precedence", and returns the set of beans with the highest precedence deployment type
that occurs in the set.</text>
- </assertion>
-
- <assertion id="hb">
- <text>When the container is resolving a bean by type, it examines the
deployment types of the matching beans, as defined in Section 2.5.7, "Deployment type
precedence", and returns the set of beans with the highest precedence deployment type
that occurs in the set. _If there are no matching beans, an empty set is
returned_</text>
- </assertion>
-
- </section>
-
- <section id="5.9.1" title="Binding annotations with
members">
- <assertion id="a" testable="false">
- <text>Binding types with members are supported</text>
- <note>A statement of intent</note>
- </assertion>
-
- <assertion id="b">
- <text>An annotation member may be excluded from consideration using the
@NonBinding annotation</text>
- </assertion>
-
- <assertion id="ca">
- <text>Array-valued ~or annotation-valued~ members of a binding type must be
annotated @NonBinding. If an array-valued ~or annotation-valued~ member of a binding type
is not annotated @NonBinding, a DefinitionException is thrown by the container at
deployment time</text>
- </assertion>
-
- <assertion id="cb">
- <text>~Array-valued or ~annotation-valued members of a binding type must be
annotated @NonBinding. If an ~array-valued or ~annotation-valued member of a binding type
is not annotated @NonBinding, a DefinitionException is thrown by the container at
deployment time</text>
- </assertion>
- </section>
-
- <section id="5.9.2" title="Multiple bindings">
- <assertion id="a">
- <text>A bean class may declare multiple bindings</text>
- </assertion>
-
- <assertion id="b">
- <text>A producer method may declare multiple bindings</text>
- </assertion>
-
- <assertion id="c">
- <text>A producer field may declare multiple bindings</text>
- </assertion>
-
- <assertion id="d">
- <text>A bean must declare all of the bindings that are specified at the
injection point to be considered a candidate for injection</text>
- </assertion>
- </section>
-
- <section id="5.10" title="EL name resolution">
-
- <assertion id="aa">
- <text>The container must provide a Unified EL ELResolver to the servlet
engine ~and JSF implementation~ that resolves bean names</text>
- <note>This is testable implicitly by trying to resolve using EL from a
servlet</note>
- </assertion>
-
- <assertion id="ab">
- <text>The container must provide a Unified EL ELResolver to the ~servlet
engine~ and JSF implementation that resolves bean names</text>
- <note>This is testable implicitly by trying to resolve using EL from a JSF
view</note>
- </assertion>
-
- <assertion id="b">
- <text>When this resolver is called with a null base object, it calls the
method Manager.getInstanceByName() to obtain an instance of the bean named in the EL
expression</text>
- </assertion>
-
- <assertion id="c">
- <text>The Manager.getInstanceByName() method must identify the bean by
calling Manager.resolveByName(), passing the name</text>
- </assertion>
-
- <assertion id="d">
- <text>The Manager.getInstanceByName() method must return a null value, if
Manager.resolveByName() returned an empty set</text>
- </assertion>
-
- <assertion id="e">
- <text>The Manager.getInstanceByName() method must throw an
AmbiguousDependencyException if Manager.resolveByName() returned more than one
bean</text>
- </assertion>
-
- <assertion id="f">
- <text>The Manager.getInstanceByName() method must obtain an instance of the
bean by calling Manager.getInstance(), passing the Bean instance representing the bean if
exactly one bean was returned by Manager.resolveByName(). For each distinct name that
appears in the EL expression, getInstanceByName() must be called at most
once</text>
- </assertion>
-
- <assertion id="g">
- <text>Even if a
-name appears more than once in the same expression, the container may not call
getInstanceByName() multiple times with that name. This restriction ensures that there is
a unique instance of each bean with scope @Dependent in any EL evaluation</text>
- </assertion>
- </section>
-
- <section id="5.11" title="Name resolution algorithm">
- <assertion id="a">
- <text>The resolveByName() method of the Manager interface performs name
resolution</text>
- </assertion>
-
- <assertion id="b">
- <text>When resolving a bean by name, the container must identify the set of
matching enabled beans which have the given name</text>
- </assertion>
-
- <assertion id="c">
- <text>After the container identifies the set of matching beans, it examines
the deployment types of the matching beans, as defined in Section 2.5.7, "Deployment
type precedence", and returns the set of beans with the highest precedence deployment
type that occurs in the set</text>
- </assertion>
-
- <assertion id="d">
- <text>If there are no matching beans, an empty set is returned</text>
- </assertion>
- </section>
-
- <section id="5.12" title="Injection into non-contextual
objects">
- <assertion id="a" testable="false">
- <text>The container is required to perform dependency injection upon certain
non-contextual objects</text>
- <note>This is a statement of intent</note>
- </assertion>
- </section>
-
- <section id="5.12.1" title="Non-contextual instances of session
beans">
- <assertion id="a">
- <text>The container is required to perform dependency injection for session
bean instances obtained directly from JNDI</text>
- </assertion>
-
- <assertion id="b">
- <text>The container is required to perform dependency injection for session
bean instances injected using @EJB</text>
- </assertion>
-
- <assertion id="c">
- <text>The container is required to perform dependency injection for session
bean instances injected using @Resource</text>
- </assertion>
-
- <assertion id="d">
- <text>The container is required to perform dependency injection for session
bean instances created by the container to receive remote method calls</text>
- </assertion>
-
- <assertion id="e">
- <text>The container is required to perform dependency injection for session
bean instances created by the container to receive timeouts</text>
- </assertion>
-
- <assertion id="f">
- <text>The container is required to create interceptor stacks for session bean
instances obtained directly from JNDI</text>
- </assertion>
-
- <assertion id="g">
- <text>The container is required to create interceptor stacks for session bean
instances injected using @EJB</text>
- </assertion>
-
- <assertion id="h">
- <text>The container is required to create interceptor stacks for session bean
instances injected using @Resource</text>
- </assertion>
-
- <assertion id="i">
- <text>The container is required to create interceptor stacks for session bean
instances created by the container to receive remote method calls</text>
- </assertion>
-
- <assertion id="j">
- <text>The container is required to create interceptor stacks for session bean
instances created by the container to receive timeouts</text>
- </assertion>
-
- <assertion id="k">
- <text>The container is required to create decorator stacks for session bean
instances obtained directly from JNDI</text>
- </assertion>
-
- <assertion id="l">
- <text>The container is required to create decorator stacks for session bean
instances injected using @EJB</text>
- </assertion>
-
- <assertion id="m">
- <text>The container is required to create decorator stacks for session bean
instances injected using @Resource</text>
- </assertion>
-
- <assertion id="n">
- <text>The container is required to create decorator stacks for session bean
instances created by the container to receive remote method calls</text>
- </assertion>
-
- <assertion id="o">
- <text>The container is required to create decorator stacks for session bean
instances created by the container to receive timeouts</text>
- </assertion>
-
- <assertion id="p">
- <text>For the purposes of dependency injection, the container must treat
non-contextual instances of session beans as instances of the most specialized bean that
specializes the bean with binding @New and deployment type @Standard defined in Section
3.3.6, "Session beans with the @New binding"</text>
- </assertion>
-
- <assertion id="q">
- <text>For the purposes of interceptor stack creation, the container must
treat non-contextual instances of session beans as instances of the most specialized bean
that specializes the bean with binding @New and deployment type @Standard defined in
Section 3.3.6, "Session beans with the @New binding"</text>
- </assertion>
-
- <assertion id="r">
- <text>For the purposes of decorator stack creation, the container must treat
non-contextual instances of session beans as instances of the most specialized bean that
specializes the bean with binding @New and deployment type @Standard defined in Section
3.3.6, "Session beans with the @New binding"</text>
- </assertion>
-
- </section>
-
- <section id="5.12.2" title="Message-driven beans">
- <assertion id="a">
- <text>The container performs dependency injection for message-driven bean
instances according to the bean class annotations</text>
- </assertion>
-
- <assertion id="b">
- <text>The container creates interceptor stacks for message-driven bean
instances according to the bean class annotations</text>
- </assertion>
-
- <assertion id="c">
- <text>The container creates decorator stacks for message-driven bean
instances according to the bean class annotations</text>
- </assertion>
- </section>
-
- <section id="5.12.3" title="Servlets">
- <assertion id="a">
- <text>The container performs dependency injection for servlets according to
the servlet class annotations</text>
- </assertion>
- </section>
-
- <section id="6" title="Bean lifecycle">
- <assertion id="a">
- <text>To create a contextual instance of a session bean, the container
creates an EJB local object reference</text>
- </assertion>
-
- <assertion id="b">
- <text>To create a contextual instance of a producer method bean, the
container calls the producer method</text>
- </assertion>
-
- <assertion id="c">
- <text>To create a contextual instance of a producer field bean, the container
retrieves the current value of the field</text>
- </assertion>
-
- <assertion id="d">
- <text>To create a contextual instance of a simple bean, the container calls
the bean constructor</text>
- </assertion>
-
- <assertion id="e">
- <text>To destroy a contextual instance of a stateful session bean, the
container removes the EJB instance</text>
- </assertion>
-
- <assertion id="f">
- <text>To destroy a contextual instance of a producer method bean, the
container calls the disposal method, if any</text>
- </assertion>
-
- <assertion id="g">
- <text>When the container injects a dependency and there is no existing
instance of the bean cached by the context object for the bean scope, the context object
automatically creates a new contextual instance of the bean</text>
- </assertion>
-
- <assertion id="h">
- <text>When the container resolves an EL name and there is no existing
instance of the bean cached by the context object for the bean scope, the context object
automatically creates a new contextual instance of the bean</text>
- </assertion>
-
- <assertion id="i">
- <text>When a context is destroyed, the context object automatically destroys
any instances associated with that context</text>
- </assertion>
-
- <assertion id="j">
- <text>To create and destroy contextual instances, the context object calls
operations defined by the interface Contextual</text>
- </assertion>
- </section>
-
- <section id="6.1" title="The Contextual interface">
- <assertion id="a" testable="false">
- <text>The interface javax.context.CreationalContext provides an operation
that allows the create() method to register an incompletely initialized contextual
instance with the container. A contextual instance is considered incompletely initialized
until the create() method returns the instance</text>
- <note>Statement of intent</note>
- </assertion>
-
- <assertion id="b">
- <text>If Contextual.create() calls CreationalContext.push(), it must also
return the instance passed to push()</text>
- </assertion>
-
- <assertion id="c" testable="false">
- <text>The implementation of Contextual is not required to call
CreationalContext.push()</text>
- <note>No way to test this really</note>
- </assertion>
- </section>
-
- <section id="6.2" title="Creation">
- <assertion id="a">
- <text>The Contextual.create() method obtains an instance of the
bean</text>
- </assertion>
-
- <assertion id="b">
- <text>The Contextual.create() method creates the interceptor stacks and binds
them to the instance</text>
- </assertion>
-
- <assertion id="c">
- <text>The Contextual.create() method creates the decorator stacks and binds
them to the instance</text>
- </assertion>
-
- <assertion id="d">
- <text>The Contextual.create() method injects any dependencies</text>
- </assertion>
-
- <assertion id="e">
- <text>The Contextual.create() method sets any initial field values defined in
XML</text>
- </assertion>
-
- <assertion id="f">
- <text>The Contextual.create() method calls the @PostConstruct method, if
necessary</text>
- </assertion>
-
- <assertion id="g">
- <text>If any exception occurs while creating an instance, the exception is
rethrown by the create() method</text>
- </assertion>
-
- <assertion id="h">
- <text>If a checked exception occurs while creating an instance, it is wrapped
and rethrown as an (unchecked) CreationException</text>
- </assertion>
- </section>
-
- <section id="6.3" title="Destruction">
- <assertion id="a">
- <text>The Contextual.destroy() method calls the disposal method, if
necessary</text>
- </assertion>
-
- <assertion id="b">
- <text>The Contextual.destroy() method calls the @PreDestroy method, if
necessary</text>
- </assertion>
-
- <assertion id="c">
- <text>The Contextual.destroy() method destroys all dependent objects of the
instance, as defined in Section 8.3.2, "Dependent object
destruction"</text>
- </assertion>
-
- <assertion id="d">
- <text>If any exception occurs while destroying an instance, the exception is
caught by the destroy() method</text>
- </assertion>
-
- <assertion id="e" testable="false">
- <text>If the application invokes a contextual instance after it has been
destroyed, the behavior is undefined</text>
- <note>In otherwords, the behavious is unspecified!</note>
- </assertion>
- </section>
-
- <section id="6.4" title="Lifecycle of simple beans">
- <assertion id="a">
- <text>When the create() method of the Bean object that represents a simple
bean is called, the container first calls the bean constructor to obtain an instance of
the bean. For each constructor parameter, the container passes the object returned by
Manager.getInstanceToInject(). The container is permitted to return an instance of a
container-generated subclass of the bean class, allowing interceptor and decorator
bindings</text>
- </assertion>
-
- <assertion id="b">
- <text>When the create() method of the Bean object that represents a simple
bean is called, after the bean constructor is called the container next initializes the
values of any attributes annotated @EJB</text>
- </assertion>
-
- <assertion id="c">
- <text>When the create() method of the Bean object that represents a simple
bean is called, after the bean constructor is called the container next initializes the
values of any attributes annotated @PersistenceContext</text>
- </assertion>
-
- <assertion id="d">
- <text>When the create() method of the Bean object that represents a simple
bean is called, after the bean constructor is called the container next initializes the
values of any attributes annotated @Resource</text>
- </assertion>
-
- <assertion id="e">
- <text>When the create() method of the Bean object that represents a simple
bean is called, after the @EJB, @PersistenceContext and @Resource attributes are
initialized the container initializes the values of all injected fields. For each injected
field, the container sets the value to the object returned by
Manager.getInstanceToInject().</text>
- </assertion>
-
- <assertion id="f">
- <text>When the create() method of the Bean object that represents a simple
bean is called, after injected fields are initialized the container initializes the values
of any fields with initial values specified in XML, as defined in Section 9.5.5,
"Field initial value declarations".</text>
- </assertion>
-
- <assertion id="g">
- <text>When the create() method of the Bean object that represents a simple
bean is called, after the values of fields with initial values specified in XML are
initialized the container calls all initializer methods. For each initializer method
parameter, the container passes the object
-returned by Manager.getInstanceToInject()</text>
- </assertion>
-
- <assertion id="h">
- <text>When the create() method of the Bean object that represents a simple
bean is called, after all initializer methods are called the container builds the
interceptor stacks for the instance as defined in Section A.3.10 "Interceptor stack
creation"</text>
- </assertion>
-
- <assertion id="i">
- <text>When the create() method of the Bean object that represents a simple
bean is called, after all initializer methods are called the container builds the
decorator stacks for the instance as defined in Section A.5.8 "Decorator stack
creation"</text>
- </assertion>
-
- <assertion id="j">
- <text>When the create() method of the Bean object that represents a simple
bean is called, after the interceptor and decorator stacks are built the container calls
the @PostConstruct method, if any</text>
- </assertion>
-
- <assertion id="k">
- <text>When the destroy() method of a Bean object is called, the container
calls the @PreDestroy method, if any</text>
- </assertion>
-
- <assertion id="l">
- <text>When the destroy() method of a Bean object is called, after the
container calls the @PreDestroy method, it finally destroys dependent
objects</text>
- </assertion>
- </section>
-
- <section id="6.5" title="Lifecycle of stateful session
beans">
- <assertion id="a">
- <text>When the create() method of a Bean object that represents a stateful
session bean that is called, the container creates and returns a session bean proxy, as
defined in Section 3.3.9, "Session bean proxies".</text>
- </assertion>
-
- <assertion id="b">
- <text>When the destroy() method of a Bean object is called, the container
removes the stateful session bean. The @PreDestroy callback must be invoked by the
container</text>
- </assertion>
-
- <assertion id="c">
- <text>If the underlying EJB was already removed by direct invocation of a
remove method by the application, the container ignores the instance</text>
- </assertion>
- </section>
-
- <section id="6.6" title="Lifecycle of stateless session and singleton
beans">
- <assertion id="a">
- <text>When the create() method of a Bean object that represents a stateless
session or singleton session bean is called, the container creates and returns a session
bean proxy, as defined in Section 3.3.9, "Session bean proxies".</text>
- </assertion>
-
- <assertion id="b" testable="false">
- <text>When the destroy() method of a Bean object is called, the container
simply discards the proxy and all underlying EJB local object references</text>
- <note>Untestable</note>
- </assertion>
- </section>
-
- <section id="6.7" title="Lifecycle of producer methods">
- <assertion id="a">
- <text>Any Java object may be returned by a producer method. It is not
required that the returned object be an instance of another bean</text>
- </assertion>
-
- <assertion id="b" testable="false">
- <text>If an object returned by a producer method is not an instance of
another bean, the container will not provide injection of other beans</text>
- <note>In other words the behaviour is unspecified</note>
- </assertion>
-
- <assertion id="c" testable="false">
- <text>If an object returned by a producer method is not an instance of
another bean, the container will not provide lifecycle callbacks</text>
- <note>In other words the behaviour is unspecified</note>
- </assertion>
-
- <assertion id="d" testable="false">
- <text>If an object returned by a producer method is not an instance of
another bean, the container will not provide method and lifecycle
interception</text>
- <note>In other words the behaviour is unspecified</note>
- </assertion>
-
- <assertion id="e">
- <text>When the create() method of a Bean object that represents a producer
method is called, the container must invoke the producer method, passing the object
returned by Manager.getInstanceToInject() to each parameter</text>
- </assertion>
-
- <assertion id="f">
- <text>If a producer method is static, the container must invoke the
method</text>
- </assertion>
-
- <assertion id="g">
- <text>If a producer method is not static, the container must obtain the Bean
object for the most specialized bean that specializes the bean which declares the producer
method</text>
- </assertion>
-
- <assertion id="h">
- <text>If a producer method is not static, after obtaining the most
specialized Bean object the container must obtain an instance of the most specialized
bean, by calling Manager.getInstance(), passing the Bean object representing the
bean</text>
- </assertion>
-
- <assertion id="i">
- <text>If a producer method is not static, after obtaining an instance of the
most specialized bean the container must invoke the producer method upon this
instance</text>
- </assertion>
-
- <assertion id="j">
- <text>The return value of the producer method, after method interception
completes, is the new contextual instance to be returned by Bean.create()</text>
- </assertion>
-
- <assertion id="k">
- <text>If the producer method returns a null value and the producer method
bean has the scope @Dependent, the create() method returns a null value</text>
- </assertion>
-
- <assertion id="l">
- <text>If the producer method returns a null value, and the scope of the
producer method is not @Dependent, the create() method throws an
IllegalProductException</text>
- </assertion>
-
- <assertion id="m">
- <text>When the destroy() method is called, and if there is a disposal method
for this producer method, the container must invoke the disposal method, passing the
instance given to destroy() to the disposed parameter, and the object returned by
Manager.getInstanceToInject() to each of the other parameters</text>
- </assertion>
-
- <assertion id="n">
- <text>If a disposal method is static, the container must invoke the
method</text>
- </assertion>
-
- <assertion id="o">
- <text>If a disposal method is non-static, the container must obtain the Bean
object for the most specialized bean that specializes the bean which declares the disposal
method</text>
- </assertion>
-
- <assertion id="p">
- <text>If a disposal method is non-static, after obtaining the Bean object for
the most specialized bean, the container must obtain an instance of the most specialized
bean, by calling Manager.getInstance(), passing the Bean object representing the
bean</text>
- </assertion>
-
- <assertion id="q">
- <text>If a disposal method is non-static, after obtaining the instance of the
most specialized bean the container must invoke the disposal method upon this
instance</text>
- </assertion>
-
- <assertion id="r">
- <text>Finally, the container destroys dependent objects</text>
- </assertion>
- </section>
-
- <section id="6.8" title="Lifecycle of producer fields">
- <assertion id="a">
- <text>Any Java object may be the value of a producer field</text>
- </assertion>
-
- <assertion id="b">
- <text>It is not required that the returned object of a producer field be an
instance of another bean</text>
- </assertion>
-
- <assertion id="c" testable="false">
- <text>If the object returned by a producer field is not an instance of
another bean, the container will not provide injection of other beans</text>
- <note>In other words the behaviour is unspecified</note>
- </assertion>
-
- <assertion id="d" testable="false">
- <text>If the object returned by a producer field is not an instance of
another bean, the container will not provide lifecycle callbacks</text>
- <note>In other words the behaviour is unspecified</note>
- </assertion>
-
- <assertion id="e" testable="false">
- <text>If the object returned by a producer field is not an instance of
another bean, the container will not provide method interception</text>
- <note>In other words the behaviour is unspecified</note>
- </assertion>
-
- <assertion id="f" testable="false">
- <text>If the object returned by a producer field is not an instance of
another bean, the container will not provide lifecycle interception</text>
- <note>In other words the behaviour is unspecified</note>
- </assertion>
-
- <assertion id="g">
- <text>When the create() method of a Bean object that represents a producer
field is called, the container must access the producer field to obtain the current value
of the field</text>
- </assertion>
-
- <assertion id="h">
- <text>If a producer field is static, the container must access the field
value</text>
- </assertion>
-
- <assertion id="i">
- <text>If a producer field is non-static, the container must obtain the Bean
object for the most specialized bean that specializes the bean which declares the producer
field</text>
- </assertion>
-
- <assertion id="j">
- <text>If a producer field is non-static, after obtaining the Bean object for
the most specialized bean the container must obtain an instance of the most specialized
bean, by calling Manager.getInstance(), passing the Bean object representing the
bean</text>
- </assertion>
-
- <assertion id="k">
- <text>If a producer field is non-static, after obtaining an instance of the
most specialized bean, the container must access the field value of this
instance</text>
- </assertion>
-
- <assertion id="l">
- <text>The value of the producer field is the new contextual instance to be
returned by Bean.create()</text>
- </assertion>
-
- <assertion id="m">
- <text>If the producer field contains a null value and the producer field bean
has the scope @Dependent, the create() method returns a null value</text>
- </assertion>
-
- <assertion id="n">
- <text>If the producer field contains a null value, and the scope of the
producer method is not @Dependent, the create() method throws an
IllegalProductException</text>
- </assertion>
- </section>
-
- <section id="6.9" title="Lifecycle of resources">
- <assertion id="a" testable="false">
- <text>An instance of a resource is a proxy object, provided by the container,
that implements the declared bean type, delegating the actual implementation of the
methods directly to the underlying Java EE resource, entity manager, entity manager
factory, EJB remote object or web service referenc</text>
- </assertion>
-
- <assertion id="b">
- <text>A resource proxy object is a dependent object of the object it is
injected into</text>
- </assertion>
-
- <assertion id="c">
- <text>Resource proxy objects are serializable</text>
- </assertion>
-
- <assertion id="d">
- <text>When the create() method of a Bean object that represents a JMS
resource is called, the container creates and returns a proxy object that implements the
bean type of the resource</text>
- </assertion>
-
- <assertion id="e">
- <text>The methods of this proxy object delegate to the underlying
implementation, which is obtained using the metadata provided in the resource
declaration</text>
- </assertion>
-
- <assertion id="f">
- <text>A Java EE resource is obtained using the JNDI name or mapped name
specified by <Resource></text>
- </assertion>
-
- <assertion id="g">
- <text>A persistence context is obtained using the persistence unit name
specified by <PersistenceContext></text>
- </assertion>
-
- <assertion id="h">
- <text>A persistence unit is obtained using the persistence unit name
specified by <PersistenceUnit></text>
- </assertion>
-
- <assertion id="i">
- <text>A remote EJB is obtained using the JNDI name, mapped name or EJB link
specified by <EJB></text>
- </assertion>
-
- <assertion id="j">
- <text>A web service is obtained using the JNDI name or mapped name specified
by <WebServiceRef></text>
- </assertion>
-
- <assertion id="k">
- <text>When the destroy() method is called, the container discards the proxy
object</text>
- </assertion>
- </section>
-
- <section id="6.10" title="Lifecycle of JMS resources">
- <assertion id="a" testable="false">
- <text>An instance of a JMS resource is a proxy object, provided by the
container, that implements all the bean types defined in Section 3.7, "JMS
resources", delegating the actual implementation of these methods directly to the
underlying JMS objects</text>
- </assertion>
-
- <assertion id="b">
- <text>A JMS resource proxy object is a dependent object of the object it is
injected into</text>
- </assertion>
-
- <assertion id="c">
- <text>JMS resource proxy objects are serializable</text>
- </assertion>
-
- <assertion id="d">
- <text>When the create() method of a Bean object that represents a JMS
resource is called, the container creates and returns a proxy object that implements all
the bean types of the JMS resource</text>
- </assertion>
-
- <assertion id="e">
- <text>The methods of this proxy object delegate to JMS objects obtained as
needed using the metadata provided by the JMS resource declaration and using standard JMS
APIs</text>
- </assertion>
-
- <assertion id="f">
- <text>The Destination is obtained using the JNDI name or mapped name
specified by <Resource></text>
- </assertion>
-
- <assertion id="g">
- <text>The appropriate ConnectionFactory for the topic or queue is obtained
automatically</text>
- </assertion>
-
- <assertion id="h">
- <text>The Connection is obtained by calling
QueueConnectionFactory.createQueueConnection() or
TopicConnectionFactory.createTopicConnection()</text>
- </assertion>
-
- <assertion id="i" testable="false">
- <text>The container is permitted to share a connection between multiple proxy
objects</text>
- </assertion>
-
- <assertion id="j">
- <text>The Session object is obtained by calling
QueueConnection.createQueueSession() or TopicConnection.createTopicSession()</text>
- </assertion>
-
- <assertion id="k">
- <text>The MessageProducer object is obtained by calling
QueueSession.createSender() or TopicSession.createPublisher()</text>
- </assertion>
-
- <assertion id="l">
- <text>The MessageConsumer object is obtained by calling
QueueSession.createReceiver() or TopicSession.createSubscriber()</text>
- </assertion>
-
- <assertion id="m">
- <text>When the destroy() method is called, the container must ensure that all
JMS objects created by the proxy object are destroyed by calling close() if
necessary</text>
- </assertion>
-
- <assertion id="n">
- <text>The Connection is destroyed by calling Connection.close() if
necessary</text>
- </assertion>
-
- <assertion id="o">
- <text>If the connection is being shared between multiple proxy objects, the
container is not required to close the connection when the proxy is
destroyed</text>
- </assertion>
-
- <assertion id="p">
- <text>The Session object is destroyed by calling
Session.close()</text>
- </assertion>
-
- <assertion id="q">
- <text>The MessageProducer object is destroyed by calling
MessageProducer.close()</text>
- </assertion>
-
- <assertion id="r">
- <text>The MessageConsumer object is destroyed by calling
MessageConsumer.close()</text>
- </assertion>
-
- <assertion id="s">
- <text>The close() method of a JMS resource proxy object always throws an
UnsupportedOperationException</text>
- </assertion>
-
- </section>
-
- <section id="6.11" title="Lifecycle of EJBs">
- <assertion id="a">
- <text>When the EJB container creates a new instance of an EJB, after Java EE
injection has been performed and before the @PostConstruct callback occurs the container
must initialize the values of all injected fields . For each injected field, the
container sets the value to the
-object returned by Manager.getInstanceToInject()</text>
- </assertion>
-
- <assertion id="b">
- <text>When the EJB container creates a new instance of an EJB, after Java EE
injection has been performed and before the @PostConstruct callback occurs the container
must initialize the values of any fields with initial values specified in XML, as defined
in Section 9.5.5, "Field initial value declarations"</text>
- </assertion>
-
- <assertion id="c">
- <text>When the EJB container creates a new instance of an EJB, after Java EE
injection has been performed and before the @PostConstruct callback occurs the container
calls all initializer methods. For each initializer method parameter, the container passes
the object returned by Manager.getInstanceToInject()</text>
- </assertion>
-
- <assertion id="d">
- <text>When the EJB container creates a new instance of an EJB, after Java EE
injection has been performed and before the @PostConstruct callback occurs the container
builds the interceptor stacks for the instance as defined in Section A.3.10,
"Interceptor stack creation" and Section A.5.8, "Decorator stack
creation" and binds them to the instance</text>
- </assertion>
-
- <assertion id="e">
- <text>When the EJB container creates a new instance of an EJB, after Java EE
injection has been performed and before the @PostConstruct callback occurs the container
builds the decorator stacks for the instance as defined in Section A.3.10,
"Interceptor stack creation" and Section A.5.8, "Decorator stack
creation" and binds them to the instance</text>
- </assertion>
-
- <assertion id="f">
- <text>When the EJB container removes an instance of an EJB, the container
destroys all dependent objects, after the @PreDestroy callback completes</text>
- </assertion>
- </section>
-
- <section id="6.12" title="Lifecycle of servlets">
- <assertion id="a">
- <text>When the servlet container creates a new instance of a servlet, the
container initializes the values of all injected fields. For each injected field, the
container sets the value to the object returned by
Manager.getInstanceToInject()</text>
- </assertion>
-
- <assertion id="b">
- <text>When the servlet container creates a new instance of a servlet, the
container calls all initializer methods. For each initializer method parameter, the
container passes the object
-returned by Manager.getInstanceToInject()</text>
- </assertion>
-
- <assertion id="c">
- <text>When the servlet container destroys a servlet, the container destroys
all dependent objects</text>
- </assertion>
-
- <assertion id="d" testable="false">
- <text>In a Java EE 5 environment, the container is not required to support
injected fields or initializer methods of servlets</text>
- </assertion>
- </section>
-
- <section id="7" title="Events">
-
- </section>
-
- <section id="7.1" title="Event types and binding types">
-
- <assertion id="a">
- <text>An event object is an instance of a concrete Java class with no [type
variables] or wildcards</text>
- </assertion>
-
- <assertion id="b">
- <text>An event object is an instance of a concrete Java class with no type
variables or [wildcards]</text>
- </assertion>
-
- <assertion id="c">
- <text>The event types of the event include all superclasses and interfaces of
the class of the event object</text>
- </assertion>
-
- <assertion id="d">
- <text>An event binding type is a Java annotation defined as @Target({FIELD,
PARAMETER}) ~or @Target({METHOD, FIELD, PARAMETER, TYPE}) and
@Retention(RUNTIME)~</text>
- </assertion>
-
- <assertion id="e">
- <text>An event binding type is a Java annotation defined as ~@Target({FIELD,
PARAMETER}) or~ @Target({METHOD, FIELD, PARAMETER, TYPE}) ~and
@Retention(RUNTIME)~</text>
- </assertion>
-
- <assertion id="f" testable="false">
- <text>An event binding type is a Java annotation defined as ~@Target({FIELD,
PARAMETER}) or @Target({METHOD, FIELD, PARAMETER, TYPE}) and
~@Retention(RUNTIME)</text>
- <note>The compiler discards non-runtime-retention annotation</note>
- </assertion>
-
- <assertion id="g">
- <text>All event binding types must specify the @javax.inject.BindingType
meta-annotation</text>
- </assertion>
-
- <assertion id="h">
- <text>An event consumer will be notified of an event if the observed event
type it specifies is one of the event types of the event, and if all the observed event
bindings it specifies are event bindings of the event</text>
- </assertion>
-
- </section>
-
- <section id="7.2" title="Firing an event via the Manager
interface">
-
- <assertion id="a">
- <text>The Manager interface provides the fireEvent() method for firing
events</text>
- </assertion>
-
- <assertion id="b">
- <text>If the type of the event object passed to fireEvent() contains [type
variables] or wildcards, an IllegalArgumentException is thrown</text>
- </assertion>
-
- <assertion id="c">
- <text>If the type of the event object passed to fireEvent() contains type
variables or [wildcards], an IllegalArgumentException is thrown</text>
- </assertion>
-
- <assertion id="d">
- <text>If an instance of an annotation that is not a binding type is passed to
fireEvent(), an IllegalArgumentException is thrown. (Not in PRD2, but should appear in
next revision)</text>
- </assertion>
-
- </section>
-
- <section id="7.3" title="Observing events via the Observer
interface">
- <assertion id="a">
- <text>Observers of events implement the javax.event.Observer
interface</text>
- </assertion>
-
- <assertion id="b">
- <text>An observer instance may be registered with the container by calling
Manager.addObserver()</text>
- </assertion>
-
- <assertion id="c">
- <text>In the signature of Manager.addObserver(), the first parameter is the
observer object, the second parameter is the observed event type, and the remaining
parameters are
-optional observed event bindings</text>
- </assertion>
-
- <assertion id="d">
- <text>The observer is notified when an event object that is assignable to the
observed event type is raised with the observed event bindings</text>
- </assertion>
-
- <assertion id="e">
- <text>An observer instance may be deregistered by calling
Manager.removeObserver()</text>
- </assertion>
-
- <assertion id="f">
- <text>If the observed event type passed to ~addObserver()~ or
removeObserver() contains ~type variables~ or wildcards, an IllegalArgumentException is
thrown</text>
- </assertion>
-
- <assertion id="g">
- <text>If the observed event type passed to ~addObserver()~ or
removeObserver() contains type variables or ~wildcards~, an IllegalArgumentException is
thrown</text>
- </assertion>
-
- <assertion id="h">
- <text>If the observed event type passed to addObserver() or
~removeObserver()~ contains ~type variables~ or wildcards, an IllegalArgumentException is
thrown</text>
- </assertion>
-
- <assertion id="i">
- <text>If the observed event type passed to addObserver() or
~removeObserver()~ contains type variables or ~wildcards~, an IllegalArgumentException is
thrown</text>
- </assertion>
-
- <assertion id="j">
- <text>If two instances of the same binding type are passed to ~addObserver()~
or removeObserver(), a DuplicateBindingTypeException is thrown</text>
- </assertion>
-
- <assertion id="k">
- <text>If two instances of the same binding type are passed to addObserver()
or ~removeObserver()~, a DuplicateBindingTypeException is thrown</text>
- </assertion>
-
- <assertion id="l">
- <text>If an instance of an annotation that is not a binding type is passed to
~addObserver()~ or removeObserver(), an IllegalArgumentException is thrown</text>
- </assertion>
-
- <assertion id="m">
- <text>If an instance of an annotation that is not a binding type is passed to
addObserver() or ~removeObserver()~, an IllegalArgumentException is thrown</text>
- </assertion>
- </section>
-
- <section id="7.4" title="Observer notification">
-
- <assertion id="a">
- <text>When an event is fired by the application the container must determine
the observers for that event by calling Manager.resolveObservers(), passing the event
object and all event bindings</text>
- </assertion>
-
- <assertion id="b">
- <text>When an event is fired by the application the container must, for each
observer, call the notify() method of the Observer interface, passing the event
object</text>
- </assertion>
-
- <assertion id="c">
- <text>If an observer throws an exception, the exception aborts processing of
the event. No other observers of that event will be called. The fireEvent() method
rethrows the exception</text>
- </assertion>
-
- <assertion id="d">
- <text>Any observer called before completion of a transaction may call
setRollbackOnly() to force a transaction rollback</text>
- </assertion>
-
- <assertion id="e">
- <text>An observer may not directly ~initiate~, commit or rollback JTA
transactions</text>
- </assertion>
-
- <assertion id="f">
- <text>An observer may not directly initiate, ~commit~ or rollback JTA
transactions</text>
- </assertion>
-
- <assertion id="g">
- <text>An observer may not directly initiate, commit or ~rollback~ JTA
transactions</text>
- </assertion>
-
- </section>
-
- <section id="7.5" title="Observer methods">
- <assertion id="a">
- <text>An observer method is an observer defined via annotations, instead of
by explicitly implementing the Observer interface. Unlike regular observers, observer
methods are automatically discovered and registered by the container</text>
- </assertion>
-
- <assertion id="b">
- <text>An observer method must be a method of a simple bean class or session
bean class</text>
- </assertion>
-
- <assertion id="c">
- <text>An observer method may be either static or non-static</text>
- </assertion>
-
- <assertion id="d">
- <text>If the bean is a session bean, the observer method must be a business
method of the EJB or a static method of the bean class</text>
- </assertion>
-
- <assertion id="e">
- <text>There may be arbitrarily many observer methods with the same event
parameter type and bindings</text>
- </assertion>
-
- <assertion id="f">
- <text>A bean may declare multiple observer methods</text>
- </assertion>
- </section>
-
- <section id="7.5.1" title="Event parameter of an observer
method">
- <assertion id="a">
- <text>Each observer method must have exactly one event parameter, of the same
type as the event type it observes. When searching for observer methods for an event, the
container considers the type and bindings of the event parameter</text>
- </assertion>
-
- <assertion id="b">
- <text>If the event parameter does not explicitly declare any binding, the
observer method observes events with no binding</text>
- </assertion>
-
- <assertion id="c">
- <text>If the type of the event parameter contains type variables or
wildcards, a DefinitionException is thrown by the container at deployment
time</text>
- </assertion>
- </section>
-
- <section id="7.5.2" title="Declaring an observer method using
annotations">
- <assertion id="a">
- <text>A observer method may be declared using annotations by annotating a
parameter @javax.event.Observes. That parameter is the event parameter.</text>
- </assertion>
-
- <assertion id="b">
- <text>If a method has more than one parameter annotated @Observes, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="c">
- <text>If an observer method is annotated @Produces a DefinitionException
-is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>If an observer method is annotated @Initializer a DefinitionException
-is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="e">
- <text>If an observer method has a parameter annotated @Disposes, 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 @Observes, and the method is not a business method of the EJB, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="g">
- <text>The event parameter may declare bindings</text>
- </assertion>
- </section>
-
- <section id="7.5.3" title="Declaring an observer method using
XML">
- <assertion id="a">
- <text>For a beans defined in XML, an observer method may be declared using
the method name, the <Observes> element, and the parameter types of the
method</text>
- </assertion>
-
- <assertion id="b">
- <text>When an observer 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
parameters that match those declared in XML, a DefinitionException is thrown by the
container at deployment time</text>
- </assertion>
- </section>
-
- <section id="7.5.4" title="Observer method parameters">
- <assertion id="a">
- <text>In addition to the event parameter, observer methods may declare
additional parameters, which may declare bindings. The container calls the method
Manager.getInstanceToInject() defined in Section 5.7.1, "Resolving dependencies"
to determine a value for each parameter of an observer method and calls the observer
method with those parameter values</text>
- </assertion>
- </section>
-
- <section id="7.5.5" title="Conditional observer methods">
- <assertion id="a">
- <text>Conditional observer methods are observer methods which are notified of
an event only if an instance of the bean that defines the observer method already exists
in the current context</text>
- </assertion>
-
- <assertion id="b">
- <text>A conditional observer methods may be declared by annotating the event
parameter with the @javax.event.IfExists annotation</text>
- </assertion>
-
- <assertion id="c">
- <text>Conditional observer methods may be declared in XML by adding a child
<IfExists> element to the <Observes> element</text>
- </assertion>
- </section>
-
- <section id="7.5.6" title="Transactional observer methods">
- <assertion id="a">
- <text>Transactional observer methods are observer methods which receive event
notifications during the before or after completion phase of the transaction in which the
event was fired. If no transaction is in progress when the event is fired, they are
notified at the same time as other observers</text>
- </assertion>
-
- <assertion id="b">
- <text>A before completion observer method is called during the before
completion phase of the transaction</text>
- </assertion>
-
- <assertion id="c">
- <text>An after completion observer method is called during the after
completion phase of the transaction</text>
- </assertion>
-
- <assertion id="d">
- <text>An after success observer method is called during the after completion
phase of the transaction, only when the transaction completes successfully</text>
- </assertion>
-
- <assertion id="e">
- <text>An after failure observer method is called during the after completion
phase of the transaction, only when the transaction fails</text>
- </assertion>
-
- <assertion id="f">
- <text>A transactional observer method may be declared by ~annotating the
event parameter of the observer method~ or in XML by a child element of the
<Observes> element</text>
- </assertion>
-
- <assertion id="g">
- <text>A transactional observer method may be declared by annotating the event
parameter of the observer method or ~in XML by a child element of the
<Observes> element~</text>
- </assertion>
-
- <assertion id="h">
- <text>The @javax.event.BeforeTransactionCompletion annotation or
<BeforeTransactionCompletion> element specifies that the observer method is
a before completion observer method</text>
- </assertion>
-
- <assertion id="i">
- <text>The @javax.event.AfterTransactionCompletion annotation or
<AfterTransactionCompletion> element specifies that the observer method is
an after completion observer method</text>
- </assertion>
-
- <assertion id="j">
- <text>The @javax.event.AfterTransactionSuccess annotation or
<AfterTransactionSuccess> element specifies that the observer method is an
after success observer method</text>
- </assertion>
-
- <assertion id="k">
- <text>The @javax.event.AfterTransactionFailure annotation or
<AfterTransactionFailure> element specifies that the observer method is an
after failure observer method</text>
- </assertion>
-
- <assertion id="l">
- <text>A transactional observer method may not specify more than one of the
four types. If a transactional observer method specifies more than one of the four types,
a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="7.5.7" title="Asynchronous observer methods">
- <assertion id="a">
- <text>An asynchronous observer method may be declared by ~annotating the
event parameter of the observer method @javax.event.Asynchronously~ or in XML by a child
<Asynchronously> element of the <Observes>
element</text>
- </assertion>
-
- <assertion id="b">
- <text>An asynchronous observer method may be declared by annotating the event
parameter of the observer method @javax.event.Asynchronously or ~in XML by a child
<Asynchronously> element of the <Observes>
element~</text>
- </assertion>
-
- <assertion id="c">
- <text>An asynchronous observer method may also be a transactional observer
method</text>
- </assertion>
-
- <assertion id="d">
- <text>If an asynchronous observer method is also a transactional observer
method, it ~may not be a before completion observer method~ or a conditional observer
method. If an asynchronous observer method is specified as a before completion or
conditional observer method, a DefinitionException is thrown by the container at
deployment time</text>
- </assertion>
-
- <assertion id="e">
- <text>If an asynchronous observer method is also a transactional observer
method, it may not be a before completion observer method or a ~conditional observer
method~. If an asynchronous observer method is specified as a before completion or
conditional observer method, a DefinitionException is thrown by the container at
deployment time</text>
- </assertion>
- </section>
-
- <section id="7.5.8" title="Observer object for an observer
method">
- <assertion id="a">
- <text>For every observer method of an enabled bean, the container is
responsible for providing and registering an appropriate implementation of the Observer
interface, that delegates event notifications to the observer method</text>
- </assertion>
-
- <assertion id="b">
- <text>The notify() method of the Observer implementation for an observer
method either invokes the observer method ~immediately~, or asynchronously, or registers
the observer method for later invocation during the transaction completion phase, using a
JTA Synchronization</text>
- </assertion>
-
- <assertion id="c">
- <text>The notify() method of the Observer implementation for an observer
method either invokes the observer method immediately, ~or asynchronously~, or registers
the observer method for later invocation during the transaction completion phase, using a
JTA Synchronization</text>
- </assertion>
-
- <assertion id="d">
- <text>The notify() method of the Observer implementation for an observer
method either invokes the observer method immediately, or asynchronously, ~or registers
the observer method for later invocation during the transaction completion phase, using a
JTA Synchronization~</text>
- </assertion>
-
- <assertion id="e">
- <text>If the observer method is an asynchronous transactional observer method
and there is currently a JTA transaction in progress, the observer object calls the
observer method asynchronously during the after transaction completion phase</text>
- </assertion>
-
- <assertion id="f">
- <text>If the observer method is a transactional observer method and there is
currently a JTA transaction in progress, the observer object calls the observer method
during the appropriate transaction completion phase</text>
- </assertion>
-
- <assertion id="g">
- <text>If the observer method is an asynchronous observer method, the
container calls the observer method asynchronously</text>
- </assertion>
-
- <assertion id="h">
- <text>If none of the conditions of assertions e, f, or g are true, the
container calls the observer immediately</text>
- </assertion>
-
- <assertion id="i">
- <text>The container is not required to guarantee delivery of asynchronous
events in the case of a server shutdown or failure</text>
- </assertion>
-
- <assertion id="j">
- <text>To invoke an observer method, the container must pass the event object
to the event parameter and the object returned by Manager.getInstanceToInject() to each of
the other parameters</text>
- </assertion>
-
- <assertion id="k">
- <text>If the observer method is static, the container must invoke the
method</text>
- </assertion>
-
- <assertion id="l">
- <text>If the observer method is non-static, the container must obtain the
Bean object for the most specialized bean that specializes the bean which declares the
observer method</text>
- </assertion>
-
- <assertion id="m">
- <text>Placeholder for path 2</text>
- </assertion>
-
- <assertion id="n">
- <text>Placeholder for path 3</text>
- </assertion>
-
- <assertion id="o">
- <text>Placeholder for path 4 etc</text>
- </assertion>
-
- <assertion id="p">
- <text>If the observer is a transactional or asynchronous observer method, any
exception is caught and logged by the container</text>
- </assertion>
-
- <assertion id="q">
- <text>If the observer isn't a transactional or asynchronous observer
method, the exception is rethrown by the notify() method of the observer
object</text>
- </assertion>
-
- <assertion id="r">
- <text>If the exception is a checked exception, it is wrapped and rethrown as
an (unchecked) ObserverException</text>
- </assertion>
-
- <assertion id="s">
- <text>The observer object is registered by calling Manager.addObserver(),
passing the event parameter type as the observed event type, and the bindings of the event
parameter as the observed event bindings</text>
- </assertion>
- </section>
-
- <section id="7.5.9" title="Observer invocation context">
- <assertion id="a">
- <text>If the observer method is an asynchronous observer method, it is called
with no active transaction, no client security context and with a new request context that
is destroyed when the observer method returns. The application context is also
active</text>
- </assertion>
-
- <assertion id="b">
- <text>If the observer method is a @BeforeTransactionCompletion transactional
observer method, it is called within the context of the transaction that is about to
complete and with the same client security context and lifecycle contexts</text>
- </assertion>
-
- <assertion id="c">
- <text>If the observer method is any other kind of transactional observer
method, it is called in an unspecified transaction context, but with the same client
security context and lifecycle contexts as the transaction that just
completed</text>
- </assertion>
-
- <assertion id="d">
- <text>If an observer method is not an asynchronous observer method, and not a
@BeforeTransactionCompletion transactional method, and not any other kind of transactional
observer method, then the observer method is called in the same transaction context,
client security context and lifecycle contexts as the invocation of
Event.fire()</text>
- </assertion>
-
- <assertion id="e">
- <text>The transaction and security contexts for a business method of a
session bean also depend upon the transaction attribute and @RunAs descriptor, if
any</text>
- </assertion>
- </section>
-
- <section id="7.6" title="The Event interface">
- <assertion id="a">
- <text>An instance of the javax.event.Event interface may be injected via use
of the @javax.event.Fires binding</text>
- </assertion>
-
- <assertion id="b">
- <text>Additional bindings may be specified at the injection point for
javax.event.Event</text>
- </assertion>
-
- <assertion id="c">
- <text>The Event interface provides a method for firing events of a specific
type</text>
- </assertion>
-
- <assertion id="d">
- <text>The Event interface provides a method for registering observers for
-events of the same type</text>
- </assertion>
-
- <assertion id="e">
- <text>The first parameter of the fire() method is the event object. The
remaining parameters are event bindings</text>
- </assertion>
-
- <assertion id="f">
- <text>The first parameter of the observe() method is the observer object. The
remaining parameters are the observed event bindings</text>
- </assertion>
-
- <assertion id="g">
- <text>If two instances of the same binding type are passed to fire() or
observes(), a DuplicateBindingTypeException is thrown</text>
- </assertion>
-
- <assertion id="h">
- <text>If an instance of an annotation that is not a binding type is passed to
fire() or observes(), an IllegalArgumentException is thrown</text>
- </assertion>
-
- <assertion id="i">
- <text>The @Fires annotation or <Fires> element may be applied
to any injection point of type Event, where an actual type parameter is
specified</text>
- </assertion>
-
- <assertion id="j">
- <text>If the type of the injection point is not of type Event a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="k">
- <text>If the type of the injection point has no actual type parameter
specified a DefinitionException is thrown by the container at deployment
time</text>
- </assertion>
-
- <assertion id="l">
- <text>If the type of the injection point parameter contains a type variable a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="m">
- <text>If the type of the injection point parameter contains a wildcard a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="n">
- <text>Whenever the @Fires annotation appears at an injection point, an
implicit bean exists with exactly the bean type and bindings that appear at the injection
point</text>
- </assertion>
-
- <assertion id="o">
- <text>Whenever the @Fires annotation appears at an injection point, an
implicit bean exists with deployment type @Standard,</text>
- </assertion>
-
- <assertion id="p">
- <text>Whenever the @Fires annotation appears at an injection point, an
implicit bean exists with @Dependent scope</text>
- </assertion>
-
- <assertion id="q">
- <text>Whenever the @Fires annotation appears at an injection point, an
implicit bean exists with no bean name</text>
- </assertion>
-
- <assertion id="r">
- <text>Whenever the @Fires annotation appears at an injection point, an
implicit bean exists with an implementation provided automatically by the
container</text>
- </assertion>
-
- <assertion id="s">
- <text>The fire() method of the provided implementation of Event must call
Manager.fireEvent(), passing the event object passed to Event.fire(), all bindings
declared at the injection point (except @Fires), and all bindings passed to
Event.fire()</text>
- </assertion>
-
- <assertion id="t">
- <text>The application may fire events by calling the fire()
method</text>
- </assertion>
-
- <assertion id="u">
- <text>The observe() method of the provided implementation of Event must call
Manager.addObserver(), passing the observer object passed to Event.observe(), all bindings
declared at the injection point (except @Fires), and all bindings passed to
Event.observer()</text>
- </assertion>
-
- <assertion id="v">
- <text>The application may register observers by calling the observe()
method</text>
- </assertion>
- </section>
-
- <section id="7.7" title="Observer resolution">
- <assertion id="a">
- <text>The method Manager.resolveObservers() resolves observers for an event -
the first parameter of resolveObservers() is the event object. The remaining parameters
are event bindings</text>
- </assertion>
-
- <assertion id="b">
- <text>If the type of the event object passed to resolveObservers() contains
type variables, an IllegalArgumentException is thrown</text>
- </assertion>
-
- <assertion id="c">
- <text>If the type of the event object passed to resolveObservers() contains
wildcards, an IllegalArgumentException is thrown</text>
- </assertion>
-
- <assertion id="d">
- <text>If two instances of the same binding type are passed to
resolveObservers(), a DuplicateBindingTypeException is thrown</text>
- </assertion>
-
- <assertion id="e">
- <text>If an instance of an annotation that is not a binding type is passed to
resolveObservers(), an IllegalArgumentException is thrown</text>
- </assertion>
-
- <assertion id="f">
- <text>When searching for observers for an event, the event object must be
assignable to the observed event type, taking type parameters into
consideration</text>
- </assertion>
-
- <assertion id="g">
- <text>When searching for observers for an event, for each observed event
binding, (a) an instance of the binding type must have been passed to fireEvent() and (b)
any member values of the binding type must match the member values of the instance passed
to fireEvent()</text>
- </assertion>
- </section>
-
- <section id="7.7.1" title="Event binding types with
members">
- <assertion id="a">
- <text>The binding type for an Event binding may have annotation
members</text>
- </assertion>
-
- <assertion id="b">
- <text>The container uses equals() to compare event binding type member
values</text>
- </assertion>
- </section>
-
- <section id="7.7.2" title="Multiple event bindings">
- <assertion id="a">
- <text>An event parameter may have multiple bindings</text>
- </assertion>
-
- <assertion id="b">
- <text>An observer method will only be notified if all the observed event
bindings are specified when the event is fired</text>
- </assertion>
-
- <assertion id="c">
- <text>Other, less specific, observers will also be notified of events with
multiple event bindings</text>
- </assertion>
- </section>
-
- <section id="7.8" title="JMS event mappings">
- <assertion id="a">
- <text>An event type may be mapped to a JMS resource that represents a
topic</text>
- </assertion>
-
- <assertion id="b">
- <text>Multiple event types may be mapped to the same topic</text>
- </assertion>
-
- <assertion id="c">
- <text>All observers of mapped event types must be asynchronous observer
methods. If an observer for a mapped event type is not an asynchronous observer method, a
DeploymentException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>When an event type is mapped to a topic, the container must send a
message containing the serialized event and its event bindings to the topic whenever an
event with that type is fired</text>
- </assertion>
-
- <assertion id="e">
- <text>When an event type is mapped to a topic, the container must listen for
messages containing events of that type sent to the topic, and notify all observers of the
event type whenever a message containing an event of that type is received</text>
- </assertion>
-
- <assertion id="f">
- <text>Events of a mapped event type are distributed to other processes which
have the same event type mapped to the same topic</text>
- </assertion>
- </section>
-
- <section id="8" title="Scopes and contexts">
-
- </section>
-
- <section id="8.1" title="The Context interface">
-
- <assertion id="a">
- <text>The get() method of the Context object may return an existing instance
of the given contextual type</text>
- </assertion>
-
- <assertion id="b">
- <text>The get() method of the Context object may return a null value if no
CreationalContext is given</text>
- </assertion>
-
- <assertion id="c">
- <text>The get() method of the Context object may create a new instance of the
given contextual type by calling Contextual.create() and return the new instance, if a
CreationalContext is given</text>
- </assertion>
-
- <assertion id="d">
- <text>The get() method of a Context object may not return a null value unless
no CreationalContext is given, or Contextual.create() returns a null value</text>
- </assertion>
-
- <assertion id="e">
- <text>The get() method of a Context object may not create a new instance of
the given contextual type unless a CreationalContext is given</text>
- </assertion>
-
- <assertion id="f">
- <text>The Context implementation is responsible for destroying any contextual
instance it creates by passing the instance to the destroy() method of the Contextual
object representing the contextual type</text>
- </assertion>
-
- <assertion id="g">
- <text>A destroyed instance must not subsequently be returned by a Context
object's get() method</text>
- </assertion>
-
- <assertion id="h">
- <text>When a scope is inactive, any invocation of the get() from the current
thread upon the Context object for that scope results in a
ContextNotActiveException</text>
- </assertion>
-
- <assertion id="i">
- <text>The isActive() method returns false when the scope of the context
object is inactive, and true when it is active</text>
- </assertion>
-
- </section>
-
- <section id="8.2" title="Normal scopes and pseudo-scopes">
- <assertion id="a">
- <text>There may be no more than one mapped instance of a context object per
contextual type per thread</text>
- </assertion>
-
- <assertion id="b" testable="false">
- <text>A context may be associated with one or more threads</text>
- <note>A statement of intent</note>
- </assertion>
-
- <assertion id="c">
- <text>The get() operation of the Context object for an active normal scope
returns the current instance of the given contextual type</text>
- </assertion>
-
- <assertion id="d">
- <text>When a context is destroyed, all mapped instances of contextual types
with that scope are destroyed by passing them to the Contextual.destroy()
method</text>
- </assertion>
-
- <assertion id="e">
- <text>Contexts with normal scopes must obey the following rule: Suppose beans
A, B and Z all have normal scopes. Suppose A has an injection point x, and B has an
injection point y. Suppose further that both x and y resolve to bean Z according to the
typesafe resolution algorithm. If a is the current instance of A, and b is the current
instance of B, then both a.x and b.y refer to the same instance of Z. This instance is the
current instance of Z.</text>
- </assertion>
-
- <assertion id="f" testable="false">
- <text>All pseudo-scopes must be explicitly declared @ScopeType(normal=false),
to indicate to the container that no client proxy is required</text>
- <note>A statement of intent</note>
- </assertion>
-
- <assertion id="g" testable="false">
- <text>All scopes defined by this specification, except for the @Dependent
pseudo-scope, are normal scopes</text>
- <note>A statement of intent</note>
- </assertion>
- </section>
-
- <section id="8.3" title="Dependent pseudo-scope">
-
- <assertion id="a">
- <text>When a bean is declared to have @Dependent scope, no injected instance
of the bean is ever shared between multiple injection points</text>
- </assertion>
-
- <assertion id="b">
- <text>When a bean is declared to have @Dependent scope, any injected instance
of the bean is bound to the lifecycle of the bean, servlet or EJB into which it is
injected</text>
- </assertion>
-
- <assertion id="c">
- <text>When a bean is declared to have @Dependent scope, any instance of the
bean that is used to evaluate a Unified EL expression exists to service that evaluation
only</text>
- </assertion>
-
- <assertion id="d">
- <text>When a bean is declared to have @Dependent scope, any instance of the
bean that receives a producer method, producer field, disposal method or observer method
invocation exists to service that invocation only</text>
- </assertion>
-
- <assertion id="e">
- <text>Every invocation of the get() operation of the Context object for the
@Dependent scope with a CreationalContext returns a new instance of the given
bean</text>
- </assertion>
-
- <assertion id="f">
- <text>Every invocation of the get() operation of the Context object for the
@Dependent scope with no CreationalContext returns a null value</text>
- </assertion>
-
- <assertion id="g">
- <text>The @Dependent scope is inactive except when an instance of a bean with
scope @Dependent is created by the container to receive a producer method, producer field,
disposal method or observer method invocation</text>
- <note>Assertions g through k are all related and should be treated as
"or" conditions</note>
- </assertion>
-
- <assertion id="h">
- <text>The @Dependent scope is inactive except while a Unified EL expression
is evaluated</text>
- </assertion>
-
- <assertion id="i">
- <text>The @Dependent scope is inactive except while an observer method is
invoked</text>
- </assertion>
-
- <assertion id="j">
- <text>The @Dependent scope is inactive except when the container is creating
or destroying a contextual instance of a bean or injecting its dependencies</text>
- </assertion>
-
- <assertion id="k">
- <text>The @Dependent scope is inactive except when the container is injecting
dependencies of an EJB</text>
- </assertion>
-
- <assertion id="l">
- <text>The @Dependent scope is inactive except when a @PostConstruct or
@PreDestroy callback is invoked by the EJB container</text>
- </assertion>
-
- <assertion id="m">
- <text>The @Dependent scope is inactive except when the container is injecting
dependencies of a servlet</text>
- </assertion>
-
- <assertion id="n">
- <text>The @Dependent scope is even active during invocation of interceptors
and decorators of observer methods and interceptors and decorators of @PostConstruct and
@PreDestroy callbacks</text>
- </assertion>
-
- </section>
-
- <section id="8.3.1" title="Dependent objects">
- <assertion id="a" testable="false">
- <text>A bean, EJB or servlet may obtain an instance of a bean with scope
@Dependent via dependency injection or by calling Manager.getInstance(),
Manager.getInstanceByType() or Instance.get() when the @Dependent scope is
active</text>
- <note>A statement of intent</note>
- </assertion>
-
- <assertion id="b">
- <text>Instances of interceptors or decorators with scope @Dependent are also
dependent objects of the bean they intercept or decorate</text>
- </assertion>
- </section>
-
- <section id="8.3.2" title="Dependent object destruction">
-
- <assertion id="a">
- <text>The container must destroy all dependent objects of a contextual bean
instance when the instance is destroyed</text>
- </assertion>
-
- <assertion id="ba">
- <text>The container must destroy all dependent objects of an EJB ~or servlet~
when the EJB ~or servlet~ is destroyed</text>
- </assertion>
-
- <assertion id="bb">
- <text>The container must destroy all dependent objects of a~n EJB or~ servlet
when the ~EJB or~ servlet is destroyed</text>
- </assertion>
-
- <assertion id="c">
- <text>The container must destroy all @Dependent scoped contextual instances
created during an EL expression evaluation when the evaluation completes</text>
- </assertion>
-
- <assertion id="da">
- <text>The container must destroy any @Dependent scoped contextual instance
created to receive a producer method~, producer field, disposal method or observer method~
invocation when the invocation completes</text>
- </assertion>
-
- <assertion id="db">
- <text>The container must destroy any @Dependent scoped contextual instance
created to receive a ~producer method,~ producer field~, disposal method or observer
method~ invocation when the invocation completes</text>
- </assertion>
-
- <assertion id="dc">
- <text>The container must destroy any @Dependent scoped contextual instance
created to receive a ~producer method, producer field,~ disposal method ~or observer
method~ invocation when the invocation completes</text>
- </assertion>
-
- <assertion id="dd">
- <text>The container must destroy any @Dependent scoped contextual instance
created to receive a ~producer method, producer field, disposal method or~ observer method
invocation when the invocation completes</text>
- </assertion>
-
- <assertion id="e" testable="false">
- <text>The container is permitted to destroy any @Dependent scoped contextual
instance at any time if the instance is no Scopes and contexts longer referenced by the
application (excluding weak, soft and phantom references)</text>
- <note>In other words this is unspecified</note>
- </assertion>
- </section>
-
- <section id="8.4" title="Passivating scopes and
serialization">
- <assertion id="a">
- <text>The container must validate that every bean declared with a passivating
scope truly is serializable - EJB local objects are serializable. Therefore, a session
bean may declare any passivating scope</text>
- </assertion>
-
- <assertion id="b">
- <text>Simple beans are not required to be serializable. If a simple bean
declares a passivating scope, and the bean class is not serializable, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="cc">
- <text>If a ~producer method or ~field declares a passivating scope and
returns a non-serializable object at runtime, an IllegalProductException is thrown by the
container</text>
- </assertion>
-
- <assertion id="cd">
- <text>If a producer method~ or field~ declares a passivating scope and
returns a non-serializable object at runtime, an IllegalProductException is thrown by the
container</text>
- </assertion>
-
- <assertion id="ca">
- <text>Check a producer method which declares a passivating scope and returns
a serializable product works</text>
- <note>Sanity test</note>
- </assertion>
-
- <assertion id="cb">
- <text>Check a producer method which declares a passivating scope and returns
a primitive product works</text>
- <note>Sanity test</note>
- </assertion>
-
- <assertion id="d" testable="false">
- <text>The built-in session and conversation scopes are
passivating</text>
- <note>This is an API signature test</note>
- </assertion>
-
- <assertion id="e" testable="false">
- <text>No other built-in scope besides session and conversation scopes are
passivating</text>
- <note>This is an API signature test</note>
- </assertion>
-
- <assertion id="f">
- <text>A contextual instance of a bean may be serialized when the bean
declares a passivating scope, and context passivation occurs</text>
- </assertion>
-
- <assertion id="g">
- <text>A contextual instance of a bean may be serialized when the bean is an
EJB stateful session bean, and it is passivated by the EJB container</text>
- </assertion>
-
- <assertion id="h" testable="false">
- <text>In either case of assertion f or g above, any non-transient field that
holds a reference to another bean must be serialized along with the bean that is being
serialized. Therefore, the reference must be to a serializable type</text>
- <note>An explanation</note>
- </assertion>
-
- <assertion id="i">
- <text>Any reference to a bean which declares a normal scope is
serializable</text>
- </assertion>
-
- <assertion id="j">
- <text>EJB local objects are serializable, therefore, any reference to a
session bean of scope @Dependent is serializable</text>
- </assertion>
-
- <assertion id="k">
- <text>If a simple bean of scope @Dependent and a nonserializable bean class
is injected into a stateful session bean an UnserializableDependencyException must be
thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="l">
- <text>If a simple bean of scope @Dependent and a nonserializable bean class
is injected into a non-transient field an UnserializableDependencyException must be thrown
by the container at deployment time</text>
- </assertion>
-
- <assertion id="m">
- <text>If a simple bean of scope @Dependent and a nonserializable bean class
is injected into a bean constructor parameter of a bean which declares a passivating
scope, an UnserializableDependencyException must be thrown by the container at deployment
time</text>
- </assertion>
-
- <assertion id="n">
- <text>If a simple bean of scope @Dependent and a nonserializable bean class
is injected into an initializer method parameter of a bean which declares a passivating
scope, an UnserializableDependencyException must be thrown by the container at deployment
time</text>
- </assertion>
-
- <assertion id="o">
- <text>If a simple bean of scope @Dependent and a nonserializable bean class
is injected into a parameter of a producer method which declares a passivating scope, an
UnserializableDependencyException must be thrown by the container at deployment
time</text>
- </assertion>
-
- <assertion id="p">
- <text>If a producer method or field of scope @Dependent returns a
non-serializable object for injection into a stateful session bean, an
IllegalProductException is thrown by the container</text>
- </assertion>
-
- <assertion id="q">
- <text>If a producer method or field of scope @Dependent returns a
non-serializable object for injection into a non-transient field an
IllegalProductException is thrown by the container</text>
- </assertion>
-
- <assertion id="r">
- <text>If a producer method or field of scope @Dependent returns a
non-serializable object for injection into a bean constructor parameter of a bean which
declares a passivating scope, an IllegalProductException is thrown by the
container</text>
- </assertion>
-
- <assertion id="s">
- <text>If a producer method or field of scope @Dependent returns a
non-serializable object for injection into an initializer method parameter of a bean which
declares a passivating scope, an IllegalProductException is thrown by the
container</text>
- </assertion>
-
- <assertion id="t">
- <text>If a producer method or field of scope @Dependent returns a
non-serializable object for injection into a parameter of a producer method which declares
a passivating scope, an IllegalProductException is thrown by the container</text>
- </assertion>
-
- <assertion id="u">
- <text>The container must guarantee that JMS resource proxy objects are
serializable</text>
- </assertion>
-
- <assertion id="v">
- <text>The method Bean.isSerializable() may be used to detect if a bean is
serializable</text>
- </assertion>
- </section>
-
- <section id="8.5" title="Context management for built-in
scopes">
-
- <assertion id="a">
- <text>The container provides an implementation of the Context interface for
each of the built-in scopes</text>
- </assertion>
-
- <assertion id="b">
- <text>For each of the built-in normal scopes, contexts propagate across any
Java method call, including invocation of EJB local business methods</text>
- </assertion>
-
- <assertion id="c">
- <text>The built-in contexts do not propagate across remote method invocations
or to asynchronous processes such as JMS message listeners or EJB timer service
timeouts</text>
- </assertion>
-
- </section>
-
- <section id="8.5.1" title="Request context lifecycle">
-
- <assertion id="a">
- <text>The request scope is active during the service() method of any servlet
in the web application</text>
- </assertion>
-
- <assertion id="b">
- <text>The request scope is active during the doFilter() method of any servlet
filter</text>
- </assertion>
-
- <assertion id="c">
- <text>The request context is destroyed at the end of the servlet request,
after the service() method and all doFilter() methods return</text>
- </assertion>
-
- <assertion id="d">
- <text>The request scope is active during any Java EE web service
invocation</text>
- </assertion>
-
- <assertion id="e">
- <text>The request context is destroyed after a web service invocation
completes</text>
- </assertion>
-
- <assertion id="f">
- <text>The request scope is active during any asynchronous observer method
notification</text>
- </assertion>
-
- <assertion id="g">
- <text>The request context is destroyed after a asynchronous observer method
notification completes</text>
- </assertion>
-
- <assertion id="h">
- <text>The request scope is active during any remote method invocation of any
EJB</text>
- </assertion>
-
- <assertion id="i">
- <text>The request scope is active during any call to an EJB timeout
method</text>
- </assertion>
-
- <assertion id="j">
- <text>The request scope is active during message delivery to any EJB
message-driven bean</text>
- </assertion>
-
- <assertion id="k">
- <text>The request context is destroyed after the remote EJB method invocation
completes</text>
- </assertion>
-
- <assertion id="l">
- <text>The request context is destroyed after the invocation of an EJB timeout
method</text>
- </assertion>
-
- <assertion id="m">
- <text>The request context is destroyed after message delivery to an EJB
message-drive bean completes</text>
- </assertion>
- </section>
-
- <section id="8.5.2" title="Session context lifecycle">
-
- <assertion id="a">
- <text>The session scope is active during the service() method of any servlet
in the web application</text>
- </assertion>
-
- <assertion id="b">
- <text>The session scope is active during the doFilter() method of any servlet
filter</text>
- </assertion>
-
- <assertion id="c">
- <text>The session context is shared between all servlet requests that occur
in the same HTTP servlet session</text>
- </assertion>
-
- <assertion id="d">
- <text>The session context is destroyed when the HTTPSession is
invalidated</text>
- </assertion>
-
- <assertion id="e">
- <text>The session context is destroyed when the HTTPSession times
out</text>
- </assertion>
- </section>
-
- <section id="8.5.3" title="Application context lifecycle">
-
- <assertion id="a">
- <text>The application scope is active during the service() method of any
servlet in the web application</text>
- </assertion>
-
- <assertion id="b">
- <text>The application scope is active during the doFilter() method of any
servlet filter</text>
- </assertion>
-
- <assertion id="c">
- <text>The application scope is active during any Java EE web service
invocation</text>
- </assertion>
-
- <assertion id="d">
- <text>The application scope is active during any asynchronous observer method
notification</text>
- </assertion>
-
- <assertion id="e">
- <text>The application scope is active during any remote method invocation of
any EJB</text>
- </assertion>
-
- <assertion id="f">
- <text>The application scope is active during any call to an EJB timeout
method</text>
- </assertion>
-
- <assertion id="g">
- <text>The application scope is active during message delivery to any EJB
message-driven bean</text>
- </assertion>
-
- <assertion id="h">
- <text>The application context is shared between all servlet requests that
execute within the same application</text>
- </assertion>
-
- <assertion id="i">
- <text>The application context is shared between all asynchronous observer
method notifications that execute within the same application</text>
- </assertion>
-
- <assertion id="j">
- <text>The application context is shared between all web service invocations
that execute within the same application</text>
- </assertion>
-
- <assertion id="k">
- <text>The application context is shared between all EJB remote method
invocations that execute within the same application</text>
- </assertion>
-
- <assertion id="l">
- <text>The application context is shared between all EJB timeouts that
execute
-within the same application</text>
- </assertion>
-
- <assertion id="m">
- <text>The application context is shared between all message deliveries to
message driven beans that execute within the same application</text>
- </assertion>
-
- <assertion id="n">
- <text>The application context is destroyed when the application is
undeployed</text>
- </assertion>
- </section>
-
- <section id="8.5.4" title="Conversation context lifecycle">
-
- <assertion id="a">
- <text>For a JSF faces request, the conversation context is active from the
beginning of the apply request values phase, until the response is complete</text>
- </assertion>
-
- <assertion id="b">
- <text>For a JSF non-faces request, the context is active during the render
response phase</text>
- </assertion>
-
- <assertion id="c">
- <text>Any JSF request has exactly one associated conversation</text>
- </assertion>
-
- <assertion id="d">
- <text>The conversation associated with a JSF request is determined at the end
of the restore view phase and does not change during the request</text>
- </assertion>
-
- <assertion id="e">
- <text>By default, a conversation is transient</text>
- </assertion>
-
- <assertion id="f">
- <text>A transient conversation may be marked long-running by calling
Conversation.begin()</text>
- </assertion>
-
- <assertion id="g">
- <text>A long-running conversation may be marked transient by calling
Conversation.end()</text>
- </assertion>
-
- <assertion id="ha">
- <text>All long-running conversations have a string-valued unique identifier,
_which may be set by the application_ when the conversation is marked long-running~, or
generated by the container~</text>
- </assertion>
-
- <assertion id="hb">
- <text>All long-running conversations have a string-valued unique identifier,
~which may be set by the application when the conversation is marked long-running,~ or
generated by the container</text>
- </assertion>
-
- <assertion id="ia">
- <text>The container provides a built-in bean with bean type
javax.context.Conversation~, scope @RequestScoped, deployment type @Standard and binding
@Current, named javax.context.conversation~</text>
- </assertion>
-
- <assertion id="ib">
- <text>The container provides a built-in bean with ~bean type
javax.context.Conversation~, scope @RequestScoped~, deployment type @Standard and binding
@Current, named javax.context.conversation~</text>
- </assertion>
-
- <assertion id="ic">
- <text>The container provides a built-in bean with~ bean type
javax.context.Conversation, scope @RequestScoped,~ deployment type @Standard~ and binding
@Current, named javax.context.conversation~</text>
- </assertion>
-
- <assertion id="id">
- <text>The container provides a built-in bean with bean type
~javax.context.Conversation, scope @RequestScoped, deployment type @Standard and~ binding
@Current~, named javax.context.conversation~</text>
- </assertion>
-
- <assertion id="ie">
- <text>The container provides a built-in bean with bean type
~javax.context.Conversation, scope @RequestScoped, deployment type @Standard and binding
@Current,~ named javax.context.conversation</text>
- </assertion>
-
- <assertion id="j">
- <text>If the conversation associated with the current JSF request is in the
transient state at the end of a JSF request, it is destroyed, and the conversation context
is also destroyed</text>
- </assertion>
-
- <assertion id="k">
- <text>If the conversation associated with the current JSF request is in the
long-running state at the end of a JSF request, it is not destroyed</text>
- </assertion>
-
- <assertion id="l">
- <text>The long-running conversation context associated with a request that
renders a JSF view is automatically propagated to any faces request (JSF form submission)
that originates from that rendered page</text>
- </assertion>
-
- <assertion id="m">
- <text>The long-running conversation context associated with a request that
results in a JSF redirect (via a navigation rule) is automatically propagated to the
resulting non-faces request, and to any other subsequent request to the same URL. This is
accomplished via use of a GET request parameter named cid containing the unique identifier
of the conversation</text>
- </assertion>
-
- <assertion id="n">
- <text>The long-running conversation associated with a request may be
propagated to any non-faces request via use of a GET request parameter named cid
containing the unique identifier of the conversation. In this case, the application must
manage this request parameter</text>
- </assertion>
-
- <assertion id="o">
- <text>When no conversation is propagated to a JSF request, the request is
associated with a new transient conversation</text>
- </assertion>
-
- <assertion id="p">
- <text>All long-running conversations are scoped to a particular HTTP servlet
session and may not cross session boundaries</text>
- </assertion>
-
- <assertion id="q">
- <text>When the HTTP servlet session is invalidated, all long-running
conversation contexts created during the current session are destroyed</text>
- </assertion>
-
- <assertion id="r" testable="false">
- <text>The container is permitted to arbitrarily destroy any long-running
conversation that is associated with no current JSF request, in order to conserve
resources</text>
- <note>In other words, this is unspecified</note>
- </assertion>
-
- <assertion id="s">
- <text>If the propagated conversation cannot be restored, the request is
associated with a new transient conversation</text>
- </assertion>
-
- <assertion id="t" testable="false">
- <text>The method Conversation.setTimeout() is a hint to the container that a
conversation should not be destroyed if it has been active within the last given interval
in milliseconds</text>
- <note>Not required</note>
- </assertion>
-
- <assertion id="u" testable="false">
- <text>The container ensures that a long-running conversation may be
associated with at most one request at a time, by blocking or rejecting concurrent
requests</text>
- <note>Cannot test as their as what happens is not well defined</note>
- </assertion>
- </section>
-
- <section id="8.6" title="Context management for custom
scopes">
-
- <assertion id="a">
- <text>A custom implementation of Context may be associated with any scope
type at any point in the execution of the application, by calling
Manager.addContext()</text>
- </assertion>
-
- <assertion id="b">
- <text>Every time Manager.getInstance() is called, for example, during
instance or EL name resolution, the container must call Manager.getContext() to retrieve
an active context object associated with the bean scope</text>
- </assertion>
-
- <assertion id="c">
- <text>If no active context object exists for the given scope type,
Manager.getContext() must throw a ContextNotActiveException</text>
- </assertion>
-
- <assertion id="d">
- <text>If more than one active context object exists for the given
-scope type, Manager.getContext() must throw an IllegalStateException</text>
- </assertion>
- </section>
-
- <!-- <section id="9" title="XML based metadata">
- <assertion id="a">
- <text>XML-based bean declarations define additional beans?they do not
redefine or disable any bean that was declared via annotations</text>
- </assertion>
-
- <assertion id="b">
- <text>Multiple namespaces are accommodated, each representing a Java
package</text>
- </assertion>
-
- <assertion id="c">
- <text>XML elements belonging to these namespaces represent Java types, fields
and methods</text>
- </assertion>
-
- <assertion id="d">
- <text>Each namespace may declare an XML schema</text>
- </assertion>
-
- <assertion id="e">
- <text>If a beans.xml file contains any XML element without a declared
namespace, a DefinitionException is thrown by the container at deployment
time</text>
- </assertion>
-
- </section>
-
- <section id="9.1" title="XML namespace for a Java package">
- <assertion id="a">
- <text>Every Java package has a corresponding XML namespace. The namespace URN
consists of the package name, with the prefix urn:java:</text>
- </assertion>
-
- <assertion id="b">
- <text>Each namespace may, optionally, have a schema</text>
- </assertion>
-
- <assertion id="c">
- <text>An XML element belonging to such a namespace represents a Java type in
the corresponding Java package, or a method or field of a type in that
package</text>
- </assertion>
-
- <assertion id="d">
- <text>If there is a Java type in the package with the same name as the XML
element, the XML element can be interpreted to represent that Java type</text>
- </assertion>
-
- <assertion id="e">
- <text>Type parameters may be specified by child elements of the element that
represents the type</text>
- </assertion>
-
- <assertion id="f">
- <text>Members of a type may be specified by child elements of the element
that represents the type, in the same namespace as the element that represents the
type</text>
- </assertion>
-
- </section>
-
- <section id="9.2" title="XML namespace aggregating multiple
packages">
- <assertion id="a">
- <text>Alternatively, a namespace may represent several Java packages. Such a
namespace must have a URN consisting of the prefix urn:java: followed by a
period-separated list of valid Java identifiers</text>
- </assertion>
-
- <assertion id="b">
- <text>The list of packages for such a namespace must be defined in a
classpath resource named namespace in the path named by the identifier list</text>
- </assertion>
-
- <assertion id="c">
- <text>The format of the file is a list of packages, separated by
whitespace</text>
- </assertion>
-
- <assertion id="d">
- <text>An XML element belonging to such a namespace represents a Java type in
one of the listed packages, or a method or field of a type in one of the listed
packages</text>
- </assertion>
-
- <assertion id="e">
- <text>If there are multiple packages containing a Java type with the same
name as the XML element, a DefinitionException is thrown by the container at deployment
time</text>
- </assertion>
-
- <assertion id="f">
- <text>If there is exactly one Java type in the listed packages with the same
name as the XML element, the XML element can be interpreted to represent that Java
type</text>
- </assertion>
- </section>
-
- <section id="9.2.1" title="The Java EE namespace">
- <assertion id="a">
- <text>The Java EE namespace urn:java:ee represents the following packages:
java.lang, java.util, javax.annotation, javax.inject, javax.context, javax.interceptor,
javax.decorator, javax.event, javax.ejb, javax.persistence, javax.xml.ws, javax.jms, and
javax.sql</text>
- </assertion>
-
- <assertion id="b">
- <text>Several elements in the urn:java:ee namespace do not represent Java
types</text>
- </assertion>
-
- <assertion id="c">
- <text>The root <Beans> element, together with the
<Deploy>, <Interceptors> and <Decorators>
elements belong to the namespace urn:java:ee and do not represent Java types nor members
of Java types</text>
- </assertion>
-
- <assertion id="d">
- <text>Java array types may be represented by an <Array> element
in the namespace urn:java:ee, with a child element representing the element
type</text>
- </assertion>
-
- <assertion id="e">
- <text>Primitive types may be represented by the XML element that represents
the corresponding wrapper type in java.lang, since primitive and wrapper types are
considered identical for the purposes of typesafe resolution, and assignable for the
purposes of injection</text>
- </assertion>
- </section>
-
- <section id="9.3" title="Standard schema location for a
namespace">
- <assertion id="a">
- <text>The container must validate all namespaces for which schemas are
available in the classpath</text>
- </assertion>
-
- <assertion id="b">
- <text>The container searches for a schema for each namespace in the classpath
directory corresponding to the namespace</text>
- </assertion>
-
- <assertion id="c">
- <text>The schema must be named schema.xsd</text>
- </assertion>
- </section>
-
- <section id="9.4" title="Stereotype, binding type and interceptor
binding type declarations">
- <assertion id="a">
- <text>An XML element that appears as a direct child of the root
<Beans> element is interpreted as a binding type declaration if it has a
direct child <BindingType> element in the Java EE namespace, as defined in
Section 2.3.2, "Defining new binding types"</text>
- </assertion>
-
- <assertion id="b">
- <text>An XML element that appears as a direct child of the root
<Beans> element is interpreted as an interceptor binding type if it has a
direct child <InterceptorBindingType> element in the Java EE namespace, as
defined in Section A.3.4, "Interceptor bindings"</text>
- </assertion>
-
- <assertion id="c">
- <text>An XML element that appears as a direct child of the root
<Beans> element is interpreted as a stereotype declaration if it has a
direct child <Stereotype> element in the Java EE namespace, as defined in
Section 2.7.1, "Defining new stereotypes"</text>
- </assertion>
-
- <assertion id="d">
- <text>The XML element is interpreted as a Java type. If no such Java type
exists in the classpath, a DefinitionException is thrown by the container at deployment
time. If the type is not an annotation type, a DefinitionException is thrown by the
container at deployment time</text>
- </assertion>
-
- <assertion id="e">
- <text>If the annotation type is already declared as a binding type using
annotations, the annotations are ignored by the container and the XML-based declaration is
used</text>
- </assertion>
-
- <assertion id="f">
- <text>If the annotation type is already declared as an interceptor binding
type using annotations, the annotations are ignored by the container and the XML-based
declaration is used</text>
- </assertion>
-
- <assertion id="g">
- <text>If the annotation type is already declared as a stereotype using
annotations, the annotations are ignored by the container and the XML-based declaration is
used</text>
- </assertion>
-
- <assertion id="h">
- <text>If a certain annotation type is declared more than once as a binding
type, interceptor binding type or stereotype using XML, a DeploymentException is thrown by
the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="9.4.1" title="Child elements of a stereotype
declaration">
- <assertion id="a">
- <text>Every direct child element of a stereotype declaration is interpreted
as a Java type</text>
- </assertion>
-
- <assertion id="b">
- <text>If no such Java type exists in the classpath, a DefinitionException is
thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="c">
- <text>If the type is not an annotation type, a DefinitionException is thrown
by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>If the annotation type is a scope type, the default scope of the
stereotype was declared</text>
- </assertion>
-
- <assertion id="e">
- <text>If the annotation type is a deployment type, the default scope of the
stereotype was declared</text>
- </assertion>
-
- <assertion id="f">
- <text>If the annotation type is a interceptor binding type, an interceptor
binding of the stereotype was declared</text>
- </assertion>
-
- <assertion id="g">
- <text>If the annotation type is javax.annotation.Named, a stereotype with
name defaulting was declared</text>
- </assertion>
-
- <assertion id="h">
- <text>Otherwise, a DefinitionException is thrown by the container at
deployment time</text>
- </assertion>
- </section>
-
- <section id="9.4.2" title="Child elements of an interceptor binding
type declaration">
- <assertion id="a">
- <text>Every direct child element of an interceptor binding type declaration
is interpreted as a Java type</text>
- </assertion>
-
- <assertion id="b">
- <text>If no such Java type exists in the classpath, a DefinitionException is
thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="c">
- <text>If the type is not an annotation type, a DefinitionException is thrown
by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>If the annotation type is an interceptor binding type, an inherited
interceptor binding was declared, as defined in Section A.3.4.1, "Interceptor binding
types with additional interceptor bindings"</text>
- </assertion>
-
- <assertion id="e">
- <text>If the annotation type is not an interceptor binding type, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- </section>
-
- <section id="9.5" title="Bean declarations">
-
- <assertion id="a">
- <text>An XML element that appears as a direct child of the root
<Beans> element is interpreted as a bean declaration if it is not a
<Deploy>, <Interceptors> or <Decorators> element
in the Java EE namespace, and does not have a direct child
<BindingType>,<InterceptorBindingType> or
<Stereotype> element in the Java EE namespace</text>
- </assertion>
-
- <assertion id="b">
- <text>The name of the XML element is interpreted as a Java type. The
container inspects the Java type and other metadata to determine what kind of bean is
being declared. If no such Java type exists in the classpath, a DefinitionException is
thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="c">
- <text>If the type is javax.jms.Queue or javax.jms.Topic, it declares a JMS
resource, as defined in Section 3.7.2, "Declaring a JMS resource using
XML"</text>
- </assertion>
-
- <assertion id="d">
- <text>If the element has a child <Resource>,
<PersistenceContext>, <PersistenceUnit>, <EJB>
or <WebServiceRef> element, it declares a resource, as defined in Section
3.6.1, "Declaring a resource using XML"</text>
- </assertion>
-
- <assertion id="e">
- <text>If the type is an EJB bean class, a session bean was declared, as
defined in Section 3.3.5, "Declaring a session bean using XML"</text>
- </assertion>
-
- <assertion id="f">
- <text>If the type is a concrete class, is not an EJB bean class, and is not a
parameterized type, a simple bean was declared, as defined in Section 3.2.4,
"Declaring a simple bean using XML"</text>
- </assertion>
-
- <assertion id="g">
- <text>Otherwise, a DefinitionException is thrown by the container at
deployment time</text>
- </assertion>
-
- <assertion id="h">
- <text>Inline bean declarations may occur at injection points, as defined in
Section 9.9, "Inline bean declarations". Inline bean declarations always declare
simple beans</text>
- </assertion>
-
- </section>
-
- <section id="9.5.1" title="Child elements of a bean
declaration">
- <assertion id="a">
- <text>If the child element can be interpreted as a Java annotation type, the
container interprets the child element as declaring type-level metadata</text>
- </assertion>
-
- <assertion id="b">
- <text>If the child element can be interpreted as a Java class or interface,
the container interprets the child element as declaring a parameter of the bean
constructor</text>
- </assertion>
-
- <assertion id="c">
- <text>If the child element namespace is the same as the namespace of the
parent, the container interprets the element as declaring a method or field of the
bean</text>
- </assertion>
-
- <assertion id="d">
- <text>If the name of the child element matches the name of both a method and
a field of the bean class, a DefinitionException is thrown by the container at deployment
time</text>
- </assertion>
-
- <assertion id="e">
- <text>If the name of the child element matches the name of a method of the
bean class, is it interpreted to represent that method</text>
- </assertion>
-
- <assertion id="f">
- <text>If the name of the child element matches the name of a field of the
bean class, is it interpreted to represent that field</text>
- </assertion>
-
- <assertion id="g">
- <text>Otherwise, a DefinitionException is thrown by the container at
deployment time</text>
- </assertion>
- </section>
-
- <section id="9.5.2" title="Type-level metadata for a bean">
- <assertion id="a">
- <text>Type-level metadata is specified via direct child elements of the bean
declaration that represent Java annotation types</text>
- </assertion>
-
- <assertion id="b">
- <text>The child element is interpreted as a Java annotation
type</text>
- </assertion>
-
- <assertion id="c">
- <text>If the annotation type is a deployment type, the deployment type of the
bean was declared, as defined in Section 2.5.4, "Declaring the deployment type of a
bean using XML"</text>
- </assertion>
-
- <assertion id="d">
- <text>If the annotation type is a scope type, the scope of the bean was
declared, as defined in Section 2.4.4, "Declaring the bean scope using
XML"</text>
- </assertion>
-
- <assertion id="e">
- <text>If the annotation type is a binding type, a binding of the bean was
declared, as defined in Section 2.3.4, "Declaring the bindings of a bean using
XML"</text>
- </assertion>
-
- <assertion id="f">
- <text>If the annotation type is an interceptor binding type, an interceptor
binding of the bean was declared, as defined in Section A.3.6.2, "Binding an
interceptor using XML"</text>
- </assertion>
-
- <assertion id="g">
- <text>If the annotation type is a stereotype, a stereotype of the bean was
declared, as defined in Section 2.7.3, "Declaring the stereotypes for a bean using
XML"</text>
- </assertion>
-
- <assertion id="h">
- <text>If the annotation type is javax.annotation.Name, the name of the bean
was declared, as defined in Section 2.6.2, "Declaring the bean name using
XML"</text>
- </assertion>
-
- <assertion id="i">
- <text>If the annotation type is javax.inject.Specializes, the bean was
declared to directly specialize the bean with the same bean class that was defined using
annotations, as specified in Section 3.2.7, "Specializing a simple bean" and
Section 3.3.7, "Specializing a session bean"</text>
- </assertion>
-
- <assertion id="j">
- <text>If the annotation type is javax.inject.Realizes, the bean was declared
to realize the bean with the same bean class that was defined using
annotations</text>
- </assertion>
-
- <assertion id="k">
- <text>If the annotation type is javax.interceptor.Interceptor, or
javax.decorator.Decorator the bean is an interceptor or decorator, as defined in Section
9.7, "Interceptor and decorator declarations"</text>
- </assertion>
-
- <assertion id="l">
- <text>If the annotation type is javax.annotation.Resource, javax.ejb.EJB,
javax.xml.ws.WebServiceRef, javax.persistence.PersistenceContext or
javax.persistence.PersistenceUnit, the metadata for a resource or JMS resource was
declared, as defined in Section 3.6.1, "Declaring a resource using XML" and
Section 3.7.2, "Declaring a JMS resource using XML"</text>
- </assertion>
-
- <assertion id="m">
- <text>Otherwise, a DefinitionException is thrown by the container at
deployment time</text>
- </assertion>
- </section>
-
- <section id="9.5.3" title="Bean constructor declarations">
- <assertion id="a">
- <text>The bean constructor for a simple bean is declared by the list of
direct child elements of the bean declaration that represent Java class or interface
types</text>
- </assertion>
-
- <assertion id="b">
- <text>The container interprets these elements as declaring parameters of the
constructor</text>
- </assertion>
-
- <assertion id="c">
- <text>Each constructor parameter declaration is interpreted as an injection
point declaration, as specified in Section 9.8, "Injection point
declarations"</text>
- </assertion>
-
- <assertion id="d">
- <text>If the simple bean class has exactly one constructor such that the
constructor has the same number of parameters as the bean declaration has constructor
parameter declarations, and the Java type represented by each constructor parameter
declaration is assignable to the Java type of the corresponding constructor parameter then
the element is interpreted to represent that constructor, and that constructor is the bean
constructor</text>
- </assertion>
-
- <assertion id="e">
- <text>If more than one constructor exists which satisfies these conditions, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="f">
- <text>If no constructor of the simple bean class satisfies these conditions,
a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="g">
- <text>For any constructor parameter, the bean type declared in XML may be a
subtype of the Java parameter type. In this case, the container will use the bean type
declared in XML when resolving the dependency</text>
- </assertion>
- </section>
-
- <section id="9.5.4" title="Fields of a bean">
- <assertion id="a">
- <text>A field of a bean is declared by a direct child element of the bean
declaration. The name of the field is the same as the name of the element</text>
- </assertion>
-
- <assertion id="b">
- <text>If the bean class has exactly one field with the same name as the child
element, then the child element is interpreted to represent that field</text>
- </assertion>
-
- <assertion id="c">
- <text>If the bean class does not have exactly one field with the specified
name, a DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>If more than one child element of a bean declaration represents the
same field of the bean class, a DefinitionException is thrown by the container at
deployment time</text>
- </assertion>
-
- <assertion id="e">
- <text>A field declaration may contain child elements</text>
- </assertion>
-
- <assertion id="f">
- <text>If a field declaration has more than one direct child element, and at
least
-one of these elements is something other than a <value> element in the Java
EE namespace, a DefinitionException is thrown by the container at deployment
time</text>
- </assertion>
-
- <assertion id="g">
- <text>An element that represents a field may declare an injected field, a
producer field or a field with an initial value</text>
- </assertion>
-
- <assertion id="h">
- <text>If the element contains a child <Produces> element in the
Java EE namespace, a producer field was declared, as defined in Section 3.5.3,
"Declaring a producer field using XML"</text>
- </assertion>
-
- <assertion id="i">
- <text>If the element contains a child <value> element in the
Java EE namespace, a field with an initial value of type Set or List was declared, as
defined in Section 9.5.5, "Field initial value declarations"</text>
- </assertion>
-
- <assertion id="j">
- <text>If the element has exactly one child element, an injected field was
declared, as defined in Section 3.8.2, "Declaring an injected field using
XML"</text>
- </assertion>
-
- <assertion id="k">
- <text>If the element has a non-empty body, and no child elements, a field
with an initial value was declared, as defined in Section 9.5.5, "Field initial value
declarations"</text>
- </assertion>
-
- <assertion id="l">
- <text>Otherwise, a DefinitionException is thrown by the container at
deployment time</text>
- </assertion>
-
- <assertion id="m">
- <text>If a field declaration represents an injected field, the child element
is interpreted as an injection point declaration, as specified in Section 9.8,
"Injection point declarations"</text>
- </assertion>
-
- <assertion id="n">
- <text>If the declared type is not assignable to the Java type of the field, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="o">
- <text>The bean type declared in XML may be a subtype of the Java field type.
In this case, the container will use the bean type declared in XML when resolving the
dependency</text>
- </assertion>
-
- </section>
-
- <section id="9.5.5" title="Field initial value
declarations">
- <assertion id="a">
- <text>The initial value of a field of a simple bean or session bean with any
one of the following types may be specified in XML: any primitive type, or java.lang
wrapper type, any enumerated type, java.lang.String, java.util.Date, java.sql.Date,
java.sql.Time or java.sql.Timestamp, java.util.Calendar, java.math.BigDecimal or
java.math.BigInteger, java.lang.Class, java.util.List<java.lang.String> or
java.util.Set<java.lang.String>,
java.util.List<java.lang.Class> or
java.util.Set<java.lang.Class>, java.util.List<X> or
java.util.Set<X> where X is an enumerated type</text>
- </assertion>
-
- <assertion id="b">
- <text>The initial value of the field is specified in the body of an XML
element representing the field</text>
- </assertion>
-
- <assertion id="c">
- <text>The initial value of a field of primitive type or java.lang wrapper
type is specified using the Java literal syntax for that type</text>
- </assertion>
-
- <assertion id="d">
- <text>The initial value of a field of type java.lang.String is specified
using the string value</text>
- </assertion>
-
- <assertion id="e">
- <text>The initial value of a field of enumerated type is specified using the
unqualified name of the enumeration value</text>
- </assertion>
-
- <assertion id="f">
- <text>The initial value of a field of type java.util.Date, java.sql.Date,
java.sql.Time, java.sql.Timestamp or java.util.Calendar is specified using a format that
can be parsed by calling
-java.text.DateFormat.getDateTimeInstance().parse()</text>
- </assertion>
-
- <assertion id="g">
- <text>The initial value of a field of type java.math.BigDecimal or
java.math.BigInteger is specified using a format that can be parsed by the constructor
that accepts a string</text>
- </assertion>
-
- <assertion id="h">
- <text>The initial value of a field of type java.lang.Class is specified using
the fully qualified Java class name</text>
- </assertion>
-
- <assertion id="i">
- <text>The initial value of a field of type java.util.List or java.util.Set is
specified by a list of <value> elements. The body of the value element is
specified using the string value, fully qualified Java class name or unqualified name of
the enumeration value</text>
- </assertion>
-
- <assertion id="j">
- <text>If a field with an initial value specified in XML is not of one of the
listed types, or if the initial value is not specified in the correct format for the type
of the field, a DefinitionException is thrown by the container at deployment
time</text>
- </assertion>
-
- <assertion id="k">
- <text>If an element representing a field specifies both an initial value and
a type declaration, a DefinitionException is thrown by the container at deployment
time</text>
- </assertion>
- </section>
-
- <section id="9.5.6" title="Methods of a bean">
- <assertion id="a">
- <text>A method of a bean is declared by a direct child element of the bean
declaration. The name of the declared method is the same as the name of the child
element</text>
- </assertion>
-
- <assertion id="b">
- <text>A method declaration may have any number of direct child
elements</text>
- </assertion>
-
- <assertion id="c">
- <text>The container inspects the direct child elements of the method
declaration. For each child element, the element is interpreted as a Java type. If no such
Java type exists in the classpath, a DefinitionException is thrown by the container at
deployment time</text>
- </assertion>
-
- <assertion id="d">
- <text>If the type is javax.inject.Disposes, the container searches for a
direct child element of the child element and interprets that element as declaring a
disposed parameter of the disposal method</text>
- </assertion>
-
- <assertion id="e">
- <text>If the type is javax.event.Observes, the container searches for a
direct child element of the child element that is not an <IfExists>,
<Asynchronously>, <AfterTransactionCompletion>,
<AfterTransactionSuccess>, <AfterTransactionFailure> or
<BeforeTransactionCompletion> element in the Java EE namespace, and
interprets that element as declaring an event parameter of the observer
method</text>
- </assertion>
-
- <assertion id="f">
- <text>If the type is some other Java annotation type, the container
interprets the child element as declaring method-level metadata</text>
- </assertion>
-
- <assertion id="g">
- <text>If the type is a Java class or interface, the container interprets the
child element as declaring a parameter of the method</text>
- </assertion>
-
- <assertion id="h">
- <text>Otherwise, a DefinitionException is thrown by the container at
deployment time</text>
- </assertion>
-
- <assertion id="i">
- <text>If a method declaration has more than one direct child element which is
an <Initializer>, <Produces>, <Disposes> or
<Observes> element in the Java EE namespace, a DefinitionException is thrown
by the container at deployment time</text>
- </assertion>
-
- <assertion id="j">
- <text>If a <Disposes> element does not contain exactly one
direct child element, a DefinitionException is thrown by the container at deployment
time</text>
- </assertion>
-
- <assertion id="k">
- <text>If an <Observes> element does not contain exactly one
direct child element that is not an <IfExists>,
<Asynchronously>, <AfterTransactionCompletion>,
<AfterTransactionSuccess>, <AfterTransactionFailure> or
<BeforeTransactionCompletion> element in the Java EE namespace, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="l">
- <text>Each method parameter declaration and disposed parameter declaration is
interpreted as an injection point declaration, as specified in Section 9.8,
"Injection point declarations". An event parameter declaration is interpreted as
a type declaration, as defined in Section 9.10, "Specifying bean types and
bindings"</text>
- </assertion>
-
- <assertion id="m">
- <text>If the bean class has exactly one method such that the method name is
the same as the name of the element that declares the method, the method has the same
number of parameters as the element that declares the method has child elements, and the
Java type represented by each method parameter declaration is assignable to the Java type
of the corresponding method parameter, then the element is interpreted to represent that
method</text>
- </assertion>
-
- <assertion id="n">
- <text>If more than one method exists which satisfies these conditions, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="o">
- <text>If no method of the bean class satisfies these conditions, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="p">
- <text>For any method parameter, the bean type declared in XML may be a
subtype of the Java parameter type. In this case, the container will use the bean type
declared in XML when resolving the dependency</text>
- </assertion>
-
- <assertion id="q">
- <text>If more than one child element of a bean declaration represents the
same method of the bean class, a DefinitionException is thrown by the container at
deployment time</text>
- </assertion>
-
- <assertion id="r">
- <text>An element that represents a method may declare an initializer method,
an observer method, a producer method or a disposal method. Alternatively, or
additionally, it may declare method-level interceptor binding</text>
- </assertion>
-
- <assertion id="s">
- <text>If the element contains a child <Initializes> element in
the Java EE namespace, an initializer method was declared, as defined in Section 3.9.2,
"Declaring an initializer method using XML"</text>
- </assertion>
-
- <assertion id="t">
- <text>If the element contains a child <Produces> element in the
Java EE namespace, a producer method was declared, as defined in Section 3.4.3,
"Declaring a producer method using XML"</text>
- </assertion>
-
- <assertion id="u">
- <text>If the element contains a child <Disposes> element in the
Java EE namespace, a disposal method was declared, as defined in Section 3.4.9,
"Declaring a disposal method using XML"</text>
- </assertion>
-
- <assertion id="v">
- <text>If the element contains a child <Observes> element in the
Java EE namespace, an observer method was declared, as defined in Section 7.5.3,
"Declaring an observer method using XML"</text>
- </assertion>
-
- <assertion id="w">
- <text>If the element contains a child element which can be interpreted as an
interceptor binding type, method-level interceptor binding was declared, as defined in
Section A.3.6.2, "Binding an interceptor using XML"</text>
- </assertion>
- </section>
-
- <section id="9.6" title="Producer method and field
declarations">
- <assertion id="a">
- <text>A producer method or field declaration is formed by adding a direct
child <Produces> element to an element that represents the method or field,
as defined in Section 3.4.3, "Declaring a producer method using XML" and Section
3.5.3, "Declaring a producer field using XML"</text>
- </assertion>
-
- </section>
-
- <section id="9.6.1" title="Child elements of a producer field
declaration">
- <assertion id="a">
- <text>The container inspects the direct child elements of a producer field
declaration</text>
- </assertion>
-
- <assertion id="b">
- <text>If there is more than one direct child element, a DefinitionException
is thrown by the container at deployment time</text>
- </assertion>
-
- <assertion id="c">
- <text>Otherwise, the direct child element is a <Produces>
element in the Java EE namespace, and declares the return type, bindings and member-level
metadata of the producer field</text>
- </assertion>
-
- <assertion id="d">
- <text>The container inspects the direct child elements of the
<Produces> element. For each child element, the element is interpreted as a
Java type. If no such Java type exists in the classpath, a DefinitionException is thrown
by the container at deployment time</text>
- </assertion>
-
- <assertion id="e">
- <text>If the type is a Java class or interface type, the type of the producer
field was declared</text>
- </assertion>
-
- <assertion id="f">
- <text>If the type is a Java annotation type, it declares member-level
metadata of the producer field</text>
- </assertion>
-
- <assertion id="g">
- <text>Otherwise, a DefinitionException is thrown by the container at
deployment time</text>
- </assertion>
-
- <assertion id="h">
- <text>If more than one child element represents a Java class or interface
type, or if no child element represents a Java class or interface type, a
DefinitionException is thrown by the container at deployment time</text>
- </assertion>
- </section>
-
- <section id="9.6.2" title="Child elements of a producer method
declaration">
-
- </section>-->
-
-</specification>
Copied: tck/tags/1.0.0.ALPHA2/impl/src/main/resources/tck-audit.xml (from rev 1840,
tck/trunk/impl/src/main/resources/tck-audit.xml)
===================================================================
--- tck/tags/1.0.0.ALPHA2/impl/src/main/resources/tck-audit.xml
(rev 0)
+++ tck/tags/1.0.0.ALPHA2/impl/src/main/resources/tck-audit.xml 2009-03-09 00:18:30 UTC
(rev 1853)
@@ -0,0 +1,5689 @@
+<specification
+
xmlns="http://jboss.com/products/webbeans/tck/audit"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://jboss.com/products/webbeans/tck/audit
http://snapshots.jboss.org/maven2/org/hibernate/tck-utils-api/0.9-SNAPSHO...
+ name="JSR-299: Java Contexts and Dependency Injection"
+ version="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="ba">
+ <text>A bean type may be a parameterized type with an actual type
parameter.</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>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. If the type of an injection
point is a parameterized type with a type variable, a DefinitionException is thrown by the
container at deployment time.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Bean types may not declare a wildcard. If the type of an injection
point is a parameterized type with a wildcard, a DefinitionException is thrown by the
container at deployment time.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A bean type may be an interface</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A bean type may be a concrete class</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A bean type may be an abstract class</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>A bean type may be declared final</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>A bean type may have final methods</text>
+ </assertion>
+
+ <assertion id="j">
+ <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="k">
+ <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="l">
+ <text>All beans have the bean type java.lang.Object</text>
+ </assertion>
+
+ <assertion id="m">
+ <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" title="Bindings">
+
+ </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="aa">
+ <text>A binding type is a Java annotation defined as @Target({METHOD, FIELD,
PARAMETER, TYPE})~ and @Retention(RUNTIME)~.</text>
+ </assertion>
+
+ <assertion id="ab" testable="false">
+ <text>A binding type is a Java annotation defined as ~@Target({METHOD, FIELD,
PARAMETER, TYPE}) and ~(a)Retention(RUNTIME).</text>
+ <note>Non-runtime retention annotations are discarded by the
compiler</note>
+ </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" testable="false">
+ <text>A binding type may define annotation members</text>
+ <note>This is true by default in the JLS</note>
+ </assertion>
+ </section>
+
+ <section id="2.3.3" title="Declaring the bindings of a bean using
annotations">
+
+ <assertion id="a">
+ <text>A bean's bindings are declared by annotating the bean class with
the binding types</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A bean's bindings are declared by annotating the producer method
with the binding types</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A bean's bindings are declared by annotating the producer field
with the binding types</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Any bean may declare multiple binding types</text>
+ </assertion>
+ </section>
+
+ <section id="2.3.4" title="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 (see
Chapter 3, Bean implementation) to determine the bean instance that is passed when the
method is called by the container</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Binding types may be applied to parameters of initializer methods (see
Chapter 3, Bean implementation) to determine the bean instance that is passed when the
method is called by the container</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Binding types may be applied to parameters of disposal methods (see
Chapter 3, Bean implementation) to determine the bean instance that is passed when the
method is called by the container</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Binding types may be applied to parameters of bean constructors (see
Chapter 3, Bean implementation) to determine the bean instance that is passed when the
method is called by the container</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>For a bean defined in XML, the bindings of a method parameter may be
specified using XML</text>
+ </assertion>
+
+ <assertion id="f">
+ <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" testable="false">
+ <text>A scope type is represented by an annotation type.</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+
+ <assertion id="c" testable="false">
+ <text>The set of scope types is extensible</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+
+ </section>
+
+ <section id="2.4.1" title="Built-in scope types">
+ <assertion id="a" testable="false">
+ <text>The @RequestScoped, @ApplicationScoped and @SessionScoped annotations
defined in Section 8.5, "Context management for built-in scopes" represent the
standard scopes defined by the Java Servlets specification</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>The @ConversationScoped annotation represents the conversation scope
defined in Section 8.5.4, "Conversation context lifecycle".</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+
+ <assertion id="c" testable="false">
+ <text>The @Dependent pseudo-scope is for dependent objects, as defined in
Section 8.3, "Dependent pseudo-scope"</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+ </section>
+
+ <section id="2.4.2" title="Defining new scope types">
+ <assertion id="aa">
+ <text>A scope type is a Java annotation defined as @Target({TYPE, METHOD,
FIELD})~ and @Retention(RUNTIME)~</text>
+ </assertion>
+
+ <assertion id="ab" testable="false">
+ <text>A scope type is a Java annotation defined as ~@Target({TYPE, METHOD,
FIELD}) and ~@Retention(RUNTIME)</text>
+ <note>Non-runtime retention annotations are discarded by the
compiler</note>
+ </assertion>
+
+
+
+ <assertion id="b">
+ <text>All scope types must specify the @javax.context.ScopeType
meta-annotation</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.4.3" title="Declaring the bean scope using
annotations">
+ <assertion id="a">
+ <text>The bean's scope is defined by annotating the bean class or
producer method or field with a scope type</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A bean class or producer method or field may specify at most one scope
type annotation. If a bean class or producer method or field specifies multiple scope type
annotations, a DefinitionException is thrown by the container at deployment
time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A scope type may be specified using a stereotype annotation, as defined
in Section 2.7.2, "Declaring the stereotypes for a bean using
annotations"</text>
+ </assertion>
+ </section>
+
+ <section id="2.4.4" title="Declaring the bean scope using
XML">
+ <assertion id="a">
+ <text>If the bean is declared in beans.xml, the scope may be specified using
the scope annotation type name</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If more than one scope type is specified in XML, a DefinitionException
is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A scope 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.4.5" title="Default scope">
+ <assertion id="a">
+ <text>When no scope is explicitly declared by annotating the bean class or
producer method or field, or by using XML, the scope of a bean is defaulted</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the bean does not declare any stereotype with a declared default
scope, the default scope for the bean is @Dependent</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If all stereotypes declared by the bean that have some declared default
scope have the same default scope, then that scope is the default scope for the
bean</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If there are two different stereotypes declared by the bean that
declare different default scopes, then there is no default scope and the bean must
explicitly declare a scope. If it does not explicitly declare a scope, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a bean explicitly declares a scope, any default scopes declared by
stereotypes are ignored</text>
+ </assertion>
+ </section>
+
+ <section id="2.5" title="Deployment types">
+ <assertion id="a" testable="false">
+ <text>The set of deployment types is extensible</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+ </section>
+
+ <section id="2.5.1" title="Built-in deployment types">
+
+ <assertion id="a">
+ <text>All standard beans defined by this specification, and provided by the
container, are defined using the @Standard deployment type</text>
+ <note>This is tested in the test for each bean defined. See 5.6.1.za,
5.7.2.ca, 8.5.4.i</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>No bean may be declared with the @Standard deployment type unless
explicitly required by this specification</text>
+ </assertion>
+
+ <assertion id="c" testable="false">
+ <text>Application beans may be defined using the @Production deployment
type</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+
+ </section>
+
+ <section id="2.5.2" title="Defining new deployment types">
+
+ <assertion id="a">
+ <text>A deployment type is a Java annotation defined as @Target({TYPE,
METHOD, FIELD})</text>
+ </assertion>
+
+ <assertion id="bb" testable="false">
+ <text>A deployment type is a Java annotation defined with
@Retention(RUNTIME)</text>
+ <note>Non-runtime retention annotations are discarded by the
compiler</note>
+ </assertion>
+
+ <assertion id="c">
+ <text>All deployment types must also specify the @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</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The deployment type of the bean is declared by annotating the producer
method</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The deployment type of the bean is declared by annotating the
field</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>An bean class 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="e">
+ <text>A producer method 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="f">
+ <text>A 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="g">
+ <text>By default, if no deployment type annotation is explicitly specified, a
producer method inherits the deployment type of the bean in which it is
defined.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>By default, if no deployment type annotation is explicitly specified, a
producer field inherits the deployment type of the bean in which it is
defined.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>a deployment type may be specified using a stereotype annotation, as
defined in Section 2.7.2, "Declaring the stereotypes for a bean using
annotations".</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.5.4" title="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@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>
+
+ <assertion id="b">
+ <text>If a <Deploy> element is specified, only the explicitly
declared deployment types are enabled.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The @Standard deployment type must be declared. If the @Standard
deployment type is not declared, a DeploymentException is thrown by the container at
deployment time.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If no <Deploy> element is specified in any beans.xml
file, only the @Standard and @Production deployment types are enabled.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the <Deploy> element is specified in more than one
beans.xml document, a DeploymentException is thrown by the container at deployment time.
</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.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>To specify the name of a bean, the @javax.annotation.Named annotation
is applied to the producer method.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>To specify the name of a bean, the @javax.annotation.Named annotation
is applied to the producer field.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the @Named annotation does not specify the value member, the default
name is assumed</text>
+ </assertion>
+ </section>
+
+ <section id="2.6.2" title="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
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 a producer method
of a bean defined using annotations declares a @Named annotation and no name is explicitly
specified by the value member</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A default name must be assigned by the container when a producer 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="d">
+ <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="e">
+ <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 specify that all beans with the stereotype have
defaulted bean names</text>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>A bean may declare zero stereotypes</text>
+ <note>I can't see how to test this</note>
+ </assertion>
+
+ <assertion id="c">
+ <text>A bean may declare one stereotype</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A bean may declare multiple stereotypes</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.7.1" title="Defining new stereotypes">
+ <assertion id="aa">
+ <text>A beans stereotype is a Java annotation defined as @Target({TYPE,
METHOD, FIELD})~, @Target(TYPE), @Target(METHOD), @Target(FIELD) or @Target({METHOD,
FIELD}) and @Retention(RUNTIME)~</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>A beans stereotype is a Java annotation defined as ~@Target({TYPE,
METHOD, FIELD}),~ @Target(TYPE)~, @Target(METHOD), @Target(FIELD) or @Target({METHOD,
FIELD}) and @Retention(RUNTIME)~</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>A beans stereotype is a Java annotation defined as ~@Target({TYPE,
METHOD, FIELD}), @Target(TYPE), @Target(METHOD), ~@Target(FIELD) ~or @Target({METHOD,
FIELD}) and @Retention(RUNTIME)~</text>
+ </assertion>
+
+ <assertion id="ad">
+ <text>A beans stereotype is a Java annotation defined as ~@Target({TYPE,
METHOD, FIELD}), @Target(TYPE), @Target(METHOD), @Target(FIELD) or~ @Target({METHOD,
FIELD})~ and @Retention(RUNTIME)~</text>
+ </assertion>
+
+ <assertion id="ae" testable="false">
+ <text>A beans stereotype is a Java annotation defined as ~@Target({TYPE,
METHOD, FIELD}), @Target(TYPE), @Target(METHOD), @Target(FIELD) or @Target({METHOD,
FIELD}) and~ @Retention(RUNTIME)</text>
+ <note>Non-runtime retention annotations are discarded by the
compiler</note>
+ </assertion>
+
+
+
+ <assertion id="b">
+ <text>A stereotype may be declared by specifying the
@javax.annotation.Stereotype meta-annotation</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The @Stereotype meta-annotation may be omitted, and the stereotype may
be declared in beans.xml</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A stereotype may not declare any binding annotation. If a stereotype
declares a binding annotation, a DefinitionException is thrown by the container at
deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.1.1" title="Declaring the default scope and
deployment type for a stereotype">
+ <assertion id="a">
+ <text>A stereotype may declare at most one scope. If a stereotype declares
more than one scope, a DefinitionException is thrown by the container at deployment
time</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A stereotype may declare at most one deployment type. If a stereotype
declares more than one deployment type, a DefinitionException is thrown by the container
at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.1.2" title="Specifying interceptor bindings for a
stereotype">
+
+ <assertion id="a">
+ <text>A stereotype may declare zero interceptor bindings</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A stereotype may declare one interceptor binding</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A stereotype may declare multiple interceptor bindings</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.7.1.3" title="Specifying name defaulting for a
stereotype">
+ <assertion id="a">
+ <text>A stereotype may declare an empty @Named annotation. If a stereotype
declares a non-empty @Named annotation, a DefinitionException is thrown by the container
at deployment time</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A stereotype may specify that every bean with the stereotype has a
defaulted name when a name is not explicitly specified by the bean</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.1.4" title="Restricting bean scopes and types using
a stereotype">
+ <assertion id="a">
+ <text>Bean scopes may be restricted using a stereotype</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Bean types may be restricted using a stereotype</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Scope and type restrictions may not be specified when a stereotype is
declared in XML</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.1.5" title="Stereotypes with additional
stereotypes">
+ <assertion id="a">
+ <text>A stereotype may declare other stereotypes</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Stereotype declarations are transitive - a stereotype declared by a
second stereotype is inherited by all beans and other stereotypes that declare the second
stereotype</text>
+ </assertion>
+
+ <assertion id="c" >
+ <text>Stereotypes declared @Target(TYPE) may not be applied to stereotypes
declared @Target({TYPE, METHOD, FIELD})</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Stereotypes declared @Target(TYPE) may not be applied to stereotypes
declared @Target(METHOD)</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Stereotypes declared @Target(TYPE) may not be applied to stereotypes
declared @Target(FIELD)</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Stereotypes declared @Target(TYPE) may not be applied to stereotypes
declared @Target({METHOD, FIELD})</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.7.2" title="Declaring the stereotypes for a bean using
annotations">
+ <assertion id="a">
+ <text>Stereotype annotations may be applied to a bean class</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Stereotype annotations may be applied to a producer
method</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Stereotype annotations may be applied to a producer field</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>The default deployment type declared by the stereotype may be
overridden by the bean</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>The default scope declared by the stereotype may be overridden by the
bean</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Multiple stereotypes may be applied to the same bean</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.3" title="Declaring the stereotypes for a bean using
XML">
+ <assertion id="a">
+ <text>If the bean is declared in beans.xml, stereotypes may be declared using
the stereotype annotation type name</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.4" title="Stereotype restrictions">
+ <assertion id="a">
+ <text>If a stereotype declares a requiredType, and the bean types do not
include the type, a DefinitionException is thrown by the container at deployment
time</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If a stereotype explicitly declares a set of scope types using
supportedScopes, and the bean scope is not in that set, a DefinitionException is thrown by
the container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a bean declares multiple stereotypes, it must satisfy every
restriction declared by every declared stereotype</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.5" title="Built-in stereotypes">
+ <assertion id="a" testable="false">
+ <text>The built-in @Model stereotype is intended for use with beans that
define the model layer of an MVC web application architecture such as JSF</text>
+ <note>Tested by API signature test</note>
+ </assertion>
+
+ </section>
+
+ <section id="3" title="Bean Implementation">
+
+ </section>
+
+ <section id="3.1" title="Restriction upon bean
instantiation">
+ <assertion id="a">
+ <text>The bean class is a concrete class and is not required to implement any
special interface or extend any special superclass</text>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>If the application calls a producer method directly, instead of letting
the container call it, the returned object is not a contextual instance and the
capabilities listed in Section 2.1, "Functionality provided by the container to the
bean" will not be available to the returned object.</text>
+ </assertion>
+ </section>
+
+ <section id="3.2" title="Simple beans">
+ <assertion id="a">
+ <text>The bean class of a simple bean may not be a non-static inner
class</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The bean class of a simple bean may not be a parameterized
type</text>
+ </assertion>
+
+ <assertion id="ca">
+ <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="cb">
+ <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="d">
+ <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="e">
+ <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="fa">
+ <text>If a simple bean has a public field, it must have scope
@Dependent.</text>
+ <note>Check that a dependent scoped bean with a public field does
work</note>
+ </assertion>
+
+ <assertion id="fb">
+ <text>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="ba">
+ <text>A top-level Java class that is a static inner class can be a simple
bean</text>
+ </assertion>
+ <assertion id="ca">
+ <text>A top-level Java class is not a simple bean if it is an abstract
class</text>
+ </assertion>
+ <assertion id="cb">
+ <text>A top-level Java class is not a simple bean if it is an
interface</text>
+ </assertion>
+ <assertion id="cc">
+ <text>A top-level Java class can be a simple bean if it is static inner
class</text>
+ </assertion>
+ <assertion id="da">
+ <text>A top-level abstract Java class is a simple bean if it is annotated
@Decorator.</text>
+ </assertion>
+ <assertion id="db">
+ <text>A top-level interface Java class is a simple bean if it is annotated
@Decorator.</text>
+ </assertion>
+ <assertion id="e">
+ <text>A top-level Java class is not a simple bean if it is annotated with the
JPA @Entity annotation</text>
+ </assertion>
+ <assertion id="f">
+ <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="g">
+ <text>A top-level Java class is not a simple bean if it implements the
javax.servlet.Servlet interface</text>
+ </assertion>
+ <assertion id="h">
+ <text>A top-level Java class is not a simple bean if it implements the
javax.servlet.Filter interface</text>
+ </assertion>
+ <assertion id="i">
+ <text>A top-level Java class is not a simple bean if it implements the
javax.servlet.ServletContextListener interface</text>
+ </assertion>
+ <assertion id="j">
+ <text>A top-level Java class is not a simple bean if it implements the
javax.servlet.http.HttpSessionListener interface</text>
+ </assertion>
+ <assertion id="k">
+ <text>A top-level Java class is not a simple bean if it implements the
javax.servlet.ServletRequestListener interface</text>
+ </assertion>
+ <assertion id="l">
+ <text>A top-level Java class is not a simple bean if it implements the
javax.ejb.EnterpriseBean interface</text>
+ </assertion>
+ <assertion id="m">
+ <text>A top-level Java class is not a simple bean if it extends
javax.faces.component.UIComponent</text>
+ </assertion>
+ <assertion id="n">
+ <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="o">
+ <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="p">
+ <text>A top-level Java class is only a simple bean if it has an appropriate
constructor - a constructor with no parameters</text>
+ </assertion>
+ <assertion id="q">
+ <text>A top-level Java class is only a simple bean if it has an appropriate
constructor - a constructor annotated @Initializer</text>
+ </assertion>
+ <assertion id="r">
+ <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="ba">
+ <text>A bean class may also specify a scope~, name, deployment type,
stereotypes and/or bindings~</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>A bean class may also specify a ~scope,~ name~, deployment type,
stereotypes and/or bindings~</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>A bean class may also specify a ~scope, name, ~deployment type~,
stereotypes and/or bindings~</text>
+ </assertion>
+
+ <assertion id="bd">
+ <text>A bean class may also specify ~a scope, name, deployment type,
~stereotypes~ and/or bindings~</text>
+ </assertion>
+
+ <assertion id="be">
+ <text>A bean class may also specify ~a scope, name, deployment type,
stereotypes and/or~ bindings</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A 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 , 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 a non-static inner
class, a DefinitionException is thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>If the bean class of a simple bean defined in XML is a static inner
class, a DefinitionException is not thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <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="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>
+
+ <assertion id="g">
+ <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="ba">
+ <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 defined by annotations</text>
+ </assertion>
+ <assertion id="bb">
+ <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 initializer methods defined by annotations</text>
+ </assertion>
+ <assertion id="bc">
+ <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
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</text>
+ </assertion>
+ <assertion id="j">
+ <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
producer methods</text>
+ </assertion>
+ <assertion id="k">
+ <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
producer fields</text>
+ </assertion>
+ <assertion id="l">
+ <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
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>
+
+ </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, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a bean constructor has a parameter annotated @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 by the container if X is enabled.</text>
+ <note>This assertion relates to specialized beans declared using
annotations</note>
+ </assertion>
+
+ <assertion id="c">
+ <text>We say that X directly specializes Y, and we can be certain that Y will
never be called by the container if X is enabled.</text>
+ <note>This assertion relates to specialized beans declared using
annotations</note>
+ </assertion>
+
+ <assertion id="d">
+ <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="e">
+ <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>
+ </section>
+
+ <section id="3.2.8" title="Default name for a simple bean">
+ <assertion id="a" testable="false">
+ <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>
+ <note>This is a reference to the EJB specification</note>
+ </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, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the bean class of a session bean is annotated @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="da">
+ <text>If the application directly calls an EJB remove method of an instance
of a session bean that is a stateful session bean and has scope @Dependent then no
parameters are passed to the method by the container.</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>If the application directly calls an EJB remove method of an instance
of a session bean that is a stateful session bean and has scope @Dependent then the
container ignores the instance instead of destroying it when 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="ba">
+ <text>A bean class may also specify a scope~, name, deployment type,
stereotypes and/or bindings~</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>A bean class may also specify a ~scope, ~name~, deployment type,
stereotypes and/or bindings~</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>A bean class may also specify a ~scope, name, ~deployment type~,
stereotypes and/or bindings~</text>
+ </assertion>
+
+ <assertion id="bd">
+ <text>A bean class may also specify a ~scope, name, deployment type,
~stereotypes ~and/or bindings~</text>
+ </assertion>
+
+ <assertion id="be">
+ <text>A bean class may also specify a ~scope, name, deployment type,
stereotypes and/or~ bindings~</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A session bean class may extend another bean class</text>
+ </assertion>
+ </section>
+
+ <section id="3.3.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 bean class is declared in XML, a DefinitionException is
thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a 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="aa">
+ <text>Check that all enterprise beans have a @New bean</text>
+ <note>Sanity check</note>
+ </assertion>
+
+ <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</text>
+ </assertion>
+
+ <assertion id="j">
+ <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
producer methods</text>
+ </assertion>
+
+ <assertion id="k">
+ <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
producer fields</text>
+ </assertion>
+
+ <assertion id="l">
+ <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
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 by the container if X is enabled</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>We say that X directly specializes Y, and we can be certain that Y will
never be called by the container if X is enabled</text>
+ </assertion>
+
+ <assertion id="d">
+ <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="e">
+ <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 static</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A producer method may be non-static</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the bean is a session bean, the producer method must be either a
business method of the EJB or a static method of the bean class</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a producer method sometimes returns a null value, then the producer
method must have scope @Dependent</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If a producer method returns a null value at runtime, and the producer
method declares 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="g">
+ <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="h">
+ <text>If a producer method return type contains a wildcard type parameter, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If a producer method return type contains a type variable, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="j" testable="false">
+ <text>The application may call producer methods directly. However, if the
application calls a producer method directly, no parameters will be passed to the producer
method by the container; the returned object is not bound to any context; and its
lifecycle is not managed by the container</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>A bean may declare multiple producer methods</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.1" title="Bean types of a producer method">
+
+ <assertion id="a">
+ <text>If the return type of a producer method is an interface, the set of
bean types contains the return type, all interfaces it extends directly or indirectly and
java.lang.Object</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If a return type of a producer method is primitive or is a Java array
type, the set of bean types contains exactly two types: the method return type and
java.lang.Object</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the return type of a producer method is a class, the set of bean
types contains the return type, every superclass and all interfaces it implements directly
or indirectly</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.2" title="Declaring a producer method 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="ba">
+ <text>A producer method may specify a scope</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>A producer method may specify a name</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>A producer method may specify a deployment type</text>
+ </assertion>
+
+ <assertion id="bd">
+ <text>A producer method may specify stereotypes</text>
+ </assertion>
+
+ <assertion id="be">
+ <text>A producer method may specify a binding type</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a producer method is annotated @Initializer, a DefinitionException
is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a producer method has a parameter annotated @Disposes, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a producer 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 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, a DefinitionException is thrown by the
container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the method 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 static</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A disposal method may be non-static</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the bean is a session bean, the disposal method must be a business
method of the EJB or a static method of the bean class</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A bean may declare multiple disposal methods</text>
+ </assertion>
+ </section>
+
+ <section id="3.4.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 static</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A producer field may be nonstatic</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a producer field sometimes contains a null value when accessed, then
the producer field must have scope @Dependent</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a producer method contains a null value at runtime, and the producer
field declares any other scope, an IllegalProductException is thrown by the container.
This restriction allows the container to use a client proxy, as defined in Section 5.4,
"Client proxies"</text>
+ </assertion>
+
+ <assertion id="f">
+ <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="g">
+ <text>If a producer field return type contains a wildcard type parameter, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If a producer field return type contains a type variable, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="i" testable="false">
+ <text>The application may access producer fields directly. However, if the
application accesses a producer field directly, the returned object is not bound to any
context; and its lifecycle is not managed by the container</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+
+ <assertion id="j">
+ <text>A bean may declare multiple producer fields</text>
+ </assertion>
+ </section>
+
+ <section id="3.5.1" title="Bean types of a producer field">
+
+ <assertion id="a">
+ <text>The bean types of a producer field depend upon the field type. If the
field type is an interface, the set of bean types contains the field type, all interfaces
it extends directly or indirectly and java.lang.Object</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The bean types of a producer field depend upon the field type. If a
field type is primitive or is a Java array type, the set of bean types contains exactly
two types: the field type and java.lang.Object</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The bean types of a producer field depend upon the field type. If the
field type is a class, the set of bean types contains the field type, every superclass and
all interfaces it implements directly or indirectly</text>
+ </assertion>
+ </section>
+
+ <section id="3.5.2" title="Declaring a producer field using
annotations">
+
+ <assertion id="a">
+ <text>A producer field may be declared by annotating a field with the
@javax.inject.Produces annotation</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A producer field may specify a scope</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A producer field may specify a name</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A producer field may specify a deployment type</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A producer field may specify stereotypes</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A producer field may specify bindings</text>
+ </assertion>
+ </section>
+
+ <section id="3.5.3" title="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</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Resources may be declared in beans.xml, allowing direct injection of an
entity manager</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Resources may be declared in beans.xml, allowing direct injection of an
entity manager factory</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Resources may be declared in beans.xml, allowing direct injection of an
EJB remote object</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Resources may be declared in beans.xml, allowing direct injection of a
web service reference</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The lifecycle of an injected reference is identical to the semantics of
Java EE injection using @Resource</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The lifecycle of an injected reference is identical to the semantics of
Java EE injection using @PersistenceContext</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The lifecycle of an injected reference is identical to the semantics of
Java EE injection using @PersistenceUnit</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The lifecycle of an injected reference is identical to the semantics of
Java EE injection using @EJB</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The lifecycle of an injected reference is identical to the semantics of
Java EE injection using @WebServiceRef</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>A resource always has scope @Dependent</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>A resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="m" testable="false">
+ <text>Resources are always declared using XML</text>
+ <note>This is a statement of intent</note>
+ </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 id="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 id="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</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>JMS queue resources must allow the direct injection of the
QueueConnection</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>JMS queue resources must allow the direct injection of the
QueueSession</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>JMS queue resources must allow the direct injection of the
QueueReceiver</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>JMS queue resources must allow the direct injection of the
QueueSender</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>JMS topic resources must allow the direct injection of the
Topic</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>JMS topic resources must allow the direct injection of the
TopicConnection</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>JMS topic resources must allow the direct injection of the
TopicSession</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>JMS topic resources must allow the direct injection of the
TopicSubscriber</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>JMS topic resources must allow the direct injection of the
TopicPublisher</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>If the application calls close() on an instance of a QueueConnection,
an UnsupportedOperationException is thrown by the container.</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>If the application calls close() on an instance of a QueueSession, an
UnsupportedOperationException is thrown by the container.</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>If the application calls close() on an instance of a QueueReceiver, an
UnsupportedOperationException is thrown by the container.</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>If the application calls close() on an instance of a QueueSender, an
UnsupportedOperationException is thrown by the container.</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>If the application calls close() on an instance of a TopicConnection,
an UnsupportedOperationException is thrown by the container.</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>If the application calls close() on an instance of a TopicSession, an
UnsupportedOperationException is thrown by the container.</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>If the application calls close() on an instance of a TopicSubscriber,
an UnsupportedOperationException is thrown by the container.</text>
+ </assertion>
+
+ <assertion id="s">
+ <text>If the application calls close() on an instance of a TopicPublisher, an
UnsupportedOperationException is thrown by the container.</text>
+ </assertion>
+
+ <assertion id="t">
+ <text>A JMS Queue resource always has scope @Dependent</text>
+ </assertion>
+
+ <assertion id="u">
+ <text>A JMS QueueConnection resource always has scope
@Dependent</text>
+ </assertion>
+
+ <assertion id="v">
+ <text>A JMS QueueSession resource always has scope @Dependent</text>
+ </assertion>
+
+ <assertion id="w">
+ <text>A JMS QueueReceiver resource always has scope @Dependent</text>
+ </assertion>
+
+ <assertion id="x">
+ <text>A JMS QueueSender resource always has scope @Dependent</text>
+ </assertion>
+
+ <assertion id="y">
+ <text>A JMS Topic resource always has scope @Dependent</text>
+ </assertion>
+
+ <assertion id="z">
+ <text>A JMS TopicConnection resource always has scope
@Dependent</text>
+ </assertion>
+
+ <assertion id="aa">
+ <text>A JMS TopicSession resource always has scope @Dependent</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>A JMS TopicSubscriber resource always has scope
@Dependent</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>A JMS TopicPublisher resource always has scope @Dependent</text>
+ </assertion>
+
+ <assertion id="ad">
+ <text>A JMS Queue resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="ae">
+ <text>A JMS QueueConnection resource may not declare a bean
name</text>
+ </assertion>
+
+ <assertion id="af">
+ <text>A JMS QueueSession resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="ag">
+ <text>A JMS QueueReceiver resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="ah">
+ <text>A JMS QueueSender resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="ai">
+ <text>A JMS Topic resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="aj">
+ <text>A JMS TopicConnection resource may not declare a bean
name</text>
+ </assertion>
+
+ <assertion id="ak">
+ <text>A JMS TopicSession resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="al">
+ <text>A JMS TopicSubscriber resource may not declare a bean
name</text>
+ </assertion>
+
+ <assertion id="am">
+ <text>A JMS TopicPublisher resource may not declare a bean name</text>
+ </assertion>
+
+ <assertion id="an">
+ <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="aa">
+ <text>An injected field is a non-static~, non-final~ field of a bean
class.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>An injected field is a ~non-static, ~non-final field of a bean
class.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An injected field is a non-static, non-final field of a
servlet.</text>
+ <note>Test needs to check that static and final fields aren't injected
and also that no exception is thrown when you have them</note>
+ </assertion>
+
+ <assertion id="c">
+ <text>An injected field is a non-static, non-final field of any EJB session
bean class.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>An injected field is a non-static, non-final field of any message
driven bean class.</text>
+ </assertion>
+
+ <assertion id="e">
+ <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="f">
+ <text>Any EJB session bean may declare injected fields and have those fields
injected by the container</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Any EJB message driven bean may declare injected fields and have those
fields injected by the container</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If a field is a producer field, it is not an injected
field</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If a field is 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>
+
+ <assertion id="e">
+ <text>Check fields declared in XML and Java injected</text>
+ <note>Sanity check</note>
+ </assertion>
+ </section>
+
+ <section id="3.9" title="Initializer methods">
+ <assertion id="aa">
+ <text>An initializer method is a non-static method of a bean
class.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>An initializer method is a non-static method of a
servlet.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An initializer method is a non-static method of any EJB session bean
class.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>An initializer method is a non-static method of a of any EJB message
driven bean class.</text>
+ </assertion>
+
+ <assertion id="d">
+ <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="e">
+ <text>If the bean is a session bean, the initializer method is not required
to be a business method of the session bean</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Method interceptors are never called when the container calls an
initializer method</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A bean class may declare multiple (or zero) initializer
methods</text>
+ </assertion>
+
+ <assertion id="h" testable="false">
+ <text>The application may call initializer methods directly, but then no
parameters will be passed to the method by the container</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+
+ <assertion id="i">
+ <text>Any EJB session bean may declare initializer methods and have the
methods called by the container</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>Any EJB 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, a DefinitionException
is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If an initializer method has a parameter annotated @Disposes, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If an initializer method 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 is provided by the container when
annotations are applied to the bean class of a simple bean</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Dependency injection via @Resource is provided by the container when
annotations are applied to the bean class of a simple bean</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Dependency injection via @PersistenceUnit is provided by the container
when annotations are applied to the bean class of a simple bean</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Dependency injection via @PersistenceContext is provided by the
container when annotations are applied to the bean class of a simple bean</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>@PostConstruct callbacks are provided by the container when annotations
are applied to the bean class of a simple bean</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>@PreDestroy callbacks are provided by the container when annotations
are applied to the bean class of a simple bean</text>
+ </assertion>
+
+ <assertion id="g">
+ <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="h">
+ <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" testable="false">
+ <text>Concrete subclasses of Bean must implement the operations defined by
the Contextual interface defined in Section 6.1, "The Contextual
interface".</text>
+ <note>This is asserted by the JLS</note>
+ </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">
+ <assertion id="a">
+ <text>By default, Java implementation reuse is assumed</text>
+ </assertion>
+ </section>
+
+ <section id="4.1" title="Inheritance of type-level
metadata">
+
+ <assertion id="aa">
+ <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation
if and only if Z declares the @Inherited meta-annotation and neither Y nor any
intermediate class that is a subclass of X and a superclass of Y declares an annotation of
type Z.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if
and only if Z declares the @Inherited meta-annotation and neither Y nor any intermediate
class that is a subclass of X and a superclass of Y declares an annotation of type
Z.</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X is annotated with a _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="ad">
+ <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation
if and only if Z declares the @Inherited meta-annotation and neither Y nor any
intermediate class that is a subclass of X and a superclass of Y declares an annotation of
type Z.</text>
+ </assertion>
+
+ <assertion id="ae">
+ <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation
if and only if Z declares the @Inherited meta-annotation and neither Y nor any
intermediate class that is a subclass of X and a superclass of Y declares an annotation of
type Z.</text>
+ </assertion>
+
+ <assertion id="af">
+ <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X is annotated with a _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="ag">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation
if and only if Z declares the @Inherited meta-annotation and neither Y nor any
intermediate class that is a subclass of X and a superclass of Y declares an annotation of
type Z.</text>
+ </assertion>
+
+ <assertion id="ah">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if
and only if Z declares the @Inherited meta-annotation and neither Y nor any intermediate
class that is a subclass of X and a superclass of Y declares an annotation of type
Z.</text>
+ </assertion>
+
+ <assertion id="ai">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X is annotated with a _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="aj">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation
if and only if Z declares the @Inherited meta-annotation and neither Y nor any
intermediate class that is a subclass of X and a superclass of Y declares an annotation of
type Z.</text>
+ </assertion>
+
+ <assertion id="ak">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation
if and only if Z declares the @Inherited meta-annotation and neither Y nor any
intermediate class that is a subclass of X and a superclass of Y declares an annotation of
type Z.</text>
+ </assertion>
+
+ <assertion id="al">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X is annotated with a _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="ba">
+ <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X is annotated with a scope type Z then Y inherits the annotation if
and only if Z declares the @Inherited meta-annotation and neither Y nor any intermediate
class that is a subclass of X and a superclass of Y declares a scope type.</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>For class X which is extended _directly_ by the bean class of a
_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 meta-annotation and neither Y nor any intermediate
class that is a subclass of X and a superclass of Y declares a scope type.</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X is annotated with a scope type Z then Y inherits the annotation if
and only if Z declares the @Inherited meta-annotation and neither Y nor any intermediate
class that is a subclass of X and a superclass of Y declares a scope type.</text>
+ </assertion>
+
+ <assertion id="bd">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_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 meta-annotation and neither Y nor any intermediate
class that is a subclass of X and a superclass of Y declares a scope type.</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>For class X which is extended _directly_ by the bean class of a
_simple_ 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="cb">
+ <text>For class X which is extended _directly_ by the bean class of a
_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="cc">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X is annotated with a deployment type Z then Y inherits the annotation
if and only if Z declares the @Inherited meta-annotation and neither Y nor any
intermediate class that is a subclass of X and a superclass of Y declares a deployment
type.</text>
+ </assertion>
+
+ <assertion id="cd">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_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="da">
+ <text>For class X which is extended _directly_ by the bean class of a
_simple_ 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="db">
+ <text>For class X which is extended _directly_ by the bean class of a
_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="dc">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ 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="dd">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_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="ea">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only
if Z declares the @Inherited meta-annotation and Y does not explicitly declare an
annotation of type Z using XML.</text>
+ </assertion>
+
+ <assertion id="eb">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if
Z declares the @Inherited meta-annotation and Y does not explicitly declare an annotation
of type Z using XML.</text>
+ </assertion>
+
+ <assertion id="ec">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X is annotated with an _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="ed">
+ <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X is annotated with a _binding type_ Z then Y inherits the annotation if and
only if Z declares the @Inherited meta-annotation and Y does not explicitly declare an
annotation of type Z using XML.</text>
+ </assertion>
+
+ <assertion id="ee">
+ <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and
only if Z declares the @Inherited meta-annotation and Y does not explicitly declare an
annotation of type Z using XML.</text>
+ </assertion>
+
+ <assertion id="ef">
+ <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X is annotated with an _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="fa">
+ <text>For class X which is the bean class of a _simple_ 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 meta-annotation and Y does not explicitly declare a scope type
using XML.</text>
+ </assertion>
+
+ <assertion id="fb">
+ <text>For class X which is the bean class of a _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 meta-annotation and Y does not explicitly declare a
scope type using XML.</text>
+ </assertion>
+
+ <assertion id="ga">
+ <text>For class X which is the bean class of a _simple_ 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="gb">
+ <text>For class X which is the bean class of a _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="ha">
+ <text>For class X which is the bean class of a _simple_ 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="hb">
+ <text>For class X which is the bean class of a _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" testable="false">
+ <text>For annotations defined by the bean specification, all built-in _scope
types_ are declared @Inherited</text>
+ <note>sigtest</note>
+ </assertion>
+
+ <assertion id="j" testable="false">
+ <text>For annotations defined by the bean specification, all built-in
_stereotypes_ are declared @Inherited</text>
+ <note>sigtest</note>
+ </assertion>
+
+ <assertion id="k" testable="false">
+ <text>For annotations defined by the bean specification, _no built-in binding
type is declared @Inherited_</text>
+ <note>sigtest</note>
+ </assertion>
+
+ <assertion id="l" testable="false">
+ <text>For annotations defined by the bean specification, _the built-in
deployment type is not declared @Inherited_</text>
+ <note>sigtest</note>
+ </assertion>
+
+ <assertion id="m" testable="false">
+ <text>the @Named annotation is not declared @Inherited and bean names are not
inherited unless specialization is used</text>
+ <note>sigtest</note>
+ </assertion>
+
+ </section>
+
+ <section id="4.2" title="Inheritance of member-level
metadata">
+
+ <assertion id="aa">
+ <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X declares an injected field x then Y inherits x.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X declares an injected field x then Y inherits x.</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X declares an injected field x then Y inherits x.</text>
+ </assertion>
+
+ <assertion id="ad">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X declares an injected field x then Y inherits x.</text>
+ </assertion>
+
+ <assertion id="baa">
+ <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X declares a _@PostConstruct_ method x() then Y inherits x() if and
only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y
overrides the method x()</text>
+ </assertion>
+
+ <assertion id="bab">
+ <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X declares a _@PostConstruct_ method x() then Y inherits x() if and
only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y
overrides the method x()</text>
+ </assertion>
+
+ <assertion id="bac">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X declares a _@PostConstruct_ method x() then Y inherits x() if and
only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y
overrides the method x()</text>
+ </assertion>
+
+ <assertion id="bad">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X declares a _@PostConstruct_ method x() then Y inherits x() if and
only if neither Y nor any intermediate class that is a subclass of X and a superclass of Y
overrides the method x()</text>
+ </assertion>
+
+ <assertion id="bba">
+ <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X declares a _@PreDestroy_ method x() then Y inherits x() if and only
if neither Y nor any intermediate class that is a subclass of X and a superclass of Y
overrides the method x()</text>
+ </assertion>
+
+ <assertion id="bbb">
+ <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X declares a _@PreDestroy_ method x() then Y inherits x() if and only
if 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="bbc">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X declares a _@PreDestroy_ method x() then Y inherits x() if and only
if neither Y nor any intermediate class that is a subclass of X and a superclass of Y
overrides the method x()</text>
+ </assertion>
+
+ <assertion id="bbd">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X declares a _@PreDestroy_ method x() then Y inherits x() if and only
if neither Y nor any intermediate class that is a subclass of X and a superclass of Y
overrides the method x()</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>For class X which is extended _directly_ by the bean class of a
_simple_ 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="cb">
+ <text>For class X which is extended _directly_ by the bean class of a
_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="cc">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ 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="cd">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_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="da">
+ <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
+ </assertion>
+
+ <assertion id="dc">
+ <text>For class X which is extended _directly_ by the bean class of a
_simple_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
+ </assertion>
+
+ <assertion id="dd">
+ <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
+ </assertion>
+
+ <assertion id="de">
+ <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
+ </assertion>
+
+ <assertion id="df">
+ <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
+ </assertion>
+
+ <assertion id="dg">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
+ </assertion>
+
+ <assertion id="dh">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
+ </assertion>
+
+ <assertion id="di">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
+ </assertion>
+
+ <assertion id="dj">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X declares a _non-static producer method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
+ </assertion>
+
+ <assertion id="dk">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X declares a _non-static disposal method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
+ </assertion>
+
+ <assertion id="dl">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X declares a _non-static observer method_ x() then Y does not inherit
this method unless Y is explicitly declared to specialize or realize X</text>
+ </assertion>
+
+ <assertion id="ea">
+ <text>For class X which is extended _directly_ by the bean class of a
_simple_ 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="eb">
+ <text>For class X which is extended _directly_ by the bean class of a
_session_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit
this field unless Y is explicitly declared to specialize or realize X.</text>
+ </assertion>
+
+ <assertion id="ec">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ 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="ed">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_session_ bean Y, if X declares a _non-static producer field_ x then Y does not inherit
this field unless Y is explicitly declared to specialize or realize X.</text>
+ </assertion>
+
+ <assertion id="fa">
+ <text>For class X which is extended _directly_ by the bean class of a
_simple_ 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="fb">
+ <text>For class X which is extended _directly_ by the bean class of a
_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="fc">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_simple_ 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="fd">
+ <text>For class X which is extended _indirectly_ by the bean class of a
_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="ga">
+ <text>For class X which is the bean class of a _simple_ 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="gb">
+ <text>For class X which is the bean class of a _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="ha">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares an _initializer method_ x() then Y inherits x(), unless Y explicitly
declares x() using XML</text>
+ </assertion>
+
+ <assertion id="hb">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a _@PostConstruct method_ x() then Y inherits x(), unless Y explicitly
declares x() using XML</text>
+ </assertion>
+
+ <assertion id="hc">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a _@PreDestroy method_ x() then Y inherits x(), unless Y explicitly
declares x() using XML</text>
+ </assertion>
+
+ <assertion id="hd">
+ <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares an _initializer method_ x() then Y inherits x(), unless Y
explicitly declares x() using XML</text>
+ </assertion>
+
+ <assertion id="he">
+ <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a _@PostConstruct method_ x() then Y inherits x(), unless Y
explicitly declares x() using XML</text>
+ </assertion>
+
+ <assertion id="hf">
+ <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a _@PreDestroy method_ x() then Y inherits x(), unless Y
explicitly declares x() using XML</text>
+ </assertion>
+
+ <assertion id="ia">
+ <text>For class X which is the bean class of a _simple_ 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="ib">
+ <text>For class X which is the bean class of a _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="ja">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a non-static _producer method_ x() then Y does not inherit this method,
unless Y is explicitly declared to _specialize_ X.</text>
+ </assertion>
+
+ <assertion id="jb">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a non-static _producer method_ x() then Y does not inherit this method,
unless Y is explicitly declared to _realize_ X.</text>
+ </assertion>
+
+ <assertion id="jc">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a non-static _disposal method_ x() then Y does not inherit this method,
unless Y is explicitly declared to _specialize_ X.</text>
+ </assertion>
+
+ <assertion id="jd">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a non-static _disposal method_ x() then Y does not inherit this method,
unless Y is explicitly declared to _realize_ X.</text>
+ </assertion>
+
+ <assertion id="je">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a non-static _observer method_ x() then Y does not inherit this method,
unless Y is explicitly declared to _specialize_ X.</text>
+ </assertion>
+
+ <assertion id="jf">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a non-static _observer method_ x() then Y does not inherit this method,
unless Y is explicitly declared to _realize_ X.</text>
+ </assertion>
+
+ <assertion id="jg">
+ <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a non-static _producer method_ x() then Y does not inherit this
method, unless Y is explicitly declared to _specialize_ X.</text>
+ </assertion>
+
+ <assertion id="jh">
+ <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a non-static _producer method_ x() then Y does not inherit this
method, unless Y is explicitly declared to _realize_ X.</text>
+ </assertion>
+
+ <assertion id="ji">
+ <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a non-static _disposal method_ x() then Y does not inherit this
method, unless Y is explicitly declared to _specialize_ X.</text>
+ </assertion>
+
+ <assertion id="jj">
+ <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a non-static _disposal method_ x() then Y does not inherit this
method, unless Y is explicitly declared to _realize_ X.</text>
+ </assertion>
+
+ <assertion id="jk">
+ <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a non-static _observer method_ x() then Y does not inherit this
method, unless Y is explicitly declared to _specialize_ X.</text>
+ </assertion>
+
+ <assertion id="jl">
+ <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a non-static _observer method_ x() then Y does not inherit this
method, unless Y is explicitly declared to _realize_ X.</text>
+ </assertion>
+
+ <assertion id="ka">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a non-static producer field x then Y does not inherit this field,
unless Y is explicitly declared to _specialize_ X.</text>
+ </assertion>
+
+ <assertion id="kb">
+ <text>For class X which is the bean class of a _simple_ bean Y declared using
XML, if X declares a non-static producer field x then Y does not inherit this field,
unless Y is explicitly declared to _realize_ X.</text>
+ </assertion>
+
+ <assertion id="kc">
+ <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a non-static producer field x then Y does not inherit this field,
unless Y is explicitly declared to _specialize_ X.</text>
+ </assertion>
+
+ <assertion id="kd">
+ <text>For class X which is the bean class of a _session_ bean Y declared
using XML, if X declares a non-static producer field x then Y does not inherit this field,
unless Y is explicitly declared to _realize_ X.</text>
+ </assertion>
+
+ <assertion id="la">
+ <text>For class X which is the bean class of a _simple_ 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>
+
+ <assertion id="lb">
+ <text>For class X which is the bean class of a _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.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a bean X specializes a lower-priority bean Y with a name, and X
declares a name explicitly, a DefinitionException is thrown by the container at deployment
time</text>
+ </assertion>
+
+ <assertion id="f">
+ <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.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Even if the lower-priority bean defines a producer method, the method
will be called upon an instance of the specializing bean</text>
+ </assertion>
+
+ <assertion id="h" testable="false">
+ <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>
+ <note>This is a statement of intent</note>
+ </assertion>
+ </section>
+
+ <section id="4.3.2" title="Direct and indirect
specialization">
+ <assertion id="a" testable="false">
+ <text>The @javax.inject.Specializes annotation or <Specializes>
XML element is used to indicate that one bean directly specializes another
bean</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <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>
+ <note>A definition</note>
+ </assertion>
+
+ <assertion id="c">
+ <text>Any non-static producer methods (see Section 3.4, "Producer
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".</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Any non-static producer fields (see Section 3.5, "Producer
fields") of any bean are invoked upon an instance of the most specialized enabled
bean that specializes the bean, as defined by Section 6.8, "Lifecycle of producer
fields".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Any non-static disposal methods (see Section 3.4.6, "Disposal
methods") of any bean are invoked upon an instance of the most specialized enabled
bean that specializes the bean.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Any non-static 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 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" testable="false">
+ <text>Any bean that extends a generic class may directly extend the generic
class, in the case of a bean declared using annotations and then explicitly declare that
it realizes the generic class</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <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>
+ <note>A statement of intent</note>
+ </assertion>
+
+ </section>
+
+ <section id="4.4.1" title="Using realization">
+ <assertion id="a" testable="false">
+ <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>
+ <note>A statement of intent</note>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>A bean declared using XML may declare that it realizes a generic class
using the <Realizes> element.</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ <assertion id="ca">
+ <text>If a generic class Y declares a non-static _producer method_ with a
certain combination of scope, stereotypes, bindings and interceptor bindings, then every
bean X that realizes Y also has a _producer method_ with the same scope, stereotypes and
interceptor bindings. The bindings for this inherited _producer method_ consist of all
bindings declared by the _producer method_ of Y, excluding all bindings of Y, together
with the bindings declared explicitly by X. The deployment type of the inherited _producer
method_ is the deployment type of X</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>If a generic class Y declares a non-static _producer field_ with a
certain combination of scope, stereotypes, bindings and interceptor bindings, then every
bean X that realizes Y also has a _producer field_ with the same scope, stereotypes and
interceptor bindings. The bindings for this inherited _producer field_ consist of all
bindings declared by the _producer field_ of Y, excluding all bindings of Y, together with
the bindings declared explicitly by X. The deployment type of the inherited _producer
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" testable="false">
+ <text>Realization applies only to simple beans and session
beans</text>
+ <note>A statement of intent</note>
+ </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>
+ <note>The RI has unit tests for this atm</note>
+ </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>
+ <note>These need expanding out - one for each assertion that results in an
exception in 5.7.1</note>
+ </assertion>
+ </section>
+
+ <section id="5.2" title="Primitive types and null values">
+
+
+ <assertion id="aa">
+ <text>If necessary, the container performs boxing ~or unboxing~ when it
injects a value to a field or parameter of primitive or wrapper type.</text>
+ </assertion>
+ <assertion id="ab">
+ <text>If necessary, the container performs ~boxing or~ unboxing when it
injects a value to a field or parameter of primitive or wrapper type.</text>
+ </assertion>
+
+ <assertion id="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">
+ <assertion id="a">
+ <text>Client proxies are never required for a bean whose scope is a
pseudo-scope such as @Dependent</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Client proxies are used for normal scoped beans</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>All client proxies must be serializable</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must guarantee that when any valid injected reference to
a bean of normal scope is invoked, the invocation is always processed by the current
instance of the injected bean.</text>
+ </assertion>
+ </section>
+
+ <section id="5.4.1" title="Unproxyable bean types">
+ <assertion id="a">
+ <text>Classes without a non-private constructor with no parameters cannot be
proxied by the container. If an injection point whose declared type cannot be proxied by
the container resolves to a bean with a normal scope, an UnproxyableDependencyException is
thrown by the container at deployment time.</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>Classes which are declared final ~or have final methods~ cannot be
proxied by the container. If an injection point whose declared type cannot be proxied by
the container resolves to a bean with a normal scope, an UnproxyableDependencyException is
thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>Classes which ~are declared final or ~have final methods cannot be
proxied by the container. If an injection point whose declared type cannot be proxied by
the container resolves to a bean with a normal scope, an UnproxyableDependencyException is
thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Primitive types cannot be proxied by the container. If an injection
point whose declared type cannot be proxied by the container resolves to a bean with a
normal scope, an UnproxyableDependencyException is thrown by the container at deployment
time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Array types cannot be proxied by the container. If an injection point
whose declared type cannot be proxied by the container resolves to a bean with a normal
scope, an UnproxyableDependencyException is thrown by the container at deployment
time</text>
+ </assertion>
+ </section>
+
+ <section id="5.4.2" title="Client proxy invocation">
+ <assertion id="a">
+ <text>Every time a method of the bean is invoked upon a client proxy, the
client proxy must obtain the context object by calling Manager.getContext(), passing the
bean scope, then obtain an instance of the bean by calling Context.get(), passing the Bean
instance representing the bean and an instance of CreationalContext, and invoke the method
upon the bean</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The behavior of all methods declared by java.lang.Object, except for
toString(), is undefined for a client proxy</text>
+ </assertion>
+
+ </section>
+
+ <section id="5.5" title="The default binding at injection
points">
+ <assertion id="a">
+ <text>If an injection point declares no binding, the default binding @Current
is assumed</text>
+ </assertion>
+ </section>
+
+ <section id="5.6" title="Injection point metadata">
+ <assertion id="a">
+ <text>The javax.inject.manager.InjectionPoint.getBean() method returns the
Bean object representing the bean that defines the injection point</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>The javax.inject.manager.InjectionPoint.getType() method returns the
declared type of the injection point.</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>An injection point declared in XML has it's type determined
according to Section 9.10, "Specifying bean types and bindings"</text>
+ </assertion>
+
+ <assertion id="bc">
+ <text>The javax.inject.manager.InjectionPoint.getBindings() method returns
the declared bindings of the injection point.</text>
+ </assertion>
+
+ <assertion id="bd">
+ <text>An injection point declared in XML has it's bindings determined
according to Section 9.10, "Specifying bean types and bindings"</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>The javax.inject.manager.InjectionPoint.getMember() method returns the
Field object in the case of field injection</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>The javax.inject.manager.InjectionPoint.getMember() method returns the
Method object in the case of method parameter injection</text>
+ </assertion>
+
+ <assertion id="cc">
+ <text>The javax.inject.manager.InjectionPoint.getMember() method returns the
Constructor object in the case of constructor parameter injection</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>The javax.inject.manager.InjectionPoint.getAnnotation() method returns
annotations of the field in the case of field injection</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>The javax.inject.manager.InjectionPoint.getAnnotation() method returns
annotations of the parameter in the case of method parameter</text>
+ </assertion>
+
+ <assertion id="dc">
+ <text>The javax.inject.manager.InjectionPoint.getAnnotation() method returns
annotations annotations of the parameter in the case of constructor parameter
injection.</text>
+ </assertion>
+
+ <assertion id="dd">
+ <text>The javax.inject.manager.InjectionPoint.getAnnotations() method returns
annotations of the field in the case of field injection</text>
+ </assertion>
+
+ <assertion id="de">
+ <text>The javax.inject.manager.InjectionPoint.getAnnotations() method returns
annotations of the parameter in the case of method parameter</text>
+ </assertion>
+
+ <assertion id="df">
+ <text>The javax.inject.manager.InjectionPoint.getAnnotations() method returns
annotations annotations of the parameter in the case of constructor parameter
injection.</text>
+ </assertion>
+
+ <assertion id="dg">
+ <text>getAnnotation() returns a null value if no annotation of the given type
exists at the field injection point</text>
+ </assertion>
+
+ <assertion id="dh">
+ <text>getAnnotation() returns a null value if no annotation of the given type
exists at the method parameter injection point</text>
+ </assertion>
+
+ <assertion id="di">
+ <text>getAnnotation() returns a null value if no annotation of the given type
exists at the constructor injection point</text>
+ </assertion>
+
+ </section>
+
+ <section id="5.6.1" title="Injecting InjectionPoint">
+
+ <assertion id="za">
+ <text>The container must provide a bean with deployment type
@Standard.</text>
+ </assertion>
+
+ <assertion id="zb">
+ <text>The container must provide a bean with scope @Dependent.</text>
+ </assertion>
+
+ <assertion id="zc">
+ <text>The container must provide a bean with bean type
InjectionPoint.</text>
+ </assertion>
+
+ <assertion id="zd">
+ <text>The container must provide a bean with binding @Current.</text>
+ </assertion>
+
+ <assertion id="a">
+ <text>Whenever a @Dependent scoped object is instantiated by the container
for injection into a second bean, any injection point of type InjectionPoint and binding
@Current receives an instance of InjectionPoint that represents the injection point of the
second bean</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When a @Dependent scoped object is instantiated by the container to
receive a producer method, any injection point of type InjectionPoint and binding @Current
receives a null value</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>When a @Dependent scoped object is instantiated by the container to
receive a producer field, any injection point of type InjectionPoint and binding @Current
receives a null value</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When a @Dependent scoped object is instantiated by the container to
receive an observer , any injection point of type InjectionPoint and binding @Current
receives a null value</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>When a @Dependent scoped object is instantiated by the container to
receive a disposal method invocation, any injection point of type InjectionPoint and
binding @Current receives a null value</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>When a @Dependent scoped object is instantiated by the container during
EL expression evaluation, any injection point of type InjectionPoint and binding @Current
receives a null value</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>When a @Dependent scoped object is instantiated by the container as a
result of a direct call to the Manager API, any injection point of type InjectionPoint and
binding @Current receives a null value</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If a bean that declares any scope other than @Dependent has an
injection point of type InjectionPoint and binding @Current, a DefinitionException is
thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If an object that is not a bean has an injection point of type
InjectionPoint and binding @Current, a DefinitionException is thrown by the container at
deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="5.7" title="The Manager object">
+
+ </section>
+
+ <section id="5.7.1" title="Resolving dependencies">
+ <assertion id="a">
+ <text>Implementations of Bean maintain a reference to an instance of
Manager</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When the Bean implementation performs dependency injection, it must
obtain the contextual instances to inject by calling Manager.getInstanceToInject(),
passing an instance of InjectionPoint that represents the injection point and the instance
of CreationalContext that was passed to Bean.create()</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Manager.getInstanceToInject() returns a contextual instance or client
proxy to be injected to the given injection point</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The Manager.getInstanceToInject() method must Identify the bean by
calling Manager.resolveByType(), passing the type and bindings of the injection
point</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The Manager.getInstanceToInject() method must throw an
UnsatisfiedDependencyException if resolveByType() did not return a bean</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The Manager.getInstanceToInject() method must throw an
AmbiguousDependencyException if resolveByType() returned more than one bean</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The Manager.getInstanceToInject() method must throw an
UnproxyableDependencyExceptionif the bean has a normal scope and the type cannot be
proxied by the container, as defined in Section 5.4.1, "Unproxyable bean
types"</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The Manager.getInstanceToInject() method must obtain an instance of the
bean (or a client proxy) by calling Manager.getInstance(), passing the Bean object
representing the bean, and return it. Alternatively, return an incompletely initialized
instance of the bean that was
+registered by calling CreationalContext.push(), as defined in Section 6.1, "The
Contextual interface"</text>
+ </assertion>
+ </section>
+
+ <section id="5.7.2" title="Obtaining contextual instances">
+ <assertion id="a">
+ <text>Any bean may obtain an instance of Manager by injecting
it</text>
+ </assertion>
+
+ <assertion id="aa">
+ <text>The container provides a built-in bean with bean type
Manager</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>The container provides a built-in bean with scope
@Dependent</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>The container provides a built-in bean with deployment type
@Standard</text>
+ </assertion>
+
+ <assertion id="ad">
+ <text>The container provides a built-in bean with binding
@Current.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The application may obtain the Manager object from JNDI. The container
must register an instance of Manager with name java:app/Manager in JNDI at deployment
time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A contextual instance of a bean may be obtained by calling
Manager.getInstance(), passing the Bean object representing the bean</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Manager.getInstance() returns a contextual instance or client proxy for
the given bean</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the given Bean instance represents a bean with a normal scope, as
defined in Section 8.2, "Normal scopes and pseudo-scopes", Manager.getInstance()
must return a client proxy</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the Bean instance represents a bean with a pseudo-scope, as defined
in Section 8.2, "Normal scopes and pseudo-scopes", Manager.getInstance() must
obtain the context object by calling Manager.getContext(), passing the bean scope, then
obtain an instance of the bean by calling Context.get(), passing the Bean instance
representing the bean and an instance of CreationalContext</text>
+ </assertion>
+
+ <assertion id="g" testable="false">
+ <text>The Manager.getInstanceByType() methods obtain a contextual instance of
a bean</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ <assertion id="h">
+ <text>If no bindings are passed to Manager.getInstanceByType(), the default
binding @Current is assumed</text>
+ </assertion>
+
+ <assertion id="ia">
+ <text>If a parameterized type with a type parameter ~or wildcard~ is passed
to resolveByType(), an IllegalArgumentException is thrown</text>
+ </assertion>
+
+ <assertion id="ib">
+ <text>If a parameterized type with a ~type parameter or~ wildcard is passed
to resolveByType(), an IllegalArgumentException is thrown</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If two instances of the same binding type are passed to
getInstanceByType(), a DuplicateBindingTypeException is thrown</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If an instance of an annotation that is not a binding type is passed to
getInstanceByType(), an IllegalArgumentException is thrown</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The getInstanceByType() method must identify the bean by calling
Manager.resolveByType(), passing the given type and bindings</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>The getInstanceByType() method must throw an
UnsatisfiedDependencyException if resolveByType() did not return a bean</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>The getInstanceByType() method must throw an
AmbiguousDependencyException if resolveByType() returned more than one bean</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>The getInstanceByType() method must obtain an instance of the bean (or
a client proxy) by calling Manager.getInstance(), passing the Bean object representing the
bean, and return it</text>
+ </assertion>
+ </section>
+
+ <section id="5.8" title="Dynamic lookup">
+
+ <assertion id="a">
+ <text>An instance of the javax.inject.Instance interface may be injected via
use of the
+(a)javax.inject.Obtains binding</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Additional bindings may be specified at the injection
point</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The Instance interface provides a method for obtaining instances of
beans of a specific type</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If two instances of the same binding type are passed to Instance.get(),
a DuplicateBindingTypeException is thrown</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an instance of an annotation that is not a binding type is passed to
Instance.get(), an IllegalArgumentException is thrown</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The @Obtains annotation or <Obtains> element may be
applied to any injection point of type Instance where an actual type parameter is
specified</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the type of the injection point is not of type Instance a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If no actual type parameter is specified a DefinitionException is
thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If the type parameter contains a type variable a DefinitionException is
thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If the type parameter contains a wildcard a DefinitionException is
thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>Whenever the @Obtains annotation appears at an injection point, an
implicit bean exists with exactly the bean type and bindings that appear at the injection
point</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>Whenever the @Obtains annotation appears at an injection point, an
implicit bean exists with deployment type @Standard</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>Whenever the @Obtains annotation appears at an injection point, an
implicit bean exists with @Dependent scope</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>Whenever the @Obtains annotation appears at an injection point, an
implicit bean exists with no bean name</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>Whenever the @Obtains annotation appears at an injection point, an
implicit bean exists with an implementation provided automatically by the
container</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>The get() method of the provided implementation of Instance must call
Manager.getInstanceByType(), passing all bindings declared at the injection point, except
@Obtains, and all bindings passed to Instance.get()</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>The application may obtain a contextual instance by calling the
Instance.get() method</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>When the application calls Instance.get() to obtain a contextual
instance dynamically, it may need to pass instances of binding annotation
types</text>
+ </assertion>
+ </section>
+
+ <section id="5.9" title="Typesafe resolution algorithm">
+ <assertion id="a">
+ <text>The resolveByType() method of the Manager interface returns the result
of the typesafe resolution</text>
+ <note>Here we just do a general test that resolveByType() is producing
sensible results</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>If no bindings are passed to Manager.resolveByType(), the default
binding @Current is assumed</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>If a parameterized type with a type parameter ~or wildcard~ is passed
to Manager.resolveByType(), an IllegalArgumentException is thrown</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>If a parameterized type with a ~type parameter or~ wildcard is passed
to Manager.resolveByType(), an IllegalArgumentException is thrown</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If two instances of the same binding type are passed to
Manager.resolveByType(), a DuplicateBindingTypeException is thrown</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an instance of an annotation that is not a binding type is passed to
Manager.resolveByType(), an IllegalArgumentException is thrown</text>
+ </assertion>
+
+ <assertion id="fa">
+ <text>When the container is resolving a bean by type, it identifies the set
of matching enabled beans which have the given bean type.</text>
+ </assertion>
+
+ <assertion id="fb">
+ <text>When the container is resolving a bean by type~, it identifies the set
of matching enabled beans which have the given bean type~. For this purpose, primitive
types are considered to be identical to their corresponding wrapper types in java.lang~,
array types are considered identical only if their element types are identical and
parameterized types are considered identical only if both the type and all type parameters
are identical~</text>
+ </assertion>
+
+ <assertion id="fc">
+ <text>When the container is resolving a bean by type~, it identifies the set
of matching enabled beans which have the given bean type~. For this purpose, ~primitive
types are considered to be identical to their corresponding wrapper types in java.lang,~
array types are considered identical only if their element types are identical~ and
parameterized types are considered identical only if both the type and all type parameters
are identical~</text>
+ </assertion>
+
+ <assertion id="fd">
+ <text>When the container is resolving a bean by type~, it identifies the set
of matching enabled beans which have the given bean type~. For this purpose, ~primitive
types are considered to be identical to their corresponding wrapper types in java.lang,
array types are considered identical only if their element types are identical and~
parameterized types are considered identical only if both the type and all type parameters
are identical</text>
+ </assertion>
+
+ <assertion id="ga">
+ <text>When the container is resolving a bean by type, it considers the given
bindings. _If no bindings were passed to resolveByType(), the container assumes the
binding @Current_. </text>
+ </assertion>
+
+ <assertion id="gb">
+ <text>When the container is resolving a bean by type, it considers the given
bindings. ~If no bindings were passed to resolveByType(), the container assumes the
binding @Current~. The container narrows the set of matching beans to just those where for
each given binding, the bean declares a binding with _(a) the same type_ and (b) the same
annotation member value for each member which is not annotated @NonBinding (see Section
5.9.1, "Binding annotations with members")</text>
+ </assertion>
+
+ <assertion id="gc">
+ <text>When the container is resolving a bean by type, it considers the given
bindings. ~If no bindings were passed to resolveByType(), the container assumes the
binding @Current~. The container narrows the set of matching beans to just those where for
each given binding, the bean declares a binding with (a) the same type and _(b) the same
annotation member value for each member_ which is not annotated @NonBinding (see Section
5.9.1, "Binding annotations with members")</text>
+ </assertion>
+
+ <assertion id="gd">
+ <text>When the container is resolving a bean by type, it considers the given
bindings. ~If no bindings were passed to resolveByType(), the container assumes the
binding @Current~. The container narrows the set of matching beans to just those where for
each given binding, the bean declares a binding with (a) the same type and (b) the same
annotation member value for each member which is _not annotated @NonBinding_ (see Section
5.9.1, "Binding annotations with members")</text>
+ </assertion>
+
+ <assertion id="ha">
+ <text>When the container is resolving a bean by type, it examines the
deployment types of the matching beans, as defined in Section 2.5.7, "Deployment type
precedence", and returns the set of beans with the highest precedence deployment type
that occurs in the set.</text>
+ </assertion>
+
+ <assertion id="hb">
+ <text>When the container is resolving a bean by type, it examines the
deployment types of the matching beans, as defined in Section 2.5.7, "Deployment type
precedence", and returns the set of beans with the highest precedence deployment type
that occurs in the set. _If there are no matching beans, an empty set is
returned_</text>
+ </assertion>
+
+ </section>
+
+ <section id="5.9.1" title="Binding annotations with
members">
+ <assertion id="a" testable="false">
+ <text>Binding types with members are supported</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>An annotation member may be excluded from consideration using the
@NonBinding annotation</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>Array-valued ~or annotation-valued~ members of a binding type must be
annotated @NonBinding. If an array-valued ~or annotation-valued~ member of a binding type
is not annotated @NonBinding, a DefinitionException is thrown by the container at
deployment time</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>~Array-valued or ~annotation-valued members of a binding type must be
annotated @NonBinding. If an ~array-valued or ~annotation-valued member of a binding type
is not annotated @NonBinding, a DefinitionException is thrown by the container at
deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="5.9.2" title="Multiple bindings">
+ <assertion id="a">
+ <text>A bean class may declare multiple bindings</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A producer method may declare multiple bindings</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A producer field may declare multiple bindings</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A bean must declare all of the bindings that are specified at the
injection point to be considered a candidate for injection</text>
+ </assertion>
+ </section>
+
+ <section id="5.10" title="EL name resolution">
+
+ <assertion id="aa">
+ <text>The container must provide a Unified EL ELResolver to the servlet
engine ~and JSF implementation~ that resolves bean names</text>
+ <note>This is testable implicitly by trying to resolve using EL from a
servlet</note>
+ </assertion>
+
+ <assertion id="ab">
+ <text>The container must provide a Unified EL ELResolver to the ~servlet
engine~ and JSF implementation that resolves bean names</text>
+ <note>This is testable implicitly by trying to resolve using EL from a JSF
view</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>When this resolver is called with a null base object, it calls the
method Manager.getInstanceByName() to obtain an instance of the bean named in the EL
expression</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The Manager.getInstanceByName() method must identify the bean by
calling Manager.resolveByName(), passing the name</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The Manager.getInstanceByName() method must return a null value, if
Manager.resolveByName() returned an empty set</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The Manager.getInstanceByName() method must throw an
AmbiguousDependencyException if Manager.resolveByName() returned more than one
bean</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The Manager.getInstanceByName() method must obtain an instance of the
bean by calling Manager.getInstance(), passing the Bean instance representing the bean if
exactly one bean was returned by Manager.resolveByName(). For each distinct name that
appears in the EL expression, getInstanceByName() must be called at most
once</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Even if a
+name appears more than once in the same expression, the container may not call
getInstanceByName() multiple times with that name. This restriction ensures that there is
a unique instance of each bean with scope @Dependent in any EL evaluation</text>
+ </assertion>
+ </section>
+
+ <section id="5.11" title="Name resolution algorithm">
+ <assertion id="a">
+ <text>The resolveByName() method of the Manager interface performs name
resolution</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When resolving a bean by name, the container must identify the set of
matching enabled beans which have the given name</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>After the container identifies the set of matching beans, it examines
the deployment types of the matching beans, as defined in Section 2.5.7, "Deployment
type precedence", and returns the set of beans with the highest precedence deployment
type that occurs in the set</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If there are no matching beans, an empty set is returned</text>
+ </assertion>
+ </section>
+
+ <section id="5.12" title="Injection into non-contextual
objects">
+ <assertion id="a" testable="false">
+ <text>The container is required to perform dependency injection upon certain
non-contextual objects</text>
+ <note>This is a statement of intent</note>
+ </assertion>
+ </section>
+
+ <section id="5.12.1" title="Non-contextual instances of session
beans">
+ <assertion id="a">
+ <text>The container is required to perform dependency injection for session
bean instances obtained directly from JNDI</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The container is required to perform dependency injection for session
bean instances injected using @EJB</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container is required to perform dependency injection for session
bean instances injected using @Resource</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container is required to perform dependency injection for session
bean instances created by the container to receive remote method calls</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The container is required to perform dependency injection for session
bean instances created by the container to receive timeouts</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The container is required to create interceptor stacks for session bean
instances obtained directly from JNDI</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The container is required to create interceptor stacks for session bean
instances injected using @EJB</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The container is required to create interceptor stacks for session bean
instances injected using @Resource</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The container is required to create interceptor stacks for session bean
instances created by the container to receive remote method calls</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The container is required to create interceptor stacks for session bean
instances created by the container to receive timeouts</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The container is required to create decorator stacks for session bean
instances obtained directly from JNDI</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The container is required to create decorator stacks for session bean
instances injected using @EJB</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>The container is required to create decorator stacks for session bean
instances injected using @Resource</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>The container is required to create decorator stacks for session bean
instances created by the container to receive remote method calls</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>The container is required to create decorator stacks for session bean
instances created by the container to receive timeouts</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>For the purposes of dependency injection, the container must treat
non-contextual instances of session beans as instances of the most specialized bean that
specializes the bean with binding @New and deployment type @Standard defined in Section
3.3.6, "Session beans with the @New binding"</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>For the purposes of interceptor stack creation, the container must
treat non-contextual instances of session beans as instances of the most specialized bean
that specializes the bean with binding @New and deployment type @Standard defined in
Section 3.3.6, "Session beans with the @New binding"</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>For the purposes of decorator stack creation, the container must treat
non-contextual instances of session beans as instances of the most specialized bean that
specializes the bean with binding @New and deployment type @Standard defined in Section
3.3.6, "Session beans with the @New binding"</text>
+ </assertion>
+
+ </section>
+
+ <section id="5.12.2" title="Message-driven beans">
+ <assertion id="a">
+ <text>The container performs dependency injection for message-driven bean
instances according to the bean class annotations</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The container creates interceptor stacks for message-driven bean
instances according to the bean class annotations</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container creates decorator stacks for message-driven bean
instances according to the bean class annotations</text>
+ </assertion>
+ </section>
+
+ <section id="5.12.3" title="Servlets">
+ <assertion id="a">
+ <text>The container performs dependency injection for servlets according to
the servlet class annotations</text>
+ </assertion>
+ </section>
+
+ <section id="6" title="Bean lifecycle">
+ <assertion id="a">
+ <text>To create a contextual instance of a session bean, the container
creates an EJB local object reference</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>To create a contextual instance of a producer method bean, the
container calls the producer method</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>To create a contextual instance of a producer field bean, the container
retrieves the current value of the field</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>To create a contextual instance of a simple bean, the container calls
the bean constructor</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>To destroy a contextual instance of a stateful session bean, the
container removes the EJB instance</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>To destroy a contextual instance of a producer method bean, the
container calls the disposal method, if any</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>When the container injects a dependency and there is no existing
instance of the bean cached by the context object for the bean scope, the context object
automatically creates a new contextual instance of the bean</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>When the container resolves an EL name and there is no existing
instance of the bean cached by the context object for the bean scope, the context object
automatically creates a new contextual instance of the bean</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>When a context is destroyed, the context object automatically destroys
any instances associated with that context</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>To create and destroy contextual instances, the context object calls
operations defined by the interface Contextual</text>
+ </assertion>
+ </section>
+
+ <section id="6.1" title="The Contextual interface">
+ <assertion id="a" testable="false">
+ <text>The interface javax.context.CreationalContext provides an operation
that allows the create() method to register an incompletely initialized contextual
instance with the container. A contextual instance is considered incompletely initialized
until the create() method returns the instance</text>
+ <note>Statement of intent</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>If Contextual.create() calls CreationalContext.push(), it must also
return the instance passed to push()</text>
+ </assertion>
+
+ <assertion id="c" testable="false">
+ <text>The implementation of Contextual is not required to call
CreationalContext.push()</text>
+ <note>No way to test this really</note>
+ </assertion>
+ </section>
+
+ <section id="6.2" title="Creation">
+ <assertion id="a">
+ <text>The Contextual.create() method obtains an instance of the
bean</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The Contextual.create() method creates the interceptor stacks and binds
them to the instance</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The Contextual.create() method creates the decorator stacks and binds
them to the instance</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The Contextual.create() method injects any dependencies</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The Contextual.create() method sets any initial field values defined in
XML</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The Contextual.create() method calls the @PostConstruct method, if
necessary</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If any exception occurs while creating an instance, the exception is
rethrown by the create() method</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If a checked exception occurs while creating an instance, it is wrapped
and rethrown as an (unchecked) CreationException</text>
+ </assertion>
+ </section>
+
+ <section id="6.3" title="Destruction">
+ <assertion id="a">
+ <text>The Contextual.destroy() method calls the disposal method, if
necessary</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The Contextual.destroy() method calls the @PreDestroy method, if
necessary</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The Contextual.destroy() method destroys all dependent objects of the
instance, as defined in Section 8.3.2, "Dependent object
destruction"</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If any exception occurs while destroying an instance, the exception is
caught by the destroy() method</text>
+ </assertion>
+
+ <assertion id="e" testable="false">
+ <text>If the application invokes a contextual instance after it has been
destroyed, the behavior is undefined</text>
+ <note>In otherwords, the behavious is unspecified!</note>
+ </assertion>
+ </section>
+
+ <section id="6.4" title="Lifecycle of simple beans">
+ <assertion id="a">
+ <text>When the create() method of the Bean object that represents a simple
bean is called, the container first calls the bean constructor to obtain an instance of
the bean. For each constructor parameter, the container passes the object returned by
Manager.getInstanceToInject(). The container is permitted to return an instance of a
container-generated subclass of the bean class, allowing interceptor and decorator
bindings</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When the create() method of the Bean object that represents a simple
bean is called, after the bean constructor is called the container next initializes the
values of any attributes annotated @EJB</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>When the create() method of the Bean object that represents a simple
bean is called, after the bean constructor is called the container next initializes the
values of any attributes annotated @PersistenceContext</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When the create() method of the Bean object that represents a simple
bean is called, after the bean constructor is called the container next initializes the
values of any attributes annotated @Resource</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>When the create() method of the Bean object that represents a simple
bean is called, after the @EJB, @PersistenceContext and @Resource attributes are
initialized the container initializes the values of all injected fields. For each injected
field, the container sets the value to the object returned by
Manager.getInstanceToInject().</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>When the create() method of the Bean object that represents a simple
bean is called, after injected fields are initialized the container initializes the values
of any fields with initial values specified in XML, as defined in Section 9.5.5,
"Field initial value declarations".</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>When the create() method of the Bean object that represents a simple
bean is called, after the values of fields with initial values specified in XML are
initialized the container calls all initializer methods. For each initializer method
parameter, the container passes the object
+returned by Manager.getInstanceToInject()</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>When the create() method of the Bean object that represents a simple
bean is called, after all initializer methods are called the container builds the
interceptor stacks for the instance as defined in Section A.3.10 "Interceptor stack
creation"</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>When the create() method of the Bean object that represents a simple
bean is called, after all initializer methods are called the container builds the
decorator stacks for the instance as defined in Section A.5.8 "Decorator stack
creation"</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>When the create() method of the Bean object that represents a simple
bean is called, after the interceptor and decorator stacks are built the container calls
the @PostConstruct method, if any</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>When the destroy() method of a Bean object is called, the container
calls the @PreDestroy method, if any</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>When the destroy() method of a Bean object is called, after the
container calls the @PreDestroy method, it finally destroys dependent
objects</text>
+ </assertion>
+ </section>
+
+ <section id="6.5" title="Lifecycle of stateful session
beans">
+ <assertion id="a">
+ <text>When the create() method of a Bean object that represents a stateful
session bean that is called, the container creates and returns a session bean proxy, as
defined in Section 3.3.9, "Session bean proxies".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When the destroy() method of a Bean object is called, the container
removes the stateful session bean. The @PreDestroy callback must be invoked by the
container</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the underlying EJB was already removed by direct invocation of a
remove method by the application, the container ignores the instance</text>
+ </assertion>
+ </section>
+
+ <section id="6.6" title="Lifecycle of stateless session and singleton
beans">
+ <assertion id="a">
+ <text>When the create() method of a Bean object that represents a stateless
session or singleton session bean is called, the container creates and returns a session
bean proxy, as defined in Section 3.3.9, "Session bean proxies".</text>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>When the destroy() method of a Bean object is called, the container
simply discards the proxy and all underlying EJB local object references</text>
+ <note>Untestable</note>
+ </assertion>
+ </section>
+
+ <section id="6.7" title="Lifecycle of producer methods">
+ <assertion id="a">
+ <text>Any Java object may be returned by a producer method. It is not
required that the returned object be an instance of another bean</text>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>If an object returned by a producer method is not an instance of
another bean, the container will not provide injection of other beans</text>
+ <note>In other words the behaviour is unspecified</note>
+ </assertion>
+
+ <assertion id="c" testable="false">
+ <text>If an object returned by a producer method is not an instance of
another bean, the container will not provide lifecycle callbacks</text>
+ <note>In other words the behaviour is unspecified</note>
+ </assertion>
+
+ <assertion id="d" testable="false">
+ <text>If an object returned by a producer method is not an instance of
another bean, the container will not provide method and lifecycle
interception</text>
+ <note>In other words the behaviour is unspecified</note>
+ </assertion>
+
+ <assertion id="e">
+ <text>When the create() method of a Bean object that represents a producer
method is called, the container must invoke the producer method, passing the object
returned by Manager.getInstanceToInject() to each parameter</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If a producer method is static, the container must invoke the
method</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If a producer method is not static, the container must obtain the Bean
object for the most specialized bean that specializes the bean which declares the producer
method</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If a producer method is not static, after obtaining the most
specialized Bean object the container must obtain an instance of the most specialized
bean, by calling Manager.getInstance(), passing the Bean object representing the
bean</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If a producer method is not static, after obtaining an instance of the
most specialized bean the container must invoke the producer method upon this
instance</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The return value of the producer method, after method interception
completes, is the new contextual instance to be returned by Bean.create()</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If the producer method returns a null value and the producer method
bean has the scope @Dependent, the create() method returns a null value</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>If the producer method returns a null value, and the scope of the
producer method is not @Dependent, the create() method throws an
IllegalProductException</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>When the destroy() method is called, and if there is a disposal method
for this producer method, the container must invoke the disposal method, passing the
instance given to destroy() to the disposed parameter, and the object returned by
Manager.getInstanceToInject() to each of the other parameters</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>If a disposal method is static, the container must invoke the
method</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>If a disposal method is non-static, the container must obtain the Bean
object for the most specialized bean that specializes the bean which declares the disposal
method</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>If a disposal method is non-static, after obtaining the Bean object for
the most specialized bean, the container must obtain an instance of the most specialized
bean, by calling Manager.getInstance(), passing the Bean object representing the
bean</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>If a disposal method is non-static, after obtaining the instance of the
most specialized bean the container must invoke the disposal method upon this
instance</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>Finally, the container destroys dependent objects</text>
+ </assertion>
+ </section>
+
+ <section id="6.8" title="Lifecycle of producer fields">
+ <assertion id="a">
+ <text>Any Java object may be the value of a producer field</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>It is not required that the returned object of a producer field be an
instance of another bean</text>
+ </assertion>
+
+ <assertion id="c" testable="false">
+ <text>If the object returned by a producer field is not an instance of
another bean, the container will not provide injection of other beans</text>
+ <note>In other words the behaviour is unspecified</note>
+ </assertion>
+
+ <assertion id="d" testable="false">
+ <text>If the object returned by a producer field is not an instance of
another bean, the container will not provide lifecycle callbacks</text>
+ <note>In other words the behaviour is unspecified</note>
+ </assertion>
+
+ <assertion id="e" testable="false">
+ <text>If the object returned by a producer field is not an instance of
another bean, the container will not provide method interception</text>
+ <note>In other words the behaviour is unspecified</note>
+ </assertion>
+
+ <assertion id="f" testable="false">
+ <text>If the object returned by a producer field is not an instance of
another bean, the container will not provide lifecycle interception</text>
+ <note>In other words the behaviour is unspecified</note>
+ </assertion>
+
+ <assertion id="g">
+ <text>When the create() method of a Bean object that represents a producer
field is called, the container must access the producer field to obtain the current value
of the field</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If a producer field is static, the container must access the field
value</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If a producer field is non-static, the container must obtain the Bean
object for the most specialized bean that specializes the bean which declares the producer
field</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If a producer field is non-static, after obtaining the Bean object for
the most specialized bean the container must obtain an instance of the most specialized
bean, by calling Manager.getInstance(), passing the Bean object representing the
bean</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If a producer field is non-static, after obtaining an instance of the
most specialized bean, the container must access the field value of this
instance</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The value of the producer field is the new contextual instance to be
returned by Bean.create()</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>If the producer field contains a null value and the producer field bean
has the scope @Dependent, the create() method returns a null value</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>If the producer field contains a null value, and the scope of the
producer method is not @Dependent, the create() method throws an
IllegalProductException</text>
+ </assertion>
+ </section>
+
+ <section id="6.9" title="Lifecycle of resources">
+ <assertion id="a" testable="false">
+ <text>An instance of a resource is a proxy object, provided by the container,
that implements the declared bean type, delegating the actual implementation of the
methods directly to the underlying Java EE resource, entity manager, entity manager
factory, EJB remote object or web service referenc</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A resource proxy object is a dependent object of the object it is
injected into</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Resource proxy objects are serializable</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When the create() method of a Bean object that represents a JMS
resource is called, the container creates and returns a proxy object that implements the
bean type of the resource</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The methods of this proxy object delegate to the underlying
implementation, which is obtained using the metadata provided in the resource
declaration</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A Java EE resource is obtained using the JNDI name or mapped name
specified by <Resource></text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A persistence context is obtained using the persistence unit name
specified by <PersistenceContext></text>
+ </assertion>
+
+ <assertion id="h">
+ <text>A persistence unit is obtained using the persistence unit name
specified by <PersistenceUnit></text>
+ </assertion>
+
+ <assertion id="i">
+ <text>A remote EJB is obtained using the JNDI name, mapped name or EJB link
specified by <EJB></text>
+ </assertion>
+
+ <assertion id="j">
+ <text>A web service is obtained using the JNDI name or mapped name specified
by <WebServiceRef></text>
+ </assertion>
+
+ <assertion id="k">
+ <text>When the destroy() method is called, the container discards the proxy
object</text>
+ </assertion>
+ </section>
+
+ <section id="6.10" title="Lifecycle of JMS resources">
+ <assertion id="a" testable="false">
+ <text>An instance of a JMS resource is a proxy object, provided by the
container, that implements all the bean types defined in Section 3.7, "JMS
resources", delegating the actual implementation of these methods directly to the
underlying JMS objects</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A JMS resource proxy object is a dependent object of the object it is
injected into</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>JMS resource proxy objects are serializable</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When the create() method of a Bean object that represents a JMS
resource is called, the container creates and returns a proxy object that implements all
the bean types of the JMS resource</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The methods of this proxy object delegate to JMS objects obtained as
needed using the metadata provided by the JMS resource declaration and using standard JMS
APIs</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The Destination is obtained using the JNDI name or mapped name
specified by <Resource></text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The appropriate ConnectionFactory for the topic or queue is obtained
automatically</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The Connection is obtained by calling
QueueConnectionFactory.createQueueConnection() or
TopicConnectionFactory.createTopicConnection()</text>
+ </assertion>
+
+ <assertion id="i" testable="false">
+ <text>The container is permitted to share a connection between multiple proxy
objects</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The Session object is obtained by calling
QueueConnection.createQueueSession() or TopicConnection.createTopicSession()</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The MessageProducer object is obtained by calling
QueueSession.createSender() or TopicSession.createPublisher()</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The MessageConsumer object is obtained by calling
QueueSession.createReceiver() or TopicSession.createSubscriber()</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>When the destroy() method is called, the container must ensure that all
JMS objects created by the proxy object are destroyed by calling close() if
necessary</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>The Connection is destroyed by calling Connection.close() if
necessary</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>If the connection is being shared between multiple proxy objects, the
container is not required to close the connection when the proxy is
destroyed</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>The Session object is destroyed by calling
Session.close()</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>The MessageProducer object is destroyed by calling
MessageProducer.close()</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>The MessageConsumer object is destroyed by calling
MessageConsumer.close()</text>
+ </assertion>
+
+ <assertion id="s">
+ <text>The close() method of a JMS resource proxy object always throws an
UnsupportedOperationException</text>
+ </assertion>
+
+ </section>
+
+ <section id="6.11" title="Lifecycle of EJBs">
+ <assertion id="a">
+ <text>When the EJB container creates a new instance of an EJB, after Java EE
injection has been performed and before the @PostConstruct callback occurs the container
must initialize the values of all injected fields . For each injected field, the
container sets the value to the
+object returned by Manager.getInstanceToInject()</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When the EJB container creates a new instance of an EJB, after Java EE
injection has been performed and before the @PostConstruct callback occurs the container
must initialize the values of any fields with initial values specified in XML, as defined
in Section 9.5.5, "Field initial value declarations"</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>When the EJB container creates a new instance of an EJB, after Java EE
injection has been performed and before the @PostConstruct callback occurs the container
calls all initializer methods. For each initializer method parameter, the container passes
the object returned by Manager.getInstanceToInject()</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When the EJB container creates a new instance of an EJB, after Java EE
injection has been performed and before the @PostConstruct callback occurs the container
builds the interceptor stacks for the instance as defined in Section A.3.10,
"Interceptor stack creation" and Section A.5.8, "Decorator stack
creation" and binds them to the instance</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>When the EJB container creates a new instance of an EJB, after Java EE
injection has been performed and before the @PostConstruct callback occurs the container
builds the decorator stacks for the instance as defined in Section A.3.10,
"Interceptor stack creation" and Section A.5.8, "Decorator stack
creation" and binds them to the instance</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>When the EJB container removes an instance of an EJB, the container
destroys all dependent objects, after the @PreDestroy callback completes</text>
+ </assertion>
+ </section>
+
+ <section id="6.12" title="Lifecycle of servlets">
+ <assertion id="a">
+ <text>When the servlet container creates a new instance of a servlet, the
container initializes the values of all injected fields. For each injected field, the
container sets the value to the object returned by
Manager.getInstanceToInject()</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When the servlet container creates a new instance of a servlet, the
container calls all initializer methods. For each initializer method parameter, the
container passes the object
+returned by Manager.getInstanceToInject()</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>When the servlet container destroys a servlet, the container destroys
all dependent objects</text>
+ </assertion>
+
+ <assertion id="d" testable="false">
+ <text>In a Java EE 5 environment, the container is not required to support
injected fields or initializer methods of servlets</text>
+ </assertion>
+ </section>
+
+ <section id="7" title="Events">
+
+ </section>
+
+ <section id="7.1" title="Event types and binding types">
+
+ <assertion id="a">
+ <text>An event object is an instance of a concrete Java class with no [type
variables] or wildcards</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An event object is an instance of a concrete Java class with no type
variables or [wildcards]</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The event types of the event include all superclasses and interfaces of
the class of the event object</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>An event binding type is a Java annotation defined as @Target({FIELD,
PARAMETER}) ~or @Target({METHOD, FIELD, PARAMETER, TYPE}) and
@Retention(RUNTIME)~</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>An event binding type is a Java annotation defined as ~@Target({FIELD,
PARAMETER}) or~ @Target({METHOD, FIELD, PARAMETER, TYPE}) ~and
@Retention(RUNTIME)~</text>
+ </assertion>
+
+ <assertion id="f" testable="false">
+ <text>An event binding type is a Java annotation defined as ~@Target({FIELD,
PARAMETER}) or @Target({METHOD, FIELD, PARAMETER, TYPE}) and
~@Retention(RUNTIME)</text>
+ <note>The compiler discards non-runtime-retention annotation</note>
+ </assertion>
+
+ <assertion id="g">
+ <text>All event binding types must specify the @javax.inject.BindingType
meta-annotation</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>An event consumer will be notified of an event if the observed event
type it specifies is one of the event types of the event, and if all the observed event
bindings it specifies are event bindings of the event</text>
+ </assertion>
+
+ </section>
+
+ <section id="7.2" title="Firing an event via the Manager
interface">
+
+ <assertion id="a">
+ <text>The Manager interface provides the fireEvent() method for firing
events</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the type of the event object passed to fireEvent() contains [type
variables] or wildcards, an IllegalArgumentException is thrown</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the type of the event object passed to fireEvent() contains type
variables or [wildcards], an IllegalArgumentException is thrown</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If an instance of an annotation that is not a binding type is passed to
fireEvent(), an IllegalArgumentException is thrown. (Not in PRD2, but should appear in
next revision)</text>
+ </assertion>
+
+ </section>
+
+ <section id="7.3" title="Observing events via the Observer
interface">
+ <assertion id="a">
+ <text>Observers of events implement the javax.event.Observer
interface</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An observer instance may be registered with the container by calling
Manager.addObserver()</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>In the signature of Manager.addObserver(), the first parameter is the
observer object, the second parameter is the observed event type, and the remaining
parameters are
+optional observed event bindings</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The observer is notified when an event object that is assignable to the
observed event type is raised with the observed event bindings</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>An observer instance may be deregistered by calling
Manager.removeObserver()</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the observed event type passed to ~addObserver()~ or
removeObserver() contains ~type variables~ or wildcards, an IllegalArgumentException is
thrown</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the observed event type passed to ~addObserver()~ or
removeObserver() contains type variables or ~wildcards~, an IllegalArgumentException is
thrown</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If the observed event type passed to addObserver() or
~removeObserver()~ contains ~type variables~ or wildcards, an IllegalArgumentException is
thrown</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If the observed event type passed to addObserver() or
~removeObserver()~ contains type variables or ~wildcards~, an IllegalArgumentException is
thrown</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If two instances of the same binding type are passed to ~addObserver()~
or removeObserver(), a DuplicateBindingTypeException is thrown</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If two instances of the same binding type are passed to addObserver()
or ~removeObserver()~, a DuplicateBindingTypeException is thrown</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>If an instance of an annotation that is not a binding type is passed to
~addObserver()~ or removeObserver(), an IllegalArgumentException is thrown</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>If an instance of an annotation that is not a binding type is passed to
addObserver() or ~removeObserver()~, an IllegalArgumentException is thrown</text>
+ </assertion>
+ </section>
+
+ <section id="7.4" title="Observer notification">
+
+ <assertion id="a">
+ <text>When an event is fired by the application the container must determine
the observers for that event by calling Manager.resolveObservers(), passing the event
object and all event bindings</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When an event is fired by the application the container must, for each
observer, call the notify() method of the Observer interface, passing the event
object</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If an observer throws an exception, the exception aborts processing of
the event. No other observers of that event will be called. The fireEvent() method
rethrows the exception</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Any observer called before completion of a transaction may call
setRollbackOnly() to force a transaction rollback</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>An observer may not directly ~initiate~, commit or rollback JTA
transactions</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>An observer may not directly initiate, ~commit~ or rollback JTA
transactions</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>An observer may not directly initiate, commit or ~rollback~ JTA
transactions</text>
+ </assertion>
+
+ </section>
+
+ <section id="7.5" title="Observer methods">
+ <assertion id="a">
+ <text>An observer method is an observer defined via annotations, instead of
by explicitly implementing the Observer interface. Unlike regular observers, observer
methods are automatically discovered and registered by the container</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An observer method must be a method of a simple bean class or session
bean class</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>An observer method may be either static or non-static</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the bean is a session bean, the observer method must be a business
method of the EJB or a static method of the bean class</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>There may be arbitrarily many observer methods with the same event
parameter type and bindings</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A bean may declare multiple observer methods</text>
+ </assertion>
+ </section>
+
+ <section id="7.5.1" title="Event parameter of an observer
method">
+ <assertion id="a">
+ <text>Each observer method must have exactly one event parameter, of the same
type as the event type it observes. When searching for observer methods for an event, the
container considers the type and bindings of the event parameter</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the event parameter does not explicitly declare any binding, the
observer method observes events with no binding</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the type of the event parameter contains type variables or
wildcards, a DefinitionException is thrown by the container at deployment
time</text>
+ </assertion>
+ </section>
+
+ <section id="7.5.2" title="Declaring an observer method using
annotations">
+ <assertion id="a">
+ <text>A observer method may be declared using annotations by annotating a
parameter @javax.event.Observes. That parameter is the event parameter.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If a method has more than one parameter annotated @Observes, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If an observer method is annotated @Produces a DefinitionException
+is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If an observer method is annotated @Initializer a DefinitionException
+is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an observer method has a parameter annotated @Disposes, 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 @Observes, and the method is not a business method of the EJB, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The event parameter may declare bindings</text>
+ </assertion>
+ </section>
+
+ <section id="7.5.3" title="Declaring an observer method using
XML">
+ <assertion id="a">
+ <text>For a beans defined in XML, an observer method may be declared using
the method name, the <Observes> element, and the parameter types of the
method</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When an observer 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
parameters that match those declared in XML, a DefinitionException is thrown by the
container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="7.5.4" title="Observer method parameters">
+ <assertion id="a">
+ <text>In addition to the event parameter, observer methods may declare
additional parameters, which may declare bindings. The container calls the method
Manager.getInstanceToInject() defined in Section 5.7.1, "Resolving dependencies"
to determine a value for each parameter of an observer method and calls the observer
method with those parameter values</text>
+ </assertion>
+ </section>
+
+ <section id="7.5.5" title="Conditional observer methods">
+ <assertion id="a">
+ <text>Conditional observer methods are observer methods which are notified of
an event only if an instance of the bean that defines the observer method already exists
in the current context</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A conditional observer methods may be declared by annotating the event
parameter with the @javax.event.IfExists annotation</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Conditional observer methods may be declared in XML by adding a child
<IfExists> element to the <Observes> element</text>
+ </assertion>
+ </section>
+
+ <section id="7.5.6" title="Transactional observer methods">
+ <assertion id="a">
+ <text>Transactional observer methods are observer methods which receive event
notifications during the before or after completion phase of the transaction in which the
event was fired. If no transaction is in progress when the event is fired, they are
notified at the same time as other observers</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A before completion observer method is called during the before
completion phase of the transaction</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>An after completion observer method is called during the after
completion phase of the transaction</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>An after success observer method is called during the after completion
phase of the transaction, only when the transaction completes successfully</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>An after failure observer method is called during the after completion
phase of the transaction, only when the transaction fails</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A transactional observer method may be declared by ~annotating the
event parameter of the observer method~ or in XML by a child element of the
<Observes> element</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A transactional observer method may be declared by annotating the event
parameter of the observer method or ~in XML by a child element of the
<Observes> element~</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The @javax.event.BeforeTransactionCompletion annotation or
<BeforeTransactionCompletion> element specifies that the observer method is
a before completion observer method</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The @javax.event.AfterTransactionCompletion annotation or
<AfterTransactionCompletion> element specifies that the observer method is
an after completion observer method</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The @javax.event.AfterTransactionSuccess annotation or
<AfterTransactionSuccess> element specifies that the observer method is an
after success observer method</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The @javax.event.AfterTransactionFailure annotation or
<AfterTransactionFailure> element specifies that the observer method is an
after failure observer method</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>A transactional observer method may not specify more than one of the
four types. If a transactional observer method specifies more than one of the four types,
a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="7.5.7" title="Asynchronous observer methods">
+ <assertion id="a">
+ <text>An asynchronous observer method may be declared by ~annotating the
event parameter of the observer method @javax.event.Asynchronously~ or in XML by a child
<Asynchronously> element of the <Observes>
element</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An asynchronous observer method may be declared by annotating the event
parameter of the observer method @javax.event.Asynchronously or ~in XML by a child
<Asynchronously> element of the <Observes>
element~</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>An asynchronous observer method may also be a transactional observer
method</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If an asynchronous observer method is also a transactional observer
method, it ~may not be a before completion observer method~ or a conditional observer
method. If an asynchronous observer method is specified as a before completion or
conditional observer method, a DefinitionException is thrown by the container at
deployment time</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an asynchronous observer method is also a transactional observer
method, it may not be a before completion observer method or a ~conditional observer
method~. If an asynchronous observer method is specified as a before completion or
conditional observer method, a DefinitionException is thrown by the container at
deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="7.5.8" title="Observer object for an observer
method">
+ <assertion id="a">
+ <text>For every observer method of an enabled bean, the container is
responsible for providing and registering an appropriate implementation of the Observer
interface, that delegates event notifications to the observer method</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The notify() method of the Observer implementation for an observer
method either invokes the observer method ~immediately~, or asynchronously, or registers
the observer method for later invocation during the transaction completion phase, using a
JTA Synchronization</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The notify() method of the Observer implementation for an observer
method either invokes the observer method immediately, ~or asynchronously~, or registers
the observer method for later invocation during the transaction completion phase, using a
JTA Synchronization</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The notify() method of the Observer implementation for an observer
method either invokes the observer method immediately, or asynchronously, ~or registers
the observer method for later invocation during the transaction completion phase, using a
JTA Synchronization~</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the observer method is an asynchronous transactional observer method
and there is currently a JTA transaction in progress, the observer object calls the
observer method asynchronously during the after transaction completion phase</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the observer method is a transactional observer method and there is
currently a JTA transaction in progress, the observer object calls the observer method
during the appropriate transaction completion phase</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the observer method is an asynchronous observer method, the
container calls the observer method asynchronously</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If none of the conditions of assertions e, f, or g are true, the
container calls the observer immediately</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The container is not required to guarantee delivery of asynchronous
events in the case of a server shutdown or failure</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>To invoke an observer method, the container must pass the event object
to the event parameter and the object returned by Manager.getInstanceToInject() to each of
the other parameters</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If the observer method is static, the container must invoke the
method</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>If the observer method is non-static, the container must obtain the
Bean object for the most specialized bean that specializes the bean which declares the
observer method</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>Placeholder for path 2</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>Placeholder for path 3</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>Placeholder for path 4 etc</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>If the observer is a transactional or asynchronous observer method, any
exception is caught and logged by the container</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>If the observer isn't a transactional or asynchronous observer
method, the exception is rethrown by the notify() method of the observer
object</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>If the exception is a checked exception, it is wrapped and rethrown as
an (unchecked) ObserverException</text>
+ </assertion>
+
+ <assertion id="s">
+ <text>The observer object is registered by calling Manager.addObserver(),
passing the event parameter type as the observed event type, and the bindings of the event
parameter as the observed event bindings</text>
+ </assertion>
+ </section>
+
+ <section id="7.5.9" title="Observer invocation context">
+ <assertion id="a">
+ <text>If the observer method is an asynchronous observer method, it is called
with no active transaction, no client security context and with a new request context that
is destroyed when the observer method returns. The application context is also
active</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the observer method is a @BeforeTransactionCompletion transactional
observer method, it is called within the context of the transaction that is about to
complete and with the same client security context and lifecycle contexts</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the observer method is any other kind of transactional observer
method, it is called in an unspecified transaction context, but with the same client
security context and lifecycle contexts as the transaction that just
completed</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If an observer method is not an asynchronous observer method, and not a
@BeforeTransactionCompletion transactional method, and not any other kind of transactional
observer method, then the observer method is called in the same transaction context,
client security context and lifecycle contexts as the invocation of
Event.fire()</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The transaction and security contexts for a business method of a
session bean also depend upon the transaction attribute and @RunAs descriptor, if
any</text>
+ </assertion>
+ </section>
+
+ <section id="7.6" title="The Event interface">
+ <assertion id="a">
+ <text>An instance of the javax.event.Event interface may be injected via use
of the @javax.event.Fires binding</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Additional bindings may be specified at the injection point for
javax.event.Event</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The Event interface provides a method for firing events of a specific
type</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The Event interface provides a method for registering observers for
+events of the same type</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The first parameter of the fire() method is the event object. The
remaining parameters are event bindings</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The first parameter of the observe() method is the observer object. The
remaining parameters are the observed event bindings</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If two instances of the same binding type are passed to fire() or
observes(), a DuplicateBindingTypeException is thrown</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If an instance of an annotation that is not a binding type is passed to
fire() or observes(), an IllegalArgumentException is thrown</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The @Fires annotation or <Fires> element may be applied
to any injection point of type Event, where an actual type parameter is
specified</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If the type of the injection point is not of type Event a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If the type of the injection point has no actual type parameter
specified a DefinitionException is thrown by the container at deployment
time</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>If the type of the injection point parameter contains a type variable a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>If the type of the injection point parameter contains a wildcard a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>Whenever the @Fires annotation appears at an injection point, an
implicit bean exists with exactly the bean type and bindings that appear at the injection
point</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>Whenever the @Fires annotation appears at an injection point, an
implicit bean exists with deployment type @Standard,</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>Whenever the @Fires annotation appears at an injection point, an
implicit bean exists with @Dependent scope</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>Whenever the @Fires annotation appears at an injection point, an
implicit bean exists with no bean name</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>Whenever the @Fires annotation appears at an injection point, an
implicit bean exists with an implementation provided automatically by the
container</text>
+ </assertion>
+
+ <assertion id="s">
+ <text>The fire() method of the provided implementation of Event must call
Manager.fireEvent(), passing the event object passed to Event.fire(), all bindings
declared at the injection point (except @Fires), and all bindings passed to
Event.fire()</text>
+ </assertion>
+
+ <assertion id="t">
+ <text>The application may fire events by calling the fire()
method</text>
+ </assertion>
+
+ <assertion id="u">
+ <text>The observe() method of the provided implementation of Event must call
Manager.addObserver(), passing the observer object passed to Event.observe(), all bindings
declared at the injection point (except @Fires), and all bindings passed to
Event.observer()</text>
+ </assertion>
+
+ <assertion id="v">
+ <text>The application may register observers by calling the observe()
method</text>
+ </assertion>
+ </section>
+
+ <section id="7.7" title="Observer resolution">
+ <assertion id="a">
+ <text>The method Manager.resolveObservers() resolves observers for an event -
the first parameter of resolveObservers() is the event object. The remaining parameters
are event bindings</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the type of the event object passed to resolveObservers() contains
type variables, an IllegalArgumentException is thrown</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the type of the event object passed to resolveObservers() contains
wildcards, an IllegalArgumentException is thrown</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If two instances of the same binding type are passed to
resolveObservers(), a DuplicateBindingTypeException is thrown</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an instance of an annotation that is not a binding type is passed to
resolveObservers(), an IllegalArgumentException is thrown</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>When searching for observers for an event, the event object must be
assignable to the observed event type, taking type parameters into
consideration</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>When searching for observers for an event, for each observed event
binding, (a) an instance of the binding type must have been passed to fireEvent() and (b)
any member values of the binding type must match the member values of the instance passed
to fireEvent()</text>
+ </assertion>
+ </section>
+
+ <section id="7.7.1" title="Event binding types with
members">
+ <assertion id="a">
+ <text>The binding type for an Event binding may have annotation
members</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The container uses equals() to compare event binding type member
values</text>
+ </assertion>
+ </section>
+
+ <section id="7.7.2" title="Multiple event bindings">
+ <assertion id="a">
+ <text>An event parameter may have multiple bindings</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An observer method will only be notified if all the observed event
bindings are specified when the event is fired</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Other, less specific, observers will also be notified of events with
multiple event bindings</text>
+ </assertion>
+ </section>
+
+ <section id="7.8" title="JMS event mappings">
+ <assertion id="a">
+ <text>An event type may be mapped to a JMS resource that represents a
topic</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Multiple event types may be mapped to the same topic</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>All observers of mapped event types must be asynchronous observer
methods. If an observer for a mapped event type is not an asynchronous observer method, a
DeploymentException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When an event type is mapped to a topic, the container must send a
message containing the serialized event and its event bindings to the topic whenever an
event with that type is fired</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>When an event type is mapped to a topic, the container must listen for
messages containing events of that type sent to the topic, and notify all observers of the
event type whenever a message containing an event of that type is received</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Events of a mapped event type are distributed to other processes which
have the same event type mapped to the same topic</text>
+ </assertion>
+ </section>
+
+ <section id="8" title="Scopes and contexts">
+
+ </section>
+
+ <section id="8.1" title="The Context interface">
+
+ <assertion id="a">
+ <text>The get() method of the Context object may return an existing instance
of the given contextual type</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The get() method of the Context object may return a null value if no
CreationalContext is given</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The get() method of the Context object may create a new instance of the
given contextual type by calling Contextual.create() and return the new instance, if a
CreationalContext is given</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The get() method of a Context object may not return a null value unless
no CreationalContext is given, or Contextual.create() returns a null value</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The get() method of a Context object may not create a new instance of
the given contextual type unless a CreationalContext is given</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The Context implementation is responsible for destroying any contextual
instance it creates by passing the instance to the destroy() method of the Contextual
object representing the contextual type</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A destroyed instance must not subsequently be returned by a Context
object's get() method</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>When a scope is inactive, any invocation of the get() from the current
thread upon the Context object for that scope results in a
ContextNotActiveException</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The isActive() method returns false when the scope of the context
object is inactive, and true when it is active</text>
+ </assertion>
+
+ </section>
+
+ <section id="8.2" title="Normal scopes and pseudo-scopes">
+ <assertion id="a">
+ <text>There may be no more than one mapped instance of a context object per
contextual type per thread</text>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>A context may be associated with one or more threads</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ <assertion id="c">
+ <text>The get() operation of the Context object for an active normal scope
returns the current instance of the given contextual type</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When a context is destroyed, all mapped instances of contextual types
with that scope are destroyed by passing them to the Contextual.destroy()
method</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Contexts with normal scopes must obey the following rule: Suppose beans
A, B and Z all have normal scopes. Suppose A has an injection point x, and B has an
injection point y. Suppose further that both x and y resolve to bean Z according to the
typesafe resolution algorithm. If a is the current instance of A, and b is the current
instance of B, then both a.x and b.y refer to the same instance of Z. This instance is the
current instance of Z.</text>
+ </assertion>
+
+ <assertion id="f" testable="false">
+ <text>All pseudo-scopes must be explicitly declared @ScopeType(normal=false),
to indicate to the container that no client proxy is required</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ <assertion id="g" testable="false">
+ <text>All scopes defined by this specification, except for the @Dependent
pseudo-scope, are normal scopes</text>
+ <note>A statement of intent</note>
+ </assertion>
+ </section>
+
+ <section id="8.3" title="Dependent pseudo-scope">
+
+ <assertion id="a">
+ <text>When a bean is declared to have @Dependent scope, no injected instance
of the bean is ever shared between multiple injection points</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When a bean is declared to have @Dependent scope, any injected instance
of the bean is bound to the lifecycle of the bean, servlet or EJB into which it is
injected</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>When a bean is declared to have @Dependent scope, any instance of the
bean that is used to evaluate a Unified EL expression exists to service that evaluation
only</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When a bean is declared to have @Dependent scope, any instance of the
bean that receives a producer method, producer field, disposal method or observer method
invocation exists to service that invocation only</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Every invocation of the get() operation of the Context object for the
@Dependent scope with a CreationalContext returns a new instance of the given
bean</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Every invocation of the get() operation of the Context object for the
@Dependent scope with no CreationalContext returns a null value</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The @Dependent scope is inactive except when an instance of a bean with
scope @Dependent is created by the container to receive a producer method, producer field,
disposal method or observer method invocation</text>
+ <note>Assertions g through k are all related and should be treated as
"or" conditions</note>
+ </assertion>
+
+ <assertion id="h">
+ <text>The @Dependent scope is inactive except while a Unified EL expression
is evaluated</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The @Dependent scope is inactive except while an observer method is
invoked</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The @Dependent scope is inactive except when the container is creating
or destroying a contextual instance of a bean or injecting its dependencies</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The @Dependent scope is inactive except when the container is injecting
dependencies of an EJB</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The @Dependent scope is inactive except when a @PostConstruct or
@PreDestroy callback is invoked by the EJB container</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>The @Dependent scope is inactive except when the container is injecting
dependencies of a servlet</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>The @Dependent scope is even active during invocation of interceptors
and decorators of observer methods and interceptors and decorators of @PostConstruct and
@PreDestroy callbacks</text>
+ </assertion>
+
+ </section>
+
+ <section id="8.3.1" title="Dependent objects">
+ <assertion id="a" testable="false">
+ <text>A bean, EJB or servlet may obtain an instance of a bean with scope
@Dependent via dependency injection or by calling Manager.getInstance(),
Manager.getInstanceByType() or Instance.get() when the @Dependent scope is
active</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ <assertion id="b">
+ <text>Instances of interceptors or decorators with scope @Dependent are also
dependent objects of the bean they intercept or decorate</text>
+ </assertion>
+ </section>
+
+ <section id="8.3.2" title="Dependent object destruction">
+
+ <assertion id="a">
+ <text>The container must destroy all dependent objects of a contextual bean
instance when the instance is destroyed</text>
+ </assertion>
+
+ <assertion id="ba">
+ <text>The container must destroy all dependent objects of an EJB ~or servlet~
when the EJB ~or servlet~ is destroyed</text>
+ </assertion>
+
+ <assertion id="bb">
+ <text>The container must destroy all dependent objects of a~n EJB or~ servlet
when the ~EJB or~ servlet is destroyed</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container must destroy all @Dependent scoped contextual instances
created during an EL expression evaluation when the evaluation completes</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>The container must destroy any @Dependent scoped contextual instance
created to receive a producer method~, producer field, disposal method or observer method~
invocation when the invocation completes</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>The container must destroy any @Dependent scoped contextual instance
created to receive a ~producer method,~ producer field~, disposal method or observer
method~ invocation when the invocation completes</text>
+ </assertion>
+
+ <assertion id="dc">
+ <text>The container must destroy any @Dependent scoped contextual instance
created to receive a ~producer method, producer field,~ disposal method ~or observer
method~ invocation when the invocation completes</text>
+ </assertion>
+
+ <assertion id="dd">
+ <text>The container must destroy any @Dependent scoped contextual instance
created to receive a ~producer method, producer field, disposal method or~ observer method
invocation when the invocation completes</text>
+ </assertion>
+
+ <assertion id="e" testable="false">
+ <text>The container is permitted to destroy any @Dependent scoped contextual
instance at any time if the instance is no Scopes and contexts longer referenced by the
application (excluding weak, soft and phantom references)</text>
+ <note>In other words this is unspecified</note>
+ </assertion>
+ </section>
+
+ <section id="8.4" title="Passivating scopes and
serialization">
+ <assertion id="a">
+ <text>The container must validate that every bean declared with a passivating
scope truly is serializable - EJB local objects are serializable. Therefore, a session
bean may declare any passivating scope</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Simple beans are not required to be serializable. If a simple bean
declares a passivating scope, and the bean class is not serializable, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="cc">
+ <text>If a ~producer method or ~field declares a passivating scope and
returns a non-serializable object at runtime, an IllegalProductException is thrown by the
container</text>
+ </assertion>
+
+ <assertion id="cd">
+ <text>If a producer method~ or field~ declares a passivating scope and
returns a non-serializable object at runtime, an IllegalProductException is thrown by the
container</text>
+ </assertion>
+
+ <assertion id="ca">
+ <text>Check a producer method which declares a passivating scope and returns
a serializable product works</text>
+ <note>Sanity test</note>
+ </assertion>
+
+ <assertion id="cb">
+ <text>Check a producer method which declares a passivating scope and returns
a primitive product works</text>
+ <note>Sanity test</note>
+ </assertion>
+
+ <assertion id="d" testable="false">
+ <text>The built-in session and conversation scopes are
passivating</text>
+ <note>This is an API signature test</note>
+ </assertion>
+
+ <assertion id="e" testable="false">
+ <text>No other built-in scope besides session and conversation scopes are
passivating</text>
+ <note>This is an API signature test</note>
+ </assertion>
+
+ <assertion id="f">
+ <text>A contextual instance of a bean may be serialized when the bean
declares a passivating scope, and context passivation occurs</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A contextual instance of a bean may be serialized when the bean is an
EJB stateful session bean, and it is passivated by the EJB container</text>
+ </assertion>
+
+ <assertion id="h" testable="false">
+ <text>In either case of assertion f or g above, any non-transient field that
holds a reference to another bean must be serialized along with the bean that is being
serialized. Therefore, the reference must be to a serializable type</text>
+ <note>An explanation</note>
+ </assertion>
+
+ <assertion id="i">
+ <text>Any reference to a bean which declares a normal scope is
serializable</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>EJB local objects are serializable, therefore, any reference to a
session bean of scope @Dependent is serializable</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If a simple bean of scope @Dependent and a nonserializable bean class
is injected into a stateful session bean an UnserializableDependencyException must be
thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>If a simple bean of scope @Dependent and a nonserializable bean class
is injected into a non-transient field an UnserializableDependencyException must be thrown
by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>If a simple bean of scope @Dependent and a nonserializable bean class
is injected into a bean constructor parameter of a bean which declares a passivating
scope, an UnserializableDependencyException must be thrown by the container at deployment
time</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>If a simple bean of scope @Dependent and a nonserializable bean class
is injected into an initializer method parameter of a bean which declares a passivating
scope, an UnserializableDependencyException must be thrown by the container at deployment
time</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>If a simple bean of scope @Dependent and a nonserializable bean class
is injected into a parameter of a producer method which declares a passivating scope, an
UnserializableDependencyException must be thrown by the container at deployment
time</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>If a producer method or field of scope @Dependent returns a
non-serializable object for injection into a stateful session bean, an
IllegalProductException is thrown by the container</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>If a producer method or field of scope @Dependent returns a
non-serializable object for injection into a non-transient field an
IllegalProductException is thrown by the container</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>If a producer method or field of scope @Dependent returns a
non-serializable object for injection into a bean constructor parameter of a bean which
declares a passivating scope, an IllegalProductException is thrown by the
container</text>
+ </assertion>
+
+ <assertion id="s">
+ <text>If a producer method or field of scope @Dependent returns a
non-serializable object for injection into an initializer method parameter of a bean which
declares a passivating scope, an IllegalProductException is thrown by the
container</text>
+ </assertion>
+
+ <assertion id="t">
+ <text>If a producer method or field of scope @Dependent returns a
non-serializable object for injection into a parameter of a producer method which declares
a passivating scope, an IllegalProductException is thrown by the container</text>
+ </assertion>
+
+ <assertion id="u">
+ <text>The container must guarantee that JMS resource proxy objects are
serializable</text>
+ </assertion>
+
+ <assertion id="v">
+ <text>The method Bean.isSerializable() may be used to detect if a bean is
serializable</text>
+ </assertion>
+ </section>
+
+ <section id="8.5" title="Context management for built-in
scopes">
+
+ <assertion id="a">
+ <text>The container provides an implementation of the Context interface for
each of the built-in scopes</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For each of the built-in normal scopes, contexts propagate across any
Java method call, including invocation of EJB local business methods</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The built-in contexts do not propagate across remote method invocations
or to asynchronous processes such as JMS message listeners or EJB timer service
timeouts</text>
+ </assertion>
+
+ </section>
+
+ <section id="8.5.1" title="Request context lifecycle">
+
+ <assertion id="a">
+ <text>The request scope is active during the service() method of any servlet
in the web application</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The request scope is active during the doFilter() method of any servlet
filter</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The request context is destroyed at the end of the servlet request,
after the service() method and all doFilter() methods return</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The request scope is active during any Java EE web service
invocation</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The request context is destroyed after a web service invocation
completes</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The request scope is active during any asynchronous observer method
notification</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The request context is destroyed after a asynchronous observer method
notification completes</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The request scope is active during any remote method invocation of any
EJB</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The request scope is active during any call to an EJB timeout
method</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The request scope is active during message delivery to any EJB
message-driven bean</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The request context is destroyed after the remote EJB method invocation
completes</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The request context is destroyed after the invocation of an EJB timeout
method</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>The request context is destroyed after message delivery to an EJB
message-drive bean completes</text>
+ </assertion>
+ </section>
+
+ <section id="8.5.2" title="Session context lifecycle">
+
+ <assertion id="a">
+ <text>The session scope is active during the service() method of any servlet
in the web application</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The session scope is active during the doFilter() method of any servlet
filter</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The session context is shared between all servlet requests that occur
in the same HTTP servlet session</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The session context is destroyed when the HTTPSession is
invalidated</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The session context is destroyed when the HTTPSession times
out</text>
+ </assertion>
+ </section>
+
+ <section id="8.5.3" title="Application context lifecycle">
+
+ <assertion id="a">
+ <text>The application scope is active during the service() method of any
servlet in the web application</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The application scope is active during the doFilter() method of any
servlet filter</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The application scope is active during any Java EE web service
invocation</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The application scope is active during any asynchronous observer method
notification</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The application scope is active during any remote method invocation of
any EJB</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The application scope is active during any call to an EJB timeout
method</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The application scope is active during message delivery to any EJB
message-driven bean</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The application context is shared between all servlet requests that
execute within the same application</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The application context is shared between all asynchronous observer
method notifications that execute within the same application</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The application context is shared between all web service invocations
that execute within the same application</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The application context is shared between all EJB remote method
invocations that execute within the same application</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The application context is shared between all EJB timeouts that
execute
+within the same application</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>The application context is shared between all message deliveries to
message driven beans that execute within the same application</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>The application context is destroyed when the application is
undeployed</text>
+ </assertion>
+ </section>
+
+ <section id="8.5.4" title="Conversation context lifecycle">
+
+ <assertion id="a">
+ <text>For a JSF faces request, the conversation context is active from the
beginning of the apply request values phase, until the response is complete</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For a JSF non-faces request, the context is active during the render
response phase</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Any JSF request has exactly one associated conversation</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The conversation associated with a JSF request is determined at the end
of the restore view phase and does not change during the request</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>By default, a conversation is transient</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A transient conversation may be marked long-running by calling
Conversation.begin()</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A long-running conversation may be marked transient by calling
Conversation.end()</text>
+ </assertion>
+
+ <assertion id="ha">
+ <text>All long-running conversations have a string-valued unique identifier,
_which may be set by the application_ when the conversation is marked long-running~, or
generated by the container~</text>
+ </assertion>
+
+ <assertion id="hb">
+ <text>All long-running conversations have a string-valued unique identifier,
~which may be set by the application when the conversation is marked long-running,~ or
generated by the container</text>
+ </assertion>
+
+ <assertion id="ia">
+ <text>The container provides a built-in bean with bean type
javax.context.Conversation~, scope @RequestScoped, deployment type @Standard and binding
@Current, named javax.context.conversation~</text>
+ </assertion>
+
+ <assertion id="ib">
+ <text>The container provides a built-in bean with ~bean type
javax.context.Conversation~, scope @RequestScoped~, deployment type @Standard and binding
@Current, named javax.context.conversation~</text>
+ </assertion>
+
+ <assertion id="ic">
+ <text>The container provides a built-in bean with~ bean type
javax.context.Conversation, scope @RequestScoped,~ deployment type @Standard~ and binding
@Current, named javax.context.conversation~</text>
+ </assertion>
+
+ <assertion id="id">
+ <text>The container provides a built-in bean with bean type
~javax.context.Conversation, scope @RequestScoped, deployment type @Standard and~ binding
@Current~, named javax.context.conversation~</text>
+ </assertion>
+
+ <assertion id="ie">
+ <text>The container provides a built-in bean with bean type
~javax.context.Conversation, scope @RequestScoped, deployment type @Standard and binding
@Current,~ named javax.context.conversation</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If the conversation associated with the current JSF request is in the
transient state at the end of a JSF request, it is destroyed, and the conversation context
is also destroyed</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If the conversation associated with the current JSF request is in the
long-running state at the end of a JSF request, it is not destroyed</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The long-running conversation context associated with a request that
renders a JSF view is automatically propagated to any faces request (JSF form submission)
that originates from that rendered page</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>The long-running conversation context associated with a request that
results in a JSF redirect (via a navigation rule) is automatically propagated to the
resulting non-faces request, and to any other subsequent request to the same URL. This is
accomplished via use of a GET request parameter named cid containing the unique identifier
of the conversation</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>The long-running conversation associated with a request may be
propagated to any non-faces request via use of a GET request parameter named cid
containing the unique identifier of the conversation. In this case, the application must
manage this request parameter</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>When no conversation is propagated to a JSF request, the request is
associated with a new transient conversation</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>All long-running conversations are scoped to a particular HTTP servlet
session and may not cross session boundaries</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>When the HTTP servlet session is invalidated, all long-running
conversation contexts created during the current session are destroyed</text>
+ </assertion>
+
+ <assertion id="r" testable="false">
+ <text>The container is permitted to arbitrarily destroy any long-running
conversation that is associated with no current JSF request, in order to conserve
resources</text>
+ <note>In other words, this is unspecified</note>
+ </assertion>
+
+ <assertion id="s">
+ <text>If the propagated conversation cannot be restored, the request is
associated with a new transient conversation</text>
+ </assertion>
+
+ <assertion id="t" testable="false">
+ <text>The method Conversation.setTimeout() is a hint to the container that a
conversation should not be destroyed if it has been active within the last given interval
in milliseconds</text>
+ <note>Not required</note>
+ </assertion>
+
+ <assertion id="u" testable="false">
+ <text>The container ensures that a long-running conversation may be
associated with at most one request at a time, by blocking or rejecting concurrent
requests</text>
+ <note>Cannot test as their as what happens is not well defined</note>
+ </assertion>
+ </section>
+
+ <section id="8.6" title="Context management for custom
scopes">
+
+ <assertion id="a">
+ <text>A custom implementation of Context may be associated with any scope
type at any point in the execution of the application, by calling
Manager.addContext()</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Every time Manager.getInstance() is called, for example, during
instance or EL name resolution, the container must call Manager.getContext() to retrieve
an active context object associated with the bean scope</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If no active context object exists for the given scope type,
Manager.getContext() must throw a ContextNotActiveException</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If more than one active context object exists for the given
+scope type, Manager.getContext() must throw an IllegalStateException</text>
+ </assertion>
+ </section>
+
+ <!-- <section id="9" title="XML based metadata">
+ <assertion id="a">
+ <text>XML-based bean declarations define additional beans?they do not
redefine or disable any bean that was declared via annotations</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Multiple namespaces are accommodated, each representing a Java
package</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>XML elements belonging to these namespaces represent Java types, fields
and methods</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Each namespace may declare an XML schema</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a beans.xml file contains any XML element without a declared
namespace, a DefinitionException is thrown by the container at deployment
time</text>
+ </assertion>
+
+ </section>
+
+ <section id="9.1" title="XML namespace for a Java package">
+ <assertion id="a">
+ <text>Every Java package has a corresponding XML namespace. The namespace URN
consists of the package name, with the prefix urn:java:</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Each namespace may, optionally, have a schema</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>An XML element belonging to such a namespace represents a Java type in
the corresponding Java package, or a method or field of a type in that
package</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If there is a Java type in the package with the same name as the XML
element, the XML element can be interpreted to represent that Java type</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Type parameters may be specified by child elements of the element that
represents the type</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Members of a type may be specified by child elements of the element
that represents the type, in the same namespace as the element that represents the
type</text>
+ </assertion>
+
+ </section>
+
+ <section id="9.2" title="XML namespace aggregating multiple
packages">
+ <assertion id="a">
+ <text>Alternatively, a namespace may represent several Java packages. Such a
namespace must have a URN consisting of the prefix urn:java: followed by a
period-separated list of valid Java identifiers</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The list of packages for such a namespace must be defined in a
classpath resource named namespace in the path named by the identifier list</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The format of the file is a list of packages, separated by
whitespace</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>An XML element belonging to such a namespace represents a Java type in
one of the listed packages, or a method or field of a type in one of the listed
packages</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If there are multiple packages containing a Java type with the same
name as the XML element, a DefinitionException is thrown by the container at deployment
time</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If there is exactly one Java type in the listed packages with the same
name as the XML element, the XML element can be interpreted to represent that Java
type</text>
+ </assertion>
+ </section>
+
+ <section id="9.2.1" title="The Java EE namespace">
+ <assertion id="a">
+ <text>The Java EE namespace urn:java:ee represents the following packages:
java.lang, java.util, javax.annotation, javax.inject, javax.context, javax.interceptor,
javax.decorator, javax.event, javax.ejb, javax.persistence, javax.xml.ws, javax.jms, and
javax.sql</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Several elements in the urn:java:ee namespace do not represent Java
types</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The root <Beans> element, together with the
<Deploy>, <Interceptors> and <Decorators>
elements belong to the namespace urn:java:ee and do not represent Java types nor members
of Java types</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Java array types may be represented by an <Array> element
in the namespace urn:java:ee, with a child element representing the element
type</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Primitive types may be represented by the XML element that represents
the corresponding wrapper type in java.lang, since primitive and wrapper types are
considered identical for the purposes of typesafe resolution, and assignable for the
purposes of injection</text>
+ </assertion>
+ </section>
+
+ <section id="9.3" title="Standard schema location for a
namespace">
+ <assertion id="a">
+ <text>The container must validate all namespaces for which schemas are
available in the classpath</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The container searches for a schema for each namespace in the classpath
directory corresponding to the namespace</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The schema must be named schema.xsd</text>
+ </assertion>
+ </section>
+
+ <section id="9.4" title="Stereotype, binding type and interceptor
binding type declarations">
+ <assertion id="a">
+ <text>An XML element that appears as a direct child of the root
<Beans> element is interpreted as a binding type declaration if it has a
direct child <BindingType> element in the Java EE namespace, as defined in
Section 2.3.2, "Defining new binding types"</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An XML element that appears as a direct child of the root
<Beans> element is interpreted as an interceptor binding type if it has a
direct child <InterceptorBindingType> element in the Java EE namespace, as
defined in Section A.3.4, "Interceptor bindings"</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>An XML element that appears as a direct child of the root
<Beans> element is interpreted as a stereotype declaration if it has a
direct child <Stereotype> element in the Java EE namespace, as defined in
Section 2.7.1, "Defining new stereotypes"</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The XML element is interpreted as a Java type. If no such Java type
exists in the classpath, a DefinitionException is thrown by the container at deployment
time. If the type is not an annotation type, a DefinitionException is thrown by the
container at deployment time</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the annotation type is already declared as a binding type using
annotations, the annotations are ignored by the container and the XML-based declaration is
used</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the annotation type is already declared as an interceptor binding
type using annotations, the annotations are ignored by the container and the XML-based
declaration is used</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the annotation type is already declared as a stereotype using
annotations, the annotations are ignored by the container and the XML-based declaration is
used</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If a certain annotation type is declared more than once as a binding
type, interceptor binding type or stereotype using XML, a DeploymentException is thrown by
the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="9.4.1" title="Child elements of a stereotype
declaration">
+ <assertion id="a">
+ <text>Every direct child element of a stereotype declaration is interpreted
as a Java type</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If no such Java type exists in the classpath, a DefinitionException is
thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the type is not an annotation type, a DefinitionException is thrown
by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the annotation type is a scope type, the default scope of the
stereotype was declared</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the annotation type is a deployment type, the default scope of the
stereotype was declared</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the annotation type is a interceptor binding type, an interceptor
binding of the stereotype was declared</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the annotation type is javax.annotation.Named, a stereotype with
name defaulting was declared</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>Otherwise, a DefinitionException is thrown by the container at
deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="9.4.2" title="Child elements of an interceptor binding
type declaration">
+ <assertion id="a">
+ <text>Every direct child element of an interceptor binding type declaration
is interpreted as a Java type</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If no such Java type exists in the classpath, a DefinitionException is
thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the type is not an annotation type, a DefinitionException is thrown
by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the annotation type is an interceptor binding type, an inherited
interceptor binding was declared, as defined in Section A.3.4.1, "Interceptor binding
types with additional interceptor bindings"</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the annotation type is not an interceptor binding type, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ </section>
+
+ <section id="9.5" title="Bean declarations">
+
+ <assertion id="a">
+ <text>An XML element that appears as a direct child of the root
<Beans> element is interpreted as a bean declaration if it is not a
<Deploy>, <Interceptors> or <Decorators> element
in the Java EE namespace, and does not have a direct child
<BindingType>,<InterceptorBindingType> or
<Stereotype> element in the Java EE namespace</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The name of the XML element is interpreted as a Java type. The
container inspects the Java type and other metadata to determine what kind of bean is
being declared. If no such Java type exists in the classpath, a DefinitionException is
thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the type is javax.jms.Queue or javax.jms.Topic, it declares a JMS
resource, as defined in Section 3.7.2, "Declaring a JMS resource using
XML"</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the element has a child <Resource>,
<PersistenceContext>, <PersistenceUnit>, <EJB>
or <WebServiceRef> element, it declares a resource, as defined in Section
3.6.1, "Declaring a resource using XML"</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the type is an EJB bean class, a session bean was declared, as
defined in Section 3.3.5, "Declaring a session bean using XML"</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the type is a concrete class, is not an EJB bean class, and is not a
parameterized type, a simple bean was declared, as defined in Section 3.2.4,
"Declaring a simple bean using XML"</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Otherwise, a DefinitionException is thrown by the container at
deployment time</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>Inline bean declarations may occur at injection points, as defined in
Section 9.9, "Inline bean declarations". Inline bean declarations always declare
simple beans</text>
+ </assertion>
+
+ </section>
+
+ <section id="9.5.1" title="Child elements of a bean
declaration">
+ <assertion id="a">
+ <text>If the child element can be interpreted as a Java annotation type, the
container interprets the child element as declaring type-level metadata</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the child element can be interpreted as a Java class or interface,
the container interprets the child element as declaring a parameter of the bean
constructor</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the child element namespace is the same as the namespace of the
parent, the container interprets the element as declaring a method or field of the
bean</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the name of the child element matches the name of both a method and
a field of the bean class, a DefinitionException is thrown by the container at deployment
time</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the name of the child element matches the name of a method of the
bean class, is it interpreted to represent that method</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the name of the child element matches the name of a field of the
bean class, is it interpreted to represent that field</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Otherwise, a DefinitionException is thrown by the container at
deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="9.5.2" title="Type-level metadata for a bean">
+ <assertion id="a">
+ <text>Type-level metadata is specified via direct child elements of the bean
declaration that represent Java annotation types</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The child element is interpreted as a Java annotation
type</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the annotation type is a deployment type, the deployment type of the
bean was declared, as defined in Section 2.5.4, "Declaring the deployment type of a
bean using XML"</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the annotation type is a scope type, the scope of the bean was
declared, as defined in Section 2.4.4, "Declaring the bean scope using
XML"</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the annotation type is a binding type, a binding of the bean was
declared, as defined in Section 2.3.4, "Declaring the bindings of a bean using
XML"</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the annotation type is an interceptor binding type, an interceptor
binding of the bean was declared, as defined in Section A.3.6.2, "Binding an
interceptor using XML"</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the annotation type is a stereotype, a stereotype of the bean was
declared, as defined in Section 2.7.3, "Declaring the stereotypes for a bean using
XML"</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If the annotation type is javax.annotation.Name, the name of the bean
was declared, as defined in Section 2.6.2, "Declaring the bean name using
XML"</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If the annotation type is javax.inject.Specializes, the bean was
declared to directly specialize the bean with the same bean class that was defined using
annotations, as specified in Section 3.2.7, "Specializing a simple bean" and
Section 3.3.7, "Specializing a session bean"</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If the annotation type is javax.inject.Realizes, the bean was declared
to realize the bean with the same bean class that was defined using
annotations</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If the annotation type is javax.interceptor.Interceptor, or
javax.decorator.Decorator the bean is an interceptor or decorator, as defined in Section
9.7, "Interceptor and decorator declarations"</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>If the annotation type is javax.annotation.Resource, javax.ejb.EJB,
javax.xml.ws.WebServiceRef, javax.persistence.PersistenceContext or
javax.persistence.PersistenceUnit, the metadata for a resource or JMS resource was
declared, as defined in Section 3.6.1, "Declaring a resource using XML" and
Section 3.7.2, "Declaring a JMS resource using XML"</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>Otherwise, a DefinitionException is thrown by the container at
deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="9.5.3" title="Bean constructor declarations">
+ <assertion id="a">
+ <text>The bean constructor for a simple bean is declared by the list of
direct child elements of the bean declaration that represent Java class or interface
types</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The container interprets these elements as declaring parameters of the
constructor</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Each constructor parameter declaration is interpreted as an injection
point declaration, as specified in Section 9.8, "Injection point
declarations"</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the simple bean class has exactly one constructor such that the
constructor has the same number of parameters as the bean declaration has constructor
parameter declarations, and the Java type represented by each constructor parameter
declaration is assignable to the Java type of the corresponding constructor parameter then
the element is interpreted to represent that constructor, and that constructor is the bean
constructor</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If more than one constructor exists which satisfies these conditions, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If no constructor of the simple bean class satisfies these conditions,
a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>For any constructor parameter, the bean type declared in XML may be a
subtype of the Java parameter type. In this case, the container will use the bean type
declared in XML when resolving the dependency</text>
+ </assertion>
+ </section>
+
+ <section id="9.5.4" title="Fields of a bean">
+ <assertion id="a">
+ <text>A field of a bean is declared by a direct child element of the bean
declaration. The name of the field is the same as the name of the element</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the bean class has exactly one field with the same name as the child
element, then the child element is interpreted to represent that field</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean class does not have exactly one field with the specified
name, a DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If more than one child element of a bean declaration represents the
same field of the bean class, a DefinitionException is thrown by the container at
deployment time</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A field declaration may contain child elements</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If a field declaration has more than one direct child element, and at
least
+one of these elements is something other than a <value> element in the Java
EE namespace, a DefinitionException is thrown by the container at deployment
time</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>An element that represents a field may declare an injected field, a
producer field or a field with an initial value</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If the element contains a child <Produces> element in the
Java EE namespace, a producer field was declared, as defined in Section 3.5.3,
"Declaring a producer field using XML"</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If the element contains a child <value> element in the
Java EE namespace, a field with an initial value of type Set or List was declared, as
defined in Section 9.5.5, "Field initial value declarations"</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If the element has exactly one child element, an injected field was
declared, as defined in Section 3.8.2, "Declaring an injected field using
XML"</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If the element has a non-empty body, and no child elements, a field
with an initial value was declared, as defined in Section 9.5.5, "Field initial value
declarations"</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>Otherwise, a DefinitionException is thrown by the container at
deployment time</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>If a field declaration represents an injected field, the child element
is interpreted as an injection point declaration, as specified in Section 9.8,
"Injection point declarations"</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>If the declared type is not assignable to the Java type of the field, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>The bean type declared in XML may be a subtype of the Java field type.
In this case, the container will use the bean type declared in XML when resolving the
dependency</text>
+ </assertion>
+
+ </section>
+
+ <section id="9.5.5" title="Field initial value
declarations">
+ <assertion id="a">
+ <text>The initial value of a field of a simple bean or session bean with any
one of the following types may be specified in XML: any primitive type, or java.lang
wrapper type, any enumerated type, java.lang.String, java.util.Date, java.sql.Date,
java.sql.Time or java.sql.Timestamp, java.util.Calendar, java.math.BigDecimal or
java.math.BigInteger, java.lang.Class, java.util.List<java.lang.String> or
java.util.Set<java.lang.String>,
java.util.List<java.lang.Class> or
java.util.Set<java.lang.Class>, java.util.List<X> or
java.util.Set<X> where X is an enumerated type</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The initial value of the field is specified in the body of an XML
element representing the field</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The initial value of a field of primitive type or java.lang wrapper
type is specified using the Java literal syntax for that type</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The initial value of a field of type java.lang.String is specified
using the string value</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The initial value of a field of enumerated type is specified using the
unqualified name of the enumeration value</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The initial value of a field of type java.util.Date, java.sql.Date,
java.sql.Time, java.sql.Timestamp or java.util.Calendar is specified using a format that
can be parsed by calling
+java.text.DateFormat.getDateTimeInstance().parse()</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The initial value of a field of type java.math.BigDecimal or
java.math.BigInteger is specified using a format that can be parsed by the constructor
that accepts a string</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The initial value of a field of type java.lang.Class is specified using
the fully qualified Java class name</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The initial value of a field of type java.util.List or java.util.Set is
specified by a list of <value> elements. The body of the value element is
specified using the string value, fully qualified Java class name or unqualified name of
the enumeration value</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If a field with an initial value specified in XML is not of one of the
listed types, or if the initial value is not specified in the correct format for the type
of the field, a DefinitionException is thrown by the container at deployment
time</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If an element representing a field specifies both an initial value and
a type declaration, a DefinitionException is thrown by the container at deployment
time</text>
+ </assertion>
+ </section>
+
+ <section id="9.5.6" title="Methods of a bean">
+ <assertion id="a">
+ <text>A method of a bean is declared by a direct child element of the bean
declaration. The name of the declared method is the same as the name of the child
element</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A method declaration may have any number of direct child
elements</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container inspects the direct child elements of the method
declaration. For each child element, the element is interpreted as a Java type. If no such
Java type exists in the classpath, a DefinitionException is thrown by the container at
deployment time</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the type is javax.inject.Disposes, the container searches for a
direct child element of the child element and interprets that element as declaring a
disposed parameter of the disposal method</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the type is javax.event.Observes, the container searches for a
direct child element of the child element that is not an <IfExists>,
<Asynchronously>, <AfterTransactionCompletion>,
<AfterTransactionSuccess>, <AfterTransactionFailure> or
<BeforeTransactionCompletion> element in the Java EE namespace, and
interprets that element as declaring an event parameter of the observer
method</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the type is some other Java annotation type, the container
interprets the child element as declaring method-level metadata</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>If the type is a Java class or interface, the container interprets the
child element as declaring a parameter of the method</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>Otherwise, a DefinitionException is thrown by the container at
deployment time</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>If a method declaration has more than one direct child element which is
an <Initializer>, <Produces>, <Disposes> or
<Observes> element in the Java EE namespace, a DefinitionException is thrown
by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If a <Disposes> element does not contain exactly one
direct child element, a DefinitionException is thrown by the container at deployment
time</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If an <Observes> element does not contain exactly one
direct child element that is not an <IfExists>,
<Asynchronously>, <AfterTransactionCompletion>,
<AfterTransactionSuccess>, <AfterTransactionFailure> or
<BeforeTransactionCompletion> element in the Java EE namespace, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>Each method parameter declaration and disposed parameter declaration is
interpreted as an injection point declaration, as specified in Section 9.8,
"Injection point declarations". An event parameter declaration is interpreted as
a type declaration, as defined in Section 9.10, "Specifying bean types and
bindings"</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>If the bean class has exactly one method such that the method name is
the same as the name of the element that declares the method, the method has the same
number of parameters as the element that declares the method has child elements, and the
Java type represented by each method parameter declaration is assignable to the Java type
of the corresponding method parameter, then the element is interpreted to represent that
method</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>If more than one method exists which satisfies these conditions, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>If no method of the bean class satisfies these conditions, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>For any method parameter, the bean type declared in XML may be a
subtype of the Java parameter type. In this case, the container will use the bean type
declared in XML when resolving the dependency</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>If more than one child element of a bean declaration represents the
same method of the bean class, a DefinitionException is thrown by the container at
deployment time</text>
+ </assertion>
+
+ <assertion id="r">
+ <text>An element that represents a method may declare an initializer method,
an observer method, a producer method or a disposal method. Alternatively, or
additionally, it may declare method-level interceptor binding</text>
+ </assertion>
+
+ <assertion id="s">
+ <text>If the element contains a child <Initializes> element in
the Java EE namespace, an initializer method was declared, as defined in Section 3.9.2,
"Declaring an initializer method using XML"</text>
+ </assertion>
+
+ <assertion id="t">
+ <text>If the element contains a child <Produces> element in the
Java EE namespace, a producer method was declared, as defined in Section 3.4.3,
"Declaring a producer method using XML"</text>
+ </assertion>
+
+ <assertion id="u">
+ <text>If the element contains a child <Disposes> element in the
Java EE namespace, a disposal method was declared, as defined in Section 3.4.9,
"Declaring a disposal method using XML"</text>
+ </assertion>
+
+ <assertion id="v">
+ <text>If the element contains a child <Observes> element in the
Java EE namespace, an observer method was declared, as defined in Section 7.5.3,
"Declaring an observer method using XML"</text>
+ </assertion>
+
+ <assertion id="w">
+ <text>If the element contains a child element which can be interpreted as an
interceptor binding type, method-level interceptor binding was declared, as defined in
Section A.3.6.2, "Binding an interceptor using XML"</text>
+ </assertion>
+ </section>
+
+ <section id="9.6" title="Producer method and field
declarations">
+ <assertion id="a">
+ <text>A producer method or field declaration is formed by adding a direct
child <Produces> element to an element that represents the method or field,
as defined in Section 3.4.3, "Declaring a producer method using XML" and Section
3.5.3, "Declaring a producer field using XML"</text>
+ </assertion>
+
+ </section>
+
+ <section id="9.6.1" title="Child elements of a producer field
declaration">
+ <assertion id="a">
+ <text>The container inspects the direct child elements of a producer field
declaration</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If there is more than one direct child element, a DefinitionException
is thrown by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Otherwise, the direct child element is a <Produces>
element in the Java EE namespace, and declares the return type, bindings and member-level
metadata of the producer field</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container inspects the direct child elements of the
<Produces> element. For each child element, the element is interpreted as a
Java type. If no such Java type exists in the classpath, a DefinitionException is thrown
by the container at deployment time</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the type is a Java class or interface type, the type of the producer
field was declared</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the type is a Java annotation type, it declares member-level
metadata of the producer field</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Otherwise, a DefinitionException is thrown by the container at
deployment time</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If more than one child element represents a Java class or interface
type, or if no child element represents a Java class or interface type, a
DefinitionException is thrown by the container at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="9.6.2" title="Child elements of a producer method
declaration">
+
+ </section>-->
+
+</specification>
Deleted: tck/tags/1.0.0.ALPHA2/pom.xml
===================================================================
--- tck/trunk/pom.xml 2009-03-08 22:37:17 UTC (rev 1823)
+++ tck/tags/1.0.0.ALPHA2/pom.xml 2009-03-09 00:18:30 UTC (rev 1853)
@@ -1,352 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.jsr299.tck</groupId>
- <artifactId>parent</artifactId>
- <packaging>pom</packaging>
- <version>1.0.0-SNAPSHOT</version>
- <name>JSR-299 TCK</name>
- <
url>http://www.seamframework.org/WebBeans</url>
-
- <developers>
- <developer>
- <name>Pete Muir</name>
- <email>pete.muir(a)jboss.org</email>
- <organization>JBoss, a division of Red Hat</organization>
- <url>http://in.relation.to/Bloggers/Pete</url>
- </developer>
-
- <developer>
- <name>Shane Bryzak</name>
- <organization>JBoss, a division of Red Hat</organization>
- </developer>
-
- <developer>
- <name>David Allen</name>
- </developer>
-
- <developer>
- <name>Nicklas Karlsson</name>
- </developer>
- </developers>
-
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <
url>http://repository.jboss.org/maven2</url>
- </repository>
- <repository>
- <id>snapshots.jboss.org</id>
- <name>JBoss Repository</name>
- <
url>http://snapshots.jboss.org/maven2</url>
- </repository>
- </repositories>
-
- <pluginRepositories>
- <pluginRepository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <
url>http://repository.jboss.org/maven2</url>
- </pluginRepository>
- </pluginRepositories>
-
- <modules>
- <module>api</module>
- <module>impl</module>
- </modules>
-
- <dependencyManagement>
- <dependencies>
-
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>5.8</version>
- <classifier>jdk15</classifier>
- </dependency>
-
- <dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- </dependency>
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- <version>1.0.1B</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- </dependency>
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <version>1.2</version>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.2_10</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.webbeans</groupId>
- <artifactId>jsr299-api</artifactId>
- <version>${webbeans.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.jsr299.tck</groupId>
- <artifactId>jsr299-tck-api</artifactId>
- <version>${jsr299.tck.version}</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>tck-utils-api</artifactId>
- <version>0.9-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>tck-utils-impl</artifactId>
- <version>0.9-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.ejb3</groupId>
- <artifactId>jboss-ejb3-api</artifactId>
- <version>3.1.0-Alpha1</version>
- <exclusions>
- <exclusion>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>persistence-api</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.1</version>
- </dependency>
- <dependency>
- <groupId>net.sourceforge.htmlunit</groupId>
- <artifactId>htmlunit</artifactId>
- <version>2.4</version>
- </dependency>
-
- </dependencies>
- </dependencyManagement>
-
- <build>
- <defaultGoal>install</defaultGoal>
- <extensions>
- <extension>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-webdav</artifactId>
- <version>1.0-beta-2</version>
- </extension>
- </extensions>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>verify</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <configuration>
-
<
tagBase>https://svn.jboss.org/repos/webbeans/tck/tags</tagBase>
- <autoVersionSubmodules>true</autoVersionSubmodules>
- <allowTimestampedSnapshots>true</allowTimestampedSnapshots>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- </plugin>
- </plugins>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0.2</version>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
- <addDefaultImplementationEntries>
- true
- </addDefaultImplementationEntries>
- <addDefaultSpecificationEntries>
- true
- </addDefaultSpecificationEntries>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.4.3</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.3</version>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>properties-maven-plugin</artifactId>
- <version>1.0-alpha-1</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-clean-plugin</artifactId>
- <version>2.2</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.4</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-install-plugin</artifactId>
- <version>2.2</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <version>2.0-beta-6</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.0.4</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.2</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.2</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.0</version>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.1</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>1.0-alpha-4</version>
- <executions>
- <execution>
- <id>enforce</id>
- <goals>
- <goal>enforce</goal>
- </goals>
- <configuration>
- <rules>
- <requireMavenVersion>
- <version>2.0.9</version>
- </requireMavenVersion>
- <requirePluginVersions>
- <unCheckedPlugins>
-
<unCheckedPlugin>org.apache.maven.plugins:maven-eclipse-plugin</unCheckedPlugin>
- </unCheckedPlugins>
- </requirePluginVersions>
- </rules>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <version>2.0-beta-8</version>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
- <ciManagement>
- <system>Hudson</system>
- <url />
- </ciManagement>
-
- <issueManagement>
- <system>JIRA</system>
- <
url>http://jira.jboss.org/browse/WBTCK</url>
- </issueManagement>
-
- <inceptionYear>2008</inceptionYear>
-
- <licenses>
- <license>
- <name>Apache License, Version 2.0</name>
- <
url>http://www.apache.org/licenses/LICENSE-2.0</url>
- </license>
- </licenses>
-
- <scm>
-
<
connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans</connect...
- <developerConnection>
-
scm:svn:https://svn.jboss.org/repos/webbeans
- </developerConnection>
- <
url>http://fisheye.jboss.org/browse/WebBeans</url>
- </scm>
-
- <distributionManagement>
- <repository>
- <!-- Copy the dist to the local checkout of the JBoss maven2 repo
${maven.repository.root} -->
- <!-- It is anticipated that ${maven.repository.root} be set in user's
settings.xml -->
- <!-- todo : replace this with direct svn access once the svnkit providers are
available -->
- <id>repository.jboss.org</id>
- <url>file://${maven.repository.root}</url>
- </repository>
- <snapshotRepository>
- <id>snapshots.jboss.org</id>
- <name>JBoss Snapshot Repository</name>
- <
url>dav:https://snapshots.jboss.org/maven2</url>
- </snapshotRepository>
- </distributionManagement>
-
- <properties>
- <webbeans.version>1.0.0-SNAPSHOT</webbeans.version>
- <jsr299.tck.version>1.0.0-SNAPSHOT</jsr299.tck.version>
- </properties>
-
-</project>
Copied: tck/tags/1.0.0.ALPHA2/pom.xml (from rev 1852, tck/trunk/pom.xml)
===================================================================
--- tck/tags/1.0.0.ALPHA2/pom.xml (rev 0)
+++ tck/tags/1.0.0.ALPHA2/pom.xml 2009-03-09 00:18:30 UTC (rev 1853)
@@ -0,0 +1,347 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.jsr299.tck</groupId>
+ <artifactId>parent</artifactId>
+ <packaging>pom</packaging>
+ <version>1.0.0.ALPHA2</version>
+ <name>JSR-299 TCK</name>
+ <
url>http://www.seamframework.org/WebBeans</url>
+
+ <developers>
+ <developer>
+ <name>Pete Muir</name>
+ <email>pete.muir(a)jboss.org</email>
+ <organization>JBoss, a division of Red Hat</organization>
+ <url>http://in.relation.to/Bloggers/Pete</url>
+ </developer>
+
+ <developer>
+ <name>Shane Bryzak</name>
+ <organization>JBoss, a division of Red Hat</organization>
+ </developer>
+
+ <developer>
+ <name>David Allen</name>
+ </developer>
+
+ <developer>
+ <name>Nicklas Karlsson</name>
+ </developer>
+ </developers>
+
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <
url>http://repository.jboss.org/maven2</url>
+ </repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Repository</name>
+ <
url>http://snapshots.jboss.org/maven2</url>
+ </repository>
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <
url>http://repository.jboss.org/maven2</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <modules>
+ <module>api</module>
+ <module>impl</module>
+ </modules>
+
+ <dependencyManagement>
+ <dependencies>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.8</version>
+ <classifier>jdk15</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <version>1.0.1B</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_10</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>jsr299-api</artifactId>
+ <version>1.0.0.BETA1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.jsr299.tck</groupId>
+ <artifactId>jsr299-tck-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>tck-utils-api</artifactId>
+ <version>0.9</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>tck-utils-impl</artifactId>
+ <version>0.9</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-api</artifactId>
+ <version>3.1.0-Alpha1</version>
+ <exclusions>
+ <exclusion>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>2.4</version>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav</artifactId>
+ <version>1.0-beta-2</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <configuration>
+
<
tagBase>https://svn.jboss.org/repos/webbeans/tck/tags</tagBase>
+ <autoVersionSubmodules>true</autoVersionSubmodules>
+ <allowTimestampedSnapshots>true</allowTimestampedSnapshots>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultImplementationEntries>
+ true
+ </addDefaultImplementationEntries>
+ <addDefaultSpecificationEntries>
+ true
+ </addDefaultSpecificationEntries>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.4.3</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>properties-maven-plugin</artifactId>
+ <version>1.0-alpha-1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>2.0-beta-6</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.0.4</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.0</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0-alpha-4</version>
+ <executions>
+ <execution>
+ <id>enforce</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireMavenVersion>
+ <version>2.0.9</version>
+ </requireMavenVersion>
+ <requirePluginVersions>
+ <unCheckedPlugins>
+
<unCheckedPlugin>org.apache.maven.plugins:maven-eclipse-plugin</unCheckedPlugin>
+ </unCheckedPlugins>
+ </requirePluginVersions>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>2.0-beta-8</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <ciManagement>
+ <system>Hudson</system>
+ <url />
+ </ciManagement>
+
+ <issueManagement>
+ <system>JIRA</system>
+ <
url>http://jira.jboss.org/browse/WBTCK</url>
+ </issueManagement>
+
+ <inceptionYear>2008</inceptionYear>
+
+ <licenses>
+ <license>
+ <name>Apache License, Version 2.0</name>
+ <
url>http://www.apache.org/licenses/LICENSE-2.0</url>
+ </license>
+ </licenses>
+
+ <scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans/1.0.0.ALPHA...
+ <developerConnection>
+
scm:svn:https://svn.jboss.org/repos/webbeans/tck/tags/1.0.0.ALPHA2
+ </developerConnection>
+ <
url>http://fisheye.jboss.org/browse/WebBeans/1.0.0.ALPHA2</url>
+ </scm>
+
+ <distributionManagement>
+ <repository>
+ <!-- Copy the dist to the local checkout of the JBoss maven2 repo
${maven.repository.root} -->
+ <!-- It is anticipated that ${maven.repository.root} be set in user's
settings.xml -->
+ <!-- todo : replace this with direct svn access once the svnkit providers are
available -->
+ <id>repository.jboss.org</id>
+ <url>file://${maven.repository.root}</url>
+ </repository>
+ <snapshotRepository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshot Repository</name>
+ <
url>dav:https://snapshots.jboss.org/maven2</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+</project>