diff options
Diffstat (limited to 'android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java')
-rw-r--r-- | android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java index f3a0bd310..f37ed358b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java @@ -20,38 +20,38 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertNotNull; /** - * This is a unit test class for the SmartDeviceLink library project class : + * This is a unit test class for the SmartDeviceLink library project class : * {@link com.smartdevicelink.proxy.rpc.PerformAudioPassThruResponse} */ public class PerformAudioPassThruResponseTest extends BaseRpcTests { - @Override - protected RPCMessage createMessage(){ + @Override + protected RPCMessage createMessage() { return new PerformAudioPassThruResponse(); } @Override - protected String getMessageType(){ + protected String getMessageType() { return RPCMessage.KEY_RESPONSE; } @Override - protected String getCommandType(){ + protected String getCommandType() { return FunctionID.PERFORM_AUDIO_PASS_THRU.toString(); } @Override - protected JSONObject getExpectedParameters(int sdlVersion){ + protected JSONObject getExpectedParameters(int sdlVersion) { return new JSONObject(); } - + /** - * Tests the expected values of the RPC message. - */ + * Tests the expected values of the RPC message. + */ @Test - public void testRpcValues () { - // Invalid/Null Tests - PerformAudioPassThruResponse msg = new PerformAudioPassThruResponse(); + public void testRpcValues() { + // Invalid/Null Tests + PerformAudioPassThruResponse msg = new PerformAudioPassThruResponse(); assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -60,22 +60,22 @@ public class PerformAudioPassThruResponseTest extends BaseRpcTests { * Tests a valid JSON construction of this RPC message. */ @Test - public void testJsonConstructor () { - JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); - assertNotNull(TestValues.NOT_NULL, commandJson); - - try { - Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); - PerformAudioPassThruResponse cmd = new PerformAudioPassThruResponse(hash); - - JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(TestValues.NOT_NULL, body); - - // Test everything in the json body. - assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); - assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); - } catch (JSONException e) { - e.printStackTrace(); - } + public void testJsonConstructor() { + JSONObject commandJson = JsonFileReader.readId(getInstrumentation().getContext(), getCommandType(), getMessageType()); + assertNotNull(TestValues.NOT_NULL, commandJson); + + try { + Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); + PerformAudioPassThruResponse cmd = new PerformAudioPassThruResponse(hash); + + JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); + assertNotNull(TestValues.NOT_NULL, body); + + // Test everything in the json body. + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); + } catch (JSONException e) { + e.printStackTrace(); + } } }
\ No newline at end of file |