[jboss-cvs] JBossAS SVN: r64233 - trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Jul 23 22:58:00 EDT 2007
Author: bstansberry at jboss.com
Date: 2007-07-23 22:57:59 -0400 (Mon, 23 Jul 2007)
New Revision: 64233
Added:
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalledBean.java
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalledHome.java
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalledRemote.java
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalleeBean.java
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalleeHome.java
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalleeRemote.java
Log:
[JBAS-4552] Move cluster tests into cluster package
[JBAS-4553] Reorg cluster tests to prevent unnecessary repetition
Added: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalledBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalledBean.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalledBean.java 2007-07-24 02:57:59 UTC (rev 64233)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.test.cluster.ejb2.crossserver;
+
+import java.rmi.RemoteException;
+import java.rmi.dgc.VMID;
+import java.util.Properties;
+import javax.ejb.SessionBean;
+import javax.ejb.SessionContext;
+import javax.ejb.CreateException;
+import javax.naming.InitialContext;
+import javax.naming.Context;
+import javax.rmi.PortableRemoteObject;
+
+import org.jboss.logging.Logger;
+
+/** This bean is called by the test client to validate ejb to ejb calls between
+ * server instances.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class CalledBean implements SessionBean
+{
+ private static Logger log = Logger.getLogger(CalledBean.class);
+ private static VMID vmid = new VMID();
+
+ public void ejbCreate() throws CreateException
+ {
+ log.debug("ejbCreate() called");
+ }
+
+ public void ejbActivate()
+ {
+ log.debug("ejbActivate() called");
+ }
+
+ public void ejbPassivate()
+ {
+ log.debug("ejbPassivate() called");
+ }
+
+ public void ejbRemove()
+ {
+ log.debug("ejbRemove() called");
+ }
+
+ public void setSessionContext(SessionContext context)
+ {
+ }
+
+ /** This method calls echo on a CalleeBean
+ */
+ public VMID[] invokeCall(String jndiURL, String jndiName)
+ throws RemoteException
+ {
+ log.info("invokeCall, jndiURL="+jndiURL+", jndiName="+jndiName);
+ VMID[] ids = {vmid, null};
+ try
+ {
+ Properties props = new Properties();
+ props.setProperty(Context.PROVIDER_URL, jndiURL);
+ InitialContext ic = new InitialContext(props);
+ Object ref = ic.lookup(jndiName);
+ CalleeHome localHome = (CalleeHome) PortableRemoteObject.narrow(ref,
+ CalleeHome.class);
+ CalleeRemote remoteBean = localHome.create();
+ ids[1] = remoteBean.call("invokeCall");
+ log.info("echo, CalleeRemote.call="+ids[1]+", vmid="+ids[0]);
+ }
+ catch(Exception e)
+ {
+ log.error("Failed to invoke CalleeRemote.call", e);
+ throw new RemoteException("Failed to invoke CalleeRemote.call", e);
+ }
+ return ids;
+ }
+
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalledBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalledHome.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalledHome.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalledHome.java 2007-07-24 02:57:59 UTC (rev 64233)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.test.cluster.ejb2.crossserver;
+
+import java.rmi.RemoteException;
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public interface CalledHome extends EJBHome
+{
+ public CalledRemote create() throws CreateException, RemoteException;
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalledHome.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalledRemote.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalledRemote.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalledRemote.java 2007-07-24 02:57:59 UTC (rev 64233)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.test.cluster.ejb2.crossserver;
+
+import java.rmi.RemoteException;
+import java.rmi.dgc.VMID;
+import javax.ejb.EJBObject;
+
+/** The interface for the ejb called by the test client
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public interface CalledRemote
+ extends EJBObject
+{
+ /**
+ * Invoke CalleeRemote.call("invokeCall")
+ * @return VMID[0 == localhost], [1 == remotehost]
+ * @param jndiURL
+ * @param jndiName -
+ * @throws RemoteException
+ */
+ public VMID[] invokeCall(String jndiURL, String jndiName)
+ throws RemoteException;
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalledRemote.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalleeBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalleeBean.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalleeBean.java 2007-07-24 02:57:59 UTC (rev 64233)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.test.cluster.ejb2.crossserver;
+
+import java.rmi.dgc.VMID;
+import javax.ejb.SessionBean;
+import javax.ejb.CreateException;
+import javax.ejb.SessionContext;
+
+import org.jboss.logging.Logger;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class CalleeBean implements SessionBean
+{
+ private static Logger log = Logger.getLogger(CalleeBean.class);
+ private static VMID vmid = new VMID();
+
+ public void ejbCreate() throws CreateException
+ {
+ log.debug("ejbCreate() called");
+ }
+
+ public void ejbActivate()
+ {
+ log.debug("ejbActivate() called");
+ }
+
+ public void ejbPassivate()
+ {
+ log.debug("ejbPassivate() called");
+ }
+
+ public void ejbRemove()
+ {
+ log.debug("ejbRemove() called");
+ }
+
+ public void setSessionContext(SessionContext context)
+ {
+ }
+
+ public VMID call(String info)
+ {
+ log.info("call, info="+info+", vmid="+vmid);
+ return vmid;
+ }
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalleeBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalleeHome.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalleeHome.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalleeHome.java 2007-07-24 02:57:59 UTC (rev 64233)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.test.cluster.ejb2.crossserver;
+
+import java.rmi.RemoteException;
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public interface CalleeHome extends EJBHome
+{
+ public CalleeRemote create() throws CreateException, RemoteException;
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalleeHome.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalleeRemote.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalleeRemote.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalleeRemote.java 2007-07-24 02:57:59 UTC (rev 64233)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.test.cluster.ejb2.crossserver;
+
+import java.rmi.RemoteException;
+import java.rmi.dgc.VMID;
+import javax.ejb.EJBObject;
+
+/** The interface for the ejb called by the remote server ejb
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public interface CalleeRemote
+ extends EJBObject
+{
+ public VMID call(String info) throws RemoteException;
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/ejb2/crosserver/CalleeRemote.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
More information about the jboss-cvs-commits
mailing list