Author: shane.bryzak(a)jboss.com
Date: 2009-02-10 19:07:04 -0500 (Tue, 10 Feb 2009)
New Revision: 1479
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/binding/BindingDefinitionTest.java
tck/trunk/impl/tck-audit.xml
Log:
map chapter 2 tests to assertions
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/binding/BindingDefinitionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/binding/BindingDefinitionTest.java 2009-02-10
20:30:51 UTC (rev 1478)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/definition/binding/BindingDefinitionTest.java 2009-02-11
00:07:04 UTC (rev 1479)
@@ -31,7 +31,7 @@
}
@Test
- @SpecAssertions( { @SpecAssertion(section = "2.3.3", id =
"unknown"), @SpecAssertion(section = "2.3.1", id =
"unknown") })
+ @SpecAssertion(section = "2.3.1", id = "a")
public void testDefaultBindingDeclaredInJava()
{
Bean<Order> order = manager.resolveByType(Order.class).iterator().next();
@@ -40,7 +40,7 @@
}
@Test(groups = { "annotationDefinition", "underInvestigation" })
- @SpecAssertion(section = "2.3.2", id = "unknown")
+ @SpecAssertion(section = "2.3.2", id = "a")
public void testBindingHasCorrectTarget()
{
// TODO This is only a definition without any real assertion about a given
@@ -50,7 +50,7 @@
}
@Test(groups = { "annotationDefinition", "underInvestigation" })
- @SpecAssertion(section = "2.3.2", id = "unknown")
+ @SpecAssertion(section = "2.3.2", id = "a")
public void testBindingHasCorrectRetention()
{
// TODO This is only a definition without any real assertion about a given
@@ -60,14 +60,14 @@
}
@Test(groups = { "annotationDefinition" })
- @SpecAssertion(section = "2.3.2", id = "unknown")
+ @SpecAssertion(section = "2.3.2", id = "b")
public void testBindingDeclaresBindingAnnotation()
{
assert !manager.resolveByType(Tarantula.class, new TameBinding()).isEmpty();
}
@Test
- @SpecAssertion(section = "2.3.3", id = "unknown")
+ @SpecAssertion(section = "2.3.3", id = "a")
public void testBindingsDeclaredInJava()
{
Bean<Cat> cat = manager.resolveByType(Cat.class, new
SynchronousBinding()).iterator().next();
@@ -76,7 +76,7 @@
}
@Test
- @SpecAssertion(section = "2.3.3", id = "unknown")
+ @SpecAssertion(section = "2.3.3", id = "b")
public void testMultipleBindings()
{
Bean<?> model = manager.resolveByType(Cod.class, new ChunkyBinding(true), new
WhitefishBinding()).iterator().next();
@@ -84,7 +84,7 @@
}
@Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "2.3.4", id = "unknown")
+ @SpecAssertion(section = "2.3.4", id = "a")
public void testBindingsDeclaredInXml()
{
// Map<Class<? extends Annotation>, Annotation> annotations = new
@@ -102,7 +102,7 @@
}
@Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "2.3.4", id = "unknown")
+ @SpecAssertion(section = "2.3.5", id = "d")
public void testXmlBindingOverridesAndIgnoresJava()
{
// Map<Class<? extends Annotation>, Annotation> annotations = new
@@ -121,7 +121,7 @@
}
@Test(groups = { "stub", "webbeansxml" })
- @SpecAssertion(section = "2.3.4", id = "unknown")
+ @SpecAssertion(section = "2.3.4", id = "a")
public void testNoBindingsDeclaredInXml()
{
// Map<Class<? extends Annotation>, Annotation> annotations = new
@@ -138,7 +138,8 @@
}
@Test(groups = { "stub", "webbeansxml" })
- @SpecAssertions( { @SpecAssertion(section = "2.3.4", id =
"unknown"), @SpecAssertion(section = "2.3.1", id =
"unknown") })
+ @SpecAssertions( { @SpecAssertion(section = "2.3.4", id = "a"),
+ @SpecAssertion(section = "2.3.5", id = "c") })
public void testDefaultBindingDeclaredInXml()
{
Bean<?> model = manager.resolveByType(Tuna.class).iterator().next();
@@ -157,14 +158,14 @@
}
@Test(groups = { "stub", "injection", "webbeansxml" })
- @SpecAssertion(section = "2.3.5", id = "unknown")
+ @SpecAssertion(section = "2.3.6", id = "b")
public void testFieldWithBindingInXml()
{
assert false;
}
@Test(groups = { "stub", "injection", "webbeansxml" })
- @SpecAssertion(section = "2.3.5", id = "unknown")
+ @SpecAssertion(section = "2.3.6", id = "c")
public void testFieldWithBindingInXmlIgnoresAnnotations()
{
assert false;
Modified: tck/trunk/impl/tck-audit.xml
===================================================================
--- tck/trunk/impl/tck-audit.xml 2009-02-10 20:30:51 UTC (rev 1478)
+++ tck/trunk/impl/tck-audit.xml 2009-02-11 00:07:04 UTC (rev 1479)
@@ -1,6 +1,87 @@
<specification
xmlns="http://jboss.com/products/webbeans/tck/audit"
name="JSR-299: Java Contexts and Dependency Injection"
version="Revised Public Review Draft">
+
+ <section id="2.3.1" title="Default binding type">
+
+ <assertion id="a">
+ <text>If a bean does not explicitly declare a binding, the bean has exactly
one binding, of type @javax.inject.Current</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The default binding is also assumed for any injection point that does
not explicitly declare a binding</text>
+ </assertion>
+ </section>
+
+ <section id="2.3.2" title="Defining new binding types">
+ <assertion id="a">
+ <text>A binding type is a Java annotation defined as @Target({METHOD, FIELD,
PARAMETER, TYPE}) and @Retention(RUNTIME).</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A binding type may be declared by specifying the
@javax.inject.BindingType meta-annotation</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The @BindingType meta-annotation may be omitted, and the binding type
may be declared in beans.xml</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A binding type may define annotation members</text>
+ </assertion>
+ </section>
+
+ <section id="2.3.3" title="Declaring the bindings of a bean using
annotations">
+
+ <assertion id="a">
+ <text>A bean's bindings are declared by annotating the bean class or
producer method or field with the binding types</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Any bean may declare multiple binding types</text>
+ </assertion>
+ </section>
+
+ <section id="2.3.4" title="Declaring the bindings of a bean using
XML">
+
+ <assertion id="a">
+ <text>If a bean is declared in beans.xml, bindings may be specified using the
binding type names</text>
+ </assertion>
+
+ </section>
+
+ <section id="2.3.5" title="Specifying bindings of an injected
field">
+
+ <assertion id="a">
+ <text>Binding types may be applied to injected fields (see Section 3.8,
"Injected fields") to determine the bean that is injected, according to the
typesafe resolution algorithm defined in Section 5.9, "Typesafe resolution
algorithm".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A bean may only be injected to an injection point if it has all the
bindings of the injection point</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>For a bean defined in XML, the bindings of a field may be specified
using XML</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When the bindings of a field are specified using XML, any binding
annotations of the field are ignored</text>
+ </assertion>
+ </section>
+
+ <section id="2.3.6" title="Specifying bindings of a method or
constructor parameter">
+ <assertion id="a">
+ <text>Binding types may be applied to parameters of producer methods,
initializer methods, disposal methods or bean constructors (see Chapter 3, Bean
implementation) to determine the bean instance that is passed when the method is called by
the container</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For a bean defined in XML, the bindings of a method parameter may be
specified using XML</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>When the bindings of a parameter are specified using XML, any binding
annotations of the parameter are ignored</text>
+ </assertion>
+ </section>
<section id="3" title="Bean Implementation">