| org.apache.harmony.jpda.tests.jdwp.share.JDWPRawTestCase org.apache.harmony.jpda.tests.jdwp.share.JDWPTestCase
All known Subclasses: org.apache.harmony.jpda.tests.jdwp.DebuggerOnDemand.LaunchedDebugger, org.apache.harmony.jpda.tests.jdwp.VirtualMachine.IDSizesTest, org.apache.harmony.jpda.tests.jdwp.share.JDWPSyncTestCase, org.apache.harmony.jpda.tests.jdwp.VirtualMachine.ExitTest,
JDWPTestCase | abstract public class JDWPTestCase extends JDWPRawTestCase (Code) | | Basic class for unit tests which use only one debuggee VM.
|
Method Summary | |
protected void | assertAllDataRead(Packet reply) Helper for checking reply packet data has been read. | protected void | assertEquals(String message, long expected, long actual, String strExpected, String strActual) Helper for comparison numbers and printing string equivalents. | protected void | assertString(String message, String expected, String actual) Asserts that two strings are equal. | protected void | beforeDebuggeeStart(JDWPUnitDebuggeeWrapper debuggeeWrapper) This method is invoked right before starting debuggee VM. | protected long | checkField(long refTypeID, String fieldName) Single field verification routine. | protected long[] | checkFields(long refTypeID, String checkedFieldNames) Multiple field verification routine. | protected long[] | checkFields(long refTypeID, String checkedFieldNames, String expectedSignatures, int expectedModifiers) Multiple field verification routine. | protected void | checkReplyPacket(ReplyPacket reply, String message, int errorCodeExpected) Helper for checking reply packet error code. | protected void | checkReplyPacket(ReplyPacket reply, String message) Helper for checking reply packet error code. | protected void | checkReplyPacket(ReplyPacket reply, String message, int[] expected) Helper for checking reply packet error code. | protected boolean | checkReplyPacket(ReplyPacket reply, String message, int[] expected, boolean failSign) Helper for checking reply packet error code. | protected boolean | checkReplyPacketWithoutFail(ReplyPacket reply, String message) Helper for checking reply packet error code. | protected void | clearEvent(byte eventKind, int requestID, boolean verbose) Removes breakpoint of the given event kind corresponding to the given
request id. | public void | closeConnection() Closes JDWP connection with debuggee (doesn't terminate debuggee and
doesn't stop synchronize connection). | protected JDWPUnitDebuggeeWrapper | createDebuggeeWrapper() Creates wrapper for debuggee process. | protected long | createString(String value) Performs string creation in debuggee. | protected long | getClassIDBySignature(String signature) | protected String | getClassSignature(long classID) | protected ReplyPacket | getLineTable(long classID, long methodID) Issues LineTable command. | protected long | getMethodID(long classID, String methodName) Helper for getting method ID of corresponding class and method name. | protected String | getMethodName(long classID, long methodID) Helper for getting method name of corresponding class and method ID. | protected long | getObjectReferenceType(long objectID) Helper that returns reference type ID for input object ID. | protected String | getObjectSignature(long objectID) Helper that returns reference type signature of input object ID. | protected long | getReferenceTypeID(String signature) Returns reference type ID. | protected String | getStringValue(long stringID) Returns corresponding string from string ID. | protected void | internalSetUp() Overrides inherited method to launch one debuggee VM, establish JDWP
connection, and wait for VM_START event. | protected void | internalTearDown() Overrides inherited method to stop started debuggee VM and close all
connections. | public void | openConnection() Opens JDWP connection with debuggee (doesn't run debuggee and doesn't
establish synchronize connection). | protected void | printErrorAndFail(String message) Prints error message in log writer and in junit fail. | protected void | receiveInitialEvent() Receives initial VM_INIT event if debuggee is suspended on event. | protected void | resumeDebuggee() Helper function for resuming debuggee. | protected boolean | setStaticIntField(String classSignature, String fieldName, int newValue) Helper for setting static int field in class with new value. | protected void | startDebuggeeWrapper() Starts wrapper for debuggee process. |
initialEvent | protected EventPacket initialEvent(Code) | | EventPacket instance with received VM_START event.
|
assertAllDataRead | protected void assertAllDataRead(Packet reply)(Code) | | Helper for checking reply packet data has been read.
Parameters: reply - -reply packet from debuggee |
assertEquals | protected void assertEquals(String message, long expected, long actual, String strExpected, String strActual)(Code) | | Helper for comparison numbers and printing string equivalents.
Parameters: message - -user message Parameters: expected - -expected value Parameters: actual - -actual value Parameters: strExpected - -string equivalent of expected value Parameters: strActual - -string equivalent of actual value |
assertString | protected void assertString(String message, String expected, String actual)(Code) | | Asserts that two strings are equal.
Parameters: message - -user message Parameters: expected - -expected string Parameters: actual - -actual string |
beforeDebuggeeStart | protected void beforeDebuggeeStart(JDWPUnitDebuggeeWrapper debuggeeWrapper)(Code) | | This method is invoked right before starting debuggee VM.
|
checkField | protected long checkField(long refTypeID, String fieldName)(Code) | | Single field verification routine.
Parameters: refTypeID - -reference type ID Parameters: fieldName - -name of single field filed ID |
checkFields | protected long[] checkFields(long refTypeID, String checkedFieldNames)(Code) | | Multiple field verification routine.
Parameters: refTypeID - -reference type ID Parameters: checkedFieldNames - -list of field names to be checked list of field IDs |
checkFields | protected long[] checkFields(long refTypeID, String checkedFieldNames, String expectedSignatures, int expectedModifiers)(Code) | | Multiple field verification routine.
Parameters: refTypeID - -reference type ID Parameters: checkedFieldNames - -list of field names to be checked Parameters: expectedSignatures - -list of expected field signatures Parameters: expectedModifiers - -list of expected field modifiers list of field IDs |
checkReplyPacket | protected void checkReplyPacket(ReplyPacket reply, String message, int errorCodeExpected)(Code) | | Helper for checking reply packet error code. Calls junit fail if packet
error code does not equal to expected error code.
Parameters: reply - -returned from debuggee packet Parameters: message - -additional message Parameters: errorCodeExpected - -array of expected error codes |
checkReplyPacket | protected void checkReplyPacket(ReplyPacket reply, String message)(Code) | | Helper for checking reply packet error code. Calls junit fail if packet
error code does not equal NONE.
Parameters: reply - -returned from debuggee packet Parameters: message - -additional message |
checkReplyPacket | protected void checkReplyPacket(ReplyPacket reply, String message, int[] expected)(Code) | | Helper for checking reply packet error code. Calls junit fail if packet
error code does not equal to expected error code.
Parameters: reply - -returned from debuggee packet Parameters: message - -additional message Parameters: expected - -array of expected error codes |
checkReplyPacket | protected boolean checkReplyPacket(ReplyPacket reply, String message, int[] expected, boolean failSign)(Code) | | Helper for checking reply packet error code. If reply packet does not
have unexpected error - returns true. If reply packet has got unexpected
error: If failSign param = true - calls junit fail. Otherwise prints
message about error and returns false.
Parameters: reply - -returned from debuggee packet Parameters: message - -additional message Parameters: expected - -array of expected error codes Parameters: failSign - -defines to call junit fail or not true if unexpected errors are not found, or false otherwise |
checkReplyPacketWithoutFail | protected boolean checkReplyPacketWithoutFail(ReplyPacket reply, String message)(Code) | | Helper for checking reply packet error code. If reply packet does not
have error - returns true. Otherwise does not call junit fail - simply
prints error message and returns false. if packet error code does not
equal NONE.
Parameters: reply - -returned from debuggee packet Parameters: message - -additional message true if error is not found, or false otherwise |
clearEvent | protected void clearEvent(byte eventKind, int requestID, boolean verbose)(Code) | | Removes breakpoint of the given event kind corresponding to the given
request id.
Parameters: eventKind - request event kind Parameters: requestID - request id Parameters: verbose - print or don't extra log info |
closeConnection | public void closeConnection()(Code) | | Closes JDWP connection with debuggee (doesn't terminate debuggee and
doesn't stop synchronize connection).
|
createString | protected long createString(String value)(Code) | | Performs string creation in debuggee.
Parameters: value - -content for new string StringID of new created string |
getClassIDBySignature | protected long getClassIDBySignature(String signature)(Code) | | Returns classID for the selected jni signature
Parameters: signature - classID for the selected jni signature |
getClassSignature | protected String getClassSignature(long classID)(Code) | | Returns jni signature for selected classID
Parameters: classID - jni signature for selected classID |
getLineTable | protected ReplyPacket getLineTable(long classID, long methodID)(Code) | | Issues LineTable command.
Parameters: classID - -class ID Parameters: methodID - -method ID reply packet |
getMethodID | protected long getMethodID(long classID, String methodName)(Code) | | Helper for getting method ID of corresponding class and method name.
Parameters: classID - -class ID Parameters: methodName - -method name method ID |
getMethodName | protected String getMethodName(long classID, long methodID)(Code) | | Helper for getting method name of corresponding class and method ID.
Parameters: classID - class id Parameters: methodID - method id String |
getObjectReferenceType | protected long getObjectReferenceType(long objectID)(Code) | | Helper that returns reference type ID for input object ID.
Parameters: objectID - -debuggee object ID reference type ID |
getObjectSignature | protected String getObjectSignature(long objectID)(Code) | | Helper that returns reference type signature of input object ID.
Parameters: objectID - -debuggee object ID object signature of reference type |
getReferenceTypeID | protected long getReferenceTypeID(String signature)(Code) | | Returns reference type ID.
Parameters: signature - type ID for the selected jni signature |
getStringValue | protected String getStringValue(long stringID)(Code) | | Returns corresponding string from string ID.
Parameters: stringID - -string ID string value |
internalSetUp | protected void internalSetUp() throws Exception(Code) | | Overrides inherited method to launch one debuggee VM, establish JDWP
connection, and wait for VM_START event.
|
internalTearDown | protected void internalTearDown()(Code) | | Overrides inherited method to stop started debuggee VM and close all
connections.
|
openConnection | public void openConnection()(Code) | | Opens JDWP connection with debuggee (doesn't run debuggee and doesn't
establish synchronize connection).
|
printErrorAndFail | protected void printErrorAndFail(String message)(Code) | | Prints error message in log writer and in junit fail.
Parameters: message - -error message |
receiveInitialEvent | protected void receiveInitialEvent()(Code) | | Receives initial VM_INIT event if debuggee is suspended on event.
|
resumeDebuggee | protected void resumeDebuggee()(Code) | | Helper function for resuming debuggee.
|
setStaticIntField | protected boolean setStaticIntField(String classSignature, String fieldName, int newValue)(Code) | | Helper for setting static int field in class with new value.
Parameters: classSignature - -String defining signature of class Parameters: fieldName - -String defining field name in specified class Parameters: newValue - -int value to set for specified field true, if setting is successfully, or false otherwise |
startDebuggeeWrapper | protected void startDebuggeeWrapper()(Code) | | Starts wrapper for debuggee process.
|
|
|