本文整理汇总了Java中com.smartdevicelink.proxy.rpc.SetDisplayLayout类的典型用法代码示例。如果您正苦于以下问题:Java SetDisplayLayout类的具体用法?Java SetDisplayLayout怎么用?Java SetDisplayLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SetDisplayLayout类属于com.smartdevicelink.proxy.rpc包,在下文中一共展示了SetDisplayLayout类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testJsonConstructor
import com.smartdevicelink.proxy.rpc.SetDisplayLayout; //导入依赖的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);
SetDisplayLayout cmd = new SetDisplayLayout(hash);
JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
assertNotNull(Test.MATCH, 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.readStringFromJsonObject(parameters, SetDisplayLayout.KEY_DISPLAY_LAYOUT), cmd.getDisplayLayout());
} catch (JSONException e) {
fail(Test.JSON_FAIL);
}
}
示例2: BuildSetDisplayLayout
import com.smartdevicelink.proxy.rpc.SetDisplayLayout; //导入依赖的package包/类
public static SetDisplayLayout BuildSetDisplayLayout(String displayLayout, Integer correlationID)
{
SetDisplayLayout msg = new SetDisplayLayout();
msg.setCorrelationID(correlationID);
msg.setDisplayLayout(displayLayout);
return msg;
}
示例3: createMessage
import com.smartdevicelink.proxy.rpc.SetDisplayLayout; //导入依赖的package包/类
@Override
protected RPCMessage createMessage() {
SetDisplayLayout msg = new SetDisplayLayout();
msg.setDisplayLayout(Test.GENERAL_STRING);
return msg;
}
示例4: getExpectedParameters
import com.smartdevicelink.proxy.rpc.SetDisplayLayout; //导入依赖的package包/类
@Override
protected JSONObject getExpectedParameters(int sdlVersion) {
JSONObject result = new JSONObject();
try {
result.put(SetDisplayLayout.KEY_DISPLAY_LAYOUT, Test.GENERAL_STRING);
} catch (JSONException e) {
fail(Test.JSON_FAIL);
}
return result;
}
示例5: testBuildSetDisplayLayout
import com.smartdevicelink.proxy.rpc.SetDisplayLayout; //导入依赖的package包/类
public void testBuildSetDisplayLayout () {
String testDL = "layout";
Integer testCorrelationID = 0;
SetDisplayLayout testSDL;
// Test -- BuildSetDisplayLayout(String displayLayout, Integer correlationID)
testSDL = RPCRequestFactory.BuildSetDisplayLayout(testDL, testCorrelationID);
assertEquals(Test.MATCH, testDL, testSDL.getDisplayLayout());
assertEquals(Test.MATCH, testCorrelationID, testSDL.getCorrelationID());
testSDL = RPCRequestFactory.BuildSetDisplayLayout(null, null);
assertNull(Test.NULL, testSDL.getDisplayLayout());
assertNotNull(Test.NOT_NULL, testSDL.getCorrelationID());
}