[webbeans-commits] Webbeans SVN: r290 - in ri/trunk/webbeans-ri/src: main/java/org/jboss/webbeans/ejb and 5 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Tue Nov 11 10:47:52 EST 2008
Author: nickarls
Date: 2008-11-11 10:47:51 -0500 (Tue, 11 Nov 2008)
New Revision: 290
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Koirus.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Toller.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/WelshCorgie.java
Removed:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/RequestScopedStateless.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Toller.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/WelshCorgie.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Whippet.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbMetaData.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EjbMetaDataTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/lifecycle/EnterpriseBeanLifecycleTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanRemoveMethodTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Armant.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/GoldenRetriever.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/JackRussellTerrier.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Poodle.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Pumi.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Rottweiler.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/RussellTerrier.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Saluki.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Spitz.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Hound.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Pitbull.java
Log:
Look over ejb remove method tests ->
changes in ejb remove method validation
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -2,8 +2,6 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
import javax.webbeans.ApplicationScoped;
import javax.webbeans.Decorator;
@@ -24,7 +22,6 @@
import org.jboss.webbeans.introspector.impl.InjectableField;
import org.jboss.webbeans.introspector.impl.InjectableMethod;
import org.jboss.webbeans.introspector.impl.InjectableParameter;
-import org.jboss.webbeans.util.Reflections;
public class EnterpriseBean<T> extends AbstractClassBean<T>
{
@@ -130,12 +127,41 @@
// TODO logging
protected void initRemoveMethod()
{
+ if (!getEjbMetaData().isStateful())
+ {
+ // Nothing to do for stateless enterprise beans;
+ return;
+ }
+
+ // >1 @Destructor
+ if (getEjbMetaData().getDestructorMethods().size() > 1)
+ {
+ throw new DefinitionException("Multiple @Destructor methods not allowed");
+ }
+
+
+ // <1 (0) @Destructors
+ if (getEjbMetaData().getNoArgsRemoveMethod() != null)
+ {
+ if (getEjbMetaData().getRemoveMethods().size() > 1)
+ {
+ throw new DefinitionException("Multiple @Remove methods but no @Destructor found");
+ }
+ super.removeMethod = checkRemoveMethod(getEjbMetaData().getNoArgsRemoveMethod());
+ return;
+ }
+
+ if (!getScopeType().equals(Dependent.class))
+ {
+ throw new DefinitionException("Only @Dependent scoped enterprise beans can be without remove methods");
+ }
+
+/*
if (getEjbMetaData().isStateful())
{
if (getEjbMetaData().getRemoveMethods().size() == 1)
{
-// super.removeMethod = new InjectableMethod<Object>(getEjbMetaData().getRemoveMethods().get(0));
- super.removeMethod = checkRemoveMethod(getEjbMetaData().getRemoveMethods().get(0));
+ super.removeMethod = checkRemoveMethod(getEjbMetaData().getRemoveMethods().iterator().next());
}
else if (getEjbMetaData().getRemoveMethods().size() > 1)
{
@@ -149,7 +175,7 @@
}
if (possibleRemoveMethods.size() == 1)
{
- super.removeMethod = checkRemoveMethod(possibleRemoveMethods.get(0));
+ super.removeMethod = checkRemoveMethod(possibleRemoveMethods.iterator().next());
}
else if (possibleRemoveMethods.size() == 2)
{
@@ -160,6 +186,7 @@
if (!firstMethod.equals(secondMethod)) {
throw new DefinitionException("Multiple remove methods are annotated @Remove/@Destructor for " + getType());
}
+ super.removeMethod = checkRemoveMethod(possibleRemoveMethods.iterator().next());
}
else if (possibleRemoveMethods.size() > 2)
{
@@ -183,6 +210,7 @@
throw new DefinitionException("Only stateful enterprise beans can have methods annotated @Destructor; " + getType() + " is not a stateful enterprise bean");
}
}
+ */
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbMetaData.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbMetaData.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbMetaData.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -14,6 +14,7 @@
import java.util.ArrayList;
import java.util.List;
+import javax.webbeans.DefinitionException;
import javax.webbeans.Destructor;
import org.jboss.webbeans.util.Reflections;
@@ -30,7 +31,9 @@
}
private EjbType ejbType;
- private List<Method> removeMethods;
+ private List<Method> removeMethods = new ArrayList<Method>();
+ private List<Method> destructorMethods = new ArrayList<Method>();
+ private Method noArgsRemoveMethod;
// TODO Populate this from web.xml
private String ejbLinkJndiName;
@@ -51,18 +54,24 @@
if (type.isAnnotationPresent(STATELESS_ANNOTATION))
{
this.ejbType = STATELESS;
+ // TODO Has to be done here? If they are not parsed, they can't be detected later on (EnterpriseBean remove method init)
+ if (!Reflections.getMethods(type, Destructor.class).isEmpty()) {
+ throw new DefinitionException("Stateless enterprise beans cannot have @Destructor methods");
+ }
}
else if (type.isAnnotationPresent(STATEFUL_ANNOTATION))
{
this.ejbType = STATEFUL;
- this.removeMethods = new ArrayList<Method>();
for (Method removeMethod : Reflections.getMethods(type, REMOVE_ANNOTATION))
{
removeMethods.add(removeMethod);
+ if (removeMethod.getParameterTypes().length == 0) {
+ noArgsRemoveMethod = removeMethod;
+ }
}
for (Method destructorMethod : Reflections.getMethods(type, Destructor.class))
{
- removeMethods.add(destructorMethod);
+ destructorMethods.add(destructorMethod);
}
}
else if (type.isAnnotationPresent(MESSAGE_DRIVEN_ANNOTATION))
@@ -119,5 +128,20 @@
{
return type;
}
+
+ public List<Method> getDestructorMethods()
+ {
+ return destructorMethods;
+ }
+
+ public Method getNoArgsRemoveMethod()
+ {
+ return noArgsRemoveMethod;
+ }
+
+ public void setNoArgsRemoveMethod(Method noArgsRemoveMethod)
+ {
+ this.noArgsRemoveMethod = noArgsRemoveMethod;
+ }
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EjbMetaDataTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EjbMetaDataTest.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EjbMetaDataTest.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -14,7 +14,7 @@
{
EjbMetaData<Lion> lion = new EjbMetaData<Lion>(Lion.class);
assert lion.isStateless();
- assert lion.getRemoveMethods() == null;
+ assert lion.getRemoveMethods().isEmpty();
}
@Test
@@ -30,7 +30,7 @@
{
EjbMetaData<Leopard> leopard = new EjbMetaData<Leopard>(Leopard.class);
assert leopard.isMessageDriven();
- assert leopard.getRemoveMethods() == null;
+ assert leopard.getRemoveMethods().isEmpty();
}
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/lifecycle/EnterpriseBeanLifecycleTest.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/lifecycle/EnterpriseBeanLifecycleTest.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -12,14 +12,12 @@
@Test(groups="removeMethod") @SpecAssertion(section="3.2.3")
public void testInjectonOfParametersIntoRemoveMethod()
{
- // TODO Placeholder
assert false;
}
@Test(groups="specialization") @SpecAssertion(section="3.2.4")
public void testSpecializedBeanAlwaysUsed()
{
- // TODO Placeholder
assert false;
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanRemoveMethodTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanRemoveMethodTest.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanRemoveMethodTest.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -1,8 +1,11 @@
package org.jboss.webbeans.test.ejb.model;
import javax.webbeans.DefinitionException;
+import javax.webbeans.RequestScoped;
+import javax.webbeans.UnremovedException;
import org.jboss.webbeans.bean.EnterpriseBean;
+import org.jboss.webbeans.contexts.RequestContext;
import org.jboss.webbeans.test.AbstractTest;
import org.jboss.webbeans.test.SpecAssertion;
import org.jboss.webbeans.test.SpecVersion;
@@ -15,11 +18,9 @@
import org.jboss.webbeans.test.ejb.model.invalid.RussellTerrier;
import org.jboss.webbeans.test.ejb.model.invalid.Saluki;
import org.jboss.webbeans.test.ejb.model.invalid.Spitz;
-import org.jboss.webbeans.test.ejb.model.invalid.Toller;
-import org.jboss.webbeans.test.ejb.model.invalid.WelshCorgie;
-import org.jboss.webbeans.test.ejb.model.invalid.Whippet;
-import org.jboss.webbeans.test.ejb.model.valid.Laika;
-import org.jboss.webbeans.test.ejb.model.valid.Pitbull;
+import org.jboss.webbeans.test.ejb.model.valid.Toller;
+import org.jboss.webbeans.test.ejb.model.valid.WelshCorgie;
+import org.jboss.webbeans.test.ejb.model.valid.Koirus;
import org.jboss.webbeans.test.util.Util;
import org.testng.annotations.Test;
@@ -28,105 +29,150 @@
public class EnterpriseBeanRemoveMethodTest extends AbstractTest
{
- @Test
+ public static boolean tickle = false;
+
+ @Test(groups={"ejb3", "removeMethod"}, expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3.5")
- public void testStatefulEnterpriseBeanWithoutRemoveMethodInDependentScopeOK()
+ public void testStatelessEnterpriseBeansWithRemoveMethodsFails()
{
- EnterpriseBean<Pitbull> pitbull = Util.createEnterpriseBean(Pitbull.class, manager);
+ EnterpriseBean<Armant> bean = Util.createEnterpriseBean(Armant.class, manager);
}
- @Test(expectedExceptions = DefinitionException.class)
+ @Test(groups={"ejb3", "removeMethod", "lifecycle"})
@SpecAssertion(section = "3.3.5")
- public void testStatefulEnterpriseBeanWithoutRemoveMethodInApplicationScopeFails()
+ public void testStatefulEnterpriseBeanRemoveMethodCalledWhenDestroyedByManager()
{
- EnterpriseBean<Poodle> poodle = Util.createEnterpriseBean(Poodle.class, manager);
+ EnterpriseBeanRemoveMethodTest.tickle = false;
+ EnterpriseBean<Toller> bena = Util.createEnterpriseBean(Toller.class, manager);
+ RequestContext context = (RequestContext) manager.getContext(RequestScoped.class);
+ Toller instance = context.get(bena, true);
+ context.destroy(manager);
+ assert EnterpriseBeanRemoveMethodTest.tickle;
}
- @Test(expectedExceptions = DefinitionException.class)
+ @Test(groups={"ejb3", "removeMethod"}, expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3.5")
- public void testStatefulEnterpriseBeanWithoutRemoveMethodInSessionScopeFails()
+ public void testStatefulEnterpriseBeanWithoutRemoveMethodMustBeDependentScoped()
{
- EnterpriseBean<Rottweiler> rottweiler = Util.createEnterpriseBean(Rottweiler.class, manager);
+ EnterpriseBean<Pumi> bean = Util.createEnterpriseBean(Pumi.class, manager);
}
- @Test(expectedExceptions = DefinitionException.class)
+ @Test(groups={"ejb3", "removeMethod"})
@SpecAssertion(section = "3.3.5")
- public void testStatefulEnterpriseBeanWithoutRemoveMethodInConversationScopeFails()
+ public void testStatefulEnterpriseBeanWithoutRemoveMethodMustBeDependentScoped2()
{
- EnterpriseBean<Spitz> spitz = Util.createEnterpriseBean(Spitz.class, manager);
+ EnterpriseBean<WelshCorgie> bean = Util.createEnterpriseBean(WelshCorgie.class, manager);
}
- @Test(expectedExceptions = DefinitionException.class)
+ @Test(groups={"ejb3", "removeMethod"}, expectedExceptions = UnremovedException.class)
@SpecAssertion(section = "3.3.5")
- public void testStatefulEnterpriseBeanWithoutRemoveMethodInRequestScopeFails()
+ public void testStatefulEnterpriseBeanWithoutRemoveMethodMustBeRemovedByApplicationBeforeManager()
{
- EnterpriseBean<Saluki> saluki = Util.createEnterpriseBean(Saluki.class, manager);
+ EnterpriseBean<Toller> bean = Util.createEnterpriseBean(Toller.class, manager);
+ Toller instance = manager.getInstance(bean);
+ RequestContext context = (RequestContext) manager
+ .getContext(RequestScoped.class);
+ context.destroy(manager);
}
- @Test
- @SpecAssertion(section = "3.3.5.1")
- public void testAnnotationDefinedEnterpriseBeanWithoutDestructorUsesRemoveMethodWithoutParamsAsWebBeansRemoveMethod()
+ @Test(groups={"ejb3", "removeMethod", "lifecycle"})
+ @SpecAssertion(section = "3.3.5")
+ public void testApplicationRemoveMethodCallRemovesInstanceFromContext()
{
- EnterpriseBean<Armant> whippet = Util.createEnterpriseBean(Armant.class, manager);
- assert whippet.getRemoveMethod().getAnnotatedItem().getName().equals("destroy");
+ EnterpriseBean<Toller> bean = Util.createEnterpriseBean(Toller.class, manager);
+ RequestContext context = (RequestContext) manager.getContext(RequestScoped.class);
+ Toller instance = context.get(bean, true);
+ instance.bye();
+ instance = context.get(bean, false);
+ assert instance == null;
}
- @Test
- @SpecAssertion(section = "3.3.5.1")
- public void testAnnotationDefinedEnterpriseBeanWithoutDestructorAndRemoveMethodWithoutParamsHasNoWebBeansRemoveMethod()
+ @Test(groups={"ejb3", "removeMethod"})
+ @SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
+ public void testEnterpriseBeanWithoutDestructorUsesNoArgsRemoveAnnotatedMethodAsRemoveMethod()
{
- EnterpriseBean<Laika> laika = Util.createEnterpriseBean(Laika.class, manager);
- assert laika.getRemoveMethod() == null;
+ EnterpriseBean<Toller> bean = Util.createEnterpriseBean(Toller.class, manager);
+ assert "bye".equals(bean.getRemoveMethod().getAnnotatedItem()
+ .getAnnotatedMethod().getName());
}
- @Test(expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.3.5.1")
- public void testEnterpriseBeanWithMultipleDestructorAnnotationsFail()
+ @Test(groups={"ejb3", "removeMethod"})
+ @SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
+ public void testEnterpriseBeanWithoutDestructorAndNoArgsRemoveAnnotatedMethodHasNoRemoveMethod()
{
- EnterpriseBean<Whippet> whippet = Util.createEnterpriseBean(Whippet.class, manager);
+ EnterpriseBean<Koirus> bean = Util.createEnterpriseBean(Koirus.class, manager);
+ assert bean.getRemoveMethod() == null;
}
- @Test(expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.3.5.1")
- public void testAnnotationDefinedEnterpriseBeanWithDestructorAnnotationOnMethodNotAnEJBRemoveMethodFails()
+ @Test(groups={"ejb3", "removeMethod"}, expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
+ public void testMultipleDestructorAnnotatedMethodsFails()
{
- EnterpriseBean<GoldenRetriever> goldenRetriever = Util.createEnterpriseBean(GoldenRetriever.class, manager);
+ EnterpriseBean<Rottweiler> bean = Util.createEnterpriseBean(Rottweiler.class, manager);
}
- @Test(expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.3.5.1")
- public void testAnnotationDefinedEnterpriseBeanWithDestructorWithDisposesParameterFails()
+ @Test(groups={"ejb3", "removeMethod"}, expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
+ public void testDestructorAnnotatedMethodNotRemoveAnnotatedFails()
{
- EnterpriseBean<Pumi> pumi = Util.createEnterpriseBean(Pumi.class, manager);
+ EnterpriseBean<RussellTerrier> bean = Util.createEnterpriseBean(RussellTerrier.class, manager);
}
- @Test(expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.3.5.1")
- public void testEnterpriseBeanWithInitializerAnnotationOnRemoveMethodFails()
+ @Test(groups={"ejb3", "removeMethod"}, expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
+ public void testRemoveMethodIsInitializerFails()
{
- EnterpriseBean<JackRussellTerrier> jackRussellTerrier = Util.createEnterpriseBean(JackRussellTerrier.class, manager);
+ EnterpriseBean<Saluki> bean = Util.createEnterpriseBean(Saluki.class, manager);
}
- @Test(expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.3.5.1")
- public void testEnterpriseBeanWithProducerAnnotationOnRemoveMethodFails()
+ @Test(groups={"ejb3", "removeMethod"}, expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
+ public void testRemoveMethodIsProducerFails()
{
- EnterpriseBean<RussellTerrier> russellTerrier = Util.createEnterpriseBean(RussellTerrier.class, manager);
+ EnterpriseBean<Spitz> bean = Util.createEnterpriseBean(Spitz.class, manager);
}
- @Test(expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "3.3.5.1")
- public void testEnterpriseBeanWithRemoveMethodTakingObserverAnnotatedParameterFails()
+ @Test(groups={"ejb3", "removeMethod"}, expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
+ public void testRemoveMethodWithDisposesParameterFails()
{
- EnterpriseBean<Toller> toller = Util.createEnterpriseBean(Toller.class, manager);
+ EnterpriseBean<GoldenRetriever> bean = Util.createEnterpriseBean(GoldenRetriever.class, manager);
}
- @Test(expectedExceptions=DefinitionException.class)
- public void testStatelessEnterpriseBeansWithDestructorAnnotationFails()
+ @Test(groups={"ejb3", "removeMethod"}, expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
+ public void testRemoveMethodWithObservesParameterFails()
{
- EnterpriseBean<WelshCorgie> welshCorgie = Util.createEnterpriseBean(WelshCorgie.class, manager);
+ EnterpriseBean<JackRussellTerrier> bean = Util.createEnterpriseBean(JackRussellTerrier.class, manager);
}
+
+ @Test(groups={"ejb3", "removeMethod"}, expectedExceptions = DefinitionException.class)
+ @SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
+ public void testMultipleRemoveAnnotationsButNoDestructorFails()
+ {
+ EnterpriseBean<Poodle> bean = Util.createEnterpriseBean(Poodle.class, manager);
+ }
-
+ @Test(groups={"ejb3", "removeMethod"})
+ @SpecAssertion(section = "3.3.5.2")
+ public void testXMLDefinedEnterpriseBeanWithMatchingRemoveMethodFails()
+ {
+ assert false;
+ }
+
+ @Test(groups={"ejb3", "removeMethod"})
+ @SpecAssertion(section = "3.3.5.2")
+ public void testXMLDefinedEnterpriseBeanWithMultipleRemoveMethodsFails()
+ {
+ assert false;
+ }
+
+ @Test(groups={"ejb3", "removeMethod"})
+ @SpecAssertion(section = "3.3.5.2")
+ public void testXMLDefinedEnterpriseBeanIgnoresBindingAnnotationOnParameters()
+ {
+ assert false;
+ }
+
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Armant.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Armant.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Armant.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -1,13 +1,13 @@
package org.jboss.webbeans.test.ejb.model.invalid;
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
+import javax.ejb.Stateless;
+import javax.webbeans.Destructor;
- at Stateful
+ at Stateless
public class Armant
{
- @Remove
- public void destroy() {
+ @Destructor
+ public void bye() {
}
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/GoldenRetriever.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/GoldenRetriever.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/GoldenRetriever.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -1,13 +1,18 @@
package org.jboss.webbeans.test.ejb.model.invalid;
+import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.webbeans.Destructor;
+import javax.webbeans.Disposes;
+import javax.webbeans.RequestScoped;
@Stateful
+ at RequestScoped
public class GoldenRetriever
{
- @Destructor
- public void destroy() {
+ @Remove @Destructor
+ public void bye(@Disposes Object something) {
}
+
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/JackRussellTerrier.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/JackRussellTerrier.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/JackRussellTerrier.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -2,14 +2,17 @@
import javax.ejb.Remove;
import javax.ejb.Stateful;
-import javax.webbeans.Initializer;
+import javax.webbeans.Destructor;
+import javax.webbeans.Observes;
+import javax.webbeans.RequestScoped;
@Stateful
+ at RequestScoped
public class JackRussellTerrier
{
- @Remove
- @Initializer
- public void destroy() {
+ @Remove @Destructor
+ public void bye(@Observes Object something) {
}
+
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Poodle.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Poodle.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Poodle.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -1,11 +1,22 @@
package org.jboss.webbeans.test.ejb.model.invalid;
+import javax.ejb.Remove;
import javax.ejb.Stateful;
-import javax.webbeans.ApplicationScoped;
+import javax.webbeans.Observes;
+import javax.webbeans.RequestScoped;
@Stateful
- at ApplicationScoped
+ at RequestScoped
public class Poodle
{
-
+ @Remove
+ public void bye() {
+
+ }
+
+ @Remove
+ public void byebye(@Observes Object something) {
+
+ }
+
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Pumi.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Pumi.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Pumi.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -1,17 +1,11 @@
package org.jboss.webbeans.test.ejb.model.invalid;
-import javax.ejb.Remove;
import javax.ejb.Stateful;
-import javax.webbeans.Disposes;
+import javax.webbeans.RequestScoped;
-import org.jboss.webbeans.test.annotations.Tame;
-import org.jboss.webbeans.test.beans.Horse;
-
@Stateful
+ at RequestScoped
public class Pumi
{
- @Remove
- public void destroy(@Disposes @Tame Horse horse) {
-
- }
+
}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/RequestScopedStateless.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/RequestScopedStateless.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/RequestScopedStateless.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -1,11 +0,0 @@
-package org.jboss.webbeans.test.ejb.model.invalid;
-
-import javax.ejb.Stateless;
-import javax.webbeans.RequestScoped;
-
- at RequestScoped
- at Stateless
-public class RequestScopedStateless
-{
-
-}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Rottweiler.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Rottweiler.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Rottweiler.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -1,11 +1,21 @@
package org.jboss.webbeans.test.ejb.model.invalid;
import javax.ejb.Stateful;
-import javax.webbeans.SessionScoped;
+import javax.webbeans.Destructor;
+import javax.webbeans.RequestScoped;
@Stateful
- at SessionScoped
+ at RequestScoped
public class Rottweiler
{
+ @Destructor
+ public void bye() {
+
+ }
+
+ @Destructor
+ public void bye2() {
+
+ }
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/RussellTerrier.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/RussellTerrier.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/RussellTerrier.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -1,15 +1,16 @@
package org.jboss.webbeans.test.ejb.model.invalid;
-import javax.ejb.Remove;
import javax.ejb.Stateful;
-import javax.webbeans.Produces;
+import javax.webbeans.Destructor;
+import javax.webbeans.RequestScoped;
@Stateful
+ at RequestScoped
public class RussellTerrier
{
- @Remove
- @Produces
- public void destroy() {
+ @Destructor
+ public void bye() {
}
+
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Saluki.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Saluki.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Saluki.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -1,11 +1,17 @@
package org.jboss.webbeans.test.ejb.model.invalid;
+import javax.ejb.Remove;
import javax.ejb.Stateful;
+import javax.webbeans.Initializer;
import javax.webbeans.RequestScoped;
@Stateful
@RequestScoped
public class Saluki
{
-
+ @Remove @Initializer
+ public void bye() {
+
+ }
+
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Spitz.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Spitz.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Spitz.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -1,11 +1,17 @@
package org.jboss.webbeans.test.ejb.model.invalid;
+import javax.ejb.Remove;
import javax.ejb.Stateful;
-import javax.webbeans.ConversationScoped;
+import javax.webbeans.Produces;
+import javax.webbeans.RequestScoped;
@Stateful
- at ConversationScoped
+ at RequestScoped
public class Spitz
{
-
+ @Remove @Produces
+ public void bye() {
+
+ }
+
}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Toller.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Toller.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Toller.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -1,17 +0,0 @@
-package org.jboss.webbeans.test.ejb.model.invalid;
-
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-import javax.webbeans.Observes;
-
-import org.jboss.webbeans.test.annotations.Tame;
-import org.jboss.webbeans.test.beans.Horse;
-
- at Stateful
-public class Toller
-{
- @Remove
- public void destroy(@Observes @Tame Horse horse) {
-
- }
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/WelshCorgie.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/WelshCorgie.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/WelshCorgie.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -1,13 +0,0 @@
-package org.jboss.webbeans.test.ejb.model.invalid;
-
-import javax.ejb.Stateless;
-import javax.webbeans.Destructor;
-
- at Stateless
-public class WelshCorgie
-{
- @Destructor
- public void destroy() {
-
- }
-}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Whippet.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Whippet.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Whippet.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -1,18 +0,0 @@
-package org.jboss.webbeans.test.ejb.model.invalid;
-
-import javax.ejb.Stateful;
-import javax.webbeans.Destructor;
-
- at Stateful
-public class Whippet
-{
- @Destructor
- public void destroy1() {
-
- }
-
- @Destructor
- public void destroy2() {
-
- }
-}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Hound.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Hound.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Hound.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -1,5 +1,6 @@
package org.jboss.webbeans.test.ejb.model.valid;
+import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.webbeans.Named;
@@ -9,6 +10,9 @@
@Tame
@Named("Pongo")
public class Hound
-{
+{
+ @Remove
+ public void bye() {
+ }
}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Koirus.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Koirus.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Koirus.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.ejb.model.valid;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.Dependent;
+
+ at Stateful
+ at Dependent
+public class Koirus
+{
+ @Remove
+ public void bye(Object param) {
+ }
+}
\ No newline at end of file
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Pitbull.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Pitbull.java 2008-11-11 07:20:01 UTC (rev 289)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Pitbull.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -1,11 +1,21 @@
package org.jboss.webbeans.test.ejb.model.valid;
+import javax.ejb.Remove;
import javax.ejb.Stateful;
+import javax.webbeans.ApplicationScoped;
+import javax.webbeans.Destructor;
import javax.webbeans.Named;
+import org.jboss.webbeans.test.ejb.model.EnterpriseBeanRemoveMethodTest;
+
@Stateful
+ at ApplicationScoped
@Named
public class Pitbull
{
+ @Remove @Destructor
+ public void bye() {
+ EnterpriseBeanRemoveMethodTest.tickle = true;
+ }
}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Toller.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Toller.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Toller.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -0,0 +1,17 @@
+package org.jboss.webbeans.test.ejb.model.valid;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.webbeans.RequestScoped;
+
+import org.jboss.webbeans.test.ejb.model.EnterpriseBeanRemoveMethodTest;
+
+ at Stateful
+ at RequestScoped
+public class Toller
+{
+ @Remove
+ public void bye() {
+ EnterpriseBeanRemoveMethodTest.tickle = true;
+ }
+}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/WelshCorgie.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/WelshCorgie.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/WelshCorgie.java 2008-11-11 15:47:51 UTC (rev 290)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.ejb.model.valid;
+
+import javax.ejb.Stateful;
+import javax.webbeans.Dependent;
+
+ at Stateful
+ at Dependent
+public class WelshCorgie
+{
+
+}
More information about the weld-commits
mailing list