[webbeans-commits] Webbeans SVN: r1586 - in tck/trunk/impl/src/main: resources and 1 other directory.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Wed Feb 18 19:07:01 EST 2009
Author: shane.bryzak at jboss.com
Date: 2009-02-18 19:07:01 -0500 (Wed, 18 Feb 2009)
New Revision: 1586
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/NewEnterpriseBeanTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
mapped new enterprise bean tests to assertions
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/NewEnterpriseBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/NewEnterpriseBeanTest.java 2009-02-19 00:04:19 UTC (rev 1585)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/implementation/enterprise/NewEnterpriseBeanTest.java 2009-02-19 00:07:01 UTC (rev 1586)
@@ -36,79 +36,37 @@
newEnterpriseBean = beans.iterator().next();
}
- /**
- * When the built-in binding type @New is applied to an injection point, a
- * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
- *
- * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
- * stereotypes, and such that � the implementation class is the
- * declared type of the injection point.
- */
@Test(groups = { "new" })
- @SpecAssertion(section = "3.3.6", id = "unknown")
+ @SpecAssertion(section = "3.3.6", id = "d")
public void testNewBeanIsDependentScoped()
{
assert Dependent.class.equals(newEnterpriseBean.getScopeType());
}
- /**
- * When the built-in binding type @New is applied to an injection point, a
- * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
- *
- * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
- * stereotypes, and such that � the implementation class is the
- * declared type of the injection point.
- */
@Test(groups = { "new" })
- @SpecAssertion(section = "3.3.6", id = "unknown")
+ @SpecAssertion(section = "3.3.6", id = "e")
public void testNewBeanIsOfStandardDeploymentType()
{
assert Standard.class.equals(newEnterpriseBean.getDeploymentType());
}
- /**
- * When the built-in binding type @New is applied to an injection point, a
- * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
- *
- * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
- * stereotypes, and such that � the implementation class is the
- * declared type of the injection point.
- */
@Test(groups = { "new" })
- @SpecAssertion(section = "3.3.6", id = "unknown")
+ @SpecAssertion(section = "3.3.6", id = "f")
public void testNewBeanIsHasOnlyNewBinding()
{
assert newEnterpriseBean.getBindings().size() == 1;
assert newEnterpriseBean.getBindings().iterator().next().annotationType().equals(new NewLiteral().annotationType());
}
- /**
- * When the built-in binding type @New is applied to an injection point, a
- * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
- *
- * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
- * stereotypes, and such that � the implementation class is the
- * declared type of the injection point.
- */
@Test(groups = { "new" })
- @SpecAssertion(section = "3.3.6", id = "unknown")
+ @SpecAssertion(section = "3.3.6", id = "g")
public void testNewBeanHasNoWebBeanName()
{
assert newEnterpriseBean.getName() == null;
}
- /**
- * When the built-in binding type @New is applied to an injection point, a
- * Web Bean is implicitly defined with: � scope @Dependent, � deployment type
- *
- * @Standard, � @New as the only binding annotation, � no Web Bean name, � no
- * stereotypes, and such that � the implementation class is the
- * declared type of the injection point.
- *
- * TODO It is difficult to prove if a bean has any stereotypes
- */
@Test(groups = { "stub", "new", "underInvestigation" })
- @SpecAssertion(section = "3.3.6", id = "unknown")
+ @SpecAssertion(section = "3.3.6", id = "h")
public void testNewBeanHasNoStereotypes()
{
assert false;
@@ -123,7 +81,7 @@
* is an enterprise Web Bean.
*/
@Test(groups = { "new", "stub", "ejb3" })
- @SpecAssertion(section = "3.3.6", id = "unknown")
+ @SpecAssertion(section = "3.3.6", id = "review")
public void testNewBeanIsEnterpriseWebBeanIfParameterTypeIsEnterpriseWebBean()
{
assert false;
@@ -163,17 +121,6 @@
// assert false;
// }
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
@Test(groups = {"new" })
@SpecAssertion(section = "3.3.6", id = "i")
public void testNewBeanHasNoObservers()
@@ -183,19 +130,6 @@
assert getCurrentManager().resolveObservers("event").size() == 1;
}
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- *
- * TODO There is no way to prove that a new bean has no producer fields
- */
@Test(groups = { "new", "stub", "underInvestigation" })
@SpecAssertion(section = "3.3.6", id = "k")
public void testNewBeanHasNoProducerFields()
@@ -204,56 +138,25 @@
}
/**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
*
* TODO There really is no way to prove that a @New bean has no producers
*/
@Test(groups = { "new", "stub", "underInvestigation" })
- @SpecAssertion(section = "3.3.6", id = "unknown")
+ @SpecAssertion(section = "3.3.6", id = "j")
public void testNewBeanHasNoProducerMethods()
{
assert false;
}
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
@Test(groups = { "new", "stub", "disposal" })
- @SpecAssertion(section = "3.3.6", id = "unknown")
+ @SpecAssertion(section = "3.3.6", id = "l")
public void testNewBeanHasNoDisposalMethods()
{
assert false;
}
- /**
- * Furthermore, this Web Bean: � has the same Web Bean constructor,
- * initializer methods and injected fields as a Web Bean defined using
- * annotations� that is, it has any Web Bean constructor, initializer method
- * or injected field declared by annotations that appear on the
- * implementation class, � has no observer methods, producer methods or
- * fields or disposal methods, � has the same interceptors as a Web Bean
- * defined using annotations�that is, it has all the interceptor binding
- * types declared by annotations that appear on the implementation class, and
- * � has no decorators.
- */
@Test(groups = { "stub", "new", "interceptors" })
- @SpecAssertion(section = "3.3.6", id = "unknown")
+ @SpecAssertion(section = "3.3.6", id = "c")
public void testNewBeanHasSameInterceptorMethodsAsWrappedBean()
{
assert false;
@@ -271,7 +174,7 @@
* � has no decorators.
*/
@Test(groups = { "new", "broken" })
- @SpecAssertion(section = "3.3.6", id = "unknown")
+ @SpecAssertion(section = "3.3.6", id = "review")
public void testNewBeanHasNoDecorators()
{
Annotation[] bindingTypes = newEnterpriseBean.getBindings().toArray(new Annotation[0]);
@@ -287,7 +190,7 @@
* Bean implementation class.
*/
@Test(groups = { "new" })
- @SpecAssertion(section = "3.3.6", id = "unknown")
+ @SpecAssertion(section = "3.3.6", id = "review")
public void testNewAnnotationMayBeAppliedToField()
{
deployBeans(AnnotatedField.class, WrappedEnterpriseBean.class);
@@ -303,7 +206,7 @@
* Bean implementation class.
*/
@Test(groups = { "new" })
- @SpecAssertion(section = "3.3.6", id = "unknown")
+ @SpecAssertion(section = "3.3.6", id = "review")
public void testNewAnnotationMayBeAppliedToProducerMethodParameter()
{
deployBeans(AnnotatedProducerParameter.class, WrappedEnterpriseBean.class);
@@ -319,7 +222,7 @@
* Bean implementation class.
*/
@Test(groups = { "new" })
- @SpecAssertion(section = "3.3.6", id = "unknown")
+ @SpecAssertion(section = "3.3.6", id = "review")
public void testNewAnnotationMayBeAppliedToInitializerMethodParameter()
{
deployBeans(AnnotatedInitializerParameter.class, WrappedEnterpriseBean.class);
@@ -335,7 +238,7 @@
* Bean implementation class.
*/
@Test(groups = { "new" })
- @SpecAssertion(section = "3.3.6", id = "unknown")
+ @SpecAssertion(section = "3.3.6", id = "review")
public void testNewAnnotationMayBeAppliedToConstructorMethodParameter()
{
deployBeans(AnnotatedConstructorParameter.class, WrappedEnterpriseBean.class);
@@ -350,7 +253,7 @@
* by the container at deployment time.
*/
@Test(groups = { "new" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.3.6", id = "unknown")
+ @SpecAssertion(section = "3.3.6", id = "review")
public void testNewAnnotationCannotAppearInConjunctionWithOtherBindingType()
{
deployBeans(NewAndOtherBindingType_Broken.class);
@@ -374,7 +277,7 @@
* as a binding type
*/
@Test(groups = { "stub", "new", "webbeansxml" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.3.6", id = "unknown")
+ @SpecAssertion(section = "3.3.6", id = "review")
public void testNewAnnotationCannotBeExplicitlyDeclared()
{
// This only needs to be tested with XML since the annotation itself
@@ -382,7 +285,7 @@
assert false;
}
- @Test @SpecAssertion(section="3.2.6", id = "unknown")
+ @Test @SpecAssertion(section="3.2.6", id = "review")
public void testForEachEnterpriseBeanANewBeanExists()
{
deployBeans(Order.class, Lion.class);
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-02-19 00:04:19 UTC (rev 1585)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-02-19 00:07:01 UTC (rev 1586)
@@ -831,6 +831,7 @@
<assertion id="a">
<text>When the container instantiates a simple bean, it calls the bean constructor. The bean constructor is a constructor of the bean class</text>
</assertion>
+
<assertion id="b">
<text>The application may call bean constructors directly. However, if the application directly instantiates the bean, no parameters are passed to the constructor by the container; the returned object is not bound to any context; no dependencies are injected by the container; and the lifecycle of the new instance is not managed by the container</text>
</assertion>
@@ -1029,72 +1030,58 @@
<section id="3.3.6" title="Session beans with the @New binding">
<assertion id="a">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has the same bean class</text>
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such session bean, a second bean exists which has the same bean class</text>
</assertion>
<assertion id="b">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has the initializer methods and injected fields defined by annotations</text>
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such session bean, a second bean exists which has the initializer methods and injected fields defined by annotations</text>
</assertion>
<assertion id="c">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has the same interceptor bindings defined by annotations</text>
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such session bean, a second bean exists which has the same interceptor bindings defined by annotations</text>
</assertion>
<assertion id="d">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has scope @Dependent,</text>
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such session bean, a second bean exists which has scope @Dependent,</text>
</assertion>
<assertion id="e">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has deployment type @Standard</text>
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such session bean, a second bean exists which has deployment type @Standard</text>
</assertion>
<assertion id="f">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has @javax.inject.New as the only binding</text>
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such session bean, a second bean exists which has @javax.inject.New as the only binding</text>
</assertion>
<assertion id="g">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has no bean name</text>
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such session bean, a second bean exists which has no bean name</text>
</assertion>
<assertion id="h">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has no stereotypes</text>
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such session bean, a second bean exists which has no stereotypes</text>
</assertion>
<assertion id="i">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has no observer methods</text>
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such session bean, a second bean exists which has no observer methods</text>
</assertion>
<assertion id="j">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has no producer methods</text>
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such session bean, a second bean exists which has no producer methods</text>
</assertion>
<assertion id="k">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has no producer fields</text>
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such session bean, a second bean exists which has no producer fields</text>
</assertion>
<assertion id="l">
- <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations.
-Additionally, for each such session bean, a second bean exists which has no disposal methods</text>
+ <text>Every EJB that satisfies the requirements of Section 3.3.2, "Which EJBs are beans?" is a bean, with scope, deployment type and bindings defined using annotations. Additionally, for each such session bean, a second bean exists which has no disposal methods</text>
</assertion>
</section>
<section id="3.3.7" title="Specializing a session bean">
<assertion id="a">
- <text>If a bean class of a session bean X defined using annotations is annotated @Specializes, then the bean class of X must directly extend the bean class of another session bean Y defined using annotations. Then X inherits all bindings of Y, and if Y has a name, X has the same name as Y. Also, X must support all local interfaces supported by Y, and
-if Y supports a bean-class local view, X must also support a bean-class local view.
-Otherwise, a DefinitionException is thrown by the container at deployment time.</text>
+ <text>If a bean class of a session bean X defined using annotations is annotated @Specializes, then the bean class of X must directly extend the bean class of another session bean Y defined using annotations. Then X inherits all bindings of Y, and if Y has a name, X has the same name as Y. Also, X must support all local interfaces supported by Y, and if Y supports a bean-class local view, X must also support a bean-class local view. Otherwise, a DefinitionException is thrown by the container at deployment time.</text>
</assertion>
<assertion id="b">
More information about the weld-commits
mailing list