use of hydra.MethExecutorResult in project geode by apache.
the class RemoteDUnitVM method executeMethodOnClass.
/**
* Called remotely by the master controller to cause the client to execute the method on the
* class. Does this synchronously (does not spawn a thread). This method is used by the unit test
* framework, dunit.
*
* @param className the name of the class execute
* @param methodName the name of the method to execute
* @return the result of method execution
*/
public MethExecutorResult executeMethodOnClass(String className, String methodName) {
String name = className + '.' + methodName;
long start = start(name);
MethExecutorResult result = MethExecutor.execute(className, methodName);
logDelta(name, start, result);
return result;
}
use of hydra.MethExecutorResult in project geode by apache.
the class RemoteDUnitVM method executeMethodOnObject.
/**
* Called remotely by the master controller to cause the client to execute the instance method on
* the object. Does this synchronously (does not spawn a thread). This method is used by the unit
* test framework, dunit.
*
* @param target the object to execute the method on
* @param methodName the name of the method to execute
* @return the result of method execution
*/
@Override
public MethExecutorResult executeMethodOnObject(Object target, String methodName) {
String name = target.getClass().getName() + '.' + methodName + " on object: " + target;
long start = start(name);
MethExecutorResult result = MethExecutor.executeObject(target, methodName);
logDelta(name, start, result);
return result;
}
use of hydra.MethExecutorResult in project geode by apache.
the class RemoteDUnitVM method executeMethodOnClass.
/**
* Executes a given static method in a given class with the given arguments.
*/
@Override
public MethExecutorResult executeMethodOnClass(String className, String methodName, Object[] args) {
String name = className + '.' + methodName + (args != null ? " with " + args.length + " args" : "");
long start = start(name);
MethExecutorResult result = MethExecutor.execute(className, methodName, args);
logDelta(name, start, result);
return result;
}
use of hydra.MethExecutorResult in project geode by apache.
the class RemoteDUnitVM method executeMethodOnObject.
/**
* Executes a given instance method on a given object with the given arguments.
*/
@Override
public MethExecutorResult executeMethodOnObject(Object target, String methodName, Object[] args) {
String name = target.getClass().getName() + '.' + methodName + (args != null ? " with " + args.length + " args" : "") + " on object: " + target;
long start = start(name);
MethExecutorResult result = MethExecutor.executeObject(target, methodName, args);
logDelta(name, start, result);
return result;
}
use of hydra.MethExecutorResult in project geode by apache.
the class DUnitLauncher method startLocator.
private static int startLocator(Registry registry) throws IOException, NotBoundException {
RemoteDUnitVMIF remote = (RemoteDUnitVMIF) registry.lookup("vm" + LOCATOR_VM_NUM);
final File locatorLogFile = LOCATOR_LOG_TO_DISK ? new File("locator-" + locatorPort + ".log") : new File("");
MethExecutorResult result = remote.executeMethodOnObject(new SerializableCallable() {
public Object call() throws IOException {
Properties p = getDistributedSystemProperties();
// I never want this locator to end up starting a jmx manager
// since it is part of the unit test framework
p.setProperty(JMX_MANAGER, "false");
// Disable the shared configuration on this locator.
// Shared configuration tests create their own locator
p.setProperty(ENABLE_CLUSTER_CONFIGURATION, "false");
// Tell the locator it's the first in the system for
// faster boot-up
System.setProperty(GMSJoinLeave.BYPASS_DISCOVERY_PROPERTY, "true");
// disable auto-reconnect - tests fly by so fast that it will never be
// able to do so successfully anyway
p.setProperty(DISABLE_AUTO_RECONNECT, "true");
try {
Locator.startLocatorAndDS(0, locatorLogFile, p);
InternalLocator internalLocator = (InternalLocator) Locator.getLocator();
locatorPort = internalLocator.getPort();
internalLocator.resetInternalLocatorFileNamesWithCorrectPortNumber(locatorPort);
} finally {
System.getProperties().remove(GMSJoinLeave.BYPASS_DISCOVERY_PROPERTY);
}
return locatorPort;
}
}, "call");
if (result.getException() != null) {
RuntimeException ex = new RuntimeException("Failed to start locator", result.getException());
ex.printStackTrace();
throw ex;
}
return (Integer) result.getResult();
}
Aggregations