receiveEvent = debuggeeWrapper.vmMirror.receiveEvent();
} catch (TestErrorException e) {
printErrorAndFail("There is no event received.");
}
ParsedEvent[] parsedEvents = ParsedEvent.parseEventPacket(receiveEvent);
Event_MONITOR_WAIT event = (ParsedEvent.Event_MONITOR_WAIT)parsedEvents[0];
// Check event basic message
assertEquals("Invalid number of events,", 1, parsedEvents.length);
assertEquals("Invalid event kind,", JDWPConstants.EventKind.MONITOR_WAIT, parsedEvents[0].getEventKind()
, JDWPConstants.EventKind.getName(JDWPConstants.EventKind.MONITOR_WAIT)
, JDWPConstants.EventKind.getName(parsedEvents[0].getEventKind()));
logWriter.println("==> CHECK: Event Kind: " + JDWPConstants.EventKind.getName(JDWPConstants.EventKind.MONITOR_WAIT));
// Check tested thread message
logWriter.println("==> Get testedThreadID...");
long testedThreadID = debuggeeWrapper.vmMirror.getThreadID("main");
assertEquals("Invalid tested thread id: ", testedThreadID, event.getThreadID());
logWriter.println("==> CHECK: tested blocked thread id: " + testedThreadID );
// Check the ReferenceType of monitor object
long objID = event.getTaggedObject().objectID;
long refID = debuggeeWrapper.vmMirror.getReferenceType(objID);
String actualSignature = debuggeeWrapper.vmMirror.getReferenceTypeSignature(refID);
assertEquals("Invalid monitor class signature: ", monitorSignature
, actualSignature);
logWriter.println("==> CHECK: monitor class signature: " + actualSignature);