[webbeans-commits] Webbeans SVN: r3189 - ri/branches.
by webbeans-commits@lists.jboss.org
Author: rogerk
Date: 2009-07-23 23:21:13 -0400 (Thu, 23 Jul 2009)
New Revision: 3189
Added:
ri/branches/1.0.0.PREVIEW2.SP1/
Log:
SP1 branch
Copied: ri/branches/1.0.0.PREVIEW2.SP1 (from rev 3188, ri/branches/1.0.0.PREVIEW2)
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3186 - in ri/branches/1.0.0.PREVIEW2.SP1: api and 10 other directories.
by webbeans-commits@lists.jboss.org
Author: rogerk
Date: 2009-07-23 23:06:51 -0400 (Thu, 23 Jul 2009)
New Revision: 3186
Modified:
ri/branches/1.0.0.PREVIEW2.SP1/api/pom.xml
ri/branches/1.0.0.PREVIEW2.SP1/core-api/pom.xml
ri/branches/1.0.0.PREVIEW2.SP1/impl/pom.xml
ri/branches/1.0.0.PREVIEW2.SP1/jboss-tck-runner/pom.xml
ri/branches/1.0.0.PREVIEW2.SP1/logging/pom.xml
ri/branches/1.0.0.PREVIEW2.SP1/osgi-bundle/pom.xml
ri/branches/1.0.0.PREVIEW2.SP1/parent/pom.xml
ri/branches/1.0.0.PREVIEW2.SP1/pom.xml
ri/branches/1.0.0.PREVIEW2.SP1/porting-package/pom.xml
ri/branches/1.0.0.PREVIEW2.SP1/spi/pom.xml
ri/branches/1.0.0.PREVIEW2.SP1/tests/pom.xml
ri/branches/1.0.0.PREVIEW2.SP1/version-matrix/pom.xml
Log:
pom updates
Modified: ri/branches/1.0.0.PREVIEW2.SP1/api/pom.xml
===================================================================
--- ri/branches/1.0.0.PREVIEW2.SP1/api/pom.xml 2009-07-24 02:56:23 UTC (rev 3185)
+++ ri/branches/1.0.0.PREVIEW2.SP1/api/pom.xml 2009-07-24 03:06:51 UTC (rev 3186)
@@ -4,12 +4,12 @@
<parent>
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-parent</artifactId>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
</parent>
<groupId>org.jboss.webbeans</groupId>
<artifactId>jsr299-api</artifactId>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
<packaging>jar</packaging>
<name>JSR-299 API</name>
<url>http://www.seamframework.org/WebBeans</url>
Modified: ri/branches/1.0.0.PREVIEW2.SP1/core-api/pom.xml
===================================================================
--- ri/branches/1.0.0.PREVIEW2.SP1/core-api/pom.xml 2009-07-24 02:56:23 UTC (rev 3185)
+++ ri/branches/1.0.0.PREVIEW2.SP1/core-api/pom.xml 2009-07-24 03:06:51 UTC (rev 3186)
@@ -2,12 +2,12 @@
<parent>
<artifactId>webbeans-parent</artifactId>
<groupId>org.jboss.webbeans</groupId>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-api</artifactId>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
<name>Web Beans Core API</name>
<dependencies>
Modified: ri/branches/1.0.0.PREVIEW2.SP1/impl/pom.xml
===================================================================
--- ri/branches/1.0.0.PREVIEW2.SP1/impl/pom.xml 2009-07-24 02:56:23 UTC (rev 3185)
+++ ri/branches/1.0.0.PREVIEW2.SP1/impl/pom.xml 2009-07-24 03:06:51 UTC (rev 3186)
@@ -2,12 +2,12 @@
<parent>
<artifactId>webbeans-parent</artifactId>
<groupId>org.jboss.webbeans</groupId>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-core</artifactId>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
<name>Web Beans Core</name>
<dependencies>
Modified: ri/branches/1.0.0.PREVIEW2.SP1/jboss-tck-runner/pom.xml
===================================================================
--- ri/branches/1.0.0.PREVIEW2.SP1/jboss-tck-runner/pom.xml 2009-07-24 02:56:23 UTC (rev 3185)
+++ ri/branches/1.0.0.PREVIEW2.SP1/jboss-tck-runner/pom.xml 2009-07-24 03:06:51 UTC (rev 3186)
@@ -2,7 +2,7 @@
<parent>
<artifactId>webbeans-parent</artifactId>
<groupId>org.jboss.webbeans</groupId>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.webbeans</groupId>
Modified: ri/branches/1.0.0.PREVIEW2.SP1/logging/pom.xml
===================================================================
--- ri/branches/1.0.0.PREVIEW2.SP1/logging/pom.xml 2009-07-24 02:56:23 UTC (rev 3185)
+++ ri/branches/1.0.0.PREVIEW2.SP1/logging/pom.xml 2009-07-24 03:06:51 UTC (rev 3186)
@@ -2,12 +2,12 @@
<parent>
<artifactId>webbeans-parent</artifactId>
<groupId>org.jboss.webbeans</groupId>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-logging</artifactId>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
<name>Web Beans Logging</name>
<dependencies>
Modified: ri/branches/1.0.0.PREVIEW2.SP1/osgi-bundle/pom.xml
===================================================================
--- ri/branches/1.0.0.PREVIEW2.SP1/osgi-bundle/pom.xml 2009-07-24 02:56:23 UTC (rev 3185)
+++ ri/branches/1.0.0.PREVIEW2.SP1/osgi-bundle/pom.xml 2009-07-24 03:06:51 UTC (rev 3186)
@@ -21,7 +21,7 @@
<parent>
<artifactId>webbeans-parent</artifactId>
<groupId>org.jboss.webbeans</groupId>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: ri/branches/1.0.0.PREVIEW2.SP1/parent/pom.xml
===================================================================
--- ri/branches/1.0.0.PREVIEW2.SP1/parent/pom.xml 2009-07-24 02:56:23 UTC (rev 3185)
+++ ri/branches/1.0.0.PREVIEW2.SP1/parent/pom.xml 2009-07-24 03:06:51 UTC (rev 3186)
@@ -3,12 +3,12 @@
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-parent</artifactId>
<packaging>pom</packaging>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
<parent>
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-version-matrix</artifactId>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
</parent>
<name>Web Beans, the reference implementation of JSR-299</name>
@@ -218,9 +218,9 @@
</licenses>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans/ri/branches/1.0.0.PREVIEW...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/webbeans/ri/branches/1.0.0.PREVIEW2/p...</developerConnection>
- <url>http://fisheye.jboss.org/browse/WebBeans/ri/tags/1.0.0.PREVIEW2/ri</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans/ri/tags/1.0.0.PREVIEW2.SP...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/webbeans/ri/tags/1.0.0.PREVIEW2.SP1/p...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/WebBeans/ri/tags/1.0.0.PREVIEW2.SP1/ri</url>
</scm>
<distributionManagement>
Modified: ri/branches/1.0.0.PREVIEW2.SP1/pom.xml
===================================================================
--- ri/branches/1.0.0.PREVIEW2.SP1/pom.xml 2009-07-24 02:56:23 UTC (rev 3185)
+++ ri/branches/1.0.0.PREVIEW2.SP1/pom.xml 2009-07-24 03:06:51 UTC (rev 3186)
@@ -3,15 +3,15 @@
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-build-aggregator</artifactId>
<packaging>pom</packaging>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
<name>Web Beans Build Aggregator</name>
<url>http://www.seamframework.org/WebBeans</url>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans/ri/branches/1.0.0.PREVIEW2</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/webbeans/ri/branches/1.0.0.PREVIEW2</developerConnection>
- <url>http://fisheye.jboss.org/browse/WebBeans/branches/1.0.0.PREVIEW2</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans/ri/tags/1.0.0.PREVIEW2.SP1</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/webbeans/ri/tags/1.0.0.PREVIEW2.SP1</developerConnection>
+ <url>http://fisheye.jboss.org/browse/WebBeans/tags/1.0.0.PREVIEW2.SP1</url>
</scm>
<distributionManagement>
Modified: ri/branches/1.0.0.PREVIEW2.SP1/porting-package/pom.xml
===================================================================
--- ri/branches/1.0.0.PREVIEW2.SP1/porting-package/pom.xml 2009-07-24 02:56:23 UTC (rev 3185)
+++ ri/branches/1.0.0.PREVIEW2.SP1/porting-package/pom.xml 2009-07-24 03:06:51 UTC (rev 3186)
@@ -2,12 +2,12 @@
<parent>
<artifactId>webbeans-parent</artifactId>
<groupId>org.jboss.webbeans</groupId>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-porting-package</artifactId>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
<name>Web Beans Porting Package for JSR-299 TCK</name>
<dependencies>
Modified: ri/branches/1.0.0.PREVIEW2.SP1/spi/pom.xml
===================================================================
--- ri/branches/1.0.0.PREVIEW2.SP1/spi/pom.xml 2009-07-24 02:56:23 UTC (rev 3185)
+++ ri/branches/1.0.0.PREVIEW2.SP1/spi/pom.xml 2009-07-24 03:06:51 UTC (rev 3186)
@@ -2,12 +2,12 @@
<parent>
<artifactId>webbeans-parent</artifactId>
<groupId>org.jboss.webbeans</groupId>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-spi</artifactId>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
<name>Web Beans Service Provider Interfaces</name>
<dependencies>
Modified: ri/branches/1.0.0.PREVIEW2.SP1/tests/pom.xml
===================================================================
--- ri/branches/1.0.0.PREVIEW2.SP1/tests/pom.xml 2009-07-24 02:56:23 UTC (rev 3185)
+++ ri/branches/1.0.0.PREVIEW2.SP1/tests/pom.xml 2009-07-24 03:06:51 UTC (rev 3186)
@@ -2,12 +2,12 @@
<parent>
<artifactId>webbeans-parent</artifactId>
<groupId>org.jboss.webbeans</groupId>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-core-test</artifactId>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
<name>Web Beans Core Tests</name>
<dependencies>
Modified: ri/branches/1.0.0.PREVIEW2.SP1/version-matrix/pom.xml
===================================================================
--- ri/branches/1.0.0.PREVIEW2.SP1/version-matrix/pom.xml 2009-07-24 02:56:23 UTC (rev 3185)
+++ ri/branches/1.0.0.PREVIEW2.SP1/version-matrix/pom.xml 2009-07-24 03:06:51 UTC (rev 3186)
@@ -3,7 +3,7 @@
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-version-matrix</artifactId>
<packaging>pom</packaging>
- <version>1.0.0.PREVIEW2</version>
+ <version>1.0.0.PREVIEW2.SP1</version>
<name>Web Beans Version Matrix</name>
<url>http://www.seamframework.org/WebBeans</url>
@@ -48,7 +48,7 @@
<properties>
<jsr299.tck.version>1.0.0.BETA3</jsr299.tck.version>
- <webbeans.version>1.0.0.PREVIEW2</webbeans.version>
+ <webbeans.version>1.0.0.PREVIEW2.SP1</webbeans.version>
<webbeans.servlet.version>1.0.0.CR1</webbeans.servlet.version>
<webbeans.se.version>1.0.0.BETA1</webbeans.se.version>
<jboss.test.harness.version>1.0.0.BETA3</jboss.test.harness.version>
@@ -531,9 +531,9 @@
</distributionManagement>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans/ri/branches/1.0.0.PREVIEW...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/webbeans/ri/branches/1.0.0.PREVIEW2/v...</developerConnection>
- <url>http://fisheye.jboss.org/browse/WebBeans/ri/branches/1.0.0.PREVIEW2/ri</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/webbeans/ri/tags/1.0.0.PREVIEW2.SP...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/webbeans/ri/tags/1.0.0.PREVIEW2.SP1/v...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/WebBeans/ri/tags/1.0.0.PREVIEW2.SP1/ri</url>
</scm>
</project>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3185 - ri/branches.
by webbeans-commits@lists.jboss.org
Author: rogerk
Date: 2009-07-23 22:56:23 -0400 (Thu, 23 Jul 2009)
New Revision: 3185
Added:
ri/branches/1.0.0.PREVIEW2.SP1/
Log:
SP1 branch
Copied: ri/branches/1.0.0.PREVIEW2.SP1 (from rev 3184, ri/branches/1.0.0.PREVIEW2)
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3184 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck: tests/event and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-07-23 22:26:26 -0400 (Thu, 23 Jul 2009)
New Revision: 3184
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/Item_Illegal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/StudentDirectory.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/AlarmSystem.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/BreakInEvent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/NotABindingType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SecurityEvent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SecurityEvent_Illegal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SecuritySensor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SelectEventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SystemTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/Violent.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/ImplicitEventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/Registration.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/Student.java
Log:
tests for the Event interface
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java 2009-07-24 02:24:33 UTC (rev 3183)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java 2009-07-24 02:26:26 UTC (rev 3184)
@@ -134,6 +134,12 @@
return resolveUniqueBean(type, beans);
}
+ public <T> Bean<T> getUniqueBean(TypeLiteral<T> type, Annotation... bindings)
+ {
+ Set<Bean<T>> beans = getBeans(type, bindings);
+ return resolveUniqueBean(type.getType(), beans);
+ }
+
public <T> Set<Bean<T>> getBeans(Class<T> type, Annotation... bindings)
{
return (Set) getCurrentManager().getBeans(type, bindings);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java 2009-07-24 02:24:33 UTC (rev 3183)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java 2009-07-24 02:26:26 UTC (rev 3184)
@@ -22,6 +22,8 @@
* Tests that verify the event firing behavior of the Event
* interface.
*
+ * Spec version: 20090625
+ *
* @author Dan Allen
*/
@Artifact
@@ -189,5 +191,13 @@
assert housekeeping.getItemsTainted().size() == 1;
assert housekeeping.getItemsTainted().contains(water);
}
+
+ @Test(groups = "events", expectedExceptions = IllegalArgumentException.class)
+ @SpecAssertion(section = "10.3.1", id = "f")
+ public void testEventFireThrowsExceptionIfEventObjectContainsTypeVariable()
+ {
+ MiniBar miniBar = getInstanceByType(MiniBar.class);
+ miniBar.itemEvent.fire(new Item_Illegal<Integer>("12 oz Beer", 5.50));
+ }
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/Item_Illegal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/Item_Illegal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/Item_Illegal.java 2009-07-24 02:26:26 UTC (rev 3184)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.event.fires;
+
+class Item_Illegal<T> extends Item
+{
+
+ public Item_Illegal(String name, double price)
+ {
+ super(name, price);
+ }
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/ImplicitEventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/ImplicitEventTest.java 2009-07-24 02:24:33 UTC (rev 3183)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/ImplicitEventTest.java 2009-07-24 02:26:26 UTC (rev 3184)
@@ -1,12 +1,11 @@
package org.jboss.jsr299.tck.tests.event.implicit;
+import java.io.IOException;
import java.io.Serializable;
import javax.enterprise.context.Dependent;
import javax.enterprise.event.Event;
import javax.enterprise.inject.TypeLiteral;
-import javax.enterprise.inject.deployment.Standard;
-import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
@@ -17,60 +16,95 @@
/**
* Test that there is an implicit event bean for every legal event type
+ * and verify its composition.
*
- * Spec version: 20090519
+ * Spec version: 20090625
*
* @author Dan Allen
*/
@Artifact
public class ImplicitEventTest extends AbstractJSR299Test
{
- @Test
- @SpecAssertions({
- @SpecAssertion(section = "10.4.2", id = "a"),
- @SpecAssertion(section = "10.4.2", id = "b"),
- @SpecAssertion(section = "10.1", id = "i")
- })
+ private static final TypeLiteral<Event<StudentRegisteredEvent>> STUDENT_REGISTERED_EVENT_LITERAL = new TypeLiteral<Event<StudentRegisteredEvent>>() {};
+ private static final TypeLiteral<Event<CourseFullEvent>> COURSE_FULL_EVENT_LITERAL = new TypeLiteral<Event<CourseFullEvent>>() {};
+ private static final TypeLiteral<Event<AwardEvent>> AWARD_EVENT_LITERAL = new TypeLiteral<Event<AwardEvent>>() {};
+
+ @Test(groups = "events")
+ @SpecAssertion(section = "10.3.2", id = "a")
public void testImplicitEventExistsForEachEventType()
{
- assert getBeans(new TypeLiteral<Event<StudentRegisteredEvent>>() {}, new AnyLiteral()).size() == 1;
- assert getBeans(new TypeLiteral<Event<CourseFullEvent>>() {}, new AnyLiteral()).size() == 1;
- assert getBeans(new TypeLiteral<Event<AwardEvent>>() {}, new AnyLiteral()).size() == 1;
- assert getBeans(new TypeLiteral<Event<AwardEvent>>() {}, new AnyLiteral(), new HonorsLiteral()).size() == 1;
+ assert getBeans(STUDENT_REGISTERED_EVENT_LITERAL).size() == 1;
+ assert getBeans(COURSE_FULL_EVENT_LITERAL).size() == 1;
+ assert getBeans(AWARD_EVENT_LITERAL).size() == 1;
}
- @Test
- @SpecAssertions({
- @SpecAssertion(section = "10.4.2", id = "c"),
- @SpecAssertion(section = "10.4.2", id = "d"),
- @SpecAssertion(section = "10.4.2", id = "e"),
- @SpecAssertion(section = "10.4.2", id = "g"),
- @SpecAssertion(section = "6.6.2", id = "e")
- })
- public void testImplicitEventHasCorrectAttributes()
+ @Test(groups = "events")
+ @SpecAssertion(section = "10.3.2", id = "b")
+ public void testImplicitEventHasAllExplicitBindingTypes()
{
- Bean<Event<StudentRegisteredEvent>> event = getBeans(new TypeLiteral<Event<StudentRegisteredEvent>>() {}, new AnyLiteral()).iterator().next();
- assert event != null;
- assert event.getDeploymentType().equals(Standard.class);
- assert event.getScopeType().equals(Dependent.class);
- assert event.getName() == null;
- assert event.getBindings().size() == 1;
- assert event.getBindings().iterator().next().equals(new AnyLiteral());
- Registration registration = this.getInstanceByType(Registration.class);
- assert isSerializable(registration.getCourseFullEvent().getClass());
+ assert getBeans(AWARD_EVENT_LITERAL, new AnyLiteral(), new HonorsLiteral()).size() == 1;
}
- @Test
- @SpecAssertion(section = "10.4.2", id = "f")
- public void testImplicitEventImplementationProvidedByContainer()
+ @SpecAssertion(section = "10.1", id = "i")
+ public void testImplicitEventHasAnyBinding()
{
- assert getInstanceByType(Registration.class).getCourseFullEvent() != null;
-
+ assert getUniqueBean(STUDENT_REGISTERED_EVENT_LITERAL).getBindings().contains(new AnyLiteral());
+ assert getUniqueBean(COURSE_FULL_EVENT_LITERAL).getBindings().contains(new AnyLiteral());
+ assert getUniqueBean(AWARD_EVENT_LITERAL).getBindings().contains(new AnyLiteral());
+ assert getUniqueBean(AWARD_EVENT_LITERAL, new HonorsLiteral()).getBindings().contains(new AnyLiteral());
+ assert getUniqueBean(AWARD_EVENT_LITERAL, new AnyLiteral(), new HonorsLiteral()) == getUniqueBean(AWARD_EVENT_LITERAL, new HonorsLiteral());
}
- public static boolean isSerializable(Class<?> clazz)
+ @Test(groups = "events")
+ @SpecAssertion(section = "10.3.2", id = "d")
+ public void testImplicitEventHasDependentScope()
{
- return clazz.isPrimitive() || Serializable.class.isAssignableFrom(clazz);
+ assert getUniqueBean(STUDENT_REGISTERED_EVENT_LITERAL).getScopeType().equals(Dependent.class);
}
-
+
+ @Test(groups = "events")
+ @SpecAssertion(section = "10.3.2", id = "e")
+ public void testImplicitEventHasNoName()
+ {
+ assert getUniqueBean(STUDENT_REGISTERED_EVENT_LITERAL).getName() == null;
+ }
+
+ @Test(groups = "events")
+ @SpecAssertion(section = "10.3.2", id = "f")
+ public void testImplicitEventHasImplementation()
+ {
+ StudentDirectory directory = getInstanceByType(StudentDirectory.class);
+ directory.reset();
+ Registration registration = getInstanceByType(Registration.class);
+ assert registration.getInjectedCourseFullEvent() != null;
+ assert registration.getInjectedStudentRegisteredEvent() != null;
+ Event<StudentRegisteredEvent> event = registration.getInjectedStudentRegisteredEvent();
+ Student student = new Student("Dan");
+ event.fire(new StudentRegisteredEvent(student));
+ assert directory.getStudents().size() == 1;
+ assert directory.getStudents().contains(student);
+ }
+
+ @Test(groups = { "ri-broken", "events" })
+ @SpecAssertions({
+ @SpecAssertion(section = "10.3.2", id = "g"),
+ @SpecAssertion(section = "6.6.2", id = "e") // break up this assertion into smaller bits
+ })
+ public void testImplicitEventIsPassivationCapable() throws IOException, ClassNotFoundException
+ {
+ StudentDirectory directory = getInstanceByType(StudentDirectory.class);
+ directory.reset();
+ Registration registration = getInstanceByType(Registration.class);
+ Event<StudentRegisteredEvent> event = registration.getInjectedStudentRegisteredEvent();
+ assert Serializable.class.isAssignableFrom(event.getClass());
+ byte[] serializedEvent = serialize(event);
+ @SuppressWarnings("unchecked")
+ Event<StudentRegisteredEvent> eventCopy = (Event<StudentRegisteredEvent>) deserialize(serializedEvent);
+ // make sure we can still use it
+ Student student = new Student("Dan");
+ eventCopy.fire(new StudentRegisteredEvent(student));
+ assert directory.getStudents().size() == 1;
+ assert directory.getStudents().contains(student);
+ }
+
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/Registration.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/Registration.java 2009-07-24 02:24:33 UTC (rev 3183)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/Registration.java 2009-07-24 02:26:26 UTC (rev 3184)
@@ -10,13 +10,12 @@
private Event<CourseFullEvent> courseFullEvent;
- // FIXME @Any should not be required here
- public @Initializer Registration(@Any Event<CourseFullEvent> courseFullEvent)
+ public @Initializer Registration(Event<CourseFullEvent> courseFullEvent)
{
this.courseFullEvent = courseFullEvent;
}
- public void registerUser(Student student)
+ public void registerStudent(Student student)
{
studentRegisteredEvent.fire(new StudentRegisteredEvent(student));
}
@@ -26,8 +25,13 @@
courseFullEvent.fire(new CourseFullEvent(course));
}
- Event<CourseFullEvent> getCourseFullEvent()
+ Event<StudentRegisteredEvent> getInjectedStudentRegisteredEvent()
{
+ return studentRegisteredEvent;
+ }
+
+ Event<CourseFullEvent> getInjectedCourseFullEvent()
+ {
return courseFullEvent;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/Student.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/Student.java 2009-07-24 02:24:33 UTC (rev 3183)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/Student.java 2009-07-24 02:26:26 UTC (rev 3184)
@@ -2,4 +2,15 @@
class Student
{
+ private String name;
+
+ public Student(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/StudentDirectory.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/StudentDirectory.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/implicit/StudentDirectory.java 2009-07-24 02:26:26 UTC (rev 3184)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.event.implicit;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Any;
+
+@RequestScoped class StudentDirectory
+{
+ private Set<Student> students = new HashSet<Student>();
+
+ public void addStudent(@Observes @Any StudentRegisteredEvent event)
+ {
+ students.add(event.getStudent());
+ }
+
+ public Set<Student> getStudents()
+ {
+ return students;
+ }
+
+ public void reset()
+ {
+ students.clear();
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/AlarmSystem.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/AlarmSystem.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/AlarmSystem.java 2009-07-24 02:26:26 UTC (rev 3184)
@@ -0,0 +1,64 @@
+package org.jboss.jsr299.tck.tests.event.select;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Any;
+
+@RequestScoped class AlarmSystem
+{
+ private int numSecurityEvents = 0;
+
+ private int numSystemTests = 0;
+
+ private int numBreakIns = 0;
+
+ private int numViolentBreakIns = 0;
+
+ public void securityEventOccurred(@Observes @Any SecurityEvent event)
+ {
+ numSecurityEvents++;
+ }
+
+ public void selfTest(@Observes @SystemTest SecurityEvent event)
+ {
+ numSystemTests++;
+ }
+
+ public void breakInOccurred(@Observes @Any BreakInEvent event)
+ {
+ numBreakIns++;
+ }
+
+ public void securityBreeched(@Observes @Violent BreakInEvent event)
+ {
+ numViolentBreakIns++;
+ }
+
+ public int getNumSystemTests()
+ {
+ return numSystemTests;
+ }
+
+ public int getNumSecurityEvents()
+ {
+ return numSecurityEvents;
+ }
+
+ public int getNumBreakIns()
+ {
+ return numBreakIns;
+ }
+
+ public int getNumViolentBreakIns()
+ {
+ return numViolentBreakIns;
+ }
+
+ public void reset()
+ {
+ numBreakIns = 0;
+ numViolentBreakIns = 0;
+ numSecurityEvents = 0;
+ numSystemTests = 0;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/BreakInEvent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/BreakInEvent.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/BreakInEvent.java 2009-07-24 02:26:26 UTC (rev 3184)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.event.select;
+
+class BreakInEvent extends SecurityEvent
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/NotABindingType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/NotABindingType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/NotABindingType.java 2009-07-24 02:26:26 UTC (rev 3184)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.event.select;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@interface NotABindingType
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SecurityEvent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SecurityEvent.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SecurityEvent.java 2009-07-24 02:26:26 UTC (rev 3184)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.event.select;
+
+class SecurityEvent
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SecurityEvent_Illegal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SecurityEvent_Illegal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SecurityEvent_Illegal.java 2009-07-24 02:26:26 UTC (rev 3184)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.event.select;
+
+class SecurityEvent_Illegal<T> extends SecurityEvent
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SecuritySensor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SecuritySensor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SecuritySensor.java 2009-07-24 02:26:26 UTC (rev 3184)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.event.select;
+
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Any;
+
+class SecuritySensor
+{
+ @Any Event<SecurityEvent> securityEvent;
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SelectEventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SelectEventTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SelectEventTest.java 2009-07-24 02:26:26 UTC (rev 3184)
@@ -0,0 +1,92 @@
+package org.jboss.jsr299.tck.tests.event.select;
+
+import javax.enterprise.inject.AnnotationLiteral;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+/**
+ * These tests verify the behavior of the Event#select() method.
+ *
+ * Spec version: 20090625
+ *
+ * @author Dan Allen
+ */
+@Artifact
+public class SelectEventTest extends AbstractJSR299Test
+{
+ @Test(groups = "events")
+ @SpecAssertion(section = "10.3.1", id = "eaa")
+ public void testEventSelectReturnsEventOfSameType()
+ {
+ AlarmSystem alarm = getInstanceByType(AlarmSystem.class);
+ alarm.reset();
+ SecuritySensor sensor = getInstanceByType(SecuritySensor.class);
+
+ sensor.securityEvent.fire(new SecurityEvent());
+ assert alarm.getNumSecurityEvents() == 1;
+ assert alarm.getNumSystemTests() == 0;
+ assert alarm.getNumBreakIns() == 0;
+ assert alarm.getNumViolentBreakIns() == 0;
+
+ sensor.securityEvent.select(new AnnotationLiteral<SystemTest>() {}).fire(new SecurityEvent());
+ assert alarm.getNumSecurityEvents() == 2;
+ assert alarm.getNumSystemTests() == 1;
+ assert alarm.getNumBreakIns() == 0;
+ assert alarm.getNumViolentBreakIns() == 0;
+
+ sensor.securityEvent.select(BreakInEvent.class).fire(new BreakInEvent());
+ assert alarm.getNumSecurityEvents() == 3;
+ assert alarm.getNumSystemTests() == 1;
+ assert alarm.getNumBreakIns() == 1;
+ assert alarm.getNumViolentBreakIns() == 0;
+
+ sensor.securityEvent.select(BreakInEvent.class, new AnnotationLiteral<Violent>() {}).fire(new BreakInEvent());
+ assert alarm.getNumSecurityEvents() == 4;
+ assert alarm.getNumSystemTests() == 1;
+ assert alarm.getNumBreakIns() == 2;
+ assert alarm.getNumViolentBreakIns() == 1;
+ }
+
+ @Test(groups = { "ri-broken", "events" }, expectedExceptions = IllegalArgumentException.class)
+ @SpecAssertion(section = "10.3.1", id = "eab")
+ public void testEventSelectThrowsExceptionIfEventTypeHasTypeVariable()
+ {
+ SecuritySensor sensor = getInstanceByType(SecuritySensor.class);
+ sensor.securityEvent.select(SecurityEvent_Illegal.class);
+ }
+
+ @Test(groups = "events", expectedExceptions = IllegalArgumentException.class)
+ @SpecAssertion(section = "10.3.1", id = "eba")
+ public void testEventSelectThrowsExceptionForDuplicateBindingType()
+ {
+ SecuritySensor sensor = getInstanceByType(SecuritySensor.class);
+ sensor.securityEvent.select(new AnnotationLiteral<SystemTest>() {}, new AnnotationLiteral<SystemTest>() {});
+ }
+
+ @Test(groups = "events", expectedExceptions = IllegalArgumentException.class)
+ @SpecAssertion(section = "10.3.1", id = "eba")
+ public void testEventSelectWithSubtypeThrowsExceptionForDuplicateBindingType()
+ {
+ SecuritySensor sensor = getInstanceByType(SecuritySensor.class);
+ sensor.securityEvent.select(BreakInEvent.class, new AnnotationLiteral<Violent>() {}, new AnnotationLiteral<Violent>() {});
+ }
+
+ @Test(groups = "events", expectedExceptions = IllegalArgumentException.class)
+ @SpecAssertion(section = "10.3.1", id = "ec")
+ public void testEventSelectThrowsExceptionIfAnnotationIsNotBindingType()
+ {
+ SecuritySensor sensor = getInstanceByType(SecuritySensor.class);
+ sensor.securityEvent.select(new AnnotationLiteral<NotABindingType>() {});
+ }
+
+ @Test(groups = "events", expectedExceptions = IllegalArgumentException.class)
+ @SpecAssertion(section = "10.3.1", id = "ec")
+ public void testEventSelectWithSubtypeThrowsExceptionIfAnnotationIsNotBindingType()
+ {
+ SecuritySensor sensor = getInstanceByType(SecuritySensor.class);
+ sensor.securityEvent.select(BreakInEvent.class, new AnnotationLiteral<NotABindingType>() {});
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SystemTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SystemTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SystemTest.java 2009-07-24 02:26:26 UTC (rev 3184)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.event.select;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface SystemTest
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/Violent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/Violent.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/Violent.java 2009-07-24 02:26:26 UTC (rev 3184)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.event.select;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Violent
+{
+}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3183 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-07-23 22:24:33 -0400 (Thu, 23 Jul 2009)
New Revision: 3183
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
mark assertion as testable (previously was marked as not testable)
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-24 00:27:10 UTC (rev 3182)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-24 02:24:33 UTC (rev 3183)
@@ -3671,7 +3671,7 @@
<text>The |Event| interface provides a method for firing events with a specified combination of type and bindings.</text>
</assertion>
- <assertion id="cb" testable="false">
+ <assertion id="cb">
<text>For an injected |Event|, the specified type is the type parameter specified at the injection point, and the specified bindings are the bindings specified at the injection point.</text>
</assertion>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3182 - tck/trunk/doc/reference/en-US.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-23 20:27:10 -0400 (Thu, 23 Jul 2009)
New Revision: 3182
Modified:
tck/trunk/doc/reference/en-US/Author_Group.xml
tck/trunk/doc/reference/en-US/Book_Info.xml
tck/trunk/doc/reference/en-US/Book_Preface.xml
tck/trunk/doc/reference/en-US/introduction.xml
tck/trunk/doc/reference/en-US/master.xml
Log:
various legal blurb, changes to terms, changes to whats bundled.
Modified: tck/trunk/doc/reference/en-US/Author_Group.xml
===================================================================
--- tck/trunk/doc/reference/en-US/Author_Group.xml 2009-07-23 23:16:44 UTC (rev 3181)
+++ tck/trunk/doc/reference/en-US/Author_Group.xml 2009-07-24 00:27:10 UTC (rev 3182)
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE authorgroup PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ ]>
+
+
<authorgroup>
<author>
<firstname>Gavin</firstname>
Modified: tck/trunk/doc/reference/en-US/Book_Info.xml
===================================================================
--- tck/trunk/doc/reference/en-US/Book_Info.xml 2009-07-23 23:16:44 UTC (rev 3181)
+++ tck/trunk/doc/reference/en-US/Book_Info.xml 2009-07-24 00:27:10 UTC (rev 3182)
@@ -1,6 +1,25 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE bookinfo PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ ]>
<bookinfo>
- <title>Technology Compatibility Kit Reference Guide for JSR-299: Context and Dependency Injection for Java EE</title>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Author_Group.xml"/>
+ <copyright>
+ <year>2009</year>
+ <holder>
+ Red Hat Middleware LLC, and individual contributors listed as
+ authors.
+ </holder>
+ </copyright>
+ <releaseinfo><literallayout>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.</literallayout></releaseinfo>
+
+ <title>Technology Compatibility Kit Reference Guide for JSR-299: Context and
+ Dependency Injection for Java EE</title>
+ <subtitle>Specification Lead: Red Hat Middleware LLC</subtitle>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Author_Group.xml" />
</bookinfo>
Modified: tck/trunk/doc/reference/en-US/Book_Preface.xml
===================================================================
--- tck/trunk/doc/reference/en-US/Book_Preface.xml 2009-07-23 23:16:44 UTC (rev 3181)
+++ tck/trunk/doc/reference/en-US/Book_Preface.xml 2009-07-24 00:27:10 UTC (rev 3182)
@@ -13,21 +13,30 @@
The CDI TCK is built atop the JBoss Test Harness, a portable and
configurable automated test suite for authoring unit and integration tests
in a Java EE environment. The CDI TCK 1.0.0 uses the JBoss Test
- Harness version 1.0.0 to execute the test suite.
+ Harness
+ version 1.0.0 to execute the test suite.
</para>
+ <para>
+ The CDI TCK is provide under the
+ <ulink url="http://www.apache.org/licenses/LICENSE-2.0">Apache Public License 2.0</ulink>
+ .
+ </para>
+
<section id="target-audience">
<title>Who Should Use This Book</title>
<para>
- This guide is for implementors of the Context and Dependency Injection
+ This guide is for implementors of the Context and Dependency
+ Injection
for Java EE 1.0 technology to assist in running the test
- suite that verifies the compatibility of their implementation.
+ suite
+ that verifies the compatibility of their implementation.
</para>
</section>
-
+
<section id="before-reading">
<title>Before You Read This Book</title>
-
+
<para>
Before reading this guide, you should familiarize yourself with the
Java EE programming model, specifically the Enterprise JavaBeans (EJB)
@@ -39,7 +48,8 @@
</para>
<para>
The CDI TCK is based on the Context and Dependency Injection for
- Java EE technology specification 1.0 (JSR-299). Information about the
+ Java EE
+ technology specification 1.0 (JSR-299). Information about the
specification, including links to the specification documents, can be
found on the
<ulink url="http://jcp.org/en/jsr/detail?id=299">JSR-299 JCP page</ulink>
@@ -47,19 +57,24 @@
</para>
<para>
Before running the tests in the CDI TCK, read and become
- familiar with the JBoss Test Harness Reference Guide (pending), which
- describes how the test harness functions.
+ familiar
+ with the JBoss Test Harness Reference Guide (pending), which
+ describes
+ how the test harness functions.
</para>
-
+
</section>
<section id="book-organization">
-
+
<title>How This Book Is Organized</title>
<para>
If you are running the CDI TCK for the first time, read Chapter
- 1 and Chapter 2 completely for the necessary background information
- about the TCK and its purpose. Once you have reviewed that material,
- perform the steps outlined in the remaining chapters.
+ 1 and
+ Chapter 2 completely for the necessary background information
+ about the
+ TCK and its purpose. Once you have reviewed that material,
+ perform the
+ steps outlined in the remaining chapters.
</para>
<itemizedlist>
<listitem>
Modified: tck/trunk/doc/reference/en-US/introduction.xml
===================================================================
--- tck/trunk/doc/reference/en-US/introduction.xml 2009-07-23 23:16:44 UTC (rev 3181)
+++ tck/trunk/doc/reference/en-US/introduction.xml 2009-07-24 00:27:10 UTC (rev 3182)
@@ -13,10 +13,10 @@
A TCK, or Technology Compatibility Kit, is one of the three required
pieces for any JSR (the other two being the specification document and
the reference implementation). The TCK is a set of tools and tests to
- verify that a licensee's implementation of the Sun technology conforms
- to the specification. The tests are the primary component, but the
- tools serve an equally critical role of providing a framework and/or
- set of SPIs for executing the tests.
+ verify that an implementation of the technology conforms to the
+ specification. The tests are the primary component, but the tools serve
+ an equally critical role of providing a framework and/or set of SPIs
+ for executing the tests.
</para>
<para>
The tests in the TCK are derived from assertions in the written
@@ -47,24 +47,18 @@
the rules laid out in the specification.
</para>
<para>
- Executing the TCK is a form of compatibility testing. It's
- important
- to understand that compatibility testing is distinctly
- different from
- product testing. The TCK is not concerned with
- robustness, performance
- or ease of use, and therefore cannot vouch for
- how well an
- implementation meets these criteria. What a TCK can do is
- to ensure the
- exactness of an implementation as it relates to the
- specification.
+ Executing the TCK is a form of compatibility testing. It's important
+ to understand that compatibility testing is distinctly different from
+ product testing. The TCK is not concerned with robustness, performance
+ or ease of use, and therefore cannot vouch for how well an
+ implementation meets these criteria. What a TCK can do is to ensure the
+ exactness of an implementation as it relates to the specification.
</para>
<para>
Compatibility testing of any feature relies on both a complete
specification and a complete reference implementation. The reference
implementation demonstrates how each test can be passed and provides
- additional context to the licensee during development for the
+ additional context to the implementor during development for the
corresponding assertion.
</para>
@@ -77,7 +71,7 @@
<itemizedlist>
<listitem>
<para>
- Compatibility testing is the means by which Sun ensures
+ Compatibility testing is the means by which the JCP ensures
that the Java platform does not become fragmented as it's
ported to different operating systems and hardware.
</para>
@@ -105,7 +99,7 @@
</listitem>
</itemizedlist>
<para>
- The JSR-299 specification goes to great lengths to ensure that
+ The CDI specification goes to great lengths to ensure that
programs written for Java EE are compatible and the TCK is rigorous
about enforcing the rules the specification lays down.
</para>
@@ -114,19 +108,19 @@
</section>
<section>
- <title>About the JSR-299 TCK</title>
+ <title>About the CDI TCK</title>
<para>
- The JSR-299 TCK is designed as a portable, configurable and
- automated test suite for verifying the compatibility of a licensee’s
- implementation of the JSR-299: Contexts and Dependency Injection for
- Java EE specification. The test suite is built on TestNG and provides a
- series of extensions that allow runtime packaging and deployment of JEE
- artifacts for in-container testing.
+ The CDI TCK is designed as a portable, configurable and automated
+ test suite for verifying the compatibility of an implementation of the
+ JSR-299: Contexts and Dependency Injection for Java EE specification.
+ The test suite is built on TestNG and provides a series of extensions
+ that allow runtime packaging and deployment of JEE artifacts for
+ in-container testing.
</para>
<note>
<para>
- The JSR-299 TCK harness is based on the JBoss Test harness, which
+ The CDI TCK harness is based on the JBoss Test harness, which
provides most of the aforementioned functionality.
</para>
</note>
@@ -136,50 +130,50 @@
annotations. The artifact produced can be either a WAR or an EAR.
</para>
<para>
- The benefit of the declarative approach is that it allows many of
- the tests to be executed in a standalone implementation of JSR-299,
- accounting for a boast in developer productivity. However, an
- implementation is only valid if all tests pass using the in-container
- execution mode. The standalone mode is merely a developer convenience.
+ The declarative approach allows many of the tests to be executed in
+ a standalone implementation of CDI, accounting for a boast in developer
+ productivity. However, an implementation is only valid if all tests
+ pass using the in-container execution mode. The standalone mode is
+ merely a developer convenience.
</para>
<section>
- <title>JSR-299 TCK Specifications and Requirements</title>
+ <title>CDI TCK Specifications and Requirements</title>
<para>
This section lists the applicable requirements and specifications
- for the JSR-299 TCK.
+ for the CDI TCK.
</para>
<itemizedlist>
<listitem>
<para>
<emphasis role="bold">Specification requirements</emphasis>
- - Software requirements for a JSR-299 implementation are
- itemized in section 1.2, "Relationship to other
- specifications" in the JSR-299 specification, with
- details provided throughout the specification.
+ - Software requirements for a CDI implementation are itemized
+ in section 1.2, "Relationship to other specifications" in the
+ CDI specification, with details provided throughout the
+ specification.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold">Contexts and Dependency Injection for
Java EE 1.0 API</emphasis>
- - The Java API defined in the JSR-299 specification and
- provided by the reference implementation.
+ - The Java API defined in the CDI specification and provided
+ by the reference implementation.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold">JBoss Test Harness</emphasis>
- - The JSR-299 TCK requires version 1.0.0 of the JBoss Test
- Harness
+ - The CDI TCK requires version 1.0.0 of the JBoss Test
+ Harness. The Harness is based on TestNG 5.x.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold">Porting Package</emphasis>
- An implementation of SPIs that are required for the test
- suite to run the in-container tests and at times, consult the
- JSR-299 implementation
+ suite to run the in-container tests and at times extend the
+ CDI 1.0 API to provide extra information to the TCK
</para>
</listitem>
<listitem>
@@ -187,41 +181,28 @@
<emphasis role="bold">TCK Audit Tool</emphasis>
- An itemization of the assertions in the specification
documents which are cross referenced by the individual tests.
- Relevant for producing a test coverage report.
+ Describes how well the TCK covers the specification.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold">Reference runtime</emphasis>
- The designated reference runtimes for compatibility testing
- of the JSR-299 specification is the Sun Java Platform,
- Enterprise Edition (Java EE) 5
- reference implementation (RI).
- See details at Java EE 5
+ of the CDI specification is the Sun Java Platform, Enterprise
+ Edition (Java EE) 6 reference implementation (RI). See details
+ at Java EE 6
(
- <ulink url="http://java.sun.com/javaee/5/docs/api/">http://java.sun.com/javaee/5/docs/api/
+ <ulink url="http://java.sun.com/javaee/6/docs/api/">http://java.sun.com/javaee/6/docs/api/
</ulink>
).
</para>
</listitem>
- <listitem>
- <para>
- <emphasis role="bold">Maven 2</emphasis>
- - Although licensees are free to execute the TCK however they
- decide, the recommended approach is to use Maven 2. Both the
- JSR-299 RI and the TCK are build using Maven 2. Furthermore,
- the TCK runner used to validate the RI, a resource which can
- be leveraged by licensee to test their own implementations, is
- also Maven 2 project. Therefore, it's highly recommended
- to have Maven 2 installed on the system.
- </para>
- </listitem>
</itemizedlist>
</section>
<section>
- <title>JSR-299 TCK Components</title>
- <para>The JSR-299 TCK includes the following components:</para>
+ <title>CDI TCK Components</title>
+ <para>The CDI TCK includes the following components:</para>
<itemizedlist>
<listitem>
<para>
@@ -240,7 +221,7 @@
<listitem>
<para>
<emphasis role="bold">Porting Package SPIs</emphasis>
- - Extensions to the JSR-299 SPIs to allow testing of a
+ - Extensions to the CDI SPIs to allow testing of a
container.
</para>
</listitem>
@@ -248,19 +229,12 @@
<para>
<emphasis role="bold">The test suite</emphasis>
, which is a collection of TestNG tests, the TestNG test suite
- descriptor and supplamental files that provide data for the
- automatic running of tests through the JBoss Test harness.
+ descriptor and supplemental resources that configure CDI and
+ other software components.
</para>
</listitem>
<listitem>
<para>
- <emphasis role="bold">JBoss TCK Runner</emphasis>
- - An implementation of the JBoss Test Harness deployment APIs
- for deploying artifacts to JBoss AS 5.1
- </para>
- </listitem>
- <listitem>
- <para>
<emphasis role="bold">TCK documentation</emphasis>
accompanied by release notes identifying updates between
versions.
@@ -268,46 +242,42 @@
</listitem>
</itemizedlist>
<para>
- The JSR-299 TCK has been tested with the following:
+ The CDI TCK has been tested with the following:
</para>
+ <note>
+ <para>
+ Sun Microsystems Inc. will implement the porting package and
+ test the CDI RI on the Java EE Reference Implementation
+ </para>
+ </note>
<itemizedlist>
<listitem>
- <para> Java Platform, Standard Edition, Version 5.0 (Java SE 1.5)
- </para>
+ <para>JBoss AS 5.1.0.GA</para>
</listitem>
- <listitem>
- <para> Java Platform, Enterprise Edition, Version 5 reference
- implementation (Java EE 5 RI)</para>
- </listitem>
- <listitem>
- <para>JBoss AS 5.1?</para>
- </listitem>
</itemizedlist>
- <para>The JSR-299 TCK tests run on the following platforms:</para>
+ <para>The CDI TCK tests run on the following platforms:</para>
<itemizedlist>
<listitem>
- <para>Windows XP?</para>
+ <para>Red Hat Enterprise Linux 5.2</para>
</listitem>
- <listitem>
- <para>RHEL 5.2?</para>
- </listitem>
</itemizedlist>
</section>
<section>
<title>The JBoss Test Harness</title>
<para>
- JSR-299 TCK leverages the JBoss Test Harness. The JBoss Test
+ The CDI TCK leverages the JBoss Test Harness. The JBoss Test
Harness is a testing framework based on TestNG that provides a
series of extensions that allow runtime packaging and deployment of
- Java EE artifacts (EAR or WAR) for in-container testing. It's
- important to note that the JBoss Test Harness has no relation to or
- dependency on the JBoss Application Server (AS).
+ Java EE artifacts (EAR or WAR) for in-container testing. It's
+ important to note that the JBoss Test Harness has no relation with,
+ or dependency on the JBoss Application Server (JBoss AS).
</para>
<para>
- JSR-299 supports Java EE 5, Java EE 6, Java EE 6 Web Profile and
- the Embeddable EJB 3.1. Accordingly, the TCK will be able to run in
- any of these environments, though at the time of writing the
- Embedded EJB (EEJB) mode isn't operational.
+ CDI supports Java EE 5, Java EE 6, Java EE 6 Web Profile and the
+ Embeddable EJB 3.1. The TCK will run on any of these runtimes, but
+ is only part of the CTS for Java EE 6, Java EE 6 Web Profile and
+ Embeddable EJB 3.1 (SUN: Please confirm these are the CTS the CDI
+ TCK will run in).
</para>
<note>
<para>
@@ -316,10 +286,10 @@
used in this reference guide. This term refers to running the
test suite in any of the aforementioned environments, whilst
<emphasis role="italic">standalone</emphasis>
- refers to running the tests outside the container via a JSR-299
+ refers to running the tests outside the container via a CDI
implementation-specific standalone bootstrap. The standalone mode
- only runs those tests which don't require EJB, Servlet or
- JSF to be present.
+ only runs those tests which the CDI RI can run without deployment
+ in a Java EE container.
</para>
</note>
<para>
@@ -451,16 +421,16 @@
<section>
<title>The Porting Package</title>
<para>
- The JSR-299 TCK relies on an implementation of the porting
- package to function. The porting package can be divided into two
- parts. The first part is comprised of extensions to the JSR-299 SPIs
- to allow testing of a container. The second part must contain
- implementations of the JBoss Test Harness deployment APIs for
- deploying test artifacts to a given container.
+ The CDI TCK relies on an implementation of the porting package to
+ function. The porting package can be divided into two parts. The
+ first part is comprised of extensions to the JSR-299 SPIs to allow
+ testing of a container. The second part must implement he JBoss Test
+ Harness artifact deployment APIs for deploying artifacts to the Java
+ EE container.
</para>
<para>
As mentioned earlier, there are times when the tests need to tap
- directly into the JSR-299 implementation to manipulate behavior or
+ directly into the CDI implementation to manipulate behavior or
verify results. The porting package includes a set of SPIs that
provide the TCK this level of access without tying the tests to a
given implementation.
@@ -490,24 +460,40 @@
</para>
</listitem>
</itemizedlist>
+
<para>
+ Complete JavaDoc describing the requirements for implementation
+ is provided.
+ </para>
+
+ <para>
To run the full TCK you must additionally implement
<literal>org.jboss.testharness.spi.Containers</literal>
- , which handles deploying the test artifact to the container. If you
- wish to run the TCK in standalone mode, you must also implement
+ , which handles deploying the test artifact to the container. An
+ implementations of this API is already available for JBoss AS 5.1.
+ Therefore, you only need to implement this part of the porting
+ package if you wish to use another container.
+ </para>
+ <note>
+ <para>
+ Red Hat Middleware LLC encourages CDI implementators to
+ contribute JBoss Test Harness Deployment API implementations for
+ other containers under the ASL license. Please contact the CDI
+ TCK lead.
+ </para>
+ </note>
+ <para>
+ If you wish to run the TCK in standalone mode, a CDI implementation
+ must provide an implementation of
<literal>org.jboss.testharness.spi.StandaloneContainers</literal>
- . Implementations of these APIs are already available for JBoss AS
- 5.1. Therefore, you only need to implement this part of the porting
- package if you wish to use a container other than JBoss AS 5.1, for
- instance GlassFish V3.
+ . The CDI RI provides an implementation of this API; see the RI
+ reference guide.
</para>
<para>
- The default configuration for the TCK is property-based.
- Therefore, you specify the implementation class for all of these
- SPIs in a properties file. There are additional properties for
- controlling whether the tests are run in standalone or in-container
- mode. Optionally, you can use system properties to configure the
- TCK. Details are provided in section 4.1.
+ The default configuration for the TCK uses Java properties files.
+ The implementation class for all of these SPIs is placed in this
+ properties file. Optionally, you can use system properties to
+ configure the TCK. Details are provided in section 4.1.
</para>
</section>
<section>
@@ -519,12 +505,11 @@
coverage report.
</para>
<para>
- The audit document is provided along with the TCK and each
- assertion matches against at least one test. Each assertion is
- defined with a reference to a chapter, section and paragraph from
- the specification document, making it easy for the licensee to
- locate the language in the specification document that supports the
- feature being tested.
+ The audit document is provided along with the TCK; at least 75%
+ of assertions are tested. Each assertion is defined with a reference
+ to a chapter, section and paragraph from the specification document,
+ making it easy for the implementor to locate the language in the
+ specification document that supports the feature being tested.
</para>
</section>
</section>
Modified: tck/trunk/doc/reference/en-US/master.xml
===================================================================
--- tck/trunk/doc/reference/en-US/master.xml 2009-07-23 23:16:44 UTC (rev 3181)
+++ tck/trunk/doc/reference/en-US/master.xml 2009-07-24 00:27:10 UTC (rev 3182)
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
-<!-- This document was created with Syntext Serna Free. --><!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ ]>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ ]>
<book lang="en">
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Book_Info.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Book_Preface.xml"/>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3181 - tck/trunk/doc/reference/en-US.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-23 19:16:44 -0400 (Thu, 23 Jul 2009)
New Revision: 3181
Modified:
tck/trunk/doc/reference/en-US/introduction.xml
Log:
ws
Modified: tck/trunk/doc/reference/en-US/introduction.xml
===================================================================
--- tck/trunk/doc/reference/en-US/introduction.xml 2009-07-23 23:16:08 UTC (rev 3180)
+++ tck/trunk/doc/reference/en-US/introduction.xml 2009-07-23 23:16:44 UTC (rev 3181)
@@ -13,13 +13,10 @@
A TCK, or Technology Compatibility Kit, is one of the three required
pieces for any JSR (the other two being the specification document and
the reference implementation). The TCK is a set of tools and tests to
- verify that a licensee's implementation of the Sun technology
- conforms
- to the specification. The tests are the primary component, but
- the tools
- serve an equally critical role of providing a framework
- and/or set of
- SPIs for executing the tests.
+ verify that a licensee's implementation of the Sun technology conforms
+ to the specification. The tests are the primary component, but the
+ tools serve an equally critical role of providing a framework and/or
+ set of SPIs for executing the tests.
</para>
<para>
The tests in the TCK are derived from assertions in the written
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3180 - tck/trunk/doc/reference/en-US.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-23 19:16:08 -0400 (Thu, 23 Jul 2009)
New Revision: 3180
Modified:
tck/trunk/doc/reference/en-US/introduction.xml
Log:
ws
Modified: tck/trunk/doc/reference/en-US/introduction.xml
===================================================================
--- tck/trunk/doc/reference/en-US/introduction.xml 2009-07-23 23:05:00 UTC (rev 3179)
+++ tck/trunk/doc/reference/en-US/introduction.xml 2009-07-23 23:16:08 UTC (rev 3180)
@@ -1,208 +1,534 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ ]>
<chapter id="introduction">
- <title>Introduction</title>
- <para>This chapter explains the purpose of a TCK and identifies the foundation elements of the JSR-299 TCK.</para>
- <section>
- <title>TCK Primer</title>
- <para>A TCK, or Technology Compatibility Kit, is one of the three required pieces for any JSR (the other two being the specification document and the reference implementation). The TCK is a set of tools and tests to verify that a licensee's implementation of the Sun technology conforms to the specification. The tests are the primary component, but the tools serve an equally critical role of providing a framework and/or set of SPIs for executing the tests.</para>
- <para>The tests in the TCK are derived from assertions in the written specification document. The assertions materialize as a suite of automated tests that collectively validate whether an implementation complies with the aforementioned assertions, and in turn the specification. For a particular implementation to be certified, all of the required tests must pass (the provided test suite must be run unmodified).</para>
- <para>A TCK is entirely implementation agnostic. Ideally, it should validate assertions by consulting the specficiation's public API. However, when the information returned by the public API is not low-level enough to validate the assertion, the implementation must be consulted directly. In this case, the TCK provides an independent API as part of a porting package which must also be implemented by the licensee. Section 1.3.4 introduces the porting package and section 4.1 covers the requirements for implementing it.</para>
- </section>
- <section>
- <title>Compatibility Testing</title>
- <para>The goal of any specification is to eliminate portability problems so long as the program which uses the implementation also conforms to the rules laid out in the specification.</para>
- <para>Executing the TCK is a form of compatibility testing. It's important to understand that compatibility testing is distinctly different from product testing. The TCK is not concerned with robustness, performance or ease of use, and therefore cannot vouch for how well an implementation meets these criteria. What a TCK can do is to ensure the exactness of an implementation as it relates to the specification.</para>
- <para>Compatibility testing of any feature relies on both a complete specification and a complete reference implementation. The reference implementation demonstrates how each test can be passed and provides additional context to the licensee during development for the corresponding assertion.</para>
- <section>
- <title>Why Compatibility Is Important</title>
- <para>Java platform compatibility is important to different groups involved with Java technologies for
-different reasons:
-</para>
- <itemizedlist>
- <listitem>
- <para>Compatibility testing is the means by which Sun ensures that the Java platform does not become
-fragmented as it's ported to different operating systems and hardware.
-</para>
- </listitem>
- <listitem>
- <para>Compatibility testing benefits developers working in the Java programming language, enabling
-them to write applications once and deploy them across heterogeneous computing
- environments without porting.</para>
- </listitem>
- <listitem>
- <para>Compatibility testing enables application users to obtain applications from disparate sources and
- deploy them with confidence.
-</para>
- </listitem>
- <listitem>
- <para>Conformance testing benefits Java platform implementors by ensuring the same extent of reliability for all Java platform ports.
-</para>
- </listitem>
- </itemizedlist>
- <para>The JSR-299 specification goes to great lengths to ensure that programs written for Java EE are compatible and the TCK is rigorous about enforcing the rules the specification lays down.</para>
- </section>
- </section>
- <section>
- <title>About the JSR-299 TCK</title>
- <para>The JSR-299 TCK is designed as a portable, configurable and automated test suite for
-verifying the compatibility of a licensee’s implementation of the JSR-299: Contexts and Dependency Injection for Java EE specification. The test suite is built on TestNG and provides a series of extensions that allow runtime packaging and deployment of JEE artifacts for in-container testing.</para>
- <note>
- <para>The JSR-299 TCK harness is based on the JBoss Test harness, which provides most of the aforementioned functionality.</para>
- </note>
- <para>Each test class in the suite acts as a deployable unit. The deployable units, or artifacts, are defined declaratively using annotations. The artifact produced can be either a WAR or an EAR.</para>
- <para>The benefit of the declarative approach is that it allows many of the tests to be executed in a standalone implementation of JSR-299, accounting for a boast in developer productivity. However, an implementation is only valid if all tests pass using the in-container execution mode. The standalone mode is merely a developer convenience.</para>
- <section>
- <title>JSR-299 TCK Specifications and Requirements</title>
- <para>This section lists the applicable requirements and specifications for the JSR-299 TCK.</para>
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">Specification requirements</emphasis> - Software requirements for a JSR-299 implementation are itemized in section 1.2, "Relationship to other specifications" in the JSR-299 specification, with details provided throughout the specification.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">Contexts and Dependency Injection for Java EE 1.0 API</emphasis> - The Java API defined in the JSR-299 specification and provided by the reference implementation.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">JBoss Test Harness</emphasis> - The JSR-299 TCK requires version 1.0.0 of the JBoss Test Harness</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">Porting Package</emphasis> - An implementation of SPIs that are required for the test suite to run the in-container tests and at times, consult the JSR-299 implementation</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">TCK Audit Tool</emphasis> - An itemization of the assertions in the specification documents which are cross referenced by the individual tests. Relevant for producing a test coverage report.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">Reference runtime</emphasis> - The designated reference runtimes for compatibility testing of the JSR-299 specification is the Sun Java Platform, Enterprise Edition (Java EE) 5
- reference implementation (RI).
- See details at Java EE 5
- (<ulink url="http://java.sun.com/javaee/5/docs/api/">http://java.sun.com/javaee/5/docs/api/</ulink>).</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">Maven 2</emphasis> - Although licensees are free to execute the TCK however they decide, the recommended approach is to use Maven 2. Both the JSR-299 RI and the TCK are build using Maven 2. Furthermore, the TCK runner used to validate the RI, a resource which can be leveraged by licensee to test their own implementations, is also Maven 2 project. Therefore, it's highly recommended to have Maven 2 installed on the system.</para>
- </listitem>
- </itemizedlist>
- </section>
- <section>
- <title>JSR-299 TCK Components</title>
- <para>The JSR-299 TCK includes the following components:</para>
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">JBoss Test Harness 1.0.0</emphasis> and related documentation.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">TestNG 5.9</emphasis>, the testing framework on which the JBoss Test Harness is based and which provides the extension points for selecting an executing the tests in the test suite.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">Porting Package SPIs</emphasis> - Extensions to the JSR-299 SPIs to allow testing of a container.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">The test suite</emphasis>, which is a collection of TestNG tests, the TestNG test suite descriptor and supplamental files that provide data for the
-automatic running of tests through the JBoss Test harness.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">JBoss TCK Runner</emphasis> - An implementation of the JBoss Test Harness deployment APIs for deploying artifacts to JBoss AS 5.1</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">TCK documentation</emphasis> accompanied by release notes identifying updates between versions.</para>
- </listitem>
- </itemizedlist>
- <para>The JSR-299 TCK has been tested with the following:</para>
- <itemizedlist>
- <listitem>
- <para> Java Platform, Standard Edition, Version 5.0 (Java SE 1.5)
-</para>
- </listitem>
- <listitem>
- <para> Java Platform, Enterprise Edition, Version 5 reference implementation (Java EE 5 RI)</para>
- </listitem>
- <listitem>
- <para>JBoss AS 5.1?</para>
- </listitem>
- </itemizedlist>
- <para>The JSR-299 TCK tests run on the following platforms:</para>
- <itemizedlist>
- <listitem>
- <para>Windows XP?</para>
- </listitem>
- <listitem>
- <para>RHEL 5.2?</para>
- </listitem>
- </itemizedlist>
- </section>
- <section>
- <title>The JBoss Test Harness</title>
- <para>JSR-299 TCK leverages the JBoss Test Harness. The JBoss Test Harness is a testing framework based on TestNG that provides a series of extensions that allow runtime packaging and deployment of Java EE artifacts (EAR or WAR) for in-container testing. It's important to note that the JBoss Test Harness has no relation to or dependency on the JBoss Application Server (AS).</para>
- <para>JSR-299 supports Java EE 5, Java EE 6, Java EE 6 Web Profile and the Embeddable EJB 3.1. Accordingly, the TCK will be able to run in any of these environments, though at the time of writing the Embedded EJB (EEJB) mode isn't operational.</para>
+ <title>Introduction</title>
+
+ <para>
+ This chapter explains the purpose of a TCK and identifies the
+ foundation elements of the JSR-299 TCK.
+ </para>
+ <section>
+ <title>TCK Primer</title>
+ <para>
+ A TCK, or Technology Compatibility Kit, is one of the three required
+ pieces for any JSR (the other two being the specification document and
+ the reference implementation). The TCK is a set of tools and tests to
+ verify that a licensee's implementation of the Sun technology
+ conforms
+ to the specification. The tests are the primary component, but
+ the tools
+ serve an equally critical role of providing a framework
+ and/or set of
+ SPIs for executing the tests.
+ </para>
+ <para>
+ The tests in the TCK are derived from assertions in the written
+ specification document. The assertions materialize as a suite of
+ automated tests that collectively validate whether an implementation
+ complies with the aforementioned assertions, and in turn the
+ specification. For a particular implementation to be certified, all of
+ the required tests must pass (the provided test suite must be run
+ unmodified).
+ </para>
+ <para>
+ A TCK is entirely implementation agnostic. Ideally, it should
+ validate assertions by consulting the specficiation's public API.
+ However, when the information returned by the public API is not
+ low-level enough to validate the assertion, the implementation must be
+ consulted directly. In this case, the TCK provides an independent API
+ as part of a porting package which must also be implemented by the
+ licensee. Section 1.3.4 introduces the porting package and section 4.1
+ covers the requirements for implementing it.
+ </para>
+ </section>
+ <section>
+ <title>Compatibility Testing</title>
+
+ <para>
+ The goal of any specification is to eliminate portability problems
+ so long as the program which uses the implementation also conforms to
+ the rules laid out in the specification.
+ </para>
+ <para>
+ Executing the TCK is a form of compatibility testing. It's
+ important
+ to understand that compatibility testing is distinctly
+ different from
+ product testing. The TCK is not concerned with
+ robustness, performance
+ or ease of use, and therefore cannot vouch for
+ how well an
+ implementation meets these criteria. What a TCK can do is
+ to ensure the
+ exactness of an implementation as it relates to the
+ specification.
+ </para>
+ <para>
+ Compatibility testing of any feature relies on both a complete
+ specification and a complete reference implementation. The reference
+ implementation demonstrates how each test can be passed and provides
+ additional context to the licensee during development for the
+ corresponding assertion.
+ </para>
+
+ <section>
+ <title>Why Compatibility Is Important</title>
+ <para>
+ Java platform compatibility is important to different groups
+ involved with Java technologies for different reasons:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Compatibility testing is the means by which Sun ensures
+ that the Java platform does not become fragmented as it's
+ ported to different operating systems and hardware.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Compatibility testing benefits developers working in the
+ Java programming language, enabling them to write applications
+ once and deploy them across heterogeneous computing
+ environments without porting.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Compatibility testing enables application users to obtain
+ applications from disparate sources and deploy them with
+ confidence.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Conformance testing benefits Java platform implementors by
+ ensuring the same extent of reliability for all Java platform
+ ports.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The JSR-299 specification goes to great lengths to ensure that
+ programs written for Java EE are compatible and the TCK is rigorous
+ about enforcing the rules the specification lays down.
+ </para>
+ </section>
+
+ </section>
+
+ <section>
+ <title>About the JSR-299 TCK</title>
+
+ <para>
+ The JSR-299 TCK is designed as a portable, configurable and
+ automated test suite for verifying the compatibility of a licensee’s
+ implementation of the JSR-299: Contexts and Dependency Injection for
+ Java EE specification. The test suite is built on TestNG and provides a
+ series of extensions that allow runtime packaging and deployment of JEE
+ artifacts for in-container testing.
+ </para>
<note>
- <para>You'll often see the term <emphasis role="italic">in-container</emphasis> used in this reference guide. This term refers to running the test suite in any of the aforementioned environments, whilst <emphasis role="italic">standalone</emphasis> refers to running the tests outside the container via a JSR-299 implementation-specific standalone bootstrap. The standalone mode only runs those tests which don't require EJB, Servlet or JSF to be present.</para>
+ <para>
+ The JSR-299 TCK harness is based on the JBoss Test harness, which
+ provides most of the aforementioned functionality.
+ </para>
</note>
- <para>The last thing Java developers want is yet another testing framework to make their life more complicated. What they do want is a good integration with their Integrated Development Environment (IDE). These days, if a tool doesn't have an IDE plugin, then it won't get the attention it deserves. That's why the JBoss Test Harness is built entirely upon TestNG. TestNG is one of the two prominent test frameworks for Java and TestNG plugins are available for all major IDEs (with the exception of NetBeans) and build tools (Ant and Maven 2).</para>
- <para>Because it leverages the existing TestNG ecosystem, there is no need for a special test launcher for the JBoss Test Harness, and in turn the JSR-299 TCK. You simply use the IDE or build tool of your choice. You also get reporting and debugging for free.</para>
- <para>The JBoss Test Harness supports the following features:</para>
- <itemizedlist>
- <listitem>
- <para>Test activation via any method supported by the TestNG configuration descriptor (package, group, class)</para>
- </listitem>
- <listitem>
- <para>Exclusion of in-container tests in standalone mode</para>
- </listitem>
- <listitem>
- <para>Exclusion of individual tests labeled as under investigation</para>
- </listitem>
- <listitem>
- <para>Integration with any TestNG plugin (Eclipse, IntelliJ, NetBeans, Ant, Maven)</para>
- </listitem>
- <listitem>
- <para>Automated reporting capability as provided by TestNG</para>
- </listitem>
- <listitem>
- <para>Standalone and in-container test mode</para>
- </listitem>
- <listitem>
- <para>Container pluggability</para>
- </listitem>
- <listitem>
- <para>Declarative packaging of additional resources and classes in artifact</para>
- </listitem>
- <listitem>
- <para>Declarative deployment exception trapping</para>
- </listitem>
- <listitem>
- <para>Artifact dumping for failure and packaging analysis</para>
- </listitem>
- </itemizedlist>
- <para>A test is designated by a method annotated with <literal>@org.testng.annotations.Test</literal> in a class which extends <literal>org.jboss.jsr299.tck.AbstractJSR299Test</literal> and is annotated with <literal>@org.jboss.testharness.impl.packaging.Artifact</literal>.</para>
- <para>The <literal>@Test</literal> annotation is provided by TestNG, the <literal>@Artifact</literal> annotation is provided by the JBoss Test Harness and the <literal>AbstractJSR299Test</literal> is part of the JSR-299 TCK. There is a one-to-one mapping between a TestNG test class and an artifact. The packaging type is defined by the <literal>@org.jboss.testharness.impl.packaging.Packaging</literal> annotation on the test class, defaulting to a WAR if not specified.</para>
- <para>Prior to executing the tests for a given class, the JBoss Test Harness packages the class as a deployable artifact (EAR or WAR), along with any extra resources specified, and deploys the artifact to the container. The test execution and results are negotatied via HTTP communication using a thin layer over the TestNG test launcher. The test harness can also catch and affirm expected deployment exceptions. This setup and tear down activity is provided by the super class <literal>org.jboss.jsr299.tck.AbstractJSR299Test</literal>, which all TCK test classes must extend.</para>
- <para>If the annotation <literal>@org.jboss.testharness.impl.packaging.IntegrationTest</literal> is not present on the test class, then it means the test class can be executed in standalone mode. In standalone mode, the deployable artifact is assembled on the local classpath and the tests execute in the same JVM as the launcher, just as though it were a regular TestNG test case. The standalone mode is provided merely for convenience and efficiency.</para>
- <para>Chapter 4 details how to run the TCK test suite using the JBoss Test Harness.</para>
- </section>
- <section>
- <title>The Porting Package</title>
- <para>The JSR-299 TCK relies on an implementation of the porting package to function. The porting package can be divided into two parts. The first part is comprised of extensions to the JSR-299 SPIs to allow testing of a container. The second part must contain implementations of the JBoss Test Harness deployment APIs for deploying test artifacts to a given container.</para>
- <para>As mentioned earlier, there are times when the tests need to tap directly into the JSR-299 implementation to manipulate behavior or verify results. The porting package includes a set of SPIs that provide the TCK this level of access without tying the tests to a given implementation.</para>
- <para>The four SPI classes in the JSR-299 TCK are as follows:</para>
- <itemizedlist>
- <listitem>
- <para><literal>org.jboss.jsr299.tck.spi.Beans</literal></para>
- </listitem>
- <listitem>
- <para><literal>org.jboss.jsr299.tck.spi.Contexts</literal></para>
- </listitem>
- <listitem>
- <para><literal>org.jboss.jsr299.tck.spi.EL</literal></para>
- </listitem>
- <listitem>
- <para><literal>org.jboss.jsr299.tck.spi.Managers</literal></para>
- </listitem>
- </itemizedlist>
- <para>To run the full TCK you must additionally implement <literal>org.jboss.testharness.spi.Containers</literal>, which handles deploying the test artifact to the container. If you wish to run the TCK in standalone mode, you must also implement <literal>org.jboss.testharness.spi.StandaloneContainers</literal>. Implementations of these APIs are already available for JBoss AS 5.1. Therefore, you only need to implement this part of the porting package if you wish to use a container other than JBoss AS 5.1, for instance GlassFish V3.</para>
- <para>The default configuration for the TCK is property-based. Therefore, you specify the implementation class for all of these SPIs in a properties file. There are additional properties for controlling whether the tests are run in standalone or in-container mode. Optionally, you can use system properties to configure the TCK. Details are provided in section 4.1.</para>
- </section>
- <section>
- <title>TCK Audit Tool</title>
- <para>The TCK audit is used to list out the assertions identified in the JSR-299 specification. It uses Java annotation processing to match the assertions to testcases in the test suite and produce a coverage report.</para>
- <para>The audit document is provided along with the TCK and each assertion matches against at least one test. Each assertion is defined with a reference to a chapter, section and paragraph from the specification document, making it easy for the licensee to locate the language in the specification document that supports the feature being tested.</para>
- </section>
- </section>
+ <para>
+ Each test class in the suite acts as a deployable unit. The
+ deployable units, or artifacts, are defined declaratively using
+ annotations. The artifact produced can be either a WAR or an EAR.
+ </para>
+ <para>
+ The benefit of the declarative approach is that it allows many of
+ the tests to be executed in a standalone implementation of JSR-299,
+ accounting for a boast in developer productivity. However, an
+ implementation is only valid if all tests pass using the in-container
+ execution mode. The standalone mode is merely a developer convenience.
+ </para>
+
+ <section>
+ <title>JSR-299 TCK Specifications and Requirements</title>
+ <para>
+ This section lists the applicable requirements and specifications
+ for the JSR-299 TCK.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">Specification requirements</emphasis>
+ - Software requirements for a JSR-299 implementation are
+ itemized in section 1.2, "Relationship to other
+ specifications" in the JSR-299 specification, with
+ details provided throughout the specification.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Contexts and Dependency Injection for
+ Java EE 1.0 API</emphasis>
+ - The Java API defined in the JSR-299 specification and
+ provided by the reference implementation.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">JBoss Test Harness</emphasis>
+ - The JSR-299 TCK requires version 1.0.0 of the JBoss Test
+ Harness
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Porting Package</emphasis>
+ - An implementation of SPIs that are required for the test
+ suite to run the in-container tests and at times, consult the
+ JSR-299 implementation
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">TCK Audit Tool</emphasis>
+ - An itemization of the assertions in the specification
+ documents which are cross referenced by the individual tests.
+ Relevant for producing a test coverage report.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Reference runtime</emphasis>
+ - The designated reference runtimes for compatibility testing
+ of the JSR-299 specification is the Sun Java Platform,
+ Enterprise Edition (Java EE) 5
+ reference implementation (RI).
+ See details at Java EE 5
+ (
+ <ulink url="http://java.sun.com/javaee/5/docs/api/">http://java.sun.com/javaee/5/docs/api/
+ </ulink>
+ ).
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Maven 2</emphasis>
+ - Although licensees are free to execute the TCK however they
+ decide, the recommended approach is to use Maven 2. Both the
+ JSR-299 RI and the TCK are build using Maven 2. Furthermore,
+ the TCK runner used to validate the RI, a resource which can
+ be leveraged by licensee to test their own implementations, is
+ also Maven 2 project. Therefore, it's highly recommended
+ to have Maven 2 installed on the system.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>JSR-299 TCK Components</title>
+ <para>The JSR-299 TCK includes the following components:</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">JBoss Test Harness 1.0.0</emphasis>
+ and related documentation.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">TestNG 5.9</emphasis>
+ , the testing framework on which the JBoss Test Harness is
+ based and which provides the extension points for selecting an
+ executing the tests in the test suite.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Porting Package SPIs</emphasis>
+ - Extensions to the JSR-299 SPIs to allow testing of a
+ container.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">The test suite</emphasis>
+ , which is a collection of TestNG tests, the TestNG test suite
+ descriptor and supplamental files that provide data for the
+ automatic running of tests through the JBoss Test harness.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">JBoss TCK Runner</emphasis>
+ - An implementation of the JBoss Test Harness deployment APIs
+ for deploying artifacts to JBoss AS 5.1
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">TCK documentation</emphasis>
+ accompanied by release notes identifying updates between
+ versions.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The JSR-299 TCK has been tested with the following:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para> Java Platform, Standard Edition, Version 5.0 (Java SE 1.5)
+ </para>
+ </listitem>
+ <listitem>
+ <para> Java Platform, Enterprise Edition, Version 5 reference
+ implementation (Java EE 5 RI)</para>
+ </listitem>
+ <listitem>
+ <para>JBoss AS 5.1?</para>
+ </listitem>
+ </itemizedlist>
+ <para>The JSR-299 TCK tests run on the following platforms:</para>
+ <itemizedlist>
+ <listitem>
+ <para>Windows XP?</para>
+ </listitem>
+ <listitem>
+ <para>RHEL 5.2?</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>The JBoss Test Harness</title>
+ <para>
+ JSR-299 TCK leverages the JBoss Test Harness. The JBoss Test
+ Harness is a testing framework based on TestNG that provides a
+ series of extensions that allow runtime packaging and deployment of
+ Java EE artifacts (EAR or WAR) for in-container testing. It's
+ important to note that the JBoss Test Harness has no relation to or
+ dependency on the JBoss Application Server (AS).
+ </para>
+ <para>
+ JSR-299 supports Java EE 5, Java EE 6, Java EE 6 Web Profile and
+ the Embeddable EJB 3.1. Accordingly, the TCK will be able to run in
+ any of these environments, though at the time of writing the
+ Embedded EJB (EEJB) mode isn't operational.
+ </para>
+ <note>
+ <para>
+ You'll often see the term
+ <emphasis role="italic">in-container</emphasis>
+ used in this reference guide. This term refers to running the
+ test suite in any of the aforementioned environments, whilst
+ <emphasis role="italic">standalone</emphasis>
+ refers to running the tests outside the container via a JSR-299
+ implementation-specific standalone bootstrap. The standalone mode
+ only runs those tests which don't require EJB, Servlet or
+ JSF to be present.
+ </para>
+ </note>
+ <para>
+ The last thing Java developers want is yet another testing
+ framework to make their life more complicated. What they do want is
+ a good integration with their Integrated Development Environment
+ (IDE). These days, if a tool doesn't have an IDE plugin, then
+ it won't get the attention it deserves. That's why the
+ JBoss Test Harness is built entirely upon TestNG. TestNG is one of
+ the two prominent test frameworks for Java and TestNG plugins are
+ available for all major IDEs (with the exception of NetBeans) and
+ build tools (Ant and Maven 2).
+ </para>
+ <para>
+ Because it leverages the existing TestNG ecosystem, there is no
+ need for a special test launcher for the JBoss Test Harness, and in
+ turn the JSR-299 TCK. You simply use the IDE or build tool of your
+ choice. You also get reporting and debugging for free.
+ </para>
+ <para>
+ The JBoss Test Harness supports the following features:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Test activation via any method supported by the TestNG
+ configuration descriptor (package, group, class)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Exclusion of in-container tests in standalone mode
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Exclusion of individual tests labeled as under
+ investigation
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Integration with any TestNG plugin (Eclipse, IntelliJ,
+ NetBeans, Ant, Maven)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Automated reporting capability as provided by TestNG
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Standalone and in-container test mode
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Container pluggability
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Declarative packaging of additional resources and classes
+ in artifact
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Declarative deployment exception trapping
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Artifact dumping for failure and packaging analysis
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ A test is designated by a method annotated with
+ <literal>@org.testng.annotations.Test</literal>
+ in a class which extends
+ <literal>org.jboss.jsr299.tck.AbstractJSR299Test</literal>
+ and is annotated with
+ <literal>@org.jboss.testharness.impl.packaging.Artifact</literal>
+ .
+ </para>
+ <para>
+ The
+ <literal>@Test</literal>
+ annotation is provided by TestNG, the
+ <literal>@Artifact</literal>
+ annotation is provided by the JBoss Test Harness and the
+ <literal>AbstractJSR299Test</literal>
+ is part of the JSR-299 TCK. There is a one-to-one mapping between a
+ TestNG test class and an artifact. The packaging type is defined by
+ the
+ <literal>@org.jboss.testharness.impl.packaging.Packaging</literal>
+ annotation on the test class, defaulting to a WAR if not specified.
+ </para>
+ <para>
+ Prior to executing the tests for a given class, the JBoss Test
+ Harness packages the class as a deployable artifact (EAR or WAR),
+ along with any extra resources specified, and deploys the artifact
+ to the container. The test execution and results are negotatied via
+ HTTP communication using a thin layer over the TestNG test launcher.
+ The test harness can also catch and affirm expected deployment
+ exceptions. This setup and tear down activity is provided by the
+ super class
+ <literal>org.jboss.jsr299.tck.AbstractJSR299Test</literal>
+ , which all TCK test classes must extend.
+ </para>
+ <para>
+ If the annotation
+ <literal>@org.jboss.testharness.impl.packaging.IntegrationTest
+ </literal>
+ is not present on the test class, then it means the test class can
+ be executed in standalone mode. In standalone mode, the deployable
+ artifact is assembled on the local classpath and the tests execute
+ in the same JVM as the launcher, just as though it were a regular
+ TestNG test case. The standalone mode is provided merely for
+ convenience and efficiency.
+ </para>
+ <para>
+ Chapter 4 details how to run the TCK test suite using the JBoss
+ Test Harness.
+ </para>
+ </section>
+ <section>
+ <title>The Porting Package</title>
+ <para>
+ The JSR-299 TCK relies on an implementation of the porting
+ package to function. The porting package can be divided into two
+ parts. The first part is comprised of extensions to the JSR-299 SPIs
+ to allow testing of a container. The second part must contain
+ implementations of the JBoss Test Harness deployment APIs for
+ deploying test artifacts to a given container.
+ </para>
+ <para>
+ As mentioned earlier, there are times when the tests need to tap
+ directly into the JSR-299 implementation to manipulate behavior or
+ verify results. The porting package includes a set of SPIs that
+ provide the TCK this level of access without tying the tests to a
+ given implementation.
+ </para>
+ <para>
+ The four SPI classes in the JSR-299 TCK are as follows:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>org.jboss.jsr299.tck.spi.Beans</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>org.jboss.jsr299.tck.spi.Contexts</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>org.jboss.jsr299.tck.spi.EL</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>org.jboss.jsr299.tck.spi.Managers</literal>
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ To run the full TCK you must additionally implement
+ <literal>org.jboss.testharness.spi.Containers</literal>
+ , which handles deploying the test artifact to the container. If you
+ wish to run the TCK in standalone mode, you must also implement
+ <literal>org.jboss.testharness.spi.StandaloneContainers</literal>
+ . Implementations of these APIs are already available for JBoss AS
+ 5.1. Therefore, you only need to implement this part of the porting
+ package if you wish to use a container other than JBoss AS 5.1, for
+ instance GlassFish V3.
+ </para>
+ <para>
+ The default configuration for the TCK is property-based.
+ Therefore, you specify the implementation class for all of these
+ SPIs in a properties file. There are additional properties for
+ controlling whether the tests are run in standalone or in-container
+ mode. Optionally, you can use system properties to configure the
+ TCK. Details are provided in section 4.1.
+ </para>
+ </section>
+ <section>
+ <title>TCK Audit Tool</title>
+ <para>
+ The TCK audit is used to list out the assertions identified in
+ the JSR-299 specification. It uses Java annotation processing to
+ match the assertions to testcases in the test suite and produce a
+ coverage report.
+ </para>
+ <para>
+ The audit document is provided along with the TCK and each
+ assertion matches against at least one test. Each assertion is
+ defined with a reference to a chapter, section and paragraph from
+ the specification document, making it easy for the licensee to
+ locate the language in the specification document that supports the
+ feature being tested.
+ </para>
+ </section>
+ </section>
</chapter>
15 years, 4 months