[webbeans-commits] Webbeans SVN: r1096 - in tck/trunk: impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent and 3 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Mon Jan 19 17:24:39 EST 2009
Author: dallen6
Date: 2009-01-19 17:24:39 -0500 (Mon, 19 Jan 2009)
New Revision: 1096
Modified:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DependentContextTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Jamsa_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/PassivatingContextTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/EventTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/EnterpriseBeanDeclarationTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/EnterpriseBeanRemoveMethodTest.java
tck/trunk/pom.xml
Log:
Cleanup of some tests and fixed missing dependency version
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DependentContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DependentContextTest.java 2009-01-19 21:31:21 UTC (rev 1095)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/dependent/DependentContextTest.java 2009-01-19 22:24:39 UTC (rev 1096)
@@ -53,7 +53,7 @@
* field, disposal method or observer method invocation exists to service
* that invocation only
*/
- @Test(groups = { "contexts", "producerMethod", "broken" })
+ @Test(groups = { "contexts", "producerMethod" })
@SpecAssertion(section = "9.4")
public void testInstanceUsedForProducerMethodNotShared() throws Exception
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Jamsa_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Jamsa_Broken.java 2009-01-19 21:31:21 UTC (rev 1095)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/Jamsa_Broken.java 2009-01-19 22:24:39 UTC (rev 1096)
@@ -2,6 +2,7 @@
import java.io.Serializable;
+import javax.webbeans.Current;
import javax.webbeans.Produces;
import javax.webbeans.SessionScoped;
@@ -14,8 +15,8 @@
@Produces
@SessionScoped
- public Violation create()
+ public Violation create(@Current Violation violation)
{
- return new Violation();
+ return violation;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/PassivatingContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/PassivatingContextTest.java 2009-01-19 21:31:21 UTC (rev 1095)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/context/passivating/PassivatingContextTest.java 2009-01-19 22:24:39 UTC (rev 1096)
@@ -26,7 +26,7 @@
* EJB local objects are serializable. Therefore, an enterprise Web Bean may
* declare any passivating scope.
*/
- @Test(groups = { "contexts", "passivation", "enterpriseBean" })
+ @Test(groups = { "contexts", "passivation", "enterpriseBean", "integration" })
@SpecAssertion(section = "9.5")
public void testEJBWebBeanCanDeclarePassivatingScope()
{
@@ -275,14 +275,12 @@
* @throws NoSuchMethodException
* @throws SecurityException
*/
- @Test(groups = { "contexts", "passivation" , "broken" }, expectedExceptions = IllegalProductException.class)
+ @Test(groups = { "contexts", "passivation", "integration", "broken" }, expectedExceptions = IllegalProductException.class)
@SpecAssertion(section = "9.5")
public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoStatefulSessionBeanFails() throws SecurityException, NoSuchMethodException
{
- // TODO This test isn't testing SFSB, but enterprise beans
- //deployBeans(CityProducer2.class, Maarianhamina_Broken.class);
- //manager.getInstanceByType(Maarianhamina_Broken.class);
- assert false;
+ deployBeans(CityProducer2.class, Maarianhamina_Broken.class);
+ manager.getInstanceByType(Maarianhamina_Broken.class);
}
/**
@@ -463,8 +461,8 @@
public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoProducerMethodParameterWithPassivatingScopeFails()
{
// TODO Not quite sure what this test is doing
- //deployBeans(CityProducer.class, Jamsa_Broken.class);
- //manager.getInstanceByType(Jamsa_Broken.class).ping();
+ deployBeans(CityProducer.class, Jamsa_Broken.class);
+ manager.getInstanceByType(Jamsa_Broken.class).ping();
assert false;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/EventTest.java 2009-01-19 21:31:21 UTC (rev 1095)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/EventTest.java 2009-01-19 22:24:39 UTC (rev 1096)
@@ -517,12 +517,11 @@
assert false;
}
- @Test(groups = { "broken", "events" })
+ @Test(groups = { "events" })
@SpecAssertion(section = "8.5.7")
public void testObserverMethodRegistration()
{
// For now, this test is checking the registration of methods
- // TODO Check the called test to make sure it is still valid here
testObserverMethodOnEnterpriseBeanIsBusinessMethodOrStatic();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/EnterpriseBeanDeclarationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/EnterpriseBeanDeclarationTest.java 2009-01-19 21:31:21 UTC (rev 1095)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/EnterpriseBeanDeclarationTest.java 2009-01-19 22:24:39 UTC (rev 1096)
@@ -123,7 +123,7 @@
* illegal scope, a DefinitionException is thrown by the Web Bean manager at
* initialization time
*/
- @Test(groups = { "enterpriseBeans", "broken" }, expectedExceptions = DefinitionException.class)
+ @Test(groups = { "enterpriseBeans" }, expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testSingletonWithConversationScopeFails()
{
@@ -137,7 +137,7 @@
* illegal scope, a DefinitionException is thrown by the Web Bean manager at
* initialization time
*/
- @Test(groups = { "enterpriseBeans" , "broken"}, expectedExceptions = DefinitionException.class)
+ @Test(groups = { "enterpriseBeans" }, expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testSingletonWithSessionScopeFails()
{
@@ -150,7 +150,7 @@
* illegal scope, a DefinitionException is thrown by the Web Bean manager at
* initialization time
*/
- @Test(groups = { "enterpriseBeans" , "broken" })
+ @Test(groups = { "enterpriseBeans" })
@SpecAssertion(section = "3.3")
public void testSingletonWithApplicationScopeOK()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/EnterpriseBeanRemoveMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/EnterpriseBeanRemoveMethodTest.java 2009-01-19 21:31:21 UTC (rev 1095)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/implementation/enterprise/EnterpriseBeanRemoveMethodTest.java 2009-01-19 22:24:39 UTC (rev 1096)
@@ -1,12 +1,5 @@
package org.jboss.webbeans.tck.tests.implementation.enterprise;
-import static org.jboss.webbeans.tck.impl.WebBeansTCKImpl.configuration;
-
-import javax.webbeans.DefinitionException;
-import javax.webbeans.UnremovedException;
-import javax.webbeans.manager.Bean;
-import javax.webbeans.manager.Context;
-
import org.jboss.webbeans.tck.impl.SpecAssertion;
import org.jboss.webbeans.tck.impl.SpecVersion;
import org.jboss.webbeans.tck.tests.AbstractTest;
@@ -21,95 +14,17 @@
*
* @author Nicklas Karlsson
*/
- at SpecVersion("20081206")
+ at SpecVersion("20090116")
public class EnterpriseBeanRemoveMethodTest extends AbstractTest
{
/**
- * EJB spec
- */
- @Test(groups = { "enterpriseBeans", "removeMethod" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.3.5")
- public void testStatelessEnterpriseBeansWithRemoveMethodsFails()
- {
- deployBeans(Armant_Broken.class);
- }
-
- /**
- * When the Web Bean manager destroys an enterprise Web Bean instance that is
- * an EJB stateful session bean, it calls the Web Bean remove method
- */
- @Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle", "stub" })
- @SpecAssertion(section = "3.3.5")
- public void testStatefulEnterpriseBeanRemoveMethodCalledWhenDestroyedByManager()
- {
- Toller.removeCalled = false;
- Bean<Toller> bean = createEnterpriseBean(Toller.class);
- Context context = configuration().getContexts().getRequestContext();
- context.get(bean, true);
- configuration().getContexts().destroyContext(context);
- assert Toller.removeCalled;
- }
-
- /**
- * The Web Bean remove method is a remove method of the EJB stateful session
- * bean.
- */
- @Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle", "stub" })
- @SpecAssertion(section = "3.3.5")
- public void testWebBeanRemoveMethodIsEJBRemoveMethod()
- {
- assert false;
- }
-
- /**
- * If an enterprise Web Bean that is a stateful session bean and does not
- * have a Web Bean remove method declares any scope other than @Dependent, a
- * DefinitionException is thrown by the Web Bean manager at initialization
- * time
- */
- @Test(groups = { "enterpriseBeans", "removeMethod" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.3.5")
- public void testStatefulEnterpriseBeanWithoutRemoveMethodMustBeDependentScoped()
- {
- deployBeans(Pumi_Broken.class);
- }
-
- /**
- * If an enterprise Web Bean that is a stateful session bean and does not
- * have a Web Bean remove method declares any scope other than @Dependent, a
- * DefinitionException is thrown by the Web Bean manager at initialization
- * time
- */
- @Test(groups = { "enterpriseBeans", "removeMethod" })
- @SpecAssertion(section = "3.3.5")
- public void testStatefulEnterpriseBeanWithoutRemoveMethodMustBeDependentScoped2()
- {
- createEnterpriseBean(WelshCorgie.class);
- }
-
- /**
- * If an instance of an enterprise Web Bean that is a stateful session bean
- * and does not have a Web Bean remove method is not explicitly destroyed by
- * the application before the Web Bean manager attempts to destroy the
- * instance, an UnremovedException is thrown by the Web Bean manager
- */
- @Test(groups = { "enterpriseBeans", "removeMethod", "stub" }, expectedExceptions = UnremovedException.class)
- @SpecAssertion(section = "3.3.5")
- public void testStatefulEnterpriseBeanWithoutRemoveMethodMustBeRemovedByApplicationBeforeManager()
- {
- Bean<Toller> bean = createEnterpriseBean(Toller.class);
- manager.getInstance(bean);
- configuration().getContexts().destroyContext(configuration().getContexts().getRequestContext());
- }
-
- /**
* If the scope is @Dependent, the application may call any EJB remove method
* of an instance of the enterprise Web Bean, but then no parameters will be
* passed to the method by the Web Bean manager
*/
@Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle", "stub" })
- @SpecAssertion(section = "3.3.5")
+ @SpecAssertion(section = "3.3.1")
public void applicationMayCallRemoveMethodOnDependentScopedSessionEnterpriseBeansButNoParametersArePassed()
{
assert false;
@@ -121,7 +36,7 @@
* scope other than @Dependent, an UnsupportedOperationException is thrown.
*/
@Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle", "stub" }, expectedExceptions = UnsupportedOperationException.class)
- @SpecAssertion(section = "3.3.5")
+ @SpecAssertion(section = "3.3.1")
public void applicationCannotCallRemoveMethodOnNonDependentScopedSessionEnterpriseBean()
{
assert false;
@@ -134,213 +49,10 @@
* destroying it
*/
@Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle", "stub" })
- @SpecAssertion(section = "3.3.5")
+ @SpecAssertion(section = "3.3.1")
public void applicationMayCallRemoveMethodOnDependentScopedSessionEnterpriseBeansButInstanceIsNotDestroyed()
{
assert false;
}
- @Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle", "stub" })
- @SpecAssertion(section = "3.3.5")
- public void testApplicationRemoveMethodCallRemovesInstanceFromContext()
- {
- Bean<Toller> bean = createEnterpriseBean(Toller.class);
- Context context = configuration().getContexts().getRequestContext();
- Toller instance = context.get(bean, true);
- instance.bye();
- instance = context.get(bean, false);
- assert instance == null;
- }
-
- /**
- * If an enterprise Web Bean defined using annotations does not explicitly
- * declare a Web Bean remove method using @Destructor, and exactly one remove
- * method that accepts no parameters exists, then that remove method is the
- * Web Bean remove method.
- */
- @Test(groups = { "enterpriseBeans", "removeMethod" })
- @SpecAssertion(section = { "3.3.5.1" })
- public void testEnterpriseBeanWithoutDestructorUsesNoArgsRemoveAnnotatedMethodAsWebBeansRemoveMethod()
- {
- Toller.removeCalled = true;
- Bean<Toller> bean = createEnterpriseBean(Toller.class);
- bean.create();
- configuration().getContexts().destroyContext(configuration().getContexts().getRequestContext());
- assert Toller.removeCalled;
- }
-
- /**
- * Otherwise, if no remove method that accepts no parameters exists, or if
- * multiple remove methods that accept no parameters exist, the enterprise
- * Web Bean has no Web Bean remove method.
- */
- @Test(groups = { "enterpriseBeans", "removeMethod", "broken" })
- @SpecAssertion(section = { "3.3.5.1" })
- public void testEnterpriseBeanWithoutDestructorAndNoOrMultipleNoArgsRemoveMethodsHasNoWebBeansRemoveMethod()
- {
- Koirus.removeCalled = false;
- Bean<Koirus> bean = createEnterpriseBean(Koirus.class);
- bean.create();
- configuration().getContexts().destroyContext(configuration().getContexts().getDependentContext());
- assert Koirus.removeCalled;
- }
-
- /**
- * If an enterprise Web Bean defined using annotations has more than one
- * method annotated @Destructor, a DefinitionException is thrown by the Web
- * Bean manager at initialization time.
- */
- @Test(groups = { "enterpriseBeans", "removeMethod" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = { "3.3.5.1" })
- public void testMultipleDestructorAnnotatedMethodsFails()
- {
- createEnterpriseBean(Rottweiler.class);
- }
-
- /**
- * If an enterprise Web Bean defined using annotations has a method annotated
- *
- * @Destructor, and that method is not an EJB remove method, a
- * DefinitionException is thrown by the Web Bean manager at
- * initialization time.
- */
- @Test(groups = { "enterpriseBeans", "removeMethod" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = { "3.3.5.1" })
- public void testDestructorAnnotatedMethodNotRemoveAnnotatedFails()
- {
- createEnterpriseBean(RussellTerrier.class);
- }
-
- @Test(groups = { "enterpriseBeans", "removeMethod" })
- @SpecAssertion(section = { "3.3.5.1" })
- public void testDestructorAnnotatedSingleRemoveMethod()
- {
- createEnterpriseBean(GoodDoggie.class);
- }
-
- /**
- * If a Web Bean remove method is annotated @Initializer or @Produces, has a
- * parameter annotated @Disposes, or has a parameter annotated @Observes, a
- * DefinitionException is thrown by the Web Bean manager at initialization
- * time.
- */
- @Test(groups = { "enterpriseBeans", "removeMethod" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = { "3.3.5.1" })
- public void testRemoveMethodIsInitializerFails()
- {
- createEnterpriseBean(Saluki.class);
- }
-
- /**
- * If a Web Bean remove method is annotated @Initializer or @Produces, has a
- * parameter annotated @Disposes, or has a parameter annotated @Observes, a
- * DefinitionException is thrown by the Web Bean manager at initialization
- * time.
- */
- @Test(groups = { "enterpriseBeans", "removeMethod" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = { "3.3.5.1" })
- public void testRemoveMethodIsProducerFails()
- {
- createEnterpriseBean(Spitz.class);
- }
-
- /**
- * If a Web Bean remove method is annotated @Initializer or @Produces, has a
- * parameter annotated @Disposes, or has a parameter annotated @Observes, a
- * DefinitionException is thrown by the Web Bean manager at initialization
- * time.
- */
- @Test(groups = { "enterpriseBeans", "removeMethod" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = { "3.3.5.1" })
- public void testRemoveMethodWithDisposesParameterFails()
- {
- createEnterpriseBean(GoldenRetriever.class);
- }
-
- /**
- * If a Web Bean remove method is annotated @Initializer or @Produces, has a
- * parameter annotated @Disposes, or has a parameter annotated @Observes, a
- * DefinitionException is thrown by the Web Bean manager at initialization
- * time.
- */
- @Test(groups = { "enterpriseBeans", "removeMethod" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = { "3.3.5.1" })
- public void testRemoveMethodWithObservesParameterFails()
- {
- createEnterpriseBean(JackRussellTerrier.class);
- }
-
- /**
- * If an enterprise Web Bean defined using XML does not explicitly declare a
- * Web Bean remove method using XML, and exactly one remove method that
- * accepts no parameters exists, then that remove method is the Web Bean
- * remove method
- */
- @Test(groups = { "enterpriseBeans", "webbeansxml", "removeMethod", "stub" })
- @SpecAssertion(section = { "3.3.5.1", "3.3.5.2" })
- public void testXMLDefinedEnterpriseBeanWithoutDestructorUsesNoArgsRemoveAnnotatedMethodAsWebBeansRemoveMethod()
- {
- assert false;
- }
-
- /**
- * Otherwise, if no remove method that accepts no parameters exists, or if
- * multiple remove methods that accept no parameters exist, the enterprise
- * Web Bean has no Web Bean remove method.
- */
- @Test(groups = { "enterpriseBeans", "webbeansxml", "removeMethod", "stub" })
- @SpecAssertion(section = { "3.3.5.1", "3.3.5.2" })
- public void testXMLDefinedEnterpriseBeanWithoutDestructorAndNoOrMultipleNoArgsRemoveMethodsHasNoWebBeansRemoveMethod()
- {
- assert false;
- }
-
- /**
- * If the implementation class of an enterprise Web Bean declared in XML does
- * not have an EJB remove method with the name and parameter types declared
- * in XML, a NonexistentMethodException is thrown by the Web Bean manager at
- * initialization time
- */
- @Test(groups = { "enterpriseBeans", "webbeansxml", "removeMethod", "stub" })
- @SpecAssertion(section = "3.3.5.2")
- public void testXMLDefinedEnterpriseBeanWithoutMatchingRemoveMethodFails()
- {
- assert false;
- }
-
- /**
- * If an enterprise Web Bean defined using XML declares more than one Web
- * Bean remove method in XML, a DefinitionException is thrown by the Web Bean
- * manager at initialization time.
- */
- @Test(groups = { "enterpriseBeans", "webbeansxml", "removeMethod", "stub" })
- @SpecAssertion(section = "3.3.5.2")
- public void testXMLDefinedEnterpriseBeanWithMultipleRemoveMethodsFails()
- {
- assert false;
- }
-
- /**
- * When a Web Bean remove method is declared in XML, the Web Bean manager
- * ignores binding annotations applied to the Java method parameters
- */
- @Test(groups = { "enterpriseBeans", "webbeansxml", "removeMethod", "stub" })
- @SpecAssertion(section = "3.3.5.2")
- public void testXMLDefinedEnterpriseBeanIgnoresBindingAnnotationOnParameters()
- {
- assert false;
- }
-
- /**
- * If the Web Bean remove method has parameters, the Web Bean manager calls
- * Manager.getInstanceByType() to determine a value for each parameter and
- * calls the method with these parameter values.
- */
- @Test(groups = { "enterpriseBeans", "removeMethod", "stub" })
- @SpecAssertion(section = "3.3.5.3")
- public void testRemoveMethodParameterResolving()
- {
- assert false;
- }
-
}
Modified: tck/trunk/pom.xml
===================================================================
--- tck/trunk/pom.xml 2009-01-19 21:31:21 UTC (rev 1095)
+++ tck/trunk/pom.xml 2009-01-19 22:24:39 UTC (rev 1096)
@@ -115,6 +115,12 @@
</dependency>
<dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>tck-utils</artifactId>
+ <version>0.9-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-api</artifactId>
<version>${webbeans.version}</version>
More information about the weld-commits
mailing list