Package org.apache.harmony.jpda.tests.framework.jdwp.ParsedEvent

Examples of org.apache.harmony.jpda.tests.framework.jdwp.ParsedEvent.Event_MONITOR_WAITED


            receiveEvent = debuggeeWrapper.vmMirror.receiveEvent();
        } catch (TestErrorException e) {
            printErrorAndFail("There is no event received.");
        }
        ParsedEvent[] parsedEvents = ParsedEvent.parseEventPacket(receiveEvent);
        Event_MONITOR_WAITED event = (ParsedEvent.Event_MONITOR_WAITED)parsedEvents[0];
       
        // Check event basic message
        assertEquals("Invalid number of events,", 1, parsedEvents.length);
        assertEquals("Invalid event kind,", JDWPConstants.EventKind.MONITOR_WAITED, parsedEvents[0].getEventKind()
                , JDWPConstants.EventKind.getName(JDWPConstants.EventKind.MONITOR_WAITED)
                , JDWPConstants.EventKind.getName(parsedEvents[0].getEventKind()));
        logWriter.println("==> CHECK: Event Kind: " + JDWPConstants.EventKind.getName(JDWPConstants.EventKind.MONITOR_WAITED));
       
        // 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);
       
        // Check wait's timeout
        assertEquals("Invalid reference type of prepared class,", true
                , event.getTimedout());
        logWriter.println("==> CHECK: Wait time out: " + MonitorWaitAndWaitedDebuggee.TIMEOUT);
    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.jpda.tests.framework.jdwp.ParsedEvent.Event_MONITOR_WAITED

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.