[webbeans-commits] Webbeans SVN: r3848 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove and 7 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Mon Oct 5 06:41:03 EDT 2009
Author: shane.bryzak at jboss.com
Date: 2009-10-05 06:41:03 -0400 (Mon, 05 Oct 2009)
New Revision: 3848
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/MockEnterpriseBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/extendejb/SpecializingBeanExtendsEnterpriseBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend1/SpecializingBeanImplementsInterfaceOnly.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend2/SpecializingBeanExtendsNothingTest.java
tck/trunk/impl/src/main/resources/tck-audit-cdi.xml
Log:
assertion groupings for 3.1.4
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-10-05 08:02:32 UTC (rev 3847)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-10-05 10:41:03 UTC (rev 3848)
@@ -122,7 +122,7 @@
@Test(groups = "enterpriseBeans")
@SpecAssertion(section = "3.2.3", id = "be")
- public void testBeanWithBindings()
+ public void testBeanWithQualifiers()
{
Annotation tame = new AnnotationLiteral<Tame>(){};
Bean<ApeLocal> apeBean = getBeans(ApeLocal.class, tame).iterator().next();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java 2009-10-05 08:02:32 UTC (rev 3847)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java 2009-10-05 10:41:03 UTC (rev 3848)
@@ -6,7 +6,6 @@
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.IntegrationTest;
@@ -28,11 +27,13 @@
@SpecAssertion(section = "3.2.1", id = "a")
public void testApplicationMayCallAnyRemoveMethodOnDependentScopedSessionEnterpriseBeans() throws Exception
{
- DependentSessionInterface sessionBean = getInstanceByType(DependentSessionInterface.class);
- sessionBean.remove();
Bean<?> bean = getCurrentManager().getBeans(StateKeeper.class).iterator().next();
StateKeeper stateKeeper = (StateKeeper)
- getCurrentManager().getReference(bean,StateKeeper.class, getCurrentManager().createCreationalContext(bean));
+ getCurrentManager().getReference(bean,StateKeeper.class, getCurrentManager().createCreationalContext(bean));
+ stateKeeper.setRemoveCalled(false);
+
+ DependentSessionInterface sessionBean = getInstanceByType(DependentSessionInterface.class);
+ sessionBean.remove();
assert stateKeeper.isRemoveCalled();
}
@@ -47,10 +48,7 @@
}
@Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle" }, expectedExceptions = UnsupportedOperationException.class)
- @SpecAssertions({
- @SpecAssertion(section = "3.2.1", id = "b"),
- @SpecAssertion(section = "3.2.1", id = "c")
- })
+ @SpecAssertion(section = "3.2.1", id = "b")
public void testApplicationCannotCallRemoveMethodOnNonDependentScopedSessionEnterpriseBean()
{
SessionScopedSessionInterface sessionBean = getInstanceByType(SessionScopedSessionInterface.class);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/MockEnterpriseBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/MockEnterpriseBean.java 2009-10-05 08:02:32 UTC (rev 3847)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/MockEnterpriseBean.java 2009-10-05 10:41:03 UTC (rev 3848)
@@ -1,8 +1,9 @@
package org.jboss.jsr299.tck.tests.implementation.simple.definition;
-import javax.ejb.EnterpriseBean;
+import javax.ejb.Stateless;
-class MockEnterpriseBean implements EnterpriseBean
+ at Stateless
+class MockEnterpriseBean implements MockEnterpriseBeanLocal
{
/**
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-10-05 08:02:32 UTC (rev 3847)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-10-05 10:41:03 UTC (rev 3848)
@@ -76,7 +76,7 @@
@Test
@SpecAssertion(section = "3.7.2", id = "b")
- public void testBindingTypeAnnotatedConstructor()
+ public void testQualifierTypeAnnotatedConstructor()
{
getInstanceByType(Duck.class);
assert Duck.constructedCorrectly;
@@ -84,7 +84,7 @@
@Test(groups = { "specialization" })
@SpecAssertions({
- @SpecAssertion(section = "3.1.4", id = "aa")
+ @SpecAssertion(section = "3.1.4", id = "ac")
})
public void testSpecializedBeanExtendsManagedBean()
{
@@ -107,8 +107,6 @@
assert specializedBean != null;
assert specializedBean == getCurrentManager().getMostSpecializedBean(bean);
assert specializedBean.getBeanClass().getSuperclass().equals(Lion.class);
-
- //assert getInstanceByType(Lion.class, TAME_LITERAL) instanceof MountainLion;
}
@Test(groups = "beanLifecycle")
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java 2009-10-05 08:02:32 UTC (rev 3847)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java 2009-10-05 10:41:03 UTC (rev 3848)
@@ -33,7 +33,7 @@
@SpecAssertion(section = "4.3.1", id = "j"),
@SpecAssertion(section = "3.1.4", id = "aa")
})
- public void testSpecializingBeanHasBindingsOfSpecializedAndSpecializingBean()
+ public void testSpecializingBeanHasQualifiersOfSpecializedAndSpecializingBean()
{
assert getBeans(LazyFarmer.class, LANDOWNER_LITERAL).size() == 1;
Bean<?> bean = getBeans(LazyFarmer.class, LANDOWNER_LITERAL).iterator().next();
@@ -45,7 +45,7 @@
@Test
@SpecAssertions( {
@SpecAssertion(section = "4.3.1", id = "k"),
- @SpecAssertion(section = "3.1.4", id = "aa")
+ @SpecAssertion(section = "3.1.4", id = "ab")
})
public void testSpecializingBeanHasNameOfSpecializedBean()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/extendejb/SpecializingBeanExtendsEnterpriseBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/extendejb/SpecializingBeanExtendsEnterpriseBeanTest.java 2009-10-05 08:02:32 UTC (rev 3847)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/extendejb/SpecializingBeanExtendsEnterpriseBeanTest.java 2009-10-05 10:41:03 UTC (rev 3848)
@@ -18,7 +18,7 @@
public class SpecializingBeanExtendsEnterpriseBeanTest extends AbstractJSR299Test
{
@Test(groups = { "specialization" })
- @SpecAssertion(section = "3.1.4", id = "aa")
+ @SpecAssertion(section = "3.1.4", id = "dc")
public void testSpecializingClassDirectlyExtendsEnterpriseBean()
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend1/SpecializingBeanImplementsInterfaceOnly.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend1/SpecializingBeanImplementsInterfaceOnly.java 2009-10-05 08:02:32 UTC (rev 3847)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend1/SpecializingBeanImplementsInterfaceOnly.java 2009-10-05 10:41:03 UTC (rev 3848)
@@ -15,7 +15,7 @@
public class SpecializingBeanImplementsInterfaceOnly extends AbstractJSR299Test
{
@Test(groups = { "specialization" })
- @SpecAssertion(section = "3.1.4", id = "da")
+ @SpecAssertion(section = "3.1.4", id = "dd")
public void testSpecializingClassImplementsInterfaceAndExtendsNothing()
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend2/SpecializingBeanExtendsNothingTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend2/SpecializingBeanExtendsNothingTest.java 2009-10-05 08:02:32 UTC (rev 3847)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend2/SpecializingBeanExtendsNothingTest.java 2009-10-05 10:41:03 UTC (rev 3848)
@@ -15,7 +15,7 @@
public class SpecializingBeanExtendsNothingTest extends AbstractJSR299Test
{
@Test(groups = { "specialization" })
- @SpecAssertion(section = "3.1.4", id = "da")
+ @SpecAssertion(section = "3.1.4", id = "db")
public void testSpecializingClassDirectlyExtendsNothing()
{
assert false;
Modified: tck/trunk/impl/src/main/resources/tck-audit-cdi.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit-cdi.xml 2009-10-05 08:02:32 UTC (rev 3847)
+++ tck/trunk/impl/src/main/resources/tck-audit-cdi.xml 2009-10-05 10:41:03 UTC (rev 3848)
@@ -637,14 +637,42 @@
</assertion>
</section>
- <section id="3.1.4" title="Specializing a managed bean">
- <assertion id="aa">
- <text>If a bean class of a managed bean X is annotated @Specializes, then the bean class of X must directly extend the bean class of another managed bean Y. Then X directly specializes Y, as defined in Section 4.3, "Specialization".</text>
- </assertion>
-
- <assertion id="da">
- <text>If the bean class of X does not directly extend the bean class of another managed bean, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
- </assertion>
+ <section id="3.1.4" title="Specializing a managed bean">
+ <group>
+ <text>If a bean class of a managed bean X is annotated @Specializes, then the bean class of X must directly extend the bean class of another managed bean Y. Then X directly specializes Y, as defined in Section 4.3, "Specialization".</text>
+
+ <assertion id="aa">
+ <text>Test that a specializing bean has all its own qualifiers and the qualifiers of the specialized bean.</text>
+ </assertion>
+
+ <assertion id="ab">
+ <text>Test that a specializing bean has the name of the specialized bean.</text>
+ </assertion>
+
+ <assertion id="ac">
+ <text>Test a specialized bean extending a managed bean.</text>
+ </assertion>
+ </group>
+
+ <group>
+ <text>If the bean class of X does not directly extend the bean class of another managed bean, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+
+ <assertion id="da">
+ <text>Test a specializing bean extending a non simple bean.</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>Test a specializing bean extending nothing.</text>
+ </assertion>
+
+ <assertion id="dc">
+ <text>Test a specializing bean directly extending an enterprise bean class.</text>
+ </assertion>
+
+ <assertion id="dd">
+ <text>Test a specializing bean implementing an interface and extending nothing.</text>
+ </assertion>
+ </group>
</section>
<section id="3.1.5" title="Default name for a managed bean">
@@ -701,13 +729,9 @@
</assertion>
<assertion id="b">
- <text>If a session bean is a stateful session bean, and the scope is not |@Dependent|, the application may not directly call any EJB remove method of any instance of the session bean</text>
+ <text>If a session bean is a stateful session bean, and the scope is not |@Dependent|, the application may not directly call any EJB remove method of any instance of the session bean. If the application directly calls an EJB remove method of an instance of a session bean that is a stateful session bean and declares any scope other than |@Dependent|, an |UnsupportedOperationException| is thrown</text>
</assertion>
- <assertion id="c">
- <text>If the application directly calls an EJB remove method of an instance of a session bean that is a stateful session bean and declares any scope other than |@Dependent|, an |UnsupportedOperationException| is thrown</text>
- </assertion>
-
<assertion id="da">
<text>If the application directly calls an EJB remove method of an instance of a session bean that is a stateful session bean and has scope |@Dependent| then no parameters are passed to the method by the container.</text>
</assertion>
More information about the weld-commits
mailing list