Author: shane.bryzak(a)jboss.com
Date: 2009-02-18 17:06:11 -0500 (Wed, 18 Feb 2009)
New Revision: 1577
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/commonAnnotations/ResourceInjectionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/producer/field/ProducerFieldDefinitionTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
completed chapter 2 assertions, mapped more tests
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/commonAnnotations/ResourceInjectionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/commonAnnotations/ResourceInjectionTest.java 2009-02-18
18:41:21 UTC (rev 1576)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/commonAnnotations/ResourceInjectionTest.java 2009-02-18
22:06:11 UTC (rev 1577)
@@ -11,57 +11,29 @@
*/
public class ResourceInjectionTest extends AbstractDeclarativeTest
{
- /**
- * The following functionality is provided by the container when annotations
- * are applied to the bean class of a simple bean:
- *
- * • dependency injection via (@EJB), (@Resource), @PersistenceUnit and
- * @PersistenceContext.
- */
@Test(groups = "stub")
- @SpecAssertion(section = "3.10", id = "unknown")
+ @SpecAssertion(section = "3.10", id = "d")
public void testInjectionOfPersistenceContext()
{
assert false;
}
- /**
- * The following functionality is provided by the container when annotations
- * are applied to the bean class of a simple bean:
- *
- * • dependency injection via (@EJB), (@Resource), @PersistenceUnit and
- * @PersistenceContext.
- */
@Test(groups = "stub")
- @SpecAssertion(section = "3.10", id = "unknown")
+ @SpecAssertion(section = "3.10", id = "c")
public void testInjectionOfPersistenceUnit()
{
assert false;
}
- /**
- * The following functionality is provided by the container when annotations
- * are applied to the bean class of a simple bean:
- *
- * • dependency injection via (@EJB), (@Resource), @PersistenceUnit and
- * @PersistenceContext.
- */
@Test(groups = "stub")
- @SpecAssertion(section = "3.10", id = "unknown")
+ @SpecAssertion(section = "3.10", id = "b")
public void testInjectionOfResource()
{
assert false;
}
- /**
- * The following functionality is provided by the container when annotations
- * are applied to the bean class of a simple bean:
- *
- * • dependency injection via (@EJB), (@Resource), @PersistenceUnit and
- * @PersistenceContext.
- */
@Test(groups = "stub")
- @SpecAssertion(section = "3.10", id = "unknown")
+ @SpecAssertion(section = "3.10", id = "a")
public void testInjectionOfEJB()
{
assert false;
@@ -74,43 +46,28 @@
* • @PostConstruct and @PreDestroy callbacks
*/
@Test(groups = "stub")
- @SpecAssertion(section = "3.10", id = "unknown")
+ @SpecAssertion(section = "3.10", id = "e")
public void testPostConstructCallback()
{
assert false;
}
- /**
- * The following functionality is provided by the container when annotations
- * are applied to the bean class of a simple bean:
- *
- * • @PostConstruct and @PreDestroy callbacks
- */
@Test(groups = "stub")
- @SpecAssertion(section = "3.10", id = "unknown")
+ @SpecAssertion(section = "3.10", id = "f")
public void testPreDestroyCallback()
{
assert false;
}
- /**
- * The following functionality is provided by the container when annotations
- * are applied to the bean class of a simple bean:
- *
- * • interception, as defined in javax.interceptor
- */
@Test(groups = "stub")
- @SpecAssertion(section = "3.10", id = "unknown")
+ @SpecAssertion(section = "3.10", id = "g")
public void testStandardInterceptor()
{
assert false;
}
- /**
- * @PersistenceContext(type=EXTENDED) is not supported for simple beans.
- */
@Test(groups = "stub")
- @SpecAssertion(section = "3.10", id = "unknown")
+ @SpecAssertion(section = "3.10", id = "h")
public void testExtendedPersistenceContextNotSupported()
{
assert false;
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/producer/field/ProducerFieldDefinitionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/producer/field/ProducerFieldDefinitionTest.java 2009-02-18
18:41:21 UTC (rev 1576)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/producer/field/ProducerFieldDefinitionTest.java 2009-02-18
22:06:11 UTC (rev 1577)
@@ -39,15 +39,8 @@
return Collections.unmodifiableList(Arrays.asList(Standard.class, Production.class,
AnotherDeploymentType.class));
}
- /**
- * By default, if no deployment type annotation is explicitly specified, a
- * producer method or field inherits the deployment type of the bean in which
- * it is defined.
- *
- * @throws Exception
- */
@Test(groups = { "producerField" })
- @SpecAssertion(section = "2.5.3", id = "unknown")
+ @SpecAssertion(section = "2.5.3", id = "h")
public void testProducerFieldInheritsDeploymentTypeOfDeclaringWebBean() throws
Exception
{
deployBeans(TarantulaProducer.class, TarantulaConsumer.class);
@@ -69,20 +62,14 @@
*/
@Test(groups = { "broken", "producerField",
"enterpriseBeans" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.5", id = "unknown")
+ @SpecAssertion(section = "3.5", id = "review")
public void testProducerFieldIsNotBusinessField() throws Exception
{
deployBeans(VibratingSpiderImpl_Broken.class);
}
- /**
- * If the producer field return type is a parameterized type, it must specify
- * actual type parameters for each type parameter.
- *
- * @throws Exception
- */
@Test(groups = "producerField")
- @SpecAssertion(section = "3.5", id = "unknown")
+ @SpecAssertion(section = "3.5", id = "f")
public void testParameterizedReturnType() throws Exception
{
deployBeans(FunnelWeaverSpiderProducer.class, FunnelWeaverSpiderConsumer.class);
@@ -98,26 +85,15 @@
}.run();
}
- /**
- * If the producer field return type is a parameterized type, it must specify
- * actual type parameters for each type parameter. If a producer field return
- * type contains a wildcard type parameter or type variable, a
- * DefinitionException is thrown by the container at deployment time.
- *
- * @throws Exception
- */
@Test(groups = "producerField", expectedExceptions =
DefinitionException.class)
- @SpecAssertion(section = "3.5", id = "unknown")
+ @SpecAssertion(section = "3.5", id = "g")
public void testParameterizedReturnTypeWithWildcard()
{
deployBeans(SpiderProducerWildCardType_Broken.class);
}
- /**
- * A bean may declare multiple producer fields.
- */
@Test(groups = { "producerField", "deployment" })
- @SpecAssertion(section = "3.5", id = "unknown")
+ @SpecAssertion(section = "3.5", id = "j")
public void testBeanDeclaresMultipleProducerFields()
{
deployBeans(OtherSpiderProducer.class);
@@ -125,7 +101,7 @@
@Test(groups = "producerField")
@SpecAssertions({
- @SpecAssertion(section = "3.5", id = "unknown"),
+ @SpecAssertion(section = "3.5", id = "review"),
@SpecAssertion(section = "2.3.1", id = "unknown")
})
public void testDefaultBindingType()
@@ -136,15 +112,8 @@
assert tarantulaBeans.iterator().next().getBindings().contains(new
CurrentBinding());
}
- /**
- * If the field type is a class, the set of bean types contains the field
- * type, every superclass and all interfaces it implements directly or
- * indirectly.
- *
- * @throws Exception
- */
@Test(groups = "producerField")
- @SpecAssertion(section = "3.5.1", id = "unknown")
+ @SpecAssertion(section = "3.5.1", id = "c")
public void testApiTypeForClassReturn()
{
deployBeans(StaticTarantulaProducer.class);
@@ -160,15 +129,8 @@
assert tarantulaModel.getTypes().contains(Object.class);
}
- /**
- * If the field type is an interface, the set of bean types contains the
- * field type, all interfaces it extends directly or indir- ectly and
- * java.lang.Object.
- *
- * @throws Exception
- */
@Test(groups = { "producerField" })
- @SpecAssertion(section = "3.5.1", id = "unknown")
+ @SpecAssertion(section = "3.5.1", id = "a")
public void testApiTypeForInterfaceReturn()
{
deployBeans(SpiderAsAnimalProducer.class);
@@ -180,14 +142,8 @@
assert animalModel.getTypes().contains(Object.class);
}
- /**
- * If a field type is primitive or is a Java array type, the set of bean
- * types contains exactly two types: the field type and java.lang.Object.
- *
- * @throws Exception
- */
@Test(groups = { "producerField" })
- @SpecAssertion(section = "3.5.1", id = "unknown")
+ @SpecAssertion(section = "3.5.1", id = "b")
public void testApiTypeForPrimitiveReturn()
{
deployBeans(OtherSpiderProducer.class);
@@ -199,16 +155,10 @@
assert intModel.getTypes().contains(Object.class);
}
- /**
- * If a field type is primitive or is a Java array type, the set of bean
- * types contains exactly two types: the field type and java.lang.Object.
- *
- * @throws Exception
- */
@Test(groups = { "producerField" })
@SpecAssertions({
- @SpecAssertion(section = "3.5.1", id = "unknown"),
- @SpecAssertion(section = "2.2", id = "unknown")
+ @SpecAssertion(section = "3.5.1", id = "b"),
+ @SpecAssertion(section = "2.2", id = "j")
})
public void testApiTypeForArrayTypeReturn()
{
@@ -221,14 +171,8 @@
assert spidersModel.getTypes().contains(Object.class);
}
- /**
- * A producer field may also specify scope, name, deployment type,
- * stereotypes and/or bindings.
- *
- * @throws Exception
- */
@Test(groups = "producerField")
- @SpecAssertion(section = "3.5.2", id = "unknown")
+ @SpecAssertion(section = "3.5.2", id = "f")
public void testBindingType()
{
deployBeans(TameTarantulaProducer.class);
@@ -239,14 +183,8 @@
assert
tarantulaModel.getBindings().iterator().next().annotationType().equals(Tame.class);
}
- /**
- * A producer field may also specify scope, name, deployment type,
- * stereotypes and/or bindings.
- *
- * @throws Exception
- */
@Test(groups = "producerField")
- @SpecAssertion(section = "3.5.2", id = "unknown")
+ @SpecAssertion(section = "3.5.2", id = "b")
public void testScopeType()
{
deployBeans(TameTarantulaProducer.class);
@@ -258,14 +196,8 @@
// TODO Inherit scope from returned web bean?
}
- /**
- * A producer field may also specify scope, name, deployment type,
- * stereotypes and/or bindings.
- *
- * @throws Exception
- */
@Test(groups = "producerField")
- @SpecAssertion(section = "3.5.2", id = "unknown")
+ @SpecAssertion(section = "3.5.2", id = "d")
public void testDeploymentType()
{
deployBeans(TameTarantulaProducer.class);
@@ -275,14 +207,8 @@
assert tarantulaModel.getDeploymentType().equals(Production.class);
}
- /**
- * A producer field may also specify scope, name, deployment type,
- * stereotypes and/or bindings.
- *
- * @throws Exception
- */
@Test(groups = "producerField")
- @SpecAssertion(section = "3.5.2", id = "unknown")
+ @SpecAssertion(section = "3.5.2", id = "c")
public void testNamedField()
{
deployBeans(BlackWidowProducer.class);
@@ -301,8 +227,8 @@
*/
@Test(groups = { "producerField" })
@SpecAssertions({
- @SpecAssertion(section = "2.6.3", id = "unknown"),
- @SpecAssertion(section = "3.5.4", id = "unknown")
+ @SpecAssertion(section = "2.6.3", id = "b"),
+ @SpecAssertion(section = "3.5.4", id = "a")
})
public void testDefaultNamedField()
{
@@ -322,8 +248,8 @@
@Test(groups = "producerField")
@SpecAssertions({
@SpecAssertion(section = "2.7.2", id = "unknown"),
- @SpecAssertion(section = "3.5.2", id = "unknown"),
- @SpecAssertion(section = "2.2", id = "unknown")
+ @SpecAssertion(section = "3.5.2", id = "e"),
+ @SpecAssertion(section = "2.2", id = "review")
})
public void testStereotype()
{
@@ -336,7 +262,7 @@
}
@Test(groups = "producerField")
- @SpecAssertion(section = "4.2", id = "unknown")
+ @SpecAssertion(section = "4.2", id = "k")
public void testNonStaticProducerFieldNotInherited()
{
deployBeans(InfertileChicken.class);
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-02-18 18:41:21 UTC (rev 1576)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-02-18 22:06:11 UTC (rev 1577)
@@ -273,7 +273,7 @@
</assertion>
<assertion id="h">
- <text>By default, if no deployment type annotation is explicitly specified, a
field inherits the deployment type of the bean in which it is defined.</text>
+ <text>By default, if no deployment type annotation is explicitly specified, a
producer field inherits the deployment type of the bean in which it is
defined.</text>
</assertion>
<assertion id="i">
@@ -369,7 +369,7 @@
</assertion>
<assertion id="c">
- <text>A default name must be assigned by the container when a field of a bean
defined using annotations declares a @Named annotation and no name is explicitly specified
by the value member</text>
+ <text>A default name must be assigned by the container when a producer field
of a bean defined using annotations declares a @Named annotation and no name is explicitly
specified by the value member</text>
</assertion>
<assertion id="d">
@@ -391,7 +391,7 @@
<section id="2.7" title="Stereotypes">
<assertion id="a">
- <text>A stereotype may also specify that all beans with the stereotype have
defaulted bean names</text>
+ <text>A stereotype may specify that all beans with the stereotype have
defaulted bean names</text>
</assertion>
<assertion id="b">
@@ -407,7 +407,150 @@
</assertion>
</section>
+
+ <section 2.7.1" title="Defining new stereotypes">
+ <assertion id="a">
+ <text>A beans stereotype is a Java annotation defined as @Target({TYPE,
METHOD, FIELD}), @Target(TYPE), @Target(METHOD), @Target(FIELD) or @Target({METHOD,
FIELD}) and @Retention(RUNTIME)</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A stereotype may be declared by specifying the
@javax.annotation.Stereotype meta-annotation</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The @Stereotype meta-annotation may be omitted, and the stereotype may
be declared in beans.xml</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A stereotype may not declare any binding annotation. If a stereotype
declares a binding annotation, a DefinitionException is thrown by the container at
deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.1.1" title="Declaring the default scope and
deployment type for a stereotype">
+ <assertion id="a">
+ <text>A stereotype may declare at most one scope. If a stereotype declares
more than one scope, a DefinitionException is thrown by the container at deployment
time</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A stereotype may declare at most one deployment type. If a stereotype
declares more than one deployment type, a DefinitionException is thrown by the container
at deployment time</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.1.2" title="Specifying interceptor bindings for a
stereotype">
+
+ <assertion id="a">
+ <text>A stereotype may declare zero interceptor bindings</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A stereotype may declare one interceptor binding</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A stereotype may declare multiple interceptor bindings</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.7.1.3" title="Specifying name defaulting for a
stereotype">
+ <assertion id="a">
+ <text>A stereotype may declare an empty @Named annotation. If a stereotype
declares a non-empty @Named annotation, a DefinitionException is thrown by the container
at deployment time</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A stereotype may specify that every bean with the stereotype has a
defaulted name when a name is not explicitly specified by the bean</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.1.4" title="Restricting bean scopes and types using
a stereotype">
+ <assertion id="a">
+ <text>Bean scopes may be restricted using a stereotype</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Bean types may be restricted using a stereotype</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Scope and type restrictions may not be specified when a stereotype is
declared in XML</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.1.5" title="Stereotypes with additional
stereotypes">
+ <assertion id="a">
+ <text>A stereotype may declare other stereotypes</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Stereotype declarations are transitive � a stereotype declared by a
second stereotype is inherited by all beans and other stereotypes that declare the second
stereotype</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Stereotypes declared @Target(TYPE) may not be applied to stereotypes
declared @Target({TYPE, METHOD, FIELD})</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Stereotypes declared @Target(TYPE) may not be applied to stereotypes
declared @Target(METHOD)</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Stereotypes declared @Target(TYPE) may not be applied to stereotypes
declared @Target(FIELD)</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Stereotypes declared @Target(TYPE) may not be applied to stereotypes
declared @Target({METHOD, FIELD})</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.2" title="Declaring the stereotypes for a bean using
annotations">
+ <assertion id="a">
+ <text>Stereotype annotations may be applied to a bean class</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Stereotype annotations may be applied to a producer
method</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Stereotype annotations may be applied to a producer field</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The default deployment type and default scope declared by the
stereotype may be overridden by the bean</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Multiple stereotypes may be applied to the same bean</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.3" title="Declaring the stereotypes for a bean using
XML">
+ <assertion id="a">
+ <text>If the bean is declared in beans.xml, stereotypes may be declared using
the stereotype annotation type name</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.4" title="Stereotype restrictions">
+ <assertion id="a">
+ <text>If a stereotype declares a requiredType, and the bean types do not
include the type, a DefinitionException is thrown by the container at deployment
time</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If a stereotype explicitly declares a set of scope types using
supportedScopes, and the bean scope is not in that set, a DefinitionException is thrown by
the container at deployment time</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a bean declares multiple stereotypes, it must satisfy every
restriction declared by every declared stereotype</text>
+ </assertion>
+ </section>
+
+ <section id="2.7.5" title="Built-in stereotypes">
+ <assertion id="a">
+ <text>The built-in @Model stereotype is intended for use with beans that
define the model layer of an MVC web application architecture such as JSF</text>
+ </assertion>
+ </section>
+
<section id="3" title="Bean Implementation">
</section>
@@ -1200,8 +1343,24 @@
</assertion>
<assertion id="b">
- <text>A producer field may also specify scope, name, deployment type,
stereotypes and/or bindings</text>
+ <text>A producer field may specify a scope</text>
</assertion>
+
+ <assertion id="c">
+ <text>A producer field may specify a name</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A producer field may specify a deployment type</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A producer field may specify stereotypes</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A producer field may specify bindings</text>
+ </assertion>
</section>
<section id="3.5.3" title="Declaring a producer field using
XML">
@@ -1828,7 +1987,7 @@
</assertion>
<assertion id="k">
- <text>For class X which is the bean class of a simple or session bean Y
declared using XML, if X declares a non-static producer field x then Y does not inherit
this method, unless Y is explicitly declared to specialize or realize X.</text>
+ <text>For class X which is the bean class of a simple or session bean Y
declared using XML, if X declares a non-static producer field x then Y does not inherit
this field, unless Y is explicitly declared to specialize or realize X.</text>
</assertion>
<assertion id="l">