long breakpointThreadID = 0;
ParsedEvent[] eventParsed = ParsedEvent.parseEventPacket(event);
if (eventParsed.length != 1) {
throw new TestErrorException("Received " + eventParsed.length
+ " events instead of 1 BREAKPOINT_EVENT");
}
// check if received event is for breakpoint
if (eventParsed[0].getEventKind() == JDWPConstants.EventKind.BREAKPOINT) {
breakpointThreadID = ((ParsedEvent.Event_BREAKPOINT) eventParsed[0])
.getThreadID();
} else {
throw new TestErrorException(
"Kind of received event is not BREAKPOINT_EVENT: "
+ eventParsed[0].getEventKind());
}
if (eventParsed[0].getRequestID() != requestID) {
throw new TestErrorException(
"Received BREAKPOINT_EVENT with another requestID: "
+ eventParsed[0].getRequestID());
}
return breakpointThreadID;