testClassesSelector, methodName, "serialized"
);
log.debug("Ran test {} method {} at URL {}",
new Object[] { testClassesSelector, methodName, remoteUrl });
final HttpEntity entity = executor.getResponse().getEntity();
if (entity != null) {
try {
final Object o = new ObjectInputStream(entity.getContent()).readObject();
if( !(o instanceof ExecutionResult) ) {
throw new IllegalStateException("Expected an ExecutionResult, got a " + o.getClass().getName());
}
final ExecutionResult result = (ExecutionResult)o;
if (result.isFailure()) {
throw result.getException();
}
} finally {
entity.consumeContent();
}
}
}