User: slaboure
Date: 02/04/13 08:24:06
Modified: src/main/org/jboss/test JBossTestServices.java
Log:
Extended test environment for clustering testing (mainly private members that become
protected)
Revision Changes Path
1.12 +27 -36 jbosstest/src/main/org/jboss/test/JBossTestServices.java
Index: JBossTestServices.java
===================================================================
RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/JBossTestServices.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- JBossTestServices.java 25 Feb 2002 19:49:52 -0000 1.11
+++ JBossTestServices.java 13 Apr 2002 15:24:06 -0000 1.12
@@ -8,30 +8,16 @@
package org.jboss.test;
import java.io.File;
-import java.net.InetAddress;
-import java.net.MalformedURLException;
import java.net.URL;
-import java.util.HashSet;
-import java.util.Set;
-import javax.management.MBeanException;
-import javax.management.MBeanRegistrationException;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectInstance;
+import java.net.MalformedURLException;
+import java.net.InetAddress;
+
import javax.management.ObjectName;
-import javax.management.ReflectionException;
-import javax.management.RuntimeErrorException;
-import javax.management.RuntimeMBeanException;
-import javax.management.RuntimeOperationsException;
-import javax.naming.Context;
+import javax.management.MalformedObjectNameException;
import javax.naming.InitialContext;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-
import org.apache.log4j.Category;
-import org.jboss.jmx.adaptor.rmi.RMIAdaptor;
-
/**
* This is provides services for jboss junit test cases and TestSetups. It supplies
* access to log4j logging, the jboss jmx server, jndi, and a method for
@@ -46,7 +32,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">David Jencks</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Christoph G. Jung</a>
- * @version $Revision: 1.11 $
+ * @version $Revision: 1.12 $
*/
public class JBossTestServices
{
@@ -55,18 +41,18 @@
//private final static String serviceDeployerName =
"jboss.system:service=ServiceDeployer";
//private final static String j2eeDeployerName =
"jboss.j2ee:service=J2eeDeployer";
- private final static String DEPLOYER_NAME = "jboss.system:service=MainDeployer";
+ protected final static String DEPLOYER_NAME =
"jboss.system:service=MainDeployer";
- private final static int DEFAULT_THREADCOUNT = 10;
- private final static int DEFAULT_ITERATIONCOUNT = 1000;
- private final static int DEFAULT_BEANCOUNT = 100;
+ protected final static int DEFAULT_THREADCOUNT = 10;
+ protected final static int DEFAULT_ITERATIONCOUNT = 1000;
+ protected final static int DEFAULT_BEANCOUNT = 100;
// Attributes ----------------------------------------------------
- private RMIAdaptor server;
- private Category log;
- private InitialContext initialContext;
+ protected org.jboss.jmx.adaptor.rmi.RMIAdaptor server;
+ protected Category log;
+ protected InitialContext initialContext;
- private HashSet deployed = new HashSet();
+ protected java.util.HashSet deployed = new java.util.HashSet();
// Static --------------------------------------------------------
@@ -128,7 +114,7 @@
*
* @return The Server value
*/
- RMIAdaptor getServer() throws Exception
+ org.jboss.jmx.adaptor.rmi.RMIAdaptor getServer () throws Exception
{
init();
return server;
@@ -221,31 +207,36 @@
*/
protected Object invoke(ObjectName name, String method, Object[] args, String[]
sig) throws Exception
{
+ return invoke (getServer(), name, method, args, sig);
+ }
+
+ protected Object invoke (org.jboss.jmx.adaptor.rmi.RMIAdaptor server, ObjectName
name, String method, Object[] args, String[] sig) throws Exception
+ {
try
{
- return getServer().invoke(name, method, args, sig);
+ return server.invoke(name, method, args, sig);
}
- catch (MBeanException e)
+ catch (javax.management.MBeanException e)
{
log.error("MbeanException", e.getTargetException());
throw e.getTargetException();
}
- catch (ReflectionException e)
+ catch (javax.management.ReflectionException e)
{
log.error("ReflectionException", e.getTargetException());
throw e.getTargetException();
}
- catch (RuntimeOperationsException e)
+ catch (javax.management.RuntimeOperationsException e)
{
log.error("RuntimeOperationsException", e.getTargetException());
throw e.getTargetException();
}
- catch (RuntimeMBeanException e)
+ catch (javax.management.RuntimeMBeanException e)
{
log.error("RuntimeMbeanException", e.getTargetException());
throw e.getTargetException();
}
- catch (RuntimeErrorException e)
+ catch (javax.management.RuntimeErrorException e)
{
log.error("RuntimeErrorException", e.getTargetError());
throw e.getTargetError();
@@ -327,7 +318,7 @@
deployed.remove(name);
}
- private void init() throws Exception
+ protected void init() throws Exception
{
if (initialContext == null)
{
@@ -340,7 +331,7 @@
{
serverName = InetAddress.getLocalHost().getHostName();
}
- server = (RMIAdaptor)initialContext.lookup("jmx:" + serverName + ":rmi");
+ server =
(org.jboss.jmx.adaptor.rmi.RMIAdaptor)initialContext.lookup("jmx:" + serverName +
":rmi");
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development