assertEquals(7, result);
}
@Test
public void testEvaluate() throws Throwable {
ObjectReference promise = remote.evaluateForked("3+4");
ThreadReference thread = ((ThreadReference) remote.invokeMethod(
promise, "thread"));
Value result1 = remote.invokeMethod(promise, "result");
Value ex = remote.invokeMethod(promise, "throwable");
printThreadState();
VMTargetStarter.sleep(100);
printThreadState();
boolean isFinished = ((BooleanValue) remote.invokeMethod(promise,
"isFinished")).booleanValue();
assertTrue(isFinished);
ObjectReference result = (ObjectReference) remote.invokeMethod(promise,
"result");
IntegerValue intValue = (IntegerValue) remote.invokeMethod(result,
"intValue");
assertEquals(7, intValue.intValue());
}