本文整理汇总了Java中org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket.getNextValueAsBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java ReplyPacket.getNextValueAsBoolean方法的具体用法?Java ReplyPacket.getNextValueAsBoolean怎么用?Java ReplyPacket.getNextValueAsBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket
的用法示例。
在下文中一共展示了ReplyPacket.getNextValueAsBoolean方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testIsObsoleteTest001
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
* This testcase exercises Method.IsObsolete command.
* <BR>It runs MethodDebuggee, receives checked method,
* which is not obsolete, and checks it with Method.IsObsolete command.
*/
public void testIsObsoleteTest001() throws UnsupportedEncodingException {
logWriter.println("testObsoleteTest001 started");
//check capability, relevant for this test
logWriter.println("=> Check, can VM redefine classes");
debuggeeWrapper.vmMirror.capabilities();
boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canRedefineClasses;
if (!isCapability) {
logWriter.println("##WARNING: this VM can't redefine classes");
return;
}
synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
long classID = getClassIDBySignature("L"+getDebuggeeClassName().replace('.', '/')+";");
MethodInfo[] methodsInfo = jdwpGetMethodsInfo(classID);
assertFalse("Invalid number of methods", methodsInfo.length == 0);
for (int i = 0; i < methodsInfo.length; i++) {
logWriter.println(methodsInfo[i].toString());
// get variable table for this class
CommandPacket packet = new CommandPacket(
JDWPCommands.MethodCommandSet.CommandSetID,
JDWPCommands.MethodCommandSet.IsObsoleteCommand);
packet.setNextValueAsClassID(classID);
packet.setNextValueAsMethodID(methodsInfo[i].getMethodID());
ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
checkReplyPacket(reply, "Method::IsObsolete command");
boolean isObsolete = reply.getNextValueAsBoolean();
logWriter.println("isObsolete=" + isObsolete);
}
synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
}
示例2: testCapabilitiesNew001
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
* This testcase exercises VirtualMachine.CapabilitiesNew command.
* <BR>At first the test starts HelloWorld debuggee.
* <BR> Then the test performs VirtualMachine.CapabilitiesNew command and checks that:
* all returned capabilities' values are expected values and that
* there are no extra data in the reply packet;
*/
public void testCapabilitiesNew001() {
synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
CommandPacket packet = new CommandPacket(
JDWPCommands.VirtualMachineCommandSet.CommandSetID,
JDWPCommands.VirtualMachineCommandSet.CapabilitiesNewCommand);
logWriter.println("\trequest capabilities");
ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
checkReplyPacket(reply, "VirtualMachine::CapabilitiesNew command");
boolean flag;
boolean testFailed = false;
for (int i = 0; i < 32; i++) {
flag = reply.getNextValueAsBoolean();
logWriter.println("\tReceived " + capabilitiesFlags[i][0] + " = "
+ flag);
if ( (capabilitiesFlags[i][1] != null) != flag ) {
testFailed = true;
logWriter.println("\t ## FAILURE: Expected " + capabilitiesFlags[i][0] +
" = " + (capabilitiesFlags[i][1] != null));
} else {
logWriter.println("\t OK - it is expected value!");
}
}
if ( testFailed ) {
printErrorAndFail("Unexpected received capabilities values found out");
} else {
logWriter.println("testCapabilitiesNew001 - OK!");
}
assertAllDataRead(reply);
synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
}
示例3: capabilities
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
* Requests debuggee VM capabilities. Function parses reply packet of
* VirtualMachine::CapabilitiesNew command, creates and fills class
* Capabilities with returned info.
*
* @return ReplyPacket useless, already parsed reply packet.
*/
public ReplyPacket capabilities() {
// Create new command packet
CommandPacket commandPacket = new CommandPacket();
// Set command. "17" - is ID of CapabilitiesNew command in
// VirtualMachine Command Set
commandPacket
.setCommand(JDWPCommands.VirtualMachineCommandSet.CapabilitiesNewCommand);
// Set command set. "1" - is ID of VirtualMachine Command Set
commandPacket
.setCommandSet(JDWPCommands.VirtualMachineCommandSet.CommandSetID);
// Send packet
ReplyPacket replyPacket = checkReply(performCommand(commandPacket));
targetVMCapabilities = new Capabilities();
// Set capabilities
targetVMCapabilities.canWatchFieldModification = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canWatchFieldAccess = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canGetBytecodes = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canGetSyntheticAttribute = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canGetOwnedMonitorInfo = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canGetCurrentContendedMonitor = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canGetMonitorInfo = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canRedefineClasses = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canAddMethod = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.canUnrestrictedlyRedefineClasses = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canPopFrames = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.canUseInstanceFilters = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canGetSourceDebugExtension = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canRequestVMDeathEvent = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canSetDefaultStratum = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canGetInstanceInfo = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.reserved17 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.canGetMonitorFrameInfo = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canUseSourceNameFilters = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.canGetConstantPool = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canForceEarlyReturn = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.reserved22 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved23 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved24 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved25 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved26 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved27 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved28 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved29 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved30 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved31 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved32 = replyPacket.getNextValueAsBoolean();
return replyPacket;
}
示例4: testCapabilities001
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
* This testcase exercises VirtualMachine.Capabilities command.
* <BR>At first the test starts HelloWorld debuggee.
* <BR> Then the test performs VirtualMachine.Capabilities command and checks that:
* all returned capabilities' values are expected values and that
* there are no extra data in the reply packet;
*/
public void testCapabilities001() {
synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
CommandPacket packet = new CommandPacket(
JDWPCommands.VirtualMachineCommandSet.CommandSetID,
JDWPCommands.VirtualMachineCommandSet.CapabilitiesCommand);
logWriter.println("\trequest capabilities");
ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
checkReplyPacket(reply, "VirtualMachine::Capabilities command");
boolean canWatchFieldModification = reply.getNextValueAsBoolean();
boolean canWatchFieldAccess = reply.getNextValueAsBoolean();
boolean canGetBytecodes = reply.getNextValueAsBoolean();
boolean canGetSyntheticAttribute = reply.getNextValueAsBoolean();
boolean canGetOwnedMonitorInfo = reply.getNextValueAsBoolean();
boolean canGetCurrentContendedMonitor = reply.getNextValueAsBoolean();
boolean canGetMonitorInfo = reply.getNextValueAsBoolean();
logWriter.println("\tcanWatchFieldModification\t= "
+ canWatchFieldModification);
assertTrue("canWatchFieldModification must be true", canWatchFieldModification);
logWriter.println("\tcanWatchFieldAccess\t\t= " + canWatchFieldAccess);
assertTrue("canWatchFieldAccess must be true", canWatchFieldAccess);
logWriter.println("\tcanGetBytecodes\t\t\t= " + canGetBytecodes);
assertTrue("canGetBytecodes must be true", canGetBytecodes);
logWriter.println("\tcanGetSyntheticAttribute\t= "
+ canGetSyntheticAttribute);
assertTrue("canGetSyntheticAttribute must be true", canGetSyntheticAttribute);
logWriter.println("\tcanGetOwnedMonitorInfo\t\t= "
+ canGetOwnedMonitorInfo);
assertTrue("canGetOwnedMonitorInfo must be true", canGetOwnedMonitorInfo);
logWriter.println("\tcanGetCurrentContendedMonitor\t= "
+ canGetCurrentContendedMonitor);
assertTrue("canGetCurrentContendedMonitor must be true", canGetCurrentContendedMonitor);
logWriter.println("\tcanGetMonitorInfo\t\t= " + canGetMonitorInfo);
assertTrue("canGetMonitorInfo must be true", canGetMonitorInfo);
assertAllDataRead(reply);
synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
}