当前位置: 首页>>代码示例>>Java>>正文


Java DeleteCommand类代码示例

本文整理汇总了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);
}    	
  }
 
开发者ID:smartdevicelink,项目名称:sdl_android,代码行数:26,代码来源:DeleteCommandTests.java

示例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());
	
}
 
开发者ID:smartdevicelink,项目名称:sdl_android,代码行数:18,代码来源:RPCRequestFactoryTests.java

示例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;
}
 
开发者ID:smartdevicelink,项目名称:sdl_android,代码行数:8,代码来源:RPCRequestFactory.java

示例4: createMessage

import com.smartdevicelink.proxy.rpc.DeleteCommand; //导入依赖的package包/类
@Override
protected RPCMessage createMessage(){
    DeleteCommand msg = new DeleteCommand();

    msg.setCmdID(Test.GENERAL_INT);

    return msg;
}
 
开发者ID:smartdevicelink,项目名称:sdl_android,代码行数:9,代码来源:DeleteCommandTests.java

示例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;
}
 
开发者ID:smartdevicelink,项目名称:sdl_android,代码行数:13,代码来源:DeleteCommandTests.java


注:本文中的com.smartdevicelink.proxy.rpc.DeleteCommand类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。