[jboss-cvs] JBossAS SVN: r65993 - in trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785: unit and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Oct 9 17:55:31 EDT 2007
Author: ALRubinger
Date: 2007-10-09 17:55:31 -0400 (Tue, 09 Oct 2007)
New Revision: 65993
Added:
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStateless.java
Modified:
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/AbstractStatelessBean.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessBean.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessLocal.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessRemote.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/Tester.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/TesterBean.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/unit/SuperBeanTesterUnitTestCase.java
Log:
EJBTHREE-785: Updated tests to correctly identify tasked issue
Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/AbstractStatelessBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/AbstractStatelessBean.java 2007-10-09 21:07:37 UTC (rev 65992)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/AbstractStatelessBean.java 2007-10-09 21:55:31 UTC (rev 65993)
@@ -21,16 +21,18 @@
*/
package org.jboss.ejb3.test.ejbthree785;
+import javax.ejb.Stateless;
+
/**
* This one implements the business interface.
- *
+ *
* @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
+ * @version $Revision$
*/
-public class AbstractStatelessBean implements MyStatelessRemote, MyStatelessLocal
-{
- public String sayHiTo(String name)
- {
- return "Hi " + name;
- }
+ at Stateless
+public class AbstractStatelessBean implements MyStatelessRemote,
+ MyStatelessLocal {
+ public String sayHiTo(String name) {
+ return "Hi " + name;
+ }
}
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStateless.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStateless.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStateless.java 2007-10-09 21:55:31 UTC (rev 65993)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.ejbthree785;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public interface MyStateless {
+ String sayHiTo(String name);
+}
Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessBean.java 2007-10-09 21:07:37 UTC (rev 65992)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessBean.java 2007-10-09 21:55:31 UTC (rev 65993)
@@ -21,24 +21,16 @@
*/
package org.jboss.ejb3.test.ejbthree785;
-import javax.ejb.Stateless;
-import org.jboss.annotation.ejb.LocalBinding;
-import org.jboss.annotation.ejb.RemoteBinding;
-
/**
* Comment
*
* @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
* @author <a href="mailto:alr at alrubinger.com">ALR</a>
- * @version $Revision: $
+ * @version $Revision$
*/
- at Stateless
- at RemoteBinding(jndiBinding = MyStatelessBean.JNDI_NAME_REMOTE)
- at LocalBinding(jndiBinding = MyStatelessBean.JNDI_NAME_LOCAL)
+
public class MyStatelessBean extends AbstractStatelessBean
{
- public static final String JNDI_NAME_REMOTE = "MyStatelessBean/remote";
-
- public static final String JNDI_NAME_LOCAL = "MyStatelessBean/local";
+
}
Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessLocal.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessLocal.java 2007-10-09 21:07:37 UTC (rev 65992)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessLocal.java 2007-10-09 21:55:31 UTC (rev 65993)
@@ -23,14 +23,18 @@
import javax.ejb.Local;
+import org.jboss.annotation.ejb.LocalBinding;
+
/**
* Comment
*
* @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
* @version $Revision: $
*/
@Local
-public interface MyStatelessLocal
+ at LocalBinding(jndiBinding = MyStatelessBean.JNDI_NAME_LOCAL)
+public interface MyStatelessLocal extends MyStateless
{
- String sayHiTo(String name);
+ public static final String JNDI_NAME_LOCAL = "MyStatelessBean/local";
}
Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessRemote.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessRemote.java 2007-10-09 21:07:37 UTC (rev 65992)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessRemote.java 2007-10-09 21:55:31 UTC (rev 65993)
@@ -23,14 +23,17 @@
import javax.ejb.Remote;
+import org.jboss.annotation.ejb.RemoteBinding;
+
/**
* Comment
- *
+ *
* @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision$
*/
@Remote
-public interface MyStatelessRemote
-{
- String sayHiTo(String name);
+ at RemoteBinding(jndiBinding = MyStatelessRemote.JNDI_NAME_REMOTE)
+public interface MyStatelessRemote extends MyStateless {
+ public static final String JNDI_NAME_REMOTE = "MyStatelessBean/remote";
}
Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/Tester.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/Tester.java 2007-10-09 21:07:37 UTC (rev 65992)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/Tester.java 2007-10-09 21:55:31 UTC (rev 65993)
@@ -8,8 +8,12 @@
import javax.ejb.Remote;
+import org.jboss.annotation.ejb.RemoteBinding;
+
@Remote
-public interface Tester
-{
- String sayHiTo(String name);
+ at RemoteBinding(jndiBinding = Tester.JNDI_NAME_REMOTE)
+public interface Tester {
+ public static final String JNDI_NAME_REMOTE = "TesterBean/remote";
+
+ String sayHiTo(String name);
}
Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/TesterBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/TesterBean.java 2007-10-09 21:07:37 UTC (rev 65992)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/TesterBean.java 2007-10-09 21:55:31 UTC (rev 65993)
@@ -9,20 +9,13 @@
import javax.ejb.EJB;
import javax.ejb.Stateless;
-import org.jboss.annotation.ejb.RemoteBinding;
-
@Stateless
- at RemoteBinding(jndiBinding = TesterBean.JNDI_NAME)
-public class TesterBean implements Tester
-{
- // Class Members
- public static final String JNDI_NAME = "TesterBean/remote";
+public class TesterBean implements Tester {
- @EJB
- private MyStatelessLocal local;
+ @EJB
+ private MyStatelessLocal local;
- public String sayHiTo(String name)
- {
- return local.sayHiTo(name);
- }
+ public String sayHiTo(String name) {
+ return local.sayHiTo(name);
+ }
}
Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/unit/SuperBeanTesterUnitTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/unit/SuperBeanTesterUnitTestCase.java 2007-10-09 21:07:37 UTC (rev 65992)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/unit/SuperBeanTesterUnitTestCase.java 2007-10-09 21:55:31 UTC (rev 65993)
@@ -25,74 +25,71 @@
import junit.framework.Test;
-import org.jboss.ejb3.test.ejbthree785.MyStatelessBean;
import org.jboss.ejb3.test.ejbthree785.MyStatelessLocal;
import org.jboss.ejb3.test.ejbthree785.MyStatelessRemote;
import org.jboss.ejb3.test.ejbthree785.Tester;
-import org.jboss.ejb3.test.ejbthree785.TesterBean;
import org.jboss.test.JBossTestCase;
/**
* Test to see if a super can have the business interface.
- *
+ *
* @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
* @author <a href="mailto:alr at alrubinger.com">ALR</a>
- * @version $Revision: $
+ * @version $Revision$
*/
-public class SuperBeanTesterUnitTestCase extends JBossTestCase
-{
+public class SuperBeanTesterUnitTestCase extends JBossTestCase {
- public SuperBeanTesterUnitTestCase(String name)
- {
- super(name);
- }
+ public SuperBeanTesterUnitTestCase(String name) {
+ super(name);
+ }
- /**
- * Ensures that a remote view of a business interface
- * implemented by a superclass of an EJB's Implementation
- * Class is deployed and invokable
- *
- * @throws Exception
- */
- public void testSuperRemoteInvokable() throws Exception
- {
- MyStatelessRemote session = (MyStatelessRemote) getInitialContext().lookup(MyStatelessBean.JNDI_NAME_REMOTE);
- Date date = new Date();
- String expected = "Hi " + date.toString();
- String actual = session.sayHiTo(date.toString());
- assertEquals(expected, actual);
- }
+ /**
+ * Ensures that a remote view of a business interface implemented by a
+ * superclass of an EJB's Implementation Class is deployed and invokable
+ *
+ * @throws Exception
+ */
+ public void testSuperRemoteInvokable() throws Exception {
+ MyStatelessRemote session = (MyStatelessRemote) getInitialContext()
+ .lookup(MyStatelessRemote.JNDI_NAME_REMOTE);
+ Date date = new Date();
+ String expected = "Hi " + date.toString();
+ String actual = session.sayHiTo(date.toString());
+ assertEquals(expected, actual);
+ }
- /**
- * Ensures that a local view of a business interface
- * implemented by a superclass of an EJB's Implementation
- * Class is deployed; won't be invokable as unit test runs in separate JVM
- *
- * @throws Exception
- */
- public void testSuperLocalDeployed() throws Exception
- {
- MyStatelessLocal session = (MyStatelessLocal) getInitialContext().lookup(MyStatelessBean.JNDI_NAME_LOCAL);
- assertNotNull(session);
- }
+ /**
+ * Ensures that a local view of a business interface implemented by a
+ * superclass of an EJB's Implementation Class is deployed; won't be
+ * invokable as unit test runs in separate JVM
+ *
+ * @throws Exception
+ */
+ public void testSuperLocalDeployed() throws Exception {
+ MyStatelessLocal session = (MyStatelessLocal) getInitialContext()
+ .lookup(MyStatelessLocal.JNDI_NAME_LOCAL);
+ assertNotNull(session);
+ }
- /**
- * Ensures that dependencies may be made upon EJBs with @Local implemented by
- * superclass of an EJB's Implementation Class, and that invocation succeeds.
- *
- * @throws Exception
- */
- public void testSuperLocalViaRemoteDelegate() throws Exception
- {
- Tester session = (Tester) getInitialContext().lookup(TesterBean.JNDI_NAME);
- Date date = new Date();
- String expected = "Hi " + date.toString();
- String actual = session.sayHiTo(date.toString());
- assertEquals(expected, actual);
- }
+ /**
+ * Ensures that dependencies may be made upon EJBs with
+ *
+ * @Local implemented by superclass of an EJB's Implementation Class, and
+ * that invocation succeeds.
+ *
+ * @throws Exception
+ */
+ public void testSuperLocalViaRemoteDelegate() throws Exception {
+ Tester session = (Tester) getInitialContext().lookup(
+ Tester.JNDI_NAME_REMOTE);
+ Date date = new Date();
+ String expected = "Hi " + date.toString();
+ String actual = session.sayHiTo(date.toString());
+ assertEquals(expected, actual);
+ }
- public static Test suite() throws Exception
- {
- return getDeploySetup(SuperBeanTesterUnitTestCase.class, "ejbthree785.jar");
- }
+ public static Test suite() throws Exception {
+ return getDeploySetup(SuperBeanTesterUnitTestCase.class,
+ "ejbthree785.jar");
+ }
}
More information about the jboss-cvs-commits
mailing list