本文整理汇总了Java中org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket.getNextValueAsObjectID方法的典型用法代码示例。如果您正苦于以下问题:Java ReplyPacket.getNextValueAsObjectID方法的具体用法?Java ReplyPacket.getNextValueAsObjectID怎么用?Java ReplyPacket.getNextValueAsObjectID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket
的用法示例。
在下文中一共展示了ReplyPacket.getNextValueAsObjectID方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getObjectID
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
private long getObjectID() {
// Compose Instances command to get tested thread objectID
CommandPacket InstancesCommand = new CommandPacket(
JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
JDWPCommands.ReferenceTypeCommandSet.InstancesCommand);
long testThreadTypeID = getClassIDBySignature(testObjSignature);
InstancesCommand.setNextValueAsReferenceTypeID(testThreadTypeID);
InstancesCommand.setNextValueAsInt(1);
ReplyPacket checkedReply = debuggeeWrapper.vmMirror
.performCommand(InstancesCommand);
InstancesCommand = null;
// Get the number of instances that returned.
int objNum = checkedReply.getNextValueAsInt();
// Get the tagged-objectID
byte tag = checkedReply.getNextValueAsByte();
long objectID = checkedReply.getNextValueAsObjectID();
return objectID;
}
示例2: getClassObjectId
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
* Returns the class object corresponding to this type
*
* @param refType
* The reference type ID.
* @return The class object.
*/
public final long getClassObjectId(long refType) {
CommandPacket command = new CommandPacket(
JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
JDWPCommands.ReferenceTypeCommandSet.ClassObjectCommand);
command.setNextValueAsReferenceTypeID(refType);
ReplyPacket reply = checkReply(performCommand(command));
return reply.getNextValueAsObjectID();
}
示例3: testClassLoader001
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
* This testcase exercises ReferenceType.ClassLoader command.
* <BR>The test starts HelloWorld debuggee, requests referenceTypeId
* for it by VirtualMachine.ClassesBySignature command, then
* performs ReferenceType.ClassLoader command and checks that command
* returns reply with some classLoaderID without any ERROR
*/
public void testClassLoader001() {
String thisTestName = "testClassLoader001";
logWriter.println("==> " + thisTestName + " for " + thisCommandName + ": START...");
synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
long refTypeID = getClassIDBySignature(debuggeeSignature);
logWriter.println("=> Debuggee class = " + getDebuggeeClassName());
logWriter.println("=> referenceTypeID for Debuggee class = " + refTypeID);
logWriter.println("=> CHECK1: send " + thisCommandName + " and check reply for ERROR...");
CommandPacket classLoaderCommand = new CommandPacket(
JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
JDWPCommands.ReferenceTypeCommandSet.ClassLoaderCommand);
classLoaderCommand.setNextValueAsReferenceTypeID(refTypeID);
ReplyPacket classLoaderReply = debuggeeWrapper.vmMirror.performCommand(classLoaderCommand);
classLoaderCommand = null;
checkReplyPacket(classLoaderReply, thisCommandName);
long returnedClassLoaderID = classLoaderReply.getNextValueAsObjectID();
logWriter.println("=> CHECK1: PASSED: Returned classLoaderID = " + returnedClassLoaderID);
assertAllDataRead(classLoaderReply);
synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
logWriter.println("==> " + thisTestName + " for " + thisCommandName + ": FINISH");
}
示例4: testInstances_String
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
* It starts InstancesDebuggee class, requests referenceTypeId for String
* class by VirtualMachine.ClassesBySignature command, then performs
* ReferenceType.Instances command and checks that returned reachable String
* objects are expected.
*/
public void testInstances_String() {
String thisTestName = "testInstances_String";
// check capability, relevant for this test
logWriter.println("=> Check capability: canGetInstanceInfo");
debuggeeWrapper.vmMirror.capabilities();
boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canGetInstanceInfo;
if (!isCapability) {
logWriter
.println("##WARNING: this VM dosn't possess capability: canGetInstanceInfo");
return;
}
logWriter.println("==> " + thisTestName + " for " + thisCommandName
+ ": START...");
synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
long stringRefTypeID = getClassIDBySignature(stringSignature);
maxInstances = 10;
logWriter.println("=> CHECK: send " + thisCommandName
+ " and check reply for ERROR...");
CommandPacket InstancesCommand = new CommandPacket(
JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
JDWPCommands.ReferenceTypeCommandSet.InstancesCommand);
InstancesCommand.setNextValueAsReferenceTypeID(stringRefTypeID);
InstancesCommand.setNextValueAsInt(maxInstances);
ReplyPacket checkedReply = debuggeeWrapper.vmMirror
.performCommand(InstancesCommand);
InstancesCommand = null;
checkReplyPacket(checkedReply, thisTestName);
// Get the number of instances that returned.
int reachableInstancesNum = checkedReply.getNextValueAsInt();
for (int i = 0; i < reachableInstancesNum; i++) {
// Get the tagged-objectID
byte tag = checkedReply.getNextValueAsByte();
assertEquals(thisCommandName + "returned String tag is invalid.",
's', tag, null, null);
long objectID = checkedReply.getNextValueAsObjectID();
logWriter.println("=> ObjectID is: " + objectID);
}
logWriter.println("=> CHECK: PASSED: expected instances are returned:");
synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
logWriter.println("==> " + thisTestName + " for " + thisCommandName
+ ": FINISH");
assertAllDataRead(checkedReply);
}
示例5: testInstances_Array
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
* It starts InstancesDebuggee class, requests referenceTypeId for Array
* class by VirtualMachine.ClassesBySignature command, then performs
* ReferenceType.Instances command and checks that returned reachable Array
* objects are expected.
*/
public void testInstances_Array() {
String thisTestName = "testInstances_Array";
// check capability, relevant for this test
logWriter.println("=> Check capability: canGetInstanceInfo");
debuggeeWrapper.vmMirror.capabilities();
boolean isCapability = debuggeeWrapper.vmMirror.targetVMCapabilities.canGetInstanceInfo;
if (!isCapability) {
logWriter
.println("##WARNING: this VM dosn't possess capability: canGetInstanceInfo");
return;
}
logWriter.println("==> " + thisTestName + " for " + thisCommandName
+ ": START...");
synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
long intArrayRefTypeID = getClassIDBySignature(intArraySignature);
maxInstances = 10;
logWriter.println("=> CHECK: send " + thisCommandName
+ " and check reply for ERROR...");
CommandPacket InstancesCommand = new CommandPacket(
JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
JDWPCommands.ReferenceTypeCommandSet.InstancesCommand);
InstancesCommand.setNextValueAsReferenceTypeID(intArrayRefTypeID);
InstancesCommand.setNextValueAsInt(maxInstances);
ReplyPacket checkedReply = debuggeeWrapper.vmMirror
.performCommand(InstancesCommand);
InstancesCommand = null;
checkReplyPacket(checkedReply, thisTestName);
// Get the number of instances that returned.
int reachableInstancesNum = checkedReply.getNextValueAsInt();
for (int i = 0; i < reachableInstancesNum; i++) {
// Get the tagged-objectID
byte tag = checkedReply.getNextValueAsByte();
assertEquals(thisCommandName + "returned Array tag is invalid.",
'[', tag, null, null);
long objectID = checkedReply.getNextValueAsObjectID();
logWriter.println("=> ObjectID is: " + objectID);
}
logWriter.println("=> CHECK: PASSED: expected instances are returned:");
synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
logWriter.println("==> " + thisTestName + " for " + thisCommandName
+ ": FINISH");
assertAllDataRead(checkedReply);
}
示例6: testReferringObjects_IllegalArgument
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; //导入方法依赖的package包/类
/**
* This testcase exercises ObjectReference.ReferringObjects command. <BR>
* Compose a ReferringObjects command with negative maxReferrers
* The vm should throw a ILLEGAL_ARGUMENT exception.
*/
public void testReferringObjects_IllegalArgument() {
String thisTestName = "testReferringObjects_IllegalArgument";
if (!isCapability()) {
logWriter.println("##WARNING: this VM dosn't possess capability: canGetInstanceInfo");
return;
}
int maxReferrers = -1;
logWriter.println("==> " + thisTestName + " for " + thisCommandName + ": START...");
synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
// Compose Instances command to get referree objectID
CommandPacket InstancesCommand = new CommandPacket(
JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
JDWPCommands.ReferenceTypeCommandSet.InstancesCommand);
long referreeObjTypeID = getClassIDBySignature(referreeObjSignature);
InstancesCommand.setNextValueAsReferenceTypeID(referreeObjTypeID);
InstancesCommand.setNextValueAsInt(1);
ReplyPacket checkedReply = debuggeeWrapper.vmMirror.performCommand(InstancesCommand);
InstancesCommand = null;
// Get the number of instances that returned.
int objNum = checkedReply.getNextValueAsInt();
// Get the tagged-objectID
byte tag = checkedReply.getNextValueAsByte();
long objectID = checkedReply.getNextValueAsObjectID();
// Compose ReferringObjects commnad
CommandPacket ReferringObjectsCommand = new CommandPacket(
JDWPCommands.ObjectReferenceCommandSet.CommandSetID,
JDWPCommands.ObjectReferenceCommandSet.ReferringObjectsCommand);
ReferringObjectsCommand.setNextValueAsObjectID(objectID);
ReferringObjectsCommand.setNextValueAsInt(maxReferrers);
// Perform ReferringObjects command and attain reply package
checkedReply = debuggeeWrapper.vmMirror
.performCommand(ReferringObjectsCommand);
ReferringObjectsCommand = null;
short errorCode = checkedReply.getErrorCode();
if (errorCode != JDWPConstants.Error.NONE) {
if (errorCode == JDWPConstants.Error.NOT_IMPLEMENTED) {
logWriter.println("=> CHECK PASSED: Expected error (NOT_IMPLEMENTED) is returned");
return;
}
else if(errorCode == JDWPConstants.Error.ILLEGAL_ARGUMENT) {
logWriter.println("=> CHECK PASSED: Expected error (ILLEGAL_ARGUMENT) is returned");
return;
}
}
printErrorAndFail(thisCommandName + " should throw ILLEGAL_ARGUMENT exception when maxReferrers is negative.");
}