本文整理匯總了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());
}