本文整理汇总了Java中com.smartdevicelink.proxy.rpc.DeleteCommand类的典型用法代码示例。如果您正苦于以下问题:Java DeleteCommand类的具体用法?Java DeleteCommand怎么用?Java DeleteCommand使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DeleteCommand类属于com.smartdevicelink.proxy.rpc包,在下文中一共展示了DeleteCommand类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testJsonConstructor
import com.smartdevicelink.proxy.rpc.DeleteCommand; //导入依赖的package包/类
/**
* Tests a valid JSON construction of this RPC message.
*/
public void testJsonConstructor () {
JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
assertNotNull(Test.NOT_NULL, commandJson);
try {
Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
DeleteCommand cmd = new DeleteCommand(hash);
JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
assertNotNull(Test.NOT_NULL, body);
// Test everything in the json body.
assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DeleteCommand.KEY_CMD_ID), cmd.getCmdID());
}
catch (JSONException e) {
fail(Test.JSON_FAIL);
}
}
示例2: testBuildDeleteCommand
import com.smartdevicelink.proxy.rpc.DeleteCommand; //导入依赖的package包/类
public void testBuildDeleteCommand () {
Integer testCID, testCorrelationID;
DeleteCommand testDC;
// Test -- buildDeleteCommand(Integer commandID, Integer correlationID)
testCID = 0;
testCorrelationID = 1;
testDC = RPCRequestFactory.buildDeleteCommand(testCID, testCorrelationID);
assertEquals(Test.MATCH, testCID, testDC.getCmdID());
assertEquals(Test.MATCH, testCorrelationID, testDC.getCorrelationID());
testDC = RPCRequestFactory.buildDeleteCommand(null, null);
assertNull(Test.NULL, testDC.getCmdID());
assertNotNull(Test.NOT_NULL, testDC.getCorrelationID());
}
示例3: buildDeleteCommand
import com.smartdevicelink.proxy.rpc.DeleteCommand; //导入依赖的package包/类
public static DeleteCommand buildDeleteCommand(Integer commandID,
Integer correlationID) {
DeleteCommand msg = new DeleteCommand();
msg.setCmdID(commandID);
msg.setCorrelationID(correlationID);
return msg;
}
示例4: createMessage
import com.smartdevicelink.proxy.rpc.DeleteCommand; //导入依赖的package包/类
@Override
protected RPCMessage createMessage(){
DeleteCommand msg = new DeleteCommand();
msg.setCmdID(Test.GENERAL_INT);
return msg;
}
示例5: getExpectedParameters
import com.smartdevicelink.proxy.rpc.DeleteCommand; //导入依赖的package包/类
@Override
protected JSONObject getExpectedParameters(int sdlVersion){
JSONObject result = new JSONObject();
try{
result.put(DeleteCommand.KEY_CMD_ID, Test.GENERAL_INT);
}catch(JSONException e){
fail(Test.JSON_FAIL);
}
return result;
}