Class JMXTestRunner
- java.lang.Object
-
- javax.management.NotificationBroadcasterSupport
-
- org.jboss.arquillian.protocol.jmx.JMXTestRunner
-
- All Implemented Interfaces:
NotificationBroadcaster,NotificationEmitter,JMXTestRunnerMBean
public class JMXTestRunner extends NotificationBroadcasterSupport implements JMXTestRunnerMBean
An MBean to run test methods in container.- Author:
- thomas.diesler@jboss.com
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceJMXTestRunner.TestClassLoader
-
Field Summary
-
Fields inherited from interface org.jboss.arquillian.protocol.jmx.JMXTestRunnerMBean
OBJECT_NAME
-
-
Constructor Summary
Constructors Constructor Description JMXTestRunner(JMXTestRunner.TestClassLoader classLoader)JMXTestRunner(JMXTestRunner.TestClassLoader classLoader, String objectName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.jboss.arquillian.test.spi.TestResultdoRunTestMethod(TestRunner runner, Class<?> testClass, String methodName, Map<String,String> protocolProps)protected StringgetCurrentCall()voidpush(String eventId, byte[] command)Client side to push aCommandresult back to container.Command<?>receive()ReceiveCommandresultsObjectNameregisterMBean(MBeanServer mbeanServer)byte[]runTestMethod(String className, String methodName)Runs a test method on the given test classbyte[]runTestMethod(String className, String methodName, Map<String,String> protocolProps)Runs a test method on the given test classvoidsend(Command<?> command)BroadcastCommandcommands to any listenersprotected voidsetCurrentCall(String current)voidunregisterMBean(MBeanServer mbeanServer)-
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.management.NotificationBroadcaster
addNotificationListener, getNotificationInfo, removeNotificationListener
-
-
-
-
Constructor Detail
-
JMXTestRunner
public JMXTestRunner(JMXTestRunner.TestClassLoader classLoader)
-
JMXTestRunner
public JMXTestRunner(JMXTestRunner.TestClassLoader classLoader, String objectName)
-
-
Method Detail
-
registerMBean
public ObjectName registerMBean(MBeanServer mbeanServer) throws JMException
- Throws:
JMException
-
unregisterMBean
public void unregisterMBean(MBeanServer mbeanServer) throws JMException
- Throws:
JMException
-
runTestMethod
public byte[] runTestMethod(String className, String methodName)
Description copied from interface:JMXTestRunnerMBeanRuns a test method on the given test class- Specified by:
runTestMethodin interfaceJMXTestRunnerMBean- Parameters:
className- the test class namemethodName- the test method name- Returns:
- a serialized
TestResult
-
runTestMethod
public byte[] runTestMethod(String className, String methodName, Map<String,String> protocolProps)
Description copied from interface:JMXTestRunnerMBeanRuns a test method on the given test class- Specified by:
runTestMethodin interfaceJMXTestRunnerMBean- Parameters:
className- the test class namemethodName- the test method name- Returns:
- a serialized
TestResult
-
doRunTestMethod
protected org.jboss.arquillian.test.spi.TestResult doRunTestMethod(TestRunner runner, Class<?> testClass, String methodName, Map<String,String> protocolProps)
-
send
public void send(Command<?> command)
Description copied from interface:JMXTestRunnerMBeanBroadcastCommandcommands to any listeners- Specified by:
sendin interfaceJMXTestRunnerMBean- Parameters:
command- Command object containing the request
-
receive
public Command<?> receive()
Description copied from interface:JMXTestRunnerMBeanReceiveCommandresults- Specified by:
receivein interfaceJMXTestRunnerMBean- Returns:
- command Command object containing the result, null if none received (yet)
-
push
public void push(String eventId, byte[] command)
Description copied from interface:JMXTestRunnerMBeanClient side to push aCommandresult back to container.- Specified by:
pushin interfaceJMXTestRunnerMBean- Parameters:
eventId- used to correlate the resultcommand- Command object containing the result, serialized
-
getCurrentCall
protected String getCurrentCall()
- Returns:
- the currentCall
-
setCurrentCall
protected void setCurrentCall(String current)
-
-