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

Examples of org.apache.harmony.jpda.tests.framework.jdwp.Location


                (reply,  "getMethodEndLocation(): Method.LineTable command") ) {
            return null;
        }
        long methodStartCodeIndex = reply.getNextValueAsLong();
        long methodEndCodeIndex = reply.getNextValueAsLong();
        Location location = new Location();
        location.tag = JDWPConstants.TypeTag.CLASS;
        location.classID =  classID;
        location.methodID = methodID;
        location.index = methodEndCodeIndex;
        return location;
View Full Code Here


    protected boolean checkEventsLocation(ParsedEvent[] parsedEvents, Location expectedLocation) {
        boolean success = true;
        for (int i = 0; i < parsedEvents.length; i++) {
            byte eventKind = parsedEvents[i].getEventKind();
            long eventThreadID = 0;
            Location eventLocation = null;
            switch ( eventKind ) {
            case JDWPConstants.EventKind.METHOD_ENTRY:
                eventLocation = ((ParsedEvent.Event_METHOD_ENTRY)parsedEvents[i]).getLocation();
                eventThreadID = ((ParsedEvent.EventThread)parsedEvents[i]).getThreadID();
                break;
View Full Code Here

                JDWPConstants.EventKind.EXCEPTION,
                parsedEvents[0].getEventKind(),
                JDWPConstants.EventKind.getName(JDWPConstants.EventKind.EXCEPTION),
                JDWPConstants.EventKind.getName(parsedEvents[0].getEventKind()));
        long returnedThread = ((ParsedEvent.Event_EXCEPTION)parsedEvents[0]).getThreadID();
        Location returnedExceptionLoc =((ParsedEvent.Event_EXCEPTION)parsedEvents[0]).getLocation();
       
        // assert that exception thread is not null
        logWriter.println(">> testExceptionEventLocation: returnedThread = " + returnedThread);
        assertTrue("Returned exception ThreadID is null,", returnedThread != 0);

        // assert that exception location is not null
        logWriter.println(">> testExceptionEventLocation: returnedExceptionLoc = " + returnedExceptionLoc);
        assertTrue("Returned exception location is null,", returnedExceptionLoc != null);

        // assert that top stack frame location is not null
        Location topFrameLoc = getTopFrameLocation(returnedThread);
        logWriter.println(">> testExceptionEventLocation: topFrameLoc = " + topFrameLoc);
        assertTrue("Returned top stack frame location is null,", topFrameLoc != null);

        // assert that locations of exception and top frame are equal
        assertEquals("Different exception and top frame location tag,", returnedExceptionLoc.tag, topFrameLoc.tag);
View Full Code Here

        // assert that only one top frame is returned
        int framesCount = reply.getNextValueAsInt();
        assertEquals("Invalid number of top stack frames,", 1, framesCount);

        long frameID = reply.getNextValueAsFrameID();
        Location loc = reply.getNextValueAsLocation();

        return loc;
    }
View Full Code Here

        // Get Method reference ID
        long methodID = getMethodID(typeID, breakpoint.methodName);

        // Fill location
        Location location = new Location(typeTag, typeID, methodID,
                breakpoint.index);

        // Set breakpoint
        return setBreakpoint(location, suspendPolicy);
    }
View Full Code Here

        byte eventKind = JDWPConstants.EventKind.BREAKPOINT;

        EventMod mod1 = new EventMod();
        mod1.modKind = EventMod.ModKind.LocationOnly;
        mod1.loc = new Location(typeTag, typeID, methodID, breakpoint.index);

        EventMod mod2 = new EventMod();
        mod2.modKind = EventMod.ModKind.Count;
        mod2.count = count;
View Full Code Here

        lineTableReply.getNextValueAsInt();

        long lineCodeIndex = lineTableReply.getNextValueAsLong();

        // set breakpoint inside checked method
        Location breakpointLocation = new Location(JDWPConstants.TypeTag.CLASS,
                classID, methodID, lineCodeIndex);

        ReplyPacket reply = setBreakpoint(breakpointLocation);
        checkReply(reply);
View Full Code Here

        // set requests for events that will be checked
        logWriter.println("");
        logWriter.println("=> Set request for BREAKPOINT event in debuggee: "
                + getDebuggeeClassName() + ", beginning of method: "
                + methodForEvents);
        Location combinedEventsLocation = getMethodEntryLocation(debuggeeClassID, methodForEvents);
        if ( combinedEventsLocation == null ) {
            String failureMessage = "## FAILURE: Can NOT get MethodEntryLocation for method '"
                + methodForEvents + "'";
            printErrorAndFail(failureMessage);
        }
View Full Code Here

                    logWriter.println("");
                    logWriter.println("=> Chcek location for combined event N " + (i+1)
                        + ": Event kind = " + eventKind + "("
                        + JDWPConstants.EventKind.getName(eventKind) +"); eventThreadID = "
                        + eventThreadID);
                    Location eventLocation = null;
                    switch ( eventKind ) {
                    case JDWPConstants.EventKind.METHOD_ENTRY:
                        eventLocation = ((ParsedEvent.Event_METHOD_ENTRY)parsedEvents[i]).getLocation();
                        break;
                    case JDWPConstants.EventKind.SINGLE_STEP:
View Full Code Here

                + "\n## Expected event kind = " + expectedEventKinds[0] + "("
                + JDWPConstants.EventKind.getName(expectedEventKinds[0]) + ")";
            printErrorAndFail(failureMessage);
        }
        boolean testCaseIsOk = true;
        Location location = ((ParsedEvent.Event_METHOD_ENTRY)parsedEvents[0]).getLocation();
        long eventClassID = location.classID;
        logWriter.println("==> ClassID in event = " + eventClassID);
        if ( testedClassID != eventClassID ) {
            logWriter.println("## FAILURE: Unexpected ClassID in event!");
            logWriter.println("##          Expected ClassID (testedClassID) = " + testedClassID );
View Full Code Here

TOP

Related Classes of org.apache.harmony.jpda.tests.framework.jdwp.Location

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.