[jboss-cvs] JBossAS SVN: r71131 - in projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1222: unit and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Mar 21 02:17:41 EDT 2008
Author: ALRubinger
Date: 2008-03-21 02:17:41 -0400 (Fri, 21 Mar 2008)
New Revision: 71131
Added:
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1222/TestStatefulWithRemoveMethodRemoteHome.java
Modified:
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1222/TestStatefulWithRemoveMethodBean.java
projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1222/unit/RegularRemoveMethodUnitTestCase.java
Log:
[EJBTHREE-1222] Add EJB2.1 View for Test Bean, expose test failure
Modified: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1222/TestStatefulWithRemoveMethodBean.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1222/TestStatefulWithRemoveMethodBean.java 2008-03-21 05:40:17 UTC (rev 71130)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1222/TestStatefulWithRemoveMethodBean.java 2008-03-21 06:17:41 UTC (rev 71131)
@@ -21,7 +21,9 @@
*/
package org.jboss.ejb3.test.ejbthree1222;
+import javax.ejb.EJBObject;
import javax.ejb.Remote;
+import javax.ejb.RemoteHome;
import javax.ejb.Stateful;
import org.jboss.ejb3.annotation.RemoteBinding;
@@ -37,7 +39,9 @@
* @version $Revision: $
*/
@Stateful
- at Remote(TestStatefulWithRemoveMethodRemote.class)
+ at Remote(
+{TestStatefulWithRemoveMethodRemote.class, EJBObject.class})
+ at RemoteHome(TestStatefulWithRemoveMethodRemoteHome.class)
@RemoteBinding(jndiBinding = TestStatefulWithRemoveMethodRemote.JNDI_NAME)
public class TestStatefulWithRemoveMethodBean implements TestStatefulWithRemoveMethodRemote
{
Added: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1222/TestStatefulWithRemoveMethodRemoteHome.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1222/TestStatefulWithRemoveMethodRemoteHome.java (rev 0)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1222/TestStatefulWithRemoveMethodRemoteHome.java 2008-03-21 06:17:41 UTC (rev 71131)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree1222;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+
+/**
+ * TestStatefulWithRemoveMethodRemoteHome
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface TestStatefulWithRemoveMethodRemoteHome extends EJBHome
+{
+ String JNDI_NAME = "TestStatefulWithRemoveMethodBean/home";
+
+ TestStatefulWithRemoveMethodRemote create() throws RemoteException, CreateException;
+}
Modified: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1222/unit/RegularRemoveMethodUnitTestCase.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1222/unit/RegularRemoveMethodUnitTestCase.java 2008-03-21 05:40:17 UTC (rev 71130)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/ejbthree1222/unit/RegularRemoveMethodUnitTestCase.java 2008-03-21 06:17:41 UTC (rev 71131)
@@ -21,6 +21,8 @@
*/
package org.jboss.ejb3.test.ejbthree1222.unit;
+import javax.ejb.NoSuchEJBException;
+
import junit.framework.Test;
import junit.framework.TestCase;
@@ -76,8 +78,17 @@
TestCase.fail(e.getMessage());
}
- // Ensure the call was received and the bean instance is still available
- TestCase.assertEquals(1, bean.getCalls());
+ try
+ {
+ // Ensure the call was received and the bean instance is still available
+ TestCase.assertEquals(1, bean.getCalls());
+ }
+ catch (NoSuchEJBException nsee)
+ {
+ // "void remove()" should not have been handled as EJB2.1 call
+ TestCase.fail(nsee.getMessage());
+ }
+
}
// Suite
More information about the jboss-cvs-commits
mailing list