diff options
author | RHenigan <heniganr1@gmail.com> | 2020-06-16 11:23:11 -0400 |
---|---|---|
committer | RHenigan <heniganr1@gmail.com> | 2020-06-16 11:23:11 -0400 |
commit | c5649735fdcae9600305e1c61613c8f1a86ac02e (patch) | |
tree | f44fdba259471919345e472d07ff8acf0ade07e9 /android | |
parent | 31e11389efd0410279b4107d2df27c5d9642a8a3 (diff) | |
download | sdl_android-c5649735fdcae9600305e1c61613c8f1a86ac02e.tar.gz |
Refactor sdl Test file to not shadow junit import
Diffstat (limited to 'android')
312 files changed, 7481 insertions, 7472 deletions
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java index 9a24ba5f1..118ea1e9b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java @@ -20,11 +20,12 @@ import com.smartdevicelink.proxy.rpc.enums.Language; import com.smartdevicelink.proxy.rpc.enums.Result; import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener; import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.transport.BaseTransportConfig; import com.smartdevicelink.transport.TCPTransportConfig; import org.junit.Before; +import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; @@ -76,11 +77,11 @@ public class SdlManagerTests { // Color Scheme templateColorScheme = new TemplateColorScheme(); - templateColorScheme.setBackgroundColor(Test.GENERAL_RGBCOLOR); - templateColorScheme.setPrimaryColor(Test.GENERAL_RGBCOLOR); - templateColorScheme.setSecondaryColor(Test.GENERAL_RGBCOLOR); + templateColorScheme.setBackgroundColor(TestValues.GENERAL_RGBCOLOR); + templateColorScheme.setPrimaryColor(TestValues.GENERAL_RGBCOLOR); + templateColorScheme.setSecondaryColor(TestValues.GENERAL_RGBCOLOR); - sdlManager = createSampleManager("heyApp", "123456", Test.GENERAL_LOCKSCREENCONFIG); + sdlManager = createSampleManager("heyApp", "123456", TestValues.GENERAL_LOCKSCREENCONFIG); } // SETUP / HELPERS @@ -127,11 +128,11 @@ public class SdlManagerTests { builder.setLanguage(Language.EN_US); builder.setDayColorScheme(templateColorScheme); builder.setNightColorScheme(templateColorScheme); - builder.setVrSynonyms(Test.GENERAL_VECTOR_STRING); - builder.setTtsName(Test.GENERAL_VECTOR_TTS_CHUNKS); + builder.setVrSynonyms(TestValues.GENERAL_VECTOR_STRING); + builder.setTtsName(TestValues.GENERAL_VECTOR_TTS_CHUNKS); builder.setLockScreenConfig(lockScreenConfig); - builder.setMinimumProtocolVersion(Test.GENERAL_VERSION); - builder.setMinimumRPCVersion(Test.GENERAL_VERSION); + builder.setMinimumProtocolVersion(TestValues.GENERAL_VERSION); + builder.setMinimumRPCVersion(TestValues.GENERAL_VERSION); builder.setContext(mTestContext); manager = builder.build(); @@ -144,30 +145,30 @@ public class SdlManagerTests { // TESTS - @org.junit.Test + @Test public void testNotNull(){ - assertNotNull(createSampleManager("app","123456", Test.GENERAL_LOCKSCREENCONFIG)); + assertNotNull(createSampleManager("app","123456", TestValues.GENERAL_LOCKSCREENCONFIG)); } - @org.junit.Test + @Test public void testMissingAppName() { try { - createSampleManager(null,"123456", Test.GENERAL_LOCKSCREENCONFIG); + createSampleManager(null,"123456", TestValues.GENERAL_LOCKSCREENCONFIG); } catch (IllegalArgumentException ex) { assertSame(ex.getMessage(), "You must specify an app name by calling setAppName"); } } - @org.junit.Test + @Test public void testMissingAppId() { try { - createSampleManager("app",null, Test.GENERAL_LOCKSCREENCONFIG); + createSampleManager("app",null, TestValues.GENERAL_LOCKSCREENCONFIG); } catch (IllegalArgumentException ex) { assertSame(ex.getMessage(), "You must specify an app ID by calling setAppId"); } } - @org.junit.Test + @Test public void testManagerSetters() { assertEquals("123456", sdlManager.getAppId()); assertEquals("heyApp", sdlManager.getAppName()); @@ -178,14 +179,14 @@ public class SdlManagerTests { assertEquals(transport, sdlManager.getTransport()); assertEquals(templateColorScheme, sdlManager.getDayColorScheme()); assertEquals(templateColorScheme, sdlManager.getNightColorScheme()); - assertEquals(Test.GENERAL_VECTOR_STRING, sdlManager.getVrSynonyms()); - assertEquals(Test.GENERAL_VECTOR_TTS_CHUNKS, sdlManager.getTtsChunks()); - assertEquals(Test.GENERAL_LOCKSCREENCONFIG, sdlManager.getLockScreenConfig()); - assertEquals(Test.GENERAL_VERSION, sdlManager.getMinimumProtocolVersion()); - assertEquals(Test.GENERAL_VERSION, sdlManager.getMinimumRPCVersion()); + assertEquals(TestValues.GENERAL_VECTOR_STRING, sdlManager.getVrSynonyms()); + assertEquals(TestValues.GENERAL_VECTOR_TTS_CHUNKS, sdlManager.getTtsChunks()); + assertEquals(TestValues.GENERAL_LOCKSCREENCONFIG, sdlManager.getLockScreenConfig()); + assertEquals(TestValues.GENERAL_VERSION, sdlManager.getMinimumProtocolVersion()); + assertEquals(TestValues.GENERAL_VERSION, sdlManager.getMinimumRPCVersion()); } - @org.junit.Test + @Test public void testStartingManager(){ listenerCalledCounter = 0; @@ -208,7 +209,7 @@ public class SdlManagerTests { assertEquals("Listener was not called or called more/less frequently than expected", 1, listenerCalledCounter); } - @org.junit.Test + @Test public void testManagerStates() { SdlManager sdlManager = createSampleManager("test", "00000", new LockScreenConfig()); sdlManager.initialize(); @@ -319,7 +320,7 @@ public class SdlManagerTests { assertEquals(BaseSubManager.SHUTDOWN, sdlManager.getState()); } - @org.junit.Test + @Test public void testSendRPC(){ listenerCalledCounter = 0; @@ -355,12 +356,12 @@ public class SdlManagerTests { assertEquals("Listener was not called or called more/less frequently than expected", 1, listenerCalledCounter); } - @org.junit.Test + @Test public void testSendRPCs(){ testSendMultipleRPCs(false); } - @org.junit.Test + @Test public void testSendSequentialRPCs(){ testSendMultipleRPCs(true); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java index a5e1620f8..9c909ddcd 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java @@ -21,9 +21,10 @@ import com.smartdevicelink.proxy.rpc.enums.FileType; import com.smartdevicelink.proxy.rpc.enums.Result; import com.smartdevicelink.proxy.rpc.enums.StaticIconName; import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.junit.Before; +import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; @@ -59,8 +60,8 @@ public class FileManagerTests { public void setUp() throws Exception{ mTestContext = getContext(); validFile = new SdlFile(); - validFile.setName(Test.GENERAL_STRING); - validFile.setFileData(Test.GENERAL_BYTE_ARRAY); + validFile.setName(TestValues.GENERAL_STRING); + validFile.setFileData(TestValues.GENERAL_BYTE_ARRAY); validFile.setPersistent(false); } @@ -129,8 +130,8 @@ public class FileManagerTests { if(message instanceof ListFiles){ int correlationId = message.getCorrelationID(); ListFilesResponse listFilesResponse = new ListFilesResponse(); - listFilesResponse.setFilenames(Test.GENERAL_STRING_LIST); - listFilesResponse.setSpaceAvailable(Test.GENERAL_INT); + listFilesResponse.setFilenames(TestValues.GENERAL_STRING_LIST); + listFilesResponse.setSpaceAvailable(TestValues.GENERAL_INT); listFilesResponse.setSuccess(true); message.getOnRPCResponseListener().onResponse(correlationId, listFilesResponse); } @@ -147,7 +148,7 @@ public class FileManagerTests { int correlationId = message.getCorrelationID(); PutFileResponse putFileResponse = new PutFileResponse(); putFileResponse.setSuccess(true); - putFileResponse.setSpaceAvailable(Test.GENERAL_INT); + putFileResponse.setSpaceAvailable(TestValues.GENERAL_INT); message.getOnRPCResponseListener().onResponse(correlationId, putFileResponse); } return null; @@ -244,7 +245,7 @@ public class FileManagerTests { /** * Test deleting list of files, success */ - @org.junit.Test + @Test public void testDeleteRemoteFilesWithNamesSuccess(){ final ISdl internalInterface = mock(ISdl.class); @@ -276,7 +277,7 @@ public class FileManagerTests { /** * Test deleting list of files, fail */ - @org.junit.Test + @Test public void testDeleteRemoteFilesWithNamesFail(){ final ISdl internalInterface = mock(ISdl.class); @@ -308,7 +309,7 @@ public class FileManagerTests { /** * Test reUploading failed file */ - @org.junit.Test + @Test public void testFileUploadRetry(){ final ISdl internalInterface = mock(ISdl.class); @@ -340,7 +341,7 @@ public class FileManagerTests { /** * Test reUploading failed Artwork */ - @org.junit.Test + @Test public void testArtworkUploadRetry(){ final ISdl internalInterface = mock(ISdl.class); @@ -348,14 +349,14 @@ public class FileManagerTests { doAnswer(onPutFileFailureOnError).when(internalInterface).sendRPC(any(PutFile.class)); final SdlFile validFile2 = new SdlFile(); - validFile2.setName(Test.GENERAL_STRING + "2"); - validFile2.setFileData(Test.GENERAL_BYTE_ARRAY); + validFile2.setName(TestValues.GENERAL_STRING + "2"); + validFile2.setFileData(TestValues.GENERAL_BYTE_ARRAY); validFile2.setPersistent(false); validFile2.setType(FileType.GRAPHIC_PNG); final SdlFile validFile3 = new SdlFile(); - validFile3.setName(Test.GENERAL_STRING + "3"); - validFile3.setFileData(Test.GENERAL_BYTE_ARRAY); + validFile3.setName(TestValues.GENERAL_STRING + "3"); + validFile3.setFileData(TestValues.GENERAL_BYTE_ARRAY); validFile3.setPersistent(false); validFile3.setType(FileType.GRAPHIC_BMP); @@ -399,7 +400,7 @@ public class FileManagerTests { /** * Test retry uploading failed list of files */ - @org.junit.Test + @Test public void testListFilesUploadRetry(){ final ISdl internalInterface = mock(ISdl.class); @@ -407,8 +408,8 @@ public class FileManagerTests { doAnswer(onSendRequestsFailOnError).when(internalInterface).sendRequests(any(List.class), any(OnMultipleRequestListener.class)); SdlFile validFile2 = new SdlFile(); - validFile2.setName(Test.GENERAL_STRING + "2"); - validFile2.setFileData(Test.GENERAL_BYTE_ARRAY); + validFile2.setName(TestValues.GENERAL_STRING + "2"); + validFile2.setFileData(TestValues.GENERAL_BYTE_ARRAY); validFile2.setPersistent(false); validFile2.setType(FileType.GRAPHIC_JPEG); @@ -441,7 +442,7 @@ public class FileManagerTests { /** * Testing the initialization of FileManager */ - @org.junit.Test + @Test public void testInitializationSuccess() { ISdl internalInterface = mock(ISdl.class); @@ -454,8 +455,8 @@ public class FileManagerTests { public void onComplete(boolean success) { assertTrue(success); assertEquals(fileManager.getState(), BaseSubManager.READY); - assertEquals(fileManager.getRemoteFileNames(), Test.GENERAL_STRING_LIST); - assertEquals(Test.GENERAL_INT, fileManager.getBytesAvailable()); + assertEquals(fileManager.getRemoteFileNames(), TestValues.GENERAL_STRING_LIST); + assertEquals(TestValues.GENERAL_INT, fileManager.getBytesAvailable()); } }); } @@ -463,7 +464,7 @@ public class FileManagerTests { /** * Test file upload, success */ - @org.junit.Test + @Test public void testFileUploadSuccess() { ISdl internalInterface = mock(ISdl.class); @@ -487,13 +488,13 @@ public class FileManagerTests { }); assertTrue(fileManager.getRemoteFileNames().contains(validFile.getName())); assertTrue(fileManager.hasUploadedFile(validFile)); - assertEquals(Test.GENERAL_INT, fileManager.getBytesAvailable()); + assertEquals(TestValues.GENERAL_INT, fileManager.getBytesAvailable()); } /** * Testing failed file upload. */ - @org.junit.Test + @Test public void testFileUploadFailure() { ISdl internalInterface = mock(ISdl.class); @@ -521,7 +522,7 @@ public class FileManagerTests { /** * Testing uploadFile for a staticIcon, verifying that it doesn't actually upload. */ - @org.junit.Test + @Test public void testFileUploadForStaticIcon() { ISdl internalInterface = mock(ISdl.class); @@ -548,7 +549,7 @@ public class FileManagerTests { /** * Testing uploadFiles for staticIcons, verifying that it doesn't actually upload. */ - @org.junit.Test + @Test public void testMultipleFileUploadsForStaticIcon() { ISdl internalInterface = mock(ISdl.class); @@ -580,7 +581,7 @@ public class FileManagerTests { /** * Testing uploadFiles for static icons and nonStatic icons in the same list. */ - @org.junit.Test + @Test public void testMultipleFileUploadsForPartialStaticIcon() { ISdl internalInterface = mock(ISdl.class); @@ -613,7 +614,7 @@ public class FileManagerTests { /** * Test to make sure you cannot upload an SdlFile with invalid data */ - @org.junit.Test + @Test public void testInvalidSdlFileInput() { ISdl internalInterface = mock(ISdl.class); @@ -627,22 +628,22 @@ public class FileManagerTests { assertTrue(success); SdlFile sdlFile = new SdlFile(); // Don't set name - sdlFile.setFileData(Test.GENERAL_BYTE_ARRAY); + sdlFile.setFileData(TestValues.GENERAL_BYTE_ARRAY); checkForUploadFailure(fileManager, sdlFile); sdlFile = new SdlFile(); - sdlFile.setName(Test.GENERAL_STRING); + sdlFile.setName(TestValues.GENERAL_STRING); // Don't set data checkForUploadFailure(fileManager, sdlFile); sdlFile = new SdlFile(); - sdlFile.setName(Test.GENERAL_STRING); + sdlFile.setName(TestValues.GENERAL_STRING); // Give an invalid resource ID - sdlFile.setResourceId(Test.GENERAL_INT); + sdlFile.setResourceId(TestValues.GENERAL_INT); checkForUploadFailure(fileManager, sdlFile); sdlFile = new SdlFile(); - sdlFile.setName(Test.GENERAL_STRING); + sdlFile.setName(TestValues.GENERAL_STRING); // Set invalid Uri Uri testUri = Uri.parse("http://www.google.com"); sdlFile.setUri(testUri); @@ -676,7 +677,7 @@ public class FileManagerTests { * Test Invalid SdlArtWork FileTypes * SdlArtwork FileTypes can only be: GRAPHIC_BMP, GRAPHIC_PNG or GRAPHIC_JPEG */ - @org.junit.Test + @Test public void testInvalidSdlArtworkInput(){ SdlArtwork sdlArtwork = new SdlArtwork(); // Set invalid type @@ -698,7 +699,7 @@ public class FileManagerTests { /** * Test Multiple File Uploads, success */ - @org.junit.Test + @Test public void testMultipleFileUpload() { ISdl internalInterface = mock(ISdl.class); @@ -716,8 +717,8 @@ public class FileManagerTests { filesToUpload.add(validFile); SdlFile validFile2 = new SdlFile(); - validFile2.setName(Test.GENERAL_STRING + "2"); - validFile2.setFileData(Test.GENERAL_BYTE_ARRAY); + validFile2.setName(TestValues.GENERAL_STRING + "2"); + validFile2.setFileData(TestValues.GENERAL_BYTE_ARRAY); validFile2.setPersistent(false); validFile2.setType(FileType.GRAPHIC_JPEG); filesToUpload.add(validFile2); @@ -735,7 +736,7 @@ public class FileManagerTests { /** * Testing uploading multiple files with some failing. */ - @org.junit.Test + @Test public void testMultipleFileUploadPartialFailure() { ISdl internalInterface = mock(ISdl.class); @@ -743,14 +744,14 @@ public class FileManagerTests { doAnswer(onSendRequestsFailPartialOnError).when(internalInterface).sendRequests(any(List.class), any(OnMultipleRequestListener.class)); SdlFile validFile2 = new SdlFile(); - validFile2.setName(Test.GENERAL_STRING + "2"); - validFile2.setFileData(Test.GENERAL_BYTE_ARRAY); + validFile2.setName(TestValues.GENERAL_STRING + "2"); + validFile2.setFileData(TestValues.GENERAL_BYTE_ARRAY); validFile2.setPersistent(false); validFile2.setType(FileType.GRAPHIC_JPEG); SdlFile validFile3 = new SdlFile(); - validFile3.setName(Test.GENERAL_STRING + "3"); - validFile3.setFileData(Test.GENERAL_BYTE_ARRAY); + validFile3.setName(TestValues.GENERAL_STRING + "3"); + validFile3.setFileData(TestValues.GENERAL_BYTE_ARRAY); validFile3.setPersistent(false); validFile3.setType(FileType.GRAPHIC_JPEG); @@ -784,7 +785,7 @@ public class FileManagerTests { /** * Testing uploading multiple SdlArtwork files. */ - @org.junit.Test + @Test public void testMultipleArtworkUploadSuccess(){ ISdl internalInterface = mock(ISdl.class); @@ -831,14 +832,14 @@ public class FileManagerTests { /** * Testing uploading persistent SdlFile */ - @org.junit.Test + @Test public void testPersistentFileUploaded(){ ISdl internalInterface = mock(ISdl.class); doAnswer(onListFilesSuccess).when(internalInterface).sendRPC(any(ListFiles.class)); final SdlFile file = new SdlFile(); - file.setName(Test.GENERAL_STRING_LIST.get(0)); + file.setName(TestValues.GENERAL_STRING_LIST.get(0)); file.setPersistent(true); FileManagerConfig fileManagerConfig = new FileManagerConfig(); @@ -854,7 +855,7 @@ public class FileManagerTests { /** * Test FileManagerConfig */ - @org.junit.Test + @Test public void testFileManagerConfig() { FileManagerConfig fileManagerConfig = new FileManagerConfig(); fileManagerConfig.setFileRetryCount(2); @@ -867,7 +868,7 @@ public class FileManagerTests { * Tests overwrite property for uploading a file. * Checks to make sure file does not overwrite itself if overwrite property is set to false */ - @org.junit.Test + @Test public void testOverwriteFileProperty() { ISdl internalInterface = mock(ISdl.class); @@ -904,7 +905,7 @@ public class FileManagerTests { * Tests overwrite property for uploading a list of files. * Checks to make sure files do not overwrite themselves if overwrite property is set to false. */ - @org.junit.Test + @Test public void testOverWriteFilePropertyListFiles() { final ISdl internalInterface = mock(ISdl.class); @@ -912,8 +913,8 @@ public class FileManagerTests { doAnswer(onListFileUploadSuccess).when(internalInterface).sendRequests(any(List.class), any(OnMultipleRequestListener.class)); final SdlFile validFile2 = new SdlFile(); - validFile2.setName(Test.GENERAL_STRING + "2"); - validFile2.setFileData(Test.GENERAL_BYTE_ARRAY); + validFile2.setName(TestValues.GENERAL_STRING + "2"); + validFile2.setFileData(TestValues.GENERAL_BYTE_ARRAY); validFile2.setPersistent(false); validFile2.setType(FileType.GRAPHIC_JPEG); @@ -951,7 +952,7 @@ public class FileManagerTests { /** * Test custom overridden SdlFile equals method */ - @org.junit.Test + @Test public void testSdlFileEquals() { // Case 1: object is null, assertFalse SdlFile artwork1 = new SdlFile("image1", FileType.GRAPHIC_PNG, 1, true); @@ -990,7 +991,7 @@ public class FileManagerTests { artwork1 = new SdlFile("image1", FileType.GRAPHIC_PNG, 1, false); artwork2 = new SdlFile("image1", FileType.GRAPHIC_PNG, 1, false); byte[] GENERAL_BYTE_ARRAY2 = new byte[2]; - artwork1.setFileData(Test.GENERAL_BYTE_ARRAY); + artwork1.setFileData(TestValues.GENERAL_BYTE_ARRAY); artwork2.setFileData(GENERAL_BYTE_ARRAY2); assertFalse(artwork1.equals(artwork2)); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlArtworkTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlArtworkTests.java index 0f3154c84..5b179e8ef 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlArtworkTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlArtworkTests.java @@ -4,8 +4,9 @@ import android.support.test.runner.AndroidJUnit4; import com.smartdevicelink.managers.file.filetypes.SdlArtwork; import com.smartdevicelink.proxy.rpc.enums.StaticIconName; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; +import org.junit.Test; import org.junit.runner.RunWith; import static junit.framework.TestCase.assertEquals; @@ -16,9 +17,9 @@ import static junit.framework.TestCase.assertTrue; @RunWith(AndroidJUnit4.class) public class SdlArtworkTests { - @org.junit.Test + @Test public void testClone(){ - SdlArtwork original = Test.GENERAL_ARTWORK; + SdlArtwork original = TestValues.GENERAL_ARTWORK; SdlArtwork clone = original.clone(); equalTest(original, clone); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlFileTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlFileTests.java index 58b3e4af5..bdb47aec1 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlFileTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlFileTests.java @@ -34,8 +34,9 @@ package com.smartdevicelink.managers.file.filetypes; import android.support.test.runner.AndroidJUnit4; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; +import org.junit.Test; import org.junit.runner.RunWith; import static junit.framework.TestCase.assertEquals; @@ -43,104 +44,104 @@ import static junit.framework.TestCase.assertEquals; @RunWith(AndroidJUnit4.class) public class SdlFileTests { - @org.junit.Test + @Test public void testConstructorWithNoParams() { SdlFile sdlFile; // Case 1 (Setting data) sdlFile = new SdlFile(); - sdlFile.setFileData(Test.GENERAL_BYTE_ARRAY); - assertEquals(sdlFile.getFileData(), Test.GENERAL_BYTE_ARRAY); + sdlFile.setFileData(TestValues.GENERAL_BYTE_ARRAY); + assertEquals(sdlFile.getFileData(), TestValues.GENERAL_BYTE_ARRAY); sdlFile.setName(null); assertEquals(sdlFile.getName(), "e9800998ecf8427e"); - sdlFile.setName(Test.GENERAL_STRING); - assertEquals(sdlFile.getName(), Test.GENERAL_STRING); - sdlFile.setType(Test.GENERAL_FILETYPE); - assertEquals(sdlFile.getType(), Test.GENERAL_FILETYPE); - sdlFile.setPersistent(Test.GENERAL_BOOLEAN); - assertEquals(sdlFile.isPersistent(), Test.GENERAL_BOOLEAN); + sdlFile.setName(TestValues.GENERAL_STRING); + assertEquals(sdlFile.getName(), TestValues.GENERAL_STRING); + sdlFile.setType(TestValues.GENERAL_FILETYPE); + assertEquals(sdlFile.getType(), TestValues.GENERAL_FILETYPE); + sdlFile.setPersistent(TestValues.GENERAL_BOOLEAN); + assertEquals(sdlFile.isPersistent(), TestValues.GENERAL_BOOLEAN); // Case 2 (Setting resourceId) sdlFile = new SdlFile(); - sdlFile.setResourceId(Test.GENERAL_INTEGER); - assertEquals((Integer) sdlFile.getResourceId(), Test.GENERAL_INTEGER); + sdlFile.setResourceId(TestValues.GENERAL_INTEGER); + assertEquals((Integer) sdlFile.getResourceId(), TestValues.GENERAL_INTEGER); sdlFile.setName(null); assertEquals(sdlFile.getName(), "ec9ebc78777cf40d"); - sdlFile.setName(Test.GENERAL_STRING); - assertEquals(sdlFile.getName(), Test.GENERAL_STRING); - sdlFile.setType(Test.GENERAL_FILETYPE); - assertEquals(sdlFile.getType(), Test.GENERAL_FILETYPE); - sdlFile.setPersistent(Test.GENERAL_BOOLEAN); - assertEquals(sdlFile.isPersistent(), Test.GENERAL_BOOLEAN); + sdlFile.setName(TestValues.GENERAL_STRING); + assertEquals(sdlFile.getName(), TestValues.GENERAL_STRING); + sdlFile.setType(TestValues.GENERAL_FILETYPE); + assertEquals(sdlFile.getType(), TestValues.GENERAL_FILETYPE); + sdlFile.setPersistent(TestValues.GENERAL_BOOLEAN); + assertEquals(sdlFile.isPersistent(), TestValues.GENERAL_BOOLEAN); // Case 3 (Setting URI) sdlFile = new SdlFile(); - sdlFile.setUri(Test.GENERAL_URI); - assertEquals(sdlFile.getUri(), Test.GENERAL_URI); + sdlFile.setUri(TestValues.GENERAL_URI); + assertEquals(sdlFile.getUri(), TestValues.GENERAL_URI); sdlFile.setName(null); assertEquals(sdlFile.getName(), "d3467db131372140"); - sdlFile.setName(Test.GENERAL_STRING); - assertEquals(sdlFile.getName(), Test.GENERAL_STRING); - sdlFile.setType(Test.GENERAL_FILETYPE); - assertEquals(sdlFile.getType(), Test.GENERAL_FILETYPE); - sdlFile.setPersistent(Test.GENERAL_BOOLEAN); - assertEquals(sdlFile.isPersistent(), Test.GENERAL_BOOLEAN); + sdlFile.setName(TestValues.GENERAL_STRING); + assertEquals(sdlFile.getName(), TestValues.GENERAL_STRING); + sdlFile.setType(TestValues.GENERAL_FILETYPE); + assertEquals(sdlFile.getType(), TestValues.GENERAL_FILETYPE); + sdlFile.setPersistent(TestValues.GENERAL_BOOLEAN); + assertEquals(sdlFile.isPersistent(), TestValues.GENERAL_BOOLEAN); } - @org.junit.Test + @Test public void testConstructorWithResourceId() { // Case1 (Set the name manually) - SdlFile sdlFile1 = new SdlFile(Test.GENERAL_STRING, Test.GENERAL_FILETYPE, Test.GENERAL_INTEGER, Test.GENERAL_BOOLEAN); - assertEquals(sdlFile1.getName(), Test.GENERAL_STRING); - assertEquals(sdlFile1.getType(), Test.GENERAL_FILETYPE); - assertEquals((Integer) sdlFile1.getResourceId(), Test.GENERAL_INTEGER); - assertEquals(sdlFile1.isPersistent(), Test.GENERAL_BOOLEAN); + SdlFile sdlFile1 = new SdlFile(TestValues.GENERAL_STRING, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_INTEGER, TestValues.GENERAL_BOOLEAN); + assertEquals(sdlFile1.getName(), TestValues.GENERAL_STRING); + assertEquals(sdlFile1.getType(), TestValues.GENERAL_FILETYPE); + assertEquals((Integer) sdlFile1.getResourceId(), TestValues.GENERAL_INTEGER); + assertEquals(sdlFile1.isPersistent(), TestValues.GENERAL_BOOLEAN); // Case2 (Let the library generate a name) - SdlFile sdlFile2 = new SdlFile(null, Test.GENERAL_FILETYPE, Test.GENERAL_INTEGER, Test.GENERAL_BOOLEAN); - SdlFile sdlFile3 = new SdlFile(null, Test.GENERAL_FILETYPE, Test.GENERAL_INTEGER, Test.GENERAL_BOOLEAN); + SdlFile sdlFile2 = new SdlFile(null, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_INTEGER, TestValues.GENERAL_BOOLEAN); + SdlFile sdlFile3 = new SdlFile(null, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_INTEGER, TestValues.GENERAL_BOOLEAN); assertEquals(sdlFile2.getName(), sdlFile3.getName()); assertEquals(sdlFile2.getName(), "ec9ebc78777cf40d"); - assertEquals(sdlFile2.getType(), Test.GENERAL_FILETYPE); - assertEquals((Integer) sdlFile2.getResourceId(), Test.GENERAL_INTEGER); - assertEquals(sdlFile2.isPersistent(), Test.GENERAL_BOOLEAN); + assertEquals(sdlFile2.getType(), TestValues.GENERAL_FILETYPE); + assertEquals((Integer) sdlFile2.getResourceId(), TestValues.GENERAL_INTEGER); + assertEquals(sdlFile2.isPersistent(), TestValues.GENERAL_BOOLEAN); } - @org.junit.Test + @Test public void testConstructorWithData() { // Case1 (Set the name manually) - SdlFile sdlFile1 = new SdlFile(Test.GENERAL_STRING, Test.GENERAL_FILETYPE, Test.GENERAL_BYTE_ARRAY, Test.GENERAL_BOOLEAN); - assertEquals(sdlFile1.getName(), Test.GENERAL_STRING); - assertEquals(sdlFile1.getType(), Test.GENERAL_FILETYPE); - assertEquals(sdlFile1.getFileData(), Test.GENERAL_BYTE_ARRAY); - assertEquals(sdlFile1.isPersistent(), Test.GENERAL_BOOLEAN); + SdlFile sdlFile1 = new SdlFile(TestValues.GENERAL_STRING, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_BYTE_ARRAY, TestValues.GENERAL_BOOLEAN); + assertEquals(sdlFile1.getName(), TestValues.GENERAL_STRING); + assertEquals(sdlFile1.getType(), TestValues.GENERAL_FILETYPE); + assertEquals(sdlFile1.getFileData(), TestValues.GENERAL_BYTE_ARRAY); + assertEquals(sdlFile1.isPersistent(), TestValues.GENERAL_BOOLEAN); // Case2 (Let the library generate a name) - SdlFile sdlFile2 = new SdlFile(null, Test.GENERAL_FILETYPE, Test.GENERAL_BYTE_ARRAY, Test.GENERAL_BOOLEAN); - SdlFile sdlFile3 = new SdlFile(null, Test.GENERAL_FILETYPE, Test.GENERAL_BYTE_ARRAY, Test.GENERAL_BOOLEAN); + SdlFile sdlFile2 = new SdlFile(null, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_BYTE_ARRAY, TestValues.GENERAL_BOOLEAN); + SdlFile sdlFile3 = new SdlFile(null, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_BYTE_ARRAY, TestValues.GENERAL_BOOLEAN); assertEquals(sdlFile2.getName(), sdlFile3.getName()); assertEquals(sdlFile2.getName(), "e9800998ecf8427e"); - assertEquals(sdlFile2.getType(), Test.GENERAL_FILETYPE); - assertEquals(sdlFile2.getFileData(), Test.GENERAL_BYTE_ARRAY); - assertEquals(sdlFile2.isPersistent(), Test.GENERAL_BOOLEAN); + assertEquals(sdlFile2.getType(), TestValues.GENERAL_FILETYPE); + assertEquals(sdlFile2.getFileData(), TestValues.GENERAL_BYTE_ARRAY); + assertEquals(sdlFile2.isPersistent(), TestValues.GENERAL_BOOLEAN); } - @org.junit.Test + @Test public void testConstructorWithUri() { // Case1 (Set the name manually) - SdlFile sdlFile1 = new SdlFile(Test.GENERAL_STRING, Test.GENERAL_FILETYPE, Test.GENERAL_URI, Test.GENERAL_BOOLEAN); - assertEquals(sdlFile1.getName(), Test.GENERAL_STRING); - assertEquals(sdlFile1.getType(), Test.GENERAL_FILETYPE); - assertEquals(sdlFile1.getUri(), Test.GENERAL_URI); - assertEquals(sdlFile1.isPersistent(), Test.GENERAL_BOOLEAN); + SdlFile sdlFile1 = new SdlFile(TestValues.GENERAL_STRING, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_URI, TestValues.GENERAL_BOOLEAN); + assertEquals(sdlFile1.getName(), TestValues.GENERAL_STRING); + assertEquals(sdlFile1.getType(), TestValues.GENERAL_FILETYPE); + assertEquals(sdlFile1.getUri(), TestValues.GENERAL_URI); + assertEquals(sdlFile1.isPersistent(), TestValues.GENERAL_BOOLEAN); // Case2 (Let the library generate a name) - SdlFile sdlFile2 = new SdlFile(null, Test.GENERAL_FILETYPE, Test.GENERAL_URI, Test.GENERAL_BOOLEAN); - SdlFile sdlFile3 = new SdlFile(null, Test.GENERAL_FILETYPE, Test.GENERAL_URI, Test.GENERAL_BOOLEAN); + SdlFile sdlFile2 = new SdlFile(null, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_URI, TestValues.GENERAL_BOOLEAN); + SdlFile sdlFile3 = new SdlFile(null, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_URI, TestValues.GENERAL_BOOLEAN); assertEquals(sdlFile2.getName(), sdlFile3.getName()); assertEquals(sdlFile2.getName(), "d3467db131372140"); - assertEquals(sdlFile2.getType(), Test.GENERAL_FILETYPE); - assertEquals(sdlFile2.getUri(), Test.GENERAL_URI); - assertEquals(sdlFile2.isPersistent(), Test.GENERAL_BOOLEAN); + assertEquals(sdlFile2.getType(), TestValues.GENERAL_FILETYPE); + assertEquals(sdlFile2.getUri(), TestValues.GENERAL_URI); + assertEquals(sdlFile2.isPersistent(), TestValues.GENERAL_BOOLEAN); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/LifecycleConfigurationUpdateTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/LifecycleConfigurationUpdateTest.java index 7678abeec..61edcf87d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/LifecycleConfigurationUpdateTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/LifecycleConfigurationUpdateTest.java @@ -37,8 +37,9 @@ package com.smartdevicelink.managers.lifecycle; import android.support.test.runner.AndroidJUnit4; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; +import org.junit.Test; import org.junit.runner.RunWith; import static junit.framework.TestCase.assertEquals; @@ -46,31 +47,31 @@ import static junit.framework.TestCase.assertEquals; @RunWith(AndroidJUnit4.class) public class LifecycleConfigurationUpdateTest { - @org.junit.Test + @Test public void testIndividualSettersAndGetters(){ LifecycleConfigurationUpdate lifecycleConfigurationUpdate = new LifecycleConfigurationUpdate(); - lifecycleConfigurationUpdate.setAppName(Test.GENERAL_STRING); - lifecycleConfigurationUpdate.setShortAppName(Test.GENERAL_STRING); - lifecycleConfigurationUpdate.setTtsName(Test.GENERAL_VECTOR_TTS_CHUNKS); - lifecycleConfigurationUpdate.setVoiceRecognitionCommandNames(Test.GENERAL_VECTOR_STRING); + lifecycleConfigurationUpdate.setAppName(TestValues.GENERAL_STRING); + lifecycleConfigurationUpdate.setShortAppName(TestValues.GENERAL_STRING); + lifecycleConfigurationUpdate.setTtsName(TestValues.GENERAL_VECTOR_TTS_CHUNKS); + lifecycleConfigurationUpdate.setVoiceRecognitionCommandNames(TestValues.GENERAL_VECTOR_STRING); - assertEquals(Test.GENERAL_STRING, lifecycleConfigurationUpdate.getAppName()); - assertEquals(Test.GENERAL_STRING, lifecycleConfigurationUpdate.getShortAppName()); - assertEquals(Test.GENERAL_VECTOR_TTS_CHUNKS, lifecycleConfigurationUpdate.getTtsName()); - assertEquals(Test.GENERAL_VECTOR_STRING, lifecycleConfigurationUpdate.getVoiceRecognitionCommandNames()); + assertEquals(TestValues.GENERAL_STRING, lifecycleConfigurationUpdate.getAppName()); + assertEquals(TestValues.GENERAL_STRING, lifecycleConfigurationUpdate.getShortAppName()); + assertEquals(TestValues.GENERAL_VECTOR_TTS_CHUNKS, lifecycleConfigurationUpdate.getTtsName()); + assertEquals(TestValues.GENERAL_VECTOR_STRING, lifecycleConfigurationUpdate.getVoiceRecognitionCommandNames()); } - @org.junit.Test + @Test public void testHelperConstructor(){ - LifecycleConfigurationUpdate lifecycleConfigurationUpdate = new LifecycleConfigurationUpdate(Test.GENERAL_STRING, Test.GENERAL_STRING, Test.GENERAL_VECTOR_TTS_CHUNKS, Test.GENERAL_VECTOR_STRING); + LifecycleConfigurationUpdate lifecycleConfigurationUpdate = new LifecycleConfigurationUpdate(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING, TestValues.GENERAL_VECTOR_TTS_CHUNKS, TestValues.GENERAL_VECTOR_STRING); - assertEquals(Test.GENERAL_STRING, lifecycleConfigurationUpdate.getAppName()); - assertEquals(Test.GENERAL_STRING, lifecycleConfigurationUpdate.getShortAppName()); - assertEquals(Test.GENERAL_VECTOR_TTS_CHUNKS, lifecycleConfigurationUpdate.getTtsName()); - assertEquals(Test.GENERAL_VECTOR_STRING, lifecycleConfigurationUpdate.getVoiceRecognitionCommandNames()); + assertEquals(TestValues.GENERAL_STRING, lifecycleConfigurationUpdate.getAppName()); + assertEquals(TestValues.GENERAL_STRING, lifecycleConfigurationUpdate.getShortAppName()); + assertEquals(TestValues.GENERAL_VECTOR_TTS_CHUNKS, lifecycleConfigurationUpdate.getTtsName()); + assertEquals(TestValues.GENERAL_VECTOR_STRING, lifecycleConfigurationUpdate.getVoiceRecognitionCommandNames()); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenConfigTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenConfigTests.java index 0bf3dd5ae..d3fbe2ef7 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenConfigTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenConfigTests.java @@ -1,7 +1,7 @@ package com.smartdevicelink.managers.lockscreen; import com.smartdevicelink.AndroidTestCase2; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; /** * This is a unit test class for the SmartDeviceLink library manager class : @@ -19,9 +19,9 @@ public class LockScreenConfigTests extends AndroidTestCase2 { // set info for all the setters lockScreenConfig = new LockScreenConfig(); - lockScreenConfig.setCustomView(Test.GENERAL_INT); - lockScreenConfig.setAppIcon(Test.GENERAL_INT); - lockScreenConfig.setBackgroundColor(Test.GENERAL_INT); + lockScreenConfig.setCustomView(TestValues.GENERAL_INT); + lockScreenConfig.setAppIcon(TestValues.GENERAL_INT); + lockScreenConfig.setBackgroundColor(TestValues.GENERAL_INT); lockScreenConfig.showDeviceLogo(true); lockScreenConfig.setEnabled(true); lockScreenConfig.setDisplayMode(LockScreenConfig.DISPLAY_MODE_OPTIONAL_OR_REQUIRED); @@ -35,9 +35,9 @@ public class LockScreenConfigTests extends AndroidTestCase2 { public void testLockScreenConfig() { // get the info and make sure its correct - assertEquals(Test.GENERAL_INT, lockScreenConfig.getCustomView()); - assertEquals(Test.GENERAL_INT, lockScreenConfig.getAppIcon()); - assertEquals(Test.GENERAL_INT, lockScreenConfig.getBackgroundColor()); + assertEquals(TestValues.GENERAL_INT, lockScreenConfig.getCustomView()); + assertEquals(TestValues.GENERAL_INT, lockScreenConfig.getAppIcon()); + assertEquals(TestValues.GENERAL_INT, lockScreenConfig.getBackgroundColor()); assertTrue(lockScreenConfig.isEnabled()); assertTrue(lockScreenConfig.isDeviceLogoEnabled()); assertEquals(LockScreenConfig.DISPLAY_MODE_OPTIONAL_OR_REQUIRED, lockScreenConfig.getDisplayMode()); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenManagerTests.java index 1d294e100..29d324304 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenManagerTests.java @@ -10,7 +10,7 @@ import com.smartdevicelink.proxy.rpc.enums.DriverDistractionState; import com.smartdevicelink.proxy.rpc.enums.HMILevel; import com.smartdevicelink.proxy.rpc.enums.LockScreenStatus; import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; @@ -48,9 +48,9 @@ public class LockScreenManagerTests extends AndroidTestCase2 { Context context = getContext(); // create config LockScreenConfig lockScreenConfig = new LockScreenConfig(); - lockScreenConfig.setCustomView(Test.GENERAL_INT); - lockScreenConfig.setAppIcon(Test.GENERAL_INT); - lockScreenConfig.setBackgroundColor(Test.GENERAL_INT); + lockScreenConfig.setCustomView(TestValues.GENERAL_INT); + lockScreenConfig.setAppIcon(TestValues.GENERAL_INT); + lockScreenConfig.setBackgroundColor(TestValues.GENERAL_INT); lockScreenConfig.showDeviceLogo(true); lockScreenConfig.setEnabled(true); lockScreenConfig.setDisplayMode(LockScreenConfig.DISPLAY_MODE_OPTIONAL_OR_REQUIRED); @@ -64,9 +64,9 @@ public class LockScreenManagerTests extends AndroidTestCase2 { } public void testVariables() { - assertEquals(Test.GENERAL_INT, lockScreenManager.customView); - assertEquals(Test.GENERAL_INT, lockScreenManager.lockScreenIcon); - assertEquals(Test.GENERAL_INT, lockScreenManager.lockScreenColor); + assertEquals(TestValues.GENERAL_INT, lockScreenManager.customView); + assertEquals(TestValues.GENERAL_INT, lockScreenManager.lockScreenIcon); + assertEquals(TestValues.GENERAL_INT, lockScreenManager.lockScreenColor); assertTrue(lockScreenManager.deviceLogoEnabled); assertTrue(lockScreenManager.lockScreenEnabled); assertNull(lockScreenManager.deviceLogo); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java index 34cebfc08..7203b64b1 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java @@ -9,7 +9,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl; import com.smartdevicelink.proxy.rpc.enums.FileType; import com.smartdevicelink.proxy.rpc.enums.MetadataType; import com.smartdevicelink.proxy.rpc.enums.TextAlignment; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import java.util.Arrays; import java.util.List; @@ -123,18 +123,18 @@ public class ScreenManagerTests extends AndroidTestCase2 { public void testSetMenuManagerFields(){ screenManager.setDynamicMenuUpdatesMode(DynamicMenuUpdatesMode.FORCE_ON); - screenManager.setMenu(Test.GENERAL_MENUCELL_LIST); - screenManager.setMenuConfiguration(Test.GENERAL_MENU_CONFIGURATION); + screenManager.setMenu(TestValues.GENERAL_MENUCELL_LIST); + screenManager.setMenuConfiguration(TestValues.GENERAL_MENU_CONFIGURATION); - assertEquals(screenManager.getMenu(), Test.GENERAL_MENUCELL_LIST); + assertEquals(screenManager.getMenu(), TestValues.GENERAL_MENUCELL_LIST); assertEquals(screenManager.getDynamicMenuUpdatesMode(), DynamicMenuUpdatesMode.FORCE_ON); // Should not set because of improper RAI response and improper HMI states assertNull(screenManager.getMenuConfiguration()); } public void testSetVoiceCommands(){ - screenManager.setVoiceCommands(Test.GENERAL_VOICE_COMMAND_LIST); - assertEquals(screenManager.getVoiceCommands(), Test.GENERAL_VOICE_COMMAND_LIST); + screenManager.setVoiceCommands(TestValues.GENERAL_VOICE_COMMAND_LIST); + assertEquals(screenManager.getVoiceCommands(), TestValues.GENERAL_VOICE_COMMAND_LIST); } public void testSetSoftButtonObjects(){ diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceCellTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceCellTests.java index 0bf6af4a5..2c401e04e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceCellTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceCellTests.java @@ -35,7 +35,7 @@ package com.smartdevicelink.managers.screen.choiceset; import com.smartdevicelink.AndroidTestCase2; import com.smartdevicelink.managers.file.filetypes.SdlArtwork; import com.smartdevicelink.proxy.rpc.enums.FileType; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; public class ChoiceCellTests extends AndroidTestCase2 { @@ -55,18 +55,18 @@ public class ChoiceCellTests extends AndroidTestCase2 { public void testSettersAndGetters(){ // set everything - ChoiceCell choiceCell = new ChoiceCell(Test.GENERAL_STRING); - choiceCell.setSecondaryText(Test.GENERAL_STRING); - choiceCell.setTertiaryText(Test.GENERAL_STRING); - choiceCell.setVoiceCommands(Test.GENERAL_STRING_LIST); + ChoiceCell choiceCell = new ChoiceCell(TestValues.GENERAL_STRING); + choiceCell.setSecondaryText(TestValues.GENERAL_STRING); + choiceCell.setTertiaryText(TestValues.GENERAL_STRING); + choiceCell.setVoiceCommands(TestValues.GENERAL_STRING_LIST); choiceCell.setArtwork(artwork); choiceCell.setSecondaryArtwork(artwork); // use getters and assert equality - assertEquals(choiceCell.getText(), Test.GENERAL_STRING); - assertEquals(choiceCell.getSecondaryText(), Test.GENERAL_STRING); - assertEquals(choiceCell.getTertiaryText(), Test.GENERAL_STRING); - assertEquals(choiceCell.getVoiceCommands(), Test.GENERAL_STRING_LIST); + assertEquals(choiceCell.getText(), TestValues.GENERAL_STRING); + assertEquals(choiceCell.getSecondaryText(), TestValues.GENERAL_STRING); + assertEquals(choiceCell.getTertiaryText(), TestValues.GENERAL_STRING); + assertEquals(choiceCell.getVoiceCommands(), TestValues.GENERAL_STRING_LIST); assertEquals(choiceCell.getArtwork(), artwork); assertEquals(choiceCell.getSecondaryArtwork(), artwork); assertEquals(choiceCell.getChoiceId(), MAX_ID); @@ -75,24 +75,24 @@ public class ChoiceCellTests extends AndroidTestCase2 { public void testConstructors() { // first constructor was tested in previous method, use the rest here - ChoiceCell choiceCell = new ChoiceCell(Test.GENERAL_STRING, Test.GENERAL_STRING_LIST, artwork); - choiceCell.setSecondaryText(Test.GENERAL_STRING); - choiceCell.setTertiaryText(Test.GENERAL_STRING); + ChoiceCell choiceCell = new ChoiceCell(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING_LIST, artwork); + choiceCell.setSecondaryText(TestValues.GENERAL_STRING); + choiceCell.setTertiaryText(TestValues.GENERAL_STRING); choiceCell.setSecondaryArtwork(artwork); - assertEquals(choiceCell.getText(), Test.GENERAL_STRING); - assertEquals(choiceCell.getSecondaryText(), Test.GENERAL_STRING); - assertEquals(choiceCell.getTertiaryText(), Test.GENERAL_STRING); - assertEquals(choiceCell.getVoiceCommands(), Test.GENERAL_STRING_LIST); + assertEquals(choiceCell.getText(), TestValues.GENERAL_STRING); + assertEquals(choiceCell.getSecondaryText(), TestValues.GENERAL_STRING); + assertEquals(choiceCell.getTertiaryText(), TestValues.GENERAL_STRING); + assertEquals(choiceCell.getVoiceCommands(), TestValues.GENERAL_STRING_LIST); assertEquals(choiceCell.getArtwork(), artwork); assertEquals(choiceCell.getSecondaryArtwork(), artwork); assertEquals(choiceCell.getChoiceId(), MAX_ID); - choiceCell = new ChoiceCell(Test.GENERAL_STRING, Test.GENERAL_STRING, Test.GENERAL_STRING, Test.GENERAL_STRING_LIST, artwork, artwork); - assertEquals(choiceCell.getText(), Test.GENERAL_STRING); - assertEquals(choiceCell.getSecondaryText(), Test.GENERAL_STRING); - assertEquals(choiceCell.getTertiaryText(), Test.GENERAL_STRING); - assertEquals(choiceCell.getVoiceCommands(), Test.GENERAL_STRING_LIST); + choiceCell = new ChoiceCell(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING, TestValues.GENERAL_STRING, TestValues.GENERAL_STRING_LIST, artwork, artwork); + assertEquals(choiceCell.getText(), TestValues.GENERAL_STRING); + assertEquals(choiceCell.getSecondaryText(), TestValues.GENERAL_STRING); + assertEquals(choiceCell.getTertiaryText(), TestValues.GENERAL_STRING); + assertEquals(choiceCell.getVoiceCommands(), TestValues.GENERAL_STRING_LIST); assertEquals(choiceCell.getArtwork(), artwork); assertEquals(choiceCell.getSecondaryArtwork(), artwork); assertEquals(choiceCell.getChoiceId(), MAX_ID); @@ -100,19 +100,19 @@ public class ChoiceCellTests extends AndroidTestCase2 { public void testCellEquality(){ - ChoiceCell choiceCell = new ChoiceCell(Test.GENERAL_STRING, Test.GENERAL_STRING_LIST, artwork); - choiceCell.setSecondaryText(Test.GENERAL_STRING); - choiceCell.setTertiaryText(Test.GENERAL_STRING); + ChoiceCell choiceCell = new ChoiceCell(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING_LIST, artwork); + choiceCell.setSecondaryText(TestValues.GENERAL_STRING); + choiceCell.setTertiaryText(TestValues.GENERAL_STRING); choiceCell.setSecondaryArtwork(artwork); - ChoiceCell choiceCell2 = new ChoiceCell(Test.GENERAL_STRING, Test.GENERAL_STRING_LIST, artwork); - choiceCell2.setSecondaryText(Test.GENERAL_STRING); - choiceCell2.setTertiaryText(Test.GENERAL_STRING); + ChoiceCell choiceCell2 = new ChoiceCell(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING_LIST, artwork); + choiceCell2.setSecondaryText(TestValues.GENERAL_STRING); + choiceCell2.setTertiaryText(TestValues.GENERAL_STRING); choiceCell2.setSecondaryArtwork(artwork); - ChoiceCell choiceCell3 = new ChoiceCell(Test.GENERAL_STRING, Test.GENERAL_STRING_LIST, artwork); - choiceCell3.setSecondaryText(Test.GENERAL_STRING); - choiceCell3.setTertiaryText(Test.GENERAL_STRING); + ChoiceCell choiceCell3 = new ChoiceCell(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING_LIST, artwork); + choiceCell3.setSecondaryText(TestValues.GENERAL_STRING); + choiceCell3.setTertiaryText(TestValues.GENERAL_STRING); // Make sure our overridden method works, even though these are different objects in memory assertTrue(choiceCell.equals(choiceCell2)); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetTests.java index 900336594..b20357a4b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetTests.java @@ -33,7 +33,7 @@ package com.smartdevicelink.managers.screen.choiceset; import com.smartdevicelink.AndroidTestCase2; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import java.util.Arrays; import java.util.List; @@ -55,7 +55,7 @@ public class ChoiceSetTests extends AndroidTestCase2 { listener = mock(ChoiceSetSelectionListener.class); layout = ChoiceSetLayout.CHOICE_SET_LAYOUT_LIST; defaultTimeout = 10; - choices = Arrays.asList(new ChoiceCell(Test.GENERAL_STRING), new ChoiceCell(Test.GENERAL_STRING)); + choices = Arrays.asList(new ChoiceCell(TestValues.GENERAL_STRING), new ChoiceCell(TestValues.GENERAL_STRING)); canceledHandlerCalled = false; } @@ -67,10 +67,10 @@ public class ChoiceSetTests extends AndroidTestCase2 { public void testSettersAndGetters(){ // test small constructor - ChoiceSet choiceSet = new ChoiceSet(Test.GENERAL_STRING, choices, listener); + ChoiceSet choiceSet = new ChoiceSet(TestValues.GENERAL_STRING, choices, listener); // use getters and assert equality - assertEquals(choiceSet.getTitle(), Test.GENERAL_STRING); + assertEquals(choiceSet.getTitle(), TestValues.GENERAL_STRING); assertEquals(choiceSet.getLayout(), layout); assertEquals(choiceSet.getTimeout(), defaultTimeout); assertEquals(choiceSet.getChoices(), choices); @@ -80,29 +80,29 @@ public class ChoiceSetTests extends AndroidTestCase2 { public void testConstructors() { // first constructor was tested in previous method, use the rest here - ChoiceSet choiceSet = new ChoiceSet(Test.GENERAL_STRING, layout, Test.GENERAL_INTEGER, Test.GENERAL_STRING, Test.GENERAL_STRING, Test.GENERAL_STRING, Test.GENERAL_VRHELPITEM_LIST, Test.GENERAL_KEYBOARDPROPERTIES, choices, listener); - assertEquals(choiceSet.getTitle(), Test.GENERAL_STRING); - assertEquals(choiceSet.getInitialPrompt().get(0).getText(),Test.GENERAL_STRING); - assertEquals(choiceSet.getHelpPrompt().get(0).getText(), Test.GENERAL_STRING); - assertEquals(choiceSet.getTimeoutPrompt().get(0).getText(), Test.GENERAL_STRING); + ChoiceSet choiceSet = new ChoiceSet(TestValues.GENERAL_STRING, layout, TestValues.GENERAL_INTEGER, TestValues.GENERAL_STRING, TestValues.GENERAL_STRING, TestValues.GENERAL_STRING, TestValues.GENERAL_VRHELPITEM_LIST, TestValues.GENERAL_KEYBOARDPROPERTIES, choices, listener); + assertEquals(choiceSet.getTitle(), TestValues.GENERAL_STRING); + assertEquals(choiceSet.getInitialPrompt().get(0).getText(), TestValues.GENERAL_STRING); + assertEquals(choiceSet.getHelpPrompt().get(0).getText(), TestValues.GENERAL_STRING); + assertEquals(choiceSet.getTimeoutPrompt().get(0).getText(), TestValues.GENERAL_STRING); assertEquals(choiceSet.getLayout(), layout); - assertEquals(choiceSet.getTimeout(), Test.GENERAL_INTEGER); + assertEquals(choiceSet.getTimeout(), TestValues.GENERAL_INTEGER); assertEquals(choiceSet.getChoices(), choices); assertEquals(choiceSet.getChoiceSetSelectionListener(), listener); - ChoiceSet choiceSet2 = new ChoiceSet(Test.GENERAL_STRING, layout, Test.GENERAL_INTEGER, Test.GENERAL_TTSCHUNK_LIST, Test.GENERAL_TTSCHUNK_LIST, Test.GENERAL_TTSCHUNK_LIST, Test.GENERAL_VRHELPITEM_LIST, Test.GENERAL_KEYBOARDPROPERTIES, choices, listener); - assertEquals(choiceSet2.getTitle(), Test.GENERAL_STRING); - assertEquals(choiceSet2.getInitialPrompt(),Test.GENERAL_TTSCHUNK_LIST); - assertEquals(choiceSet2.getHelpPrompt(), Test.GENERAL_TTSCHUNK_LIST); - assertEquals(choiceSet2.getTimeoutPrompt(), Test.GENERAL_TTSCHUNK_LIST); + ChoiceSet choiceSet2 = new ChoiceSet(TestValues.GENERAL_STRING, layout, TestValues.GENERAL_INTEGER, TestValues.GENERAL_TTSCHUNK_LIST, TestValues.GENERAL_TTSCHUNK_LIST, TestValues.GENERAL_TTSCHUNK_LIST, TestValues.GENERAL_VRHELPITEM_LIST, TestValues.GENERAL_KEYBOARDPROPERTIES, choices, listener); + assertEquals(choiceSet2.getTitle(), TestValues.GENERAL_STRING); + assertEquals(choiceSet2.getInitialPrompt(), TestValues.GENERAL_TTSCHUNK_LIST); + assertEquals(choiceSet2.getHelpPrompt(), TestValues.GENERAL_TTSCHUNK_LIST); + assertEquals(choiceSet2.getTimeoutPrompt(), TestValues.GENERAL_TTSCHUNK_LIST); assertEquals(choiceSet2.getLayout(), layout); - assertEquals(choiceSet2.getTimeout(), Test.GENERAL_INTEGER); + assertEquals(choiceSet2.getTimeout(), TestValues.GENERAL_INTEGER); assertEquals(choiceSet2.getChoices(), choices); assertEquals(choiceSet2.getChoiceSetSelectionListener(), listener); } public void testCancelingChoiceSet() { - ChoiceSet choiceSet = new ChoiceSet(Test.GENERAL_STRING, choices, listener); + ChoiceSet choiceSet = new ChoiceSet(TestValues.GENERAL_STRING, choices, listener); choiceSet.canceledListener = new ChoiceSetCanceledListener() { @Override diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperationTests.java index 3fbfcada9..9b20f1bc1 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperationTests.java @@ -47,7 +47,7 @@ import com.smartdevicelink.proxy.rpc.enums.FileType; import com.smartdevicelink.proxy.rpc.enums.ImageFieldName; import com.smartdevicelink.proxy.rpc.enums.ImageType; import com.smartdevicelink.proxy.rpc.enums.TextFieldName; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import java.util.Arrays; import java.util.Collections; @@ -69,7 +69,7 @@ public class PreloadChoicesOperationTests extends AndroidTestCase2 { super.setUp(); ChoiceCell cell1 = new ChoiceCell("cell 1"); - ChoiceCell cell2 = new ChoiceCell("cell 2", null, Test.GENERAL_ARTWORK); + ChoiceCell cell2 = new ChoiceCell("cell 2", null, TestValues.GENERAL_ARTWORK); HashSet<ChoiceCell> cellsToPreload = new HashSet<>(); cellsToPreload.add(cell1); cellsToPreload.add(cell2); @@ -102,7 +102,7 @@ public class PreloadChoicesOperationTests extends AndroidTestCase2 { public void setUpNullWindowCapability() { ChoiceCell cell1 = new ChoiceCell("cell 1"); - ChoiceCell cell2 = new ChoiceCell("cell 2", null, Test.GENERAL_ARTWORK); + ChoiceCell cell2 = new ChoiceCell("cell 2", null, TestValues.GENERAL_ARTWORK); HashSet<ChoiceCell> cellsToPreload = new HashSet<>(); cellsToPreload.add(cell1); cellsToPreload.add(cell2); @@ -119,7 +119,7 @@ public class PreloadChoicesOperationTests extends AndroidTestCase2 { public void setUpEmptyWindowCapability() { ChoiceCell cell1 = new ChoiceCell("cell 1"); - ChoiceCell cell2 = new ChoiceCell("cell 2", null, Test.GENERAL_ARTWORK); + ChoiceCell cell2 = new ChoiceCell("cell 2", null, TestValues.GENERAL_ARTWORK); HashSet<ChoiceCell> cellsToPreload = new HashSet<>(); cellsToPreload.add(cell1); cellsToPreload.add(cell2); @@ -146,7 +146,7 @@ public class PreloadChoicesOperationTests extends AndroidTestCase2 { } public void testArtworkNeedsUpload(){ - boolean test = preloadChoicesOperation.artworkNeedsUpload(Test.GENERAL_ARTWORK); + boolean test = preloadChoicesOperation.artworkNeedsUpload(TestValues.GENERAL_ARTWORK); assertTrue(test); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperationTests.java index d8cf5be9d..c0b3c32fa 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperationTests.java @@ -48,7 +48,7 @@ import com.smartdevicelink.proxy.rpc.enums.KeyboardLayout; import com.smartdevicelink.proxy.rpc.enums.KeypressMode; import com.smartdevicelink.proxy.rpc.enums.Language; import com.smartdevicelink.proxy.rpc.enums.LayoutMode; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; @@ -107,7 +107,7 @@ public class PresentChoiceSetOperationTests extends AndroidTestCase2 { public void testGetLayoutMode(){ // First we will check knowing our keyboard listener is NOT NULL - presentChoiceSetOperation = new PresentChoiceSetOperation(internalInterface, choiceSet, InteractionMode.MANUAL_ONLY, getKeyBoardProperties(), keyboardListener, choiceSetSelectionListener, Test.GENERAL_INTEGER); + presentChoiceSetOperation = new PresentChoiceSetOperation(internalInterface, choiceSet, InteractionMode.MANUAL_ONLY, getKeyBoardProperties(), keyboardListener, choiceSetSelectionListener, TestValues.GENERAL_INTEGER); assertEquals(presentChoiceSetOperation.getLayoutMode(), LayoutMode.LIST_WITH_SEARCH); presentChoiceSetOperation.keyboardListener = null; @@ -115,7 +115,7 @@ public class PresentChoiceSetOperationTests extends AndroidTestCase2 { } public void testGetPerformInteraction(){ - presentChoiceSetOperation = new PresentChoiceSetOperation(internalInterface, choiceSet, InteractionMode.MANUAL_ONLY, getKeyBoardProperties(), keyboardListener, choiceSetSelectionListener, Test.GENERAL_INTEGER); + presentChoiceSetOperation = new PresentChoiceSetOperation(internalInterface, choiceSet, InteractionMode.MANUAL_ONLY, getKeyBoardProperties(), keyboardListener, choiceSetSelectionListener, TestValues.GENERAL_INTEGER); PerformInteraction pi = presentChoiceSetOperation.getPerformInteraction(); assertEquals(pi.getInitialText(), "Test"); @@ -123,12 +123,12 @@ public class PresentChoiceSetOperationTests extends AndroidTestCase2 { assertNull(pi.getTimeoutPrompt()); assertNull(pi.getVrHelp()); assertEquals(pi.getTimeout(), Integer.valueOf(10000)); - assertEquals(pi.getCancelID(), Test.GENERAL_INTEGER); + assertEquals(pi.getCancelID(), TestValues.GENERAL_INTEGER); assertEquals(presentChoiceSetOperation.getLayoutMode(), LayoutMode.LIST_WITH_SEARCH); } public void testSetSelectedCellWithId(){ - presentChoiceSetOperation = new PresentChoiceSetOperation(internalInterface, choiceSet, InteractionMode.MANUAL_ONLY, getKeyBoardProperties(), keyboardListener, choiceSetSelectionListener, Test.GENERAL_INTEGER); + presentChoiceSetOperation = new PresentChoiceSetOperation(internalInterface, choiceSet, InteractionMode.MANUAL_ONLY, getKeyBoardProperties(), keyboardListener, choiceSetSelectionListener, TestValues.GENERAL_INTEGER); assertNull(presentChoiceSetOperation.selectedCellRow); presentChoiceSetOperation.setSelectedCellWithId(0); @@ -137,7 +137,7 @@ public class PresentChoiceSetOperationTests extends AndroidTestCase2 { public void testCancelingChoiceSetSuccessfullyIfThreadIsRunning(){ when(internalInterface.getSdlMsgVersion()).thenReturn(new SdlMsgVersion(6, 0)); - presentChoiceSetOperation = new PresentChoiceSetOperation(internalInterface, choiceSet, InteractionMode.MANUAL_ONLY, null, null, choiceSetSelectionListener, Test.GENERAL_INTEGER); + presentChoiceSetOperation = new PresentChoiceSetOperation(internalInterface, choiceSet, InteractionMode.MANUAL_ONLY, null, null, choiceSetSelectionListener, TestValues.GENERAL_INTEGER); executor.execute(presentChoiceSetOperation); try { @@ -155,7 +155,7 @@ public class PresentChoiceSetOperationTests extends AndroidTestCase2 { Object[] args = invocation.getArguments(); CancelInteraction cancelInteraction = (CancelInteraction) args[0]; - assertEquals(cancelInteraction.getCancelID(), Test.GENERAL_INTEGER); + assertEquals(cancelInteraction.getCancelID(), TestValues.GENERAL_INTEGER); assertEquals(cancelInteraction.getInteractionFunctionID().intValue(), FunctionID.PERFORM_INTERACTION.getId()); RPCResponse response = new RPCResponse(FunctionID.CANCEL_INTERACTION.toString()); @@ -177,7 +177,7 @@ public class PresentChoiceSetOperationTests extends AndroidTestCase2 { public void testCancelingChoiceSetUnsuccessfullyIfThreadIsRunning(){ when(internalInterface.getSdlMsgVersion()).thenReturn(new SdlMsgVersion(6, 0)); - presentChoiceSetOperation = new PresentChoiceSetOperation(internalInterface, choiceSet, InteractionMode.MANUAL_ONLY, null, null, choiceSetSelectionListener, Test.GENERAL_INTEGER); + presentChoiceSetOperation = new PresentChoiceSetOperation(internalInterface, choiceSet, InteractionMode.MANUAL_ONLY, null, null, choiceSetSelectionListener, TestValues.GENERAL_INTEGER); executor.execute(presentChoiceSetOperation); try { executor.awaitTermination(1, TimeUnit.SECONDS); @@ -194,7 +194,7 @@ public class PresentChoiceSetOperationTests extends AndroidTestCase2 { Object[] args = invocation.getArguments(); CancelInteraction cancelInteraction = (CancelInteraction) args[0]; - assertEquals(cancelInteraction.getCancelID(), Test.GENERAL_INTEGER); + assertEquals(cancelInteraction.getCancelID(), TestValues.GENERAL_INTEGER); assertEquals(cancelInteraction.getInteractionFunctionID().intValue(), FunctionID.PERFORM_INTERACTION.getId()); RPCResponse response = new RPCResponse(FunctionID.CANCEL_INTERACTION.toString()); @@ -216,7 +216,7 @@ public class PresentChoiceSetOperationTests extends AndroidTestCase2 { public void testCancelingChoiceSetIfThreadHasFinished(){ when(internalInterface.getSdlMsgVersion()).thenReturn(new SdlMsgVersion(6, 0)); - presentChoiceSetOperation = new PresentChoiceSetOperation(internalInterface, choiceSet, InteractionMode.MANUAL_ONLY, null, null, choiceSetSelectionListener, Test.GENERAL_INTEGER); + presentChoiceSetOperation = new PresentChoiceSetOperation(internalInterface, choiceSet, InteractionMode.MANUAL_ONLY, null, null, choiceSetSelectionListener, TestValues.GENERAL_INTEGER); presentChoiceSetOperation.finishOperation(); assertFalse(presentChoiceSetOperation.isExecuting()); @@ -233,7 +233,7 @@ public class PresentChoiceSetOperationTests extends AndroidTestCase2 { public void testCancelingChoiceSetIfThreadHasNotYetRun(){ when(internalInterface.getSdlMsgVersion()).thenReturn(new SdlMsgVersion(6, 0)); - presentChoiceSetOperation = new PresentChoiceSetOperation(internalInterface, choiceSet, InteractionMode.MANUAL_ONLY, null, null, choiceSetSelectionListener, Test.GENERAL_INTEGER); + presentChoiceSetOperation = new PresentChoiceSetOperation(internalInterface, choiceSet, InteractionMode.MANUAL_ONLY, null, null, choiceSetSelectionListener, TestValues.GENERAL_INTEGER); assertFalse(presentChoiceSetOperation.isExecuting()); assertFalse(presentChoiceSetOperation.isFinished()); @@ -259,7 +259,7 @@ public class PresentChoiceSetOperationTests extends AndroidTestCase2 { public void testCancelingChoiceSetIfHeadUnitDoesNotSupportFeature(){ // Cancel Interaction is only supported on RPC specs v.6.0.0+ when(internalInterface.getSdlMsgVersion()).thenReturn(new SdlMsgVersion(5, 3)); - presentChoiceSetOperation = new PresentChoiceSetOperation(internalInterface, choiceSet, InteractionMode.MANUAL_ONLY, null, null, choiceSetSelectionListener, Test.GENERAL_INTEGER); + presentChoiceSetOperation = new PresentChoiceSetOperation(internalInterface, choiceSet, InteractionMode.MANUAL_ONLY, null, null, choiceSetSelectionListener, TestValues.GENERAL_INTEGER); executor.execute(presentChoiceSetOperation); try { executor.awaitTermination(1, TimeUnit.SECONDS); @@ -278,7 +278,7 @@ public class PresentChoiceSetOperationTests extends AndroidTestCase2 { public void testCancelingChoiceSetIfHeadUnitDoesNotSupportFeatureButThreadIsNotRunning(){ // Cancel Interaction is only supported on RPC specs v.6.0.0+ when(internalInterface.getSdlMsgVersion()).thenReturn(new SdlMsgVersion(5, 3)); - presentChoiceSetOperation = new PresentChoiceSetOperation(internalInterface, choiceSet, InteractionMode.MANUAL_ONLY, null, null, choiceSetSelectionListener, Test.GENERAL_INTEGER); + presentChoiceSetOperation = new PresentChoiceSetOperation(internalInterface, choiceSet, InteractionMode.MANUAL_ONLY, null, null, choiceSetSelectionListener, TestValues.GENERAL_INTEGER); assertFalse(presentChoiceSetOperation.isExecuting()); assertFalse(presentChoiceSetOperation.isFinished()); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperationTests.java index 486a1c361..109535c11 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperationTests.java @@ -48,7 +48,7 @@ import com.smartdevicelink.proxy.rpc.enums.KeyboardLayout; import com.smartdevicelink.proxy.rpc.enums.KeypressMode; import com.smartdevicelink.proxy.rpc.enums.Language; import com.smartdevicelink.proxy.rpc.enums.LayoutMode; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; @@ -112,7 +112,7 @@ public class PresentKeyboardOperationTests extends AndroidTestCase2 { } public void testGetPerformInteraction(){ - presentKeyboardOperation = new PresentKeyboardOperation(internalInterface, getKeyBoardProperties(), "Test", null, keyboardListener, Test.GENERAL_INTEGER); + presentKeyboardOperation = new PresentKeyboardOperation(internalInterface, getKeyBoardProperties(), "Test", null, keyboardListener, TestValues.GENERAL_INTEGER); PerformInteraction pi = presentKeyboardOperation.getPerformInteraction(); assertEquals(pi.getInitialText(), "Test"); @@ -120,12 +120,12 @@ public class PresentKeyboardOperationTests extends AndroidTestCase2 { assertNull(pi.getTimeoutPrompt()); assertNull(pi.getVrHelp()); assertEquals(pi.getInteractionLayout(), LayoutMode.KEYBOARD); - assertEquals(pi.getCancelID(), Test.GENERAL_INTEGER); + assertEquals(pi.getCancelID(), TestValues.GENERAL_INTEGER); } public void testCancelingKeyboardSuccessfullyIfThreadIsRunning(){ when(internalInterface.getSdlMsgVersion()).thenReturn(new SdlMsgVersion(6, 0)); - presentKeyboardOperation = new PresentKeyboardOperation(internalInterface, null, "Test", null, null, Test.GENERAL_INTEGER); + presentKeyboardOperation = new PresentKeyboardOperation(internalInterface, null, "Test", null, null, TestValues.GENERAL_INTEGER); executor.execute(presentKeyboardOperation); try { executor.awaitTermination(1, TimeUnit.SECONDS); @@ -142,7 +142,7 @@ public class PresentKeyboardOperationTests extends AndroidTestCase2 { Object[] args = invocation.getArguments(); CancelInteraction cancelInteraction = (CancelInteraction) args[0]; - assertEquals(cancelInteraction.getCancelID(), Test.GENERAL_INTEGER); + assertEquals(cancelInteraction.getCancelID(), TestValues.GENERAL_INTEGER); assertEquals(cancelInteraction.getInteractionFunctionID().intValue(), FunctionID.PERFORM_INTERACTION.getId()); RPCResponse response = new RPCResponse(FunctionID.CANCEL_INTERACTION.toString()); @@ -164,7 +164,7 @@ public class PresentKeyboardOperationTests extends AndroidTestCase2 { public void testCancelingKeyboardUnsuccessfullyIfThreadIsRunning(){ when(internalInterface.getSdlMsgVersion()).thenReturn(new SdlMsgVersion(6, 0)); - presentKeyboardOperation = new PresentKeyboardOperation(internalInterface, null, "Test", null, null, Test.GENERAL_INTEGER); + presentKeyboardOperation = new PresentKeyboardOperation(internalInterface, null, "Test", null, null, TestValues.GENERAL_INTEGER); executor.execute(presentKeyboardOperation); try { executor.awaitTermination(1, TimeUnit.SECONDS); @@ -177,7 +177,7 @@ public class PresentKeyboardOperationTests extends AndroidTestCase2 { Object[] args = invocation.getArguments(); CancelInteraction cancelInteraction = (CancelInteraction) args[0]; - assertEquals(cancelInteraction.getCancelID(), Test.GENERAL_INTEGER); + assertEquals(cancelInteraction.getCancelID(), TestValues.GENERAL_INTEGER); assertEquals(cancelInteraction.getInteractionFunctionID().intValue(), FunctionID.PERFORM_INTERACTION.getId()); RPCResponse response = new RPCResponse(FunctionID.CANCEL_INTERACTION.toString()); @@ -199,7 +199,7 @@ public class PresentKeyboardOperationTests extends AndroidTestCase2 { public void testCancelingKeyboardIfThreadHasFinished(){ when(internalInterface.getSdlMsgVersion()).thenReturn(new SdlMsgVersion(6, 0)); - presentKeyboardOperation = new PresentKeyboardOperation(internalInterface, null, "Test", null, null, Test.GENERAL_INTEGER); + presentKeyboardOperation = new PresentKeyboardOperation(internalInterface, null, "Test", null, null, TestValues.GENERAL_INTEGER); presentKeyboardOperation.finishOperation(); assertFalse(presentKeyboardOperation.isExecuting()); @@ -216,7 +216,7 @@ public class PresentKeyboardOperationTests extends AndroidTestCase2 { public void testCancelingKeyboardIfThreadHasNotYetRun(){ when(internalInterface.getSdlMsgVersion()).thenReturn(new SdlMsgVersion(6, 0)); - presentKeyboardOperation = new PresentKeyboardOperation(internalInterface, null, "Test", null, null, Test.GENERAL_INTEGER); + presentKeyboardOperation = new PresentKeyboardOperation(internalInterface, null, "Test", null, null, TestValues.GENERAL_INTEGER); assertFalse(presentKeyboardOperation.isExecuting()); assertFalse(presentKeyboardOperation.isFinished()); @@ -242,7 +242,7 @@ public class PresentKeyboardOperationTests extends AndroidTestCase2 { public void testCancelingChoiceSetIfHeadUnitDoesNotSupportFeature(){ // Cancel Interaction is only supported on RPC specs v.6.0.0+ when(internalInterface.getSdlMsgVersion()).thenReturn(new SdlMsgVersion(5, 3)); - presentKeyboardOperation = new PresentKeyboardOperation(internalInterface, null, "Test", null, null, Test.GENERAL_INTEGER); + presentKeyboardOperation = new PresentKeyboardOperation(internalInterface, null, "Test", null, null, TestValues.GENERAL_INTEGER); executor.execute(presentKeyboardOperation); try { executor.awaitTermination(1, TimeUnit.SECONDS); @@ -261,7 +261,7 @@ public class PresentKeyboardOperationTests extends AndroidTestCase2 { public void testCancelingChoiceSetIfHeadUnitDoesNotSupportFeatureButThreadIsNotRunning(){ // Cancel Interaction is only supported on RPC specs v.6.0.0+ when(internalInterface.getSdlMsgVersion()).thenReturn(new SdlMsgVersion(5, 3)); - presentKeyboardOperation = new PresentKeyboardOperation(internalInterface, null, "Test", null, null, Test.GENERAL_INTEGER); + presentKeyboardOperation = new PresentKeyboardOperation(internalInterface, null, "Test", null, null, TestValues.GENERAL_INTEGER); assertFalse(presentKeyboardOperation.isExecuting()); assertFalse(presentKeyboardOperation.isFinished()); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuCellTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuCellTests.java index 25a5c64f3..0105553fa 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuCellTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuCellTests.java @@ -37,8 +37,9 @@ import android.support.test.runner.AndroidJUnit4; import com.smartdevicelink.managers.file.SdlArtworkTests; import com.smartdevicelink.proxy.rpc.enums.MenuLayout; import com.smartdevicelink.proxy.rpc.enums.TriggerSource; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; +import org.junit.Test; import org.junit.runner.RunWith; import java.util.ArrayList; @@ -60,55 +61,55 @@ public class MenuCellTests { } }; - @org.junit.Test + @Test public void testSettersAndGetters(){ // set everything - MenuCell menuCell = new MenuCell(Test.GENERAL_STRING, null, null, menuSelectionListener); - menuCell.setIcon(Test.GENERAL_ARTWORK); - menuCell.setVoiceCommands(Test.GENERAL_STRING_LIST); + MenuCell menuCell = new MenuCell(TestValues.GENERAL_STRING, null, null, menuSelectionListener); + menuCell.setIcon(TestValues.GENERAL_ARTWORK); + menuCell.setVoiceCommands(TestValues.GENERAL_STRING_LIST); menuCell.setMenuSelectionListener(menuSelectionListener); - menuCell.setSubMenuLayout(Test.GENERAL_MENU_LAYOUT); + menuCell.setSubMenuLayout(TestValues.GENERAL_MENU_LAYOUT); // use getters and assert equality - assertEquals(menuCell.getTitle(), Test.GENERAL_STRING); - assertEquals(menuCell.getIcon(), Test.GENERAL_ARTWORK); - assertEquals(menuCell.getVoiceCommands(), Test.GENERAL_STRING_LIST); + assertEquals(menuCell.getTitle(), TestValues.GENERAL_STRING); + assertEquals(menuCell.getIcon(), TestValues.GENERAL_ARTWORK); + assertEquals(menuCell.getVoiceCommands(), TestValues.GENERAL_STRING_LIST); assertEquals(menuCell.getMenuSelectionListener(), menuSelectionListener); - assertEquals(menuCell.getCellId(), Test.GENERAL_MENU_MAX_ID); - assertEquals(menuCell.getParentCellId(), Test.GENERAL_MENU_MAX_ID); - assertEquals(menuCell.getSubMenuLayout(), Test.GENERAL_MENU_LAYOUT); + assertEquals(menuCell.getCellId(), TestValues.GENERAL_MENU_MAX_ID); + assertEquals(menuCell.getParentCellId(), TestValues.GENERAL_MENU_MAX_ID); + assertEquals(menuCell.getSubMenuLayout(), TestValues.GENERAL_MENU_LAYOUT); } - @org.junit.Test + @Test public void testConstructors(){ // first constructor was tested in previous method, use the last two here - MenuCell menuCell3 =new MenuCell(Test.GENERAL_STRING, Test.GENERAL_ARTWORK, Test.GENERAL_STRING_LIST, menuSelectionListener); - assertEquals(menuCell3.getTitle(), Test.GENERAL_STRING); - assertEquals(menuCell3.getIcon(), Test.GENERAL_ARTWORK); - assertEquals(menuCell3.getVoiceCommands(), Test.GENERAL_STRING_LIST); + MenuCell menuCell3 =new MenuCell(TestValues.GENERAL_STRING, TestValues.GENERAL_ARTWORK, TestValues.GENERAL_STRING_LIST, menuSelectionListener); + assertEquals(menuCell3.getTitle(), TestValues.GENERAL_STRING); + assertEquals(menuCell3.getIcon(), TestValues.GENERAL_ARTWORK); + assertEquals(menuCell3.getVoiceCommands(), TestValues.GENERAL_STRING_LIST); assertEquals(menuCell3.getMenuSelectionListener(), menuSelectionListener); - MenuCell menuCell4 =new MenuCell(Test.GENERAL_STRING,null, null, menuSelectionListener); - assertEquals(menuCell4.getTitle(), Test.GENERAL_STRING); + MenuCell menuCell4 =new MenuCell(TestValues.GENERAL_STRING,null, null, menuSelectionListener); + assertEquals(menuCell4.getTitle(), TestValues.GENERAL_STRING); assertEquals(menuCell4.getMenuSelectionListener(), menuSelectionListener); - MenuCell menuCell5 = new MenuCell(Test.GENERAL_STRING, Test.GENERAL_MENU_LAYOUT, Test.GENERAL_ARTWORK, Test.GENERAL_MENUCELL_LIST); - assertEquals(menuCell5.getTitle(), Test.GENERAL_STRING); - assertEquals(menuCell5.getIcon(), Test.GENERAL_ARTWORK); - assertEquals(menuCell5.getSubMenuLayout(), Test.GENERAL_MENU_LAYOUT); - assertEquals(menuCell5.getSubCells(), Test.GENERAL_MENUCELL_LIST); + MenuCell menuCell5 = new MenuCell(TestValues.GENERAL_STRING, TestValues.GENERAL_MENU_LAYOUT, TestValues.GENERAL_ARTWORK, TestValues.GENERAL_MENUCELL_LIST); + assertEquals(menuCell5.getTitle(), TestValues.GENERAL_STRING); + assertEquals(menuCell5.getIcon(), TestValues.GENERAL_ARTWORK); + assertEquals(menuCell5.getSubMenuLayout(), TestValues.GENERAL_MENU_LAYOUT); + assertEquals(menuCell5.getSubCells(), TestValues.GENERAL_MENUCELL_LIST); } - @org.junit.Test + @Test public void testEquality(){ //We should use assertTrue (or assertFalse) because we want to use the overridden equals() method - MenuCell menuCell = new MenuCell(Test.GENERAL_STRING, Test.GENERAL_ARTWORK, Test.GENERAL_STRING_LIST, menuSelectionListener); - MenuCell menuCell2 = new MenuCell(Test.GENERAL_STRING, Test.GENERAL_ARTWORK, Test.GENERAL_STRING_LIST, menuSelectionListener); + MenuCell menuCell = new MenuCell(TestValues.GENERAL_STRING, TestValues.GENERAL_ARTWORK, TestValues.GENERAL_STRING_LIST, menuSelectionListener); + MenuCell menuCell2 = new MenuCell(TestValues.GENERAL_STRING, TestValues.GENERAL_ARTWORK, TestValues.GENERAL_STRING_LIST, menuSelectionListener); // these are the same object, should be equal. assertTrue(menuCell.equals(menuCell)); @@ -116,15 +117,15 @@ public class MenuCellTests { // Make sure these are marked as equals, even though they are different objects assertTrue(menuCell.equals(menuCell2)); - MenuCell menuCell3 = new MenuCell(Test.GENERAL_STRING, null, Test.GENERAL_STRING_LIST, menuSelectionListener); + MenuCell menuCell3 = new MenuCell(TestValues.GENERAL_STRING, null, TestValues.GENERAL_STRING_LIST, menuSelectionListener); // these should be different assertFalse(menuCell.equals(menuCell3)); } - @org.junit.Test + @Test public void testClone(){ - MenuCell original = new MenuCell(Test.GENERAL_STRING, Test.GENERAL_ARTWORK, Test.GENERAL_STRING_LIST, menuSelectionListener); + MenuCell original = new MenuCell(TestValues.GENERAL_STRING, TestValues.GENERAL_ARTWORK, TestValues.GENERAL_STRING_LIST, menuSelectionListener); MenuCell clone = original.clone(); assertNotNull(clone); @@ -141,7 +142,7 @@ public class MenuCellTests { subcells.add(original.clone()); subcells.add(clone.clone()); - original = new MenuCell(Test.GENERAL_STRING, MenuLayout.LIST, Test.GENERAL_ARTWORK,subcells); + original = new MenuCell(TestValues.GENERAL_STRING, MenuLayout.LIST, TestValues.GENERAL_ARTWORK,subcells); clone = original.clone(); assertNotNull(original.getSubCells()); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuConfigurationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuConfigurationTests.java index 62f6ccb92..14f178f89 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuConfigurationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuConfigurationTests.java @@ -36,7 +36,7 @@ package com.smartdevicelink.managers.screen.menu; import com.smartdevicelink.AndroidTestCase2; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; public class MenuConfigurationTests extends AndroidTestCase2 { @@ -54,10 +54,10 @@ public class MenuConfigurationTests extends AndroidTestCase2 { public void testSettersAndGetters(){ // set everything - we only use the constructor to set variables in the Menu Manager - MenuConfiguration menuConfiguration = new MenuConfiguration(Test.GENERAL_MENU_LAYOUT, Test.GENERAL_MENU_LAYOUT); + MenuConfiguration menuConfiguration = new MenuConfiguration(TestValues.GENERAL_MENU_LAYOUT, TestValues.GENERAL_MENU_LAYOUT); // use getters and assert equality - assertEquals(menuConfiguration.getMenuLayout(), Test.GENERAL_MENU_LAYOUT); - assertEquals(menuConfiguration.getSubMenuLayout(), Test.GENERAL_MENU_LAYOUT); + assertEquals(menuConfiguration.getMenuLayout(), TestValues.GENERAL_MENU_LAYOUT); + assertEquals(menuConfiguration.getSubMenuLayout(), TestValues.GENERAL_MENU_LAYOUT); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/RunScoreTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/RunScoreTests.java index 15128293c..e231ce634 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/RunScoreTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/RunScoreTests.java @@ -33,7 +33,7 @@ package com.smartdevicelink.managers.screen.menu; import com.smartdevicelink.AndroidTestCase2; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; public class RunScoreTests extends AndroidTestCase2 { @@ -51,12 +51,12 @@ public class RunScoreTests extends AndroidTestCase2 { public void testSettersAndGetters(){ // set everything - we only use the constructor to set variables in the Menu Manager - RunScore runScore = new RunScore(Test.GENERAL_INT, Test.GENERAL_INTEGER_LIST, Test.GENERAL_INTEGER_LIST); + RunScore runScore = new RunScore(TestValues.GENERAL_INT, TestValues.GENERAL_INTEGER_LIST, TestValues.GENERAL_INTEGER_LIST); // use getters and assert equality - assertEquals(runScore.getScore(), Test.GENERAL_INT); - assertEquals(runScore.getCurrentMenu(), Test.GENERAL_INTEGER_LIST); - assertEquals(runScore.getOldMenu(), Test.GENERAL_INTEGER_LIST); + assertEquals(runScore.getScore(), TestValues.GENERAL_INT); + assertEquals(runScore.getCurrentMenu(), TestValues.GENERAL_INTEGER_LIST); + assertEquals(runScore.getOldMenu(), TestValues.GENERAL_INTEGER_LIST); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/SubCellCommandListTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/SubCellCommandListTests.java index c25fb7f41..37908a8e9 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/SubCellCommandListTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/SubCellCommandListTests.java @@ -33,7 +33,7 @@ package com.smartdevicelink.managers.screen.menu; import com.smartdevicelink.AndroidTestCase2; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; public class SubCellCommandListTests extends AndroidTestCase2 { @@ -49,17 +49,17 @@ public class SubCellCommandListTests extends AndroidTestCase2 { public void testSettersAndGetters() { - RunScore runScore = new RunScore(Test.GENERAL_INT, Test.GENERAL_INTEGER_LIST, Test.GENERAL_INTEGER_LIST); + RunScore runScore = new RunScore(TestValues.GENERAL_INT, TestValues.GENERAL_INTEGER_LIST, TestValues.GENERAL_INTEGER_LIST); // set everything - SubCellCommandList subCellCommandList = new SubCellCommandList(Test.GENERAL_STRING, Test.GENERAL_INTEGER, runScore, Test.GENERAL_MENUCELL_LIST, Test.GENERAL_MENUCELL_LIST); + SubCellCommandList subCellCommandList = new SubCellCommandList(TestValues.GENERAL_STRING, TestValues.GENERAL_INTEGER, runScore, TestValues.GENERAL_MENUCELL_LIST, TestValues.GENERAL_MENUCELL_LIST); // use getters and assert equality - assertEquals(subCellCommandList.getMenuTitle(), Test.GENERAL_STRING); - assertEquals(subCellCommandList.getParentId(), Test.GENERAL_INTEGER); + assertEquals(subCellCommandList.getMenuTitle(), TestValues.GENERAL_STRING); + assertEquals(subCellCommandList.getParentId(), TestValues.GENERAL_INTEGER); assertEquals(runScore, runScore); - assertEquals(subCellCommandList.getNewList(), Test.GENERAL_MENUCELL_LIST); - assertEquals(subCellCommandList.getOldList(), Test.GENERAL_MENUCELL_LIST); + assertEquals(subCellCommandList.getNewList(), TestValues.GENERAL_MENUCELL_LIST); + assertEquals(subCellCommandList.getOldList(), TestValues.GENERAL_MENUCELL_LIST); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandTests.java index f8a8a538d..8df32be83 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandTests.java @@ -33,7 +33,7 @@ package com.smartdevicelink.managers.screen.menu; import com.smartdevicelink.AndroidTestCase2; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; public class VoiceCommandTests extends AndroidTestCase2 { @@ -55,9 +55,9 @@ public class VoiceCommandTests extends AndroidTestCase2 { } public void testSettersAndGetters(){ - VoiceCommand voiceCommand = new VoiceCommand(Test.GENERAL_STRING_LIST, voiceCommandSelectionListener); + VoiceCommand voiceCommand = new VoiceCommand(TestValues.GENERAL_STRING_LIST, voiceCommandSelectionListener); - assertEquals(voiceCommand.getVoiceCommands(), Test.GENERAL_STRING_LIST); + assertEquals(voiceCommand.getVoiceCommands(), TestValues.GENERAL_STRING_LIST); assertEquals(voiceCommand.getVoiceCommandSelectionListener(), voiceCommandSelectionListener); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/video/VideoStreamManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/video/VideoStreamManagerTests.java index 1b7417363..7b654752c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/video/VideoStreamManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/video/VideoStreamManagerTests.java @@ -19,7 +19,6 @@ import com.smartdevicelink.proxy.interfaces.OnSystemCapabilityListener; import com.smartdevicelink.proxy.rpc.ImageResolution; import com.smartdevicelink.proxy.rpc.OnHMIStatus; import com.smartdevicelink.proxy.rpc.OnTouchEvent; -import com.smartdevicelink.proxy.rpc.RegisterAppInterface; import com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse; import com.smartdevicelink.proxy.rpc.TouchCoord; import com.smartdevicelink.proxy.rpc.TouchEvent; @@ -31,7 +30,7 @@ import com.smartdevicelink.proxy.rpc.enums.VideoStreamingState; import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener; import com.smartdevicelink.streaming.video.SdlRemoteDisplay; import com.smartdevicelink.streaming.video.VideoStreamingParameters; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.util.Version; import org.mockito.invocation.InvocationOnMock; @@ -176,7 +175,7 @@ public class VideoStreamManagerTests extends AndroidTestCase2 { public Void answer(InvocationOnMock invocation) { Object[] args = invocation.getArguments(); OnSystemCapabilityListener systemCapabilityListener = (OnSystemCapabilityListener) args[1]; - systemCapabilityListener.onCapabilityRetrieved(Test.GENERAL_VIDEOSTREAMINGCAPABILITY); + systemCapabilityListener.onCapabilityRetrieved(TestValues.GENERAL_VIDEOSTREAMINGCAPABILITY); return null; } }; @@ -249,7 +248,7 @@ public class VideoStreamManagerTests extends AndroidTestCase2 { public void sendFrame(ByteBuffer data, long presentationTimeUs) {} }); - when(internalInterface.getCapability(SystemCapabilityType.VIDEO_STREAMING)).thenReturn(Test.GENERAL_VIDEOSTREAMINGCAPABILITY); + when(internalInterface.getCapability(SystemCapabilityType.VIDEO_STREAMING)).thenReturn(TestValues.GENERAL_VIDEOSTREAMINGCAPABILITY); final VideoStreamManager videoStreamManager = new VideoStreamManager(internalInterface); videoStreamManager.start(new CompletionListener() { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/TestValues.java index 602e638ae..f5cc9827d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/TestValues.java @@ -214,7 +214,7 @@ import java.util.Collections; import java.util.List; import java.util.Vector; -public class Test { +public class TestValues { //Versions public static final Version MAX_RPC_VERSION_SUPPORTED = SdlProxyBase.MAX_SUPPORTED_RPC_VERSION; @@ -353,7 +353,7 @@ public class Test { public static final WayPointType GENERAL_WAYPOINTTYPE = WayPointType.DESTINATION; public static final SingleTireStatus GENERAL_SINGLETIRESTATUS = new SingleTireStatus(); public static final DriverDistractionState GENERAL_DRIVERDISTRACTIONSTATE = DriverDistractionState.DD_ON; - public static final List<LocationDetails> GENERAL_LOCATIONDETAILS_LIST = Arrays.asList(new LocationDetails[] { Test.GENERAL_LOCATIONDETAILS, Test.GENERAL_LOCATIONDETAILS}); + public static final List<LocationDetails> GENERAL_LOCATIONDETAILS_LIST = Arrays.asList(new LocationDetails[] { TestValues.GENERAL_LOCATIONDETAILS, TestValues.GENERAL_LOCATIONDETAILS}); public static final AudioStreamingIndicator GENERAL_AUDIO_STREAMING_INDICATOR = AudioStreamingIndicator.PLAY; public static final String GENERAL_APP_ID = "123e4567e8"; public static final String GENERAL_FULL_APP_ID = "123e4567-e89b-12d3-a456-426655440000"; @@ -742,8 +742,8 @@ public class Test { GENERAL_IMAGE.setIsTemplate(GENERAL_BOOLEAN); GENERAL_TEMPLATE_CONFIGURATION.setTemplate(GENERAL_STRING); - GENERAL_TEMPLATE_CONFIGURATION.setDayColorScheme(Test.GENERAL_DAYCOLORSCHEME); - GENERAL_TEMPLATE_CONFIGURATION.setNightColorScheme(Test.GENERAL_NIGHTCOLORSCHEME); + GENERAL_TEMPLATE_CONFIGURATION.setDayColorScheme(TestValues.GENERAL_DAYCOLORSCHEME); + GENERAL_TEMPLATE_CONFIGURATION.setNightColorScheme(TestValues.GENERAL_NIGHTCOLORSCHEME); GENERAL_SOFTBUTTON.setIsHighlighted(GENERAL_BOOLEAN); GENERAL_SOFTBUTTON.setSoftButtonID(GENERAL_INT); @@ -773,7 +773,7 @@ public class Test { GENERAL_KEYBOARDPROPERTIES.setKeypressMode(KeypressMode.SINGLE_KEYPRESS); GENERAL_KEYBOARDPROPERTIES.setKeyboardLayout(KeyboardLayout.QWERTY); GENERAL_KEYBOARDPROPERTIES.setLanguage(Language.EN_US); - GENERAL_KEYBOARDPROPERTIES.setLimitedCharacterList(Test.GENERAL_STRING_LIST); + GENERAL_KEYBOARDPROPERTIES.setLimitedCharacterList(TestValues.GENERAL_STRING_LIST); GENERAL_STARTTIME.setHours(GENERAL_INT); GENERAL_STARTTIME.setMinutes(GENERAL_INT); @@ -1039,15 +1039,15 @@ public class Test { GENERAL_APP_SERVICE_CAPABILITIES.setAppServices(GENERAL_APPSERVICECAPABILITY_LIST); - GENERAL_DATETIME.setDay(Test.GENERAL_INT); - GENERAL_DATETIME.setHour(Test.GENERAL_INT); - GENERAL_DATETIME.setMilliSecond(Test.GENERAL_INT); - GENERAL_DATETIME.setMinute(Test.GENERAL_INT); - GENERAL_DATETIME.setMonth(Test.GENERAL_INT); - GENERAL_DATETIME.setSecond(Test.GENERAL_INT); - GENERAL_DATETIME.setTzHour(Test.GENERAL_INT); - GENERAL_DATETIME.setTzMinute(Test.GENERAL_INT); - GENERAL_DATETIME.setYear(Test.GENERAL_INT); + GENERAL_DATETIME.setDay(TestValues.GENERAL_INT); + GENERAL_DATETIME.setHour(TestValues.GENERAL_INT); + GENERAL_DATETIME.setMilliSecond(TestValues.GENERAL_INT); + GENERAL_DATETIME.setMinute(TestValues.GENERAL_INT); + GENERAL_DATETIME.setMonth(TestValues.GENERAL_INT); + GENERAL_DATETIME.setSecond(TestValues.GENERAL_INT); + GENERAL_DATETIME.setTzHour(TestValues.GENERAL_INT); + GENERAL_DATETIME.setTzMinute(TestValues.GENERAL_INT); + GENERAL_DATETIME.setYear(TestValues.GENERAL_INT); GENERAL_WEATHERDATA.setCurrentTemperature(GENERAL_TEMPERATURE); GENERAL_WEATHERDATA.setTemperatureHigh(GENERAL_TEMPERATURE); @@ -1110,10 +1110,10 @@ public class Test { GENERAL_NAVIGATION_INSTRUCTION.setDrivingSide(GENERAL_DIRECTION); GENERAL_NAVIGATION_INSTRUCTION.setDetails(GENERAL_STRING); GENERAL_NAVIGATION_INSTRUCTION.setImage(GENERAL_IMAGE); - GENERAL_MODULE_INFO.setModuleId(Test.GENERAL_STRING); - GENERAL_MODULE_INFO.setModuleLocation(Test.GENERAL_GRID); - GENERAL_MODULE_INFO.setModuleServiceArea(Test.GENERAL_GRID); - GENERAL_MODULE_INFO.setMultipleAccessAllowance(Test.GENERAL_BOOLEAN); + GENERAL_MODULE_INFO.setModuleId(TestValues.GENERAL_STRING); + GENERAL_MODULE_INFO.setModuleLocation(TestValues.GENERAL_GRID); + GENERAL_MODULE_INFO.setModuleServiceArea(TestValues.GENERAL_GRID); + GENERAL_MODULE_INFO.setMultipleAccessAllowance(TestValues.GENERAL_BOOLEAN); try { @@ -1287,7 +1287,7 @@ public class Test { JSON_TEXTFIELDS.put(JSON_TEXTFIELD); JSON_IMAGEFIELD.put(ImageField.KEY_IMAGE_RESOLUTION, JSON_IMAGERESOLUTION); - JSON_IMAGEFIELD.put(ImageField.KEY_IMAGE_TYPE_SUPPORTED, JsonUtils.createJsonArray(Test.GENERAL_FILETYPE_LIST)); + JSON_IMAGEFIELD.put(ImageField.KEY_IMAGE_TYPE_SUPPORTED, JsonUtils.createJsonArray(TestValues.GENERAL_FILETYPE_LIST)); JSON_IMAGEFIELD.put(ImageField.KEY_NAME, ImageFieldName.graphic); JSON_IMAGEFIELDS.put(JSON_IMAGEFIELD); @@ -1345,10 +1345,10 @@ public class Test { JSON_TEXTFIELDTYPES.put(MetadataType.MEDIA_ARTIST); JSON_SEAT_LOCATIONS.put(JSON_GRID); - JSON_MODULE_INFO.put(ModuleInfo.KEY_MODULE_ID, Test.GENERAL_STRING); - JSON_MODULE_INFO.put(ModuleInfo.KEY_MODULE_LOCATION, Test.JSON_GRID); - JSON_MODULE_INFO.put(ModuleInfo.KEY_MODULE_SERVICE_AREA, Test.JSON_GRID); - JSON_MODULE_INFO.put(ModuleInfo.KEY_MULTIPLE_ACCESS_ALLOWED, Test.GENERAL_BOOLEAN); + JSON_MODULE_INFO.put(ModuleInfo.KEY_MODULE_ID, TestValues.GENERAL_STRING); + JSON_MODULE_INFO.put(ModuleInfo.KEY_MODULE_LOCATION, TestValues.JSON_GRID); + JSON_MODULE_INFO.put(ModuleInfo.KEY_MODULE_SERVICE_AREA, TestValues.JSON_GRID); + JSON_MODULE_INFO.put(ModuleInfo.KEY_MULTIPLE_ACCESS_ALLOWED, TestValues.GENERAL_BOOLEAN); } catch (JSONException e) { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java index b0f753e13..729f1e498 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java @@ -188,7 +188,7 @@ public class VehicleDataHelper{ // fuel range public static final FuelType FUEL_RANGE_TYPE = FuelType.GASOLINE; - public static final Float FUEL_RANGE_RANGE = Test.GENERAL_FLOAT; + public static final Float FUEL_RANGE_RANGE = TestValues.GENERAL_FLOAT; public static final JSONArray JSON_FUEL_RANGE = new JSONArray(); @@ -357,7 +357,7 @@ public class VehicleDataHelper{ VEHICLE_DATA.setFuelRange(FUEL_RANGE_LIST); VEHICLE_DATA.setTurnSignal(TURN_SIGNAL); VEHICLE_DATA.setElectronicParkBrakeStatus(ELECTRONIC_PARK_BRAKE_STATUS); - VEHICLE_DATA.setOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, OEM_CUSTOM_VEHICLE_DATA_STATE); + VEHICLE_DATA.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, OEM_CUSTOM_VEHICLE_DATA_STATE); //set up the GetVehicleDataResponse object VEHICLE_DATA_RESPONSE.setSpeed(SPEED); @@ -389,7 +389,7 @@ public class VehicleDataHelper{ VEHICLE_DATA_RESPONSE.setFuelRange(FUEL_RANGE_LIST); VEHICLE_DATA_RESPONSE.setTurnSignal(TURN_SIGNAL); VEHICLE_DATA_RESPONSE.setElectronicParkBrakeStatus(ELECTRONIC_PARK_BRAKE_STATUS); - VEHICLE_DATA_RESPONSE.setOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, OEM_CUSTOM_VEHICLE_DATA_STATE); + VEHICLE_DATA_RESPONSE.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, OEM_CUSTOM_VEHICLE_DATA_STATE); } private VehicleDataHelper(){} diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/heartbeat/HeartbeatMonitorTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/heartbeat/HeartbeatMonitorTests.java index 7957ee227..9002f89fd 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/heartbeat/HeartbeatMonitorTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/protocol/heartbeat/HeartbeatMonitorTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.protocol.heartbeat; import com.smartdevicelink.protocol.heartbeat.HeartbeatMonitor; import com.smartdevicelink.protocol.heartbeat.IHeartbeatMonitorListener; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -22,10 +22,10 @@ public class HeartbeatMonitorTests extends TestCase { private Timer timer; public void testValues () { - assertNotNull(Test.NOT_NULL, monitor); + assertNotNull(TestValues.NOT_NULL, monitor); testRunnable = monitor.getHeartbeatRunnable(); - assertNotNull(Test.NOT_NULL, testRunnable); + assertNotNull(TestValues.NOT_NULL, testRunnable); int testInterval = 100; monitor.setInterval(testInterval); @@ -35,7 +35,7 @@ public class HeartbeatMonitorTests extends TestCase { public void testThread () { try { Thread testThread = new Thread(testRunnable); - assertNotNull(Test.NOT_NULL, testThread); + assertNotNull(TestValues.NOT_NULL, testThread); setTimeout(5000, testThread); // Cannot leave thread hanging testThread.start(); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/InternalProxyMessageTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/InternalProxyMessageTests.java index f5baf5e06..ec64ed99d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/InternalProxyMessageTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/InternalProxyMessageTests.java @@ -1,7 +1,7 @@ package com.smartdevicelink.test.proxy; import com.smartdevicelink.proxy.callbacks.InternalProxyMessage; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -19,17 +19,17 @@ public class InternalProxyMessageTests extends TestCase { // Valid Tests String test = "functionName"; InternalProxyMessage testIPM = new InternalProxyMessage(test); - assertEquals(Test.MATCH, test, testIPM.getFunctionName()); + assertEquals(TestValues.MATCH, test, testIPM.getFunctionName()); test = "OnProxyError"; - assertEquals(Test.MATCH, test, InternalProxyMessage.OnProxyError); + assertEquals(TestValues.MATCH, test, InternalProxyMessage.OnProxyError); test = "OnProxyOpened"; - assertEquals(Test.MATCH, test, InternalProxyMessage.OnProxyOpened); + assertEquals(TestValues.MATCH, test, InternalProxyMessage.OnProxyOpened); test = "OnProxyClosed"; - assertEquals(Test.MATCH, test, InternalProxyMessage.OnProxyClosed); + assertEquals(TestValues.MATCH, test, InternalProxyMessage.OnProxyClosed); // Invalid/Null Tests testIPM = new InternalProxyMessage(null); - assertNull(Test.NULL, testIPM.getFunctionName()); + assertNull(TestValues.NULL, testIPM.getFunctionName()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/LockScreenManagerTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/LockScreenManagerTest.java index 55d22dcfd..082c87fda 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/LockScreenManagerTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/LockScreenManagerTest.java @@ -4,7 +4,7 @@ import com.smartdevicelink.proxy.LockScreenManager; import com.smartdevicelink.proxy.rpc.OnLockScreenStatus; import com.smartdevicelink.proxy.rpc.enums.HMILevel; import com.smartdevicelink.proxy.rpc.enums.LockScreenStatus; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -21,10 +21,10 @@ public class LockScreenManagerTest extends TestCase { public void testDriverDistStatus(){ LockScreenManager lockMan = new LockScreenManager(); lockMan.setDriverDistStatus(true); - assertEquals(Test.MATCH, true, (boolean) lockMan.getLockObj().getDriverDistractionStatus()); + assertEquals(TestValues.MATCH, true, (boolean) lockMan.getLockObj().getDriverDistractionStatus()); lockMan.setDriverDistStatus(false); - assertEquals(Test.MATCH, false, (boolean) lockMan.getLockObj().getDriverDistractionStatus()); + assertEquals(TestValues.MATCH, false, (boolean) lockMan.getLockObj().getDriverDistractionStatus()); } /** @@ -34,19 +34,19 @@ public class LockScreenManagerTest extends TestCase { public void testHmiLevelStatus(){ LockScreenManager lockMan = new LockScreenManager(); lockMan.setHMILevel(HMILevel.HMI_BACKGROUND); - assertEquals(Test.MATCH, HMILevel.HMI_BACKGROUND, lockMan.getLockObj().getHMILevel()); + assertEquals(TestValues.MATCH, HMILevel.HMI_BACKGROUND, lockMan.getLockObj().getHMILevel()); lockMan.setHMILevel(HMILevel.HMI_FULL); - assertEquals(Test.MATCH, HMILevel.HMI_FULL, lockMan.getLockObj().getHMILevel()); + assertEquals(TestValues.MATCH, HMILevel.HMI_FULL, lockMan.getLockObj().getHMILevel()); lockMan.setHMILevel(HMILevel.HMI_LIMITED); - assertEquals(Test.MATCH, HMILevel.HMI_LIMITED, lockMan.getLockObj().getHMILevel()); + assertEquals(TestValues.MATCH, HMILevel.HMI_LIMITED, lockMan.getLockObj().getHMILevel()); lockMan.setHMILevel(HMILevel.HMI_NONE); - assertEquals(Test.MATCH, HMILevel.HMI_NONE, lockMan.getLockObj().getHMILevel()); + assertEquals(TestValues.MATCH, HMILevel.HMI_NONE, lockMan.getLockObj().getHMILevel()); lockMan.setHMILevel(null); - assertNull(Test.NULL, lockMan.getLockObj().getHMILevel()); + assertNull(TestValues.NULL, lockMan.getLockObj().getHMILevel()); } /** @@ -55,8 +55,8 @@ public class LockScreenManagerTest extends TestCase { public void testLockScreenStatusNull(){ LockScreenManager lockMan = new LockScreenManager(); OnLockScreenStatus result = lockMan.getLockObj(); - assertNotNull(Test.NOT_NULL, result); - assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); + assertNotNull(TestValues.NOT_NULL, result); + assertEquals(TestValues.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); } /** @@ -66,23 +66,23 @@ public class LockScreenManagerTest extends TestCase { LockScreenManager lockMan = new LockScreenManager(); OnLockScreenStatus result = lockMan.getLockObj(); - assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); + assertEquals(TestValues.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); lockMan.setHMILevel(HMILevel.HMI_NONE); result = lockMan.getLockObj(); - assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); + assertEquals(TestValues.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); lockMan.setHMILevel(HMILevel.HMI_BACKGROUND); result = lockMan.getLockObj(); - assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); + assertEquals(TestValues.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); lockMan.setHMILevel(HMILevel.HMI_FULL); result = lockMan.getLockObj(); - assertEquals(Test.MATCH, LockScreenStatus.REQUIRED, result.getShowLockScreen()); + assertEquals(TestValues.MATCH, LockScreenStatus.REQUIRED, result.getShowLockScreen()); lockMan.setHMILevel(HMILevel.HMI_LIMITED); result = lockMan.getLockObj(); - assertEquals(Test.MATCH, LockScreenStatus.REQUIRED, result.getShowLockScreen()); + assertEquals(TestValues.MATCH, LockScreenStatus.REQUIRED, result.getShowLockScreen()); } /** @@ -94,23 +94,23 @@ public class LockScreenManagerTest extends TestCase { // HMI level is null OnLockScreenStatus result = lockMan.getLockObj(); - assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); + assertEquals(TestValues.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); lockMan.setHMILevel(HMILevel.HMI_NONE); result = lockMan.getLockObj(); - assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); + assertEquals(TestValues.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); lockMan.setHMILevel(HMILevel.HMI_BACKGROUND); result = lockMan.getLockObj(); - assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); + assertEquals(TestValues.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); lockMan.setHMILevel(HMILevel.HMI_FULL); result = lockMan.getLockObj(); - assertEquals(Test.MATCH, LockScreenStatus.REQUIRED, result.getShowLockScreen()); + assertEquals(TestValues.MATCH, LockScreenStatus.REQUIRED, result.getShowLockScreen()); lockMan.setHMILevel(HMILevel.HMI_LIMITED); result = lockMan.getLockObj(); - assertEquals(Test.MATCH, LockScreenStatus.REQUIRED, result.getShowLockScreen()); + assertEquals(TestValues.MATCH, LockScreenStatus.REQUIRED, result.getShowLockScreen()); } /** @@ -121,22 +121,22 @@ public class LockScreenManagerTest extends TestCase { lockMan.setDriverDistStatus(false); OnLockScreenStatus result = lockMan.getLockObj(); - assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); + assertEquals(TestValues.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); lockMan.setHMILevel(HMILevel.HMI_NONE); result = lockMan.getLockObj(); - assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); + assertEquals(TestValues.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); lockMan.setHMILevel(HMILevel.HMI_BACKGROUND); result = lockMan.getLockObj(); - assertEquals(Test.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); + assertEquals(TestValues.MATCH, LockScreenStatus.OFF, result.getShowLockScreen()); lockMan.setHMILevel(HMILevel.HMI_FULL); result = lockMan.getLockObj(); - assertEquals(Test.MATCH, LockScreenStatus.OPTIONAL, result.getShowLockScreen()); + assertEquals(TestValues.MATCH, LockScreenStatus.OPTIONAL, result.getShowLockScreen()); lockMan.setHMILevel(HMILevel.HMI_LIMITED); result = lockMan.getLockObj(); - assertEquals(Test.MATCH, LockScreenStatus.OPTIONAL, result.getShowLockScreen()); + assertEquals(TestValues.MATCH, LockScreenStatus.OPTIONAL, result.getShowLockScreen()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCMessageTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCMessageTests.java index 51727bb66..6bc3011b8 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCMessageTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCMessageTests.java @@ -10,7 +10,7 @@ import com.smartdevicelink.proxy.rpc.Image; import com.smartdevicelink.proxy.rpc.TTSChunk; import com.smartdevicelink.proxy.rpc.enums.Language; import com.smartdevicelink.proxy.rpc.enums.MediaClockFormat; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -39,11 +39,11 @@ public class RPCMessageTests extends TestCase { } public void testGeneralGettersAndSetters(){ - String testKey = Test.GENERAL_STRING; - Integer testInt = Test.GENERAL_INT; + String testKey = TestValues.GENERAL_STRING; + Integer testInt = TestValues.GENERAL_INT; testMessage.setParameters(testKey, testInt); - assertEquals(Test.MATCH, testInt, testMessage.getParameters(testKey)); + assertEquals(TestValues.MATCH, testInt, testMessage.getParameters(testKey)); testMessage.setParameters(testKey, null); assertNull(testMessage.getParameters(testKey)); @@ -51,38 +51,38 @@ public class RPCMessageTests extends TestCase { public void testCommonObjectGetters(){ String stringKey = "String"; - String testString = Test.GENERAL_STRING; + String testString = TestValues.GENERAL_STRING; testMessage.setParameters(stringKey, testString); - assertEquals(Test.MATCH, testMessage.getString(stringKey), testString); + assertEquals(TestValues.MATCH, testMessage.getString(stringKey), testString); String intKey = "Integer"; - Integer testInt = Test.GENERAL_INT; + Integer testInt = TestValues.GENERAL_INT; testMessage.setParameters(intKey, testInt); - assertEquals(Test.MATCH, testMessage.getInteger(intKey), testInt); + assertEquals(TestValues.MATCH, testMessage.getInteger(intKey), testInt); String doubleKey = "Double"; - Double testDouble = Test.GENERAL_DOUBLE; + Double testDouble = TestValues.GENERAL_DOUBLE; testMessage.setParameters(doubleKey, testDouble); - assertEquals(Test.MATCH, testMessage.getDouble(doubleKey), testDouble); + assertEquals(TestValues.MATCH, testMessage.getDouble(doubleKey), testDouble); String booleanKey = "Boolean"; - Boolean testBoolean = Test.GENERAL_BOOLEAN; + Boolean testBoolean = TestValues.GENERAL_BOOLEAN; testMessage.setParameters(booleanKey, testBoolean); - assertEquals(Test.MATCH, testMessage.getBoolean(booleanKey), testBoolean); + assertEquals(TestValues.MATCH, testMessage.getBoolean(booleanKey), testBoolean); String longKey = "Long"; - Long testLong = Test.GENERAL_LONG; + Long testLong = TestValues.GENERAL_LONG; testMessage.setParameters(longKey, testLong); - assertEquals(Test.MATCH, testMessage.getLong(longKey), testLong); + assertEquals(TestValues.MATCH, testMessage.getLong(longKey), testLong); testMessage.setParameters(longKey, testInt); - assertEquals(Test.MATCH, testMessage.getLong(longKey), new Long(testInt.longValue())); + assertEquals(TestValues.MATCH, testMessage.getLong(longKey), new Long(testInt.longValue())); testMessage.setParameters(longKey, testDouble); assertNull(testMessage.getLong(longKey)); @@ -93,28 +93,28 @@ public class RPCMessageTests extends TestCase { assertNull(testMessage.getObject(Integer.class, keyIsEmpty)); String keyLanguage = ChangeRegistration.KEY_LANGUAGE; - Language language = Test.GENERAL_LANGUAGE; + Language language = TestValues.GENERAL_LANGUAGE; testMessage.setParameters(keyLanguage, language); - assertEquals(Test.MATCH, language, testMessage.getObject(Language.class, keyLanguage)); + assertEquals(TestValues.MATCH, language, testMessage.getObject(Language.class, keyLanguage)); String languageString = language.toString(); testMessage.setParameters(keyLanguage, languageString); - assertEquals(Test.MATCH, language, testMessage.getObject(Language.class, keyLanguage)); + assertEquals(TestValues.MATCH, language, testMessage.getObject(Language.class, keyLanguage)); String keyImage = Choice.KEY_IMAGE; - Image testImage = Test.GENERAL_IMAGE; + Image testImage = TestValues.GENERAL_IMAGE; testMessage.setParameters(keyImage, testImage.getStore()); assertTrue(Validator.validateImage(testImage, (Image) testMessage.getObject(Image.class, keyImage))); String keyDTCs = GetDTCsResponse.KEY_DTC; - List<String> testDTCs = Test.GENERAL_STRING_LIST; + List<String> testDTCs = TestValues.GENERAL_STRING_LIST; testMessage.setParameters(keyDTCs, testDTCs); - assertEquals(Test.MATCH, testDTCs, testMessage.getObject(String.class, keyDTCs)); + assertEquals(TestValues.MATCH, testDTCs, testMessage.getObject(String.class, keyDTCs)); String keyTTSchunks = Alert.KEY_TTS_CHUNKS; - List<TTSChunk> testTTSchunks = Test.GENERAL_TTSCHUNK_LIST; + List<TTSChunk> testTTSchunks = TestValues.GENERAL_TTSCHUNK_LIST; testMessage.setParameters(keyTTSchunks, testTTSchunks); - assertEquals(Test.MATCH, testTTSchunks, testMessage.getObject(TTSChunk.class, keyTTSchunks)); + assertEquals(TestValues.MATCH, testTTSchunks, testMessage.getObject(TTSChunk.class, keyTTSchunks)); List<Hashtable<String, Object>> testListTTSchunks = new ArrayList<>(); for(TTSChunk ttsChunk : testTTSchunks){ @@ -125,16 +125,16 @@ public class RPCMessageTests extends TestCase { assertTrue(Validator.validateTtsChunks(testTTSchunks, underTest)); String keyMediaClockFormats = DisplayCapabilities.KEY_MEDIA_CLOCK_FORMATS; - List<MediaClockFormat> testMediaClockFormats = Test.GENERAL_MEDIACLOCKFORMAT_LIST; + List<MediaClockFormat> testMediaClockFormats = TestValues.GENERAL_MEDIACLOCKFORMAT_LIST; testMessage.setParameters(keyMediaClockFormats, testMediaClockFormats); - assertEquals(Test.MATCH, testMediaClockFormats, testMessage.getObject(MediaClockFormat.class, keyMediaClockFormats)); + assertEquals(TestValues.MATCH, testMediaClockFormats, testMessage.getObject(MediaClockFormat.class, keyMediaClockFormats)); List<String> testListMediaClockFormats = new ArrayList<>(); for(MediaClockFormat mcFormat : testMediaClockFormats){ testListMediaClockFormats.add(mcFormat.toString()); } testMessage.setParameters(keyMediaClockFormats, testListMediaClockFormats); - assertEquals(Test.MATCH, testMediaClockFormats, testMessage.getObject(MediaClockFormat.class, keyMediaClockFormats)); + assertEquals(TestValues.MATCH, testMediaClockFormats, testMessage.getObject(MediaClockFormat.class, keyMediaClockFormats)); assertNull(testMessage.getObject(Image.class, keyLanguage)); // Test incorrect class } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestFactoryTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestFactoryTests.java index 4762bc2b9..8c66446af 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestFactoryTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestFactoryTests.java @@ -51,7 +51,7 @@ import com.smartdevicelink.proxy.rpc.enums.SamplingRate; import com.smartdevicelink.proxy.rpc.enums.TextAlignment; import com.smartdevicelink.proxy.rpc.enums.UpdateMode; import com.smartdevicelink.test.NullValues; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -75,14 +75,14 @@ public class RPCRequestFactoryTests extends TestCase { testData = "test"; testInt = 0; testBSR = RPCRequestFactory.buildSystemRequest(testData, testInt); - assertNotNull(Test.NOT_NULL, testBSR.getBulkData()); - assertEquals(Test.MATCH, testInt, testBSR.getCorrelationID()); + assertNotNull(TestValues.NOT_NULL, testBSR.getBulkData()); + assertEquals(TestValues.MATCH, testInt, testBSR.getCorrelationID()); testBSR = RPCRequestFactory.buildSystemRequest(testData, null); - assertNotNull(Test.NULL, testBSR.getCorrelationID()); + assertNotNull(TestValues.NULL, testBSR.getCorrelationID()); testBSR = RPCRequestFactory.buildSystemRequest(null, testInt); - assertNull(Test.NULL, testBSR); + assertNull(TestValues.NULL, testBSR); // Test -- buildSystemRequestLegacy(Vector<String> data, Integer correlationID) testVData = new Vector<String>(); @@ -90,14 +90,14 @@ public class RPCRequestFactoryTests extends TestCase { testVData.add("Test B"); testVData.add("Test C"); testBSR = RPCRequestFactory.buildSystemRequestLegacy(testVData, testInt); - assertEquals(Test.MATCH, testVData, new Vector<String>(testBSR.getLegacyData())); - assertEquals(Test.MATCH, testInt, testBSR.getCorrelationID()); + assertEquals(TestValues.MATCH, testVData, new Vector<String>(testBSR.getLegacyData())); + assertEquals(TestValues.MATCH, testInt, testBSR.getCorrelationID()); testBSR = RPCRequestFactory.buildSystemRequestLegacy(testVData, null); - assertNotNull(Test.NOT_NULL, testBSR.getCorrelationID()); + assertNotNull(TestValues.NOT_NULL, testBSR.getCorrelationID()); testBSR = RPCRequestFactory.buildSystemRequestLegacy(null, testInt); - assertNull(Test.NULL, testBSR); + assertNull(TestValues.NULL, testBSR); // Issue #166 -- Null values within the Vector<String> parameter. // TODO: Once resolved, add the following test. @@ -131,20 +131,20 @@ public class RPCRequestFactoryTests extends TestCase { testVrCommands.add("Test A"); testVrCommands.add("Test B"); testBAC = RPCRequestFactory.buildAddCommand(testCommandID, testMenuText, testParentID, testPosition, testVrCommands, testImage, testCorrelationID); - assertEquals(Test.MATCH, testCommandID, testBAC.getCmdID()); - assertEquals(Test.MATCH, testMenuText, testBAC.getMenuParams().getMenuName()); - assertEquals(Test.MATCH, testParentID, testBAC.getMenuParams().getParentID()); - assertEquals(Test.MATCH, testPosition, testBAC.getMenuParams().getPosition()); - assertEquals(Test.MATCH, testVrCommands, testBAC.getVrCommands()); - assertTrue(Test.TRUE, Validator.validateImage(testImage, testBAC.getCmdIcon())); - assertEquals(Test.MATCH, testCorrelationID, testBAC.getCorrelationID()); + assertEquals(TestValues.MATCH, testCommandID, testBAC.getCmdID()); + assertEquals(TestValues.MATCH, testMenuText, testBAC.getMenuParams().getMenuName()); + assertEquals(TestValues.MATCH, testParentID, testBAC.getMenuParams().getParentID()); + assertEquals(TestValues.MATCH, testPosition, testBAC.getMenuParams().getPosition()); + assertEquals(TestValues.MATCH, testVrCommands, testBAC.getVrCommands()); + assertTrue(TestValues.TRUE, Validator.validateImage(testImage, testBAC.getCmdIcon())); + assertEquals(TestValues.MATCH, testCorrelationID, testBAC.getCorrelationID()); testBAC = RPCRequestFactory.buildAddCommand(null, null, null, null, null, null, null); - assertNull(Test.NULL, testBAC.getCmdID()); - assertNull(Test.NULL, testBAC.getMenuParams()); - assertNull(Test.NULL, testBAC.getVrCommands()); - assertNull(Test.NULL, testBAC.getCmdIcon()); - assertNotNull(Test.NOT_NULL, testBAC.getCorrelationID()); + assertNull(TestValues.NULL, testBAC.getCmdID()); + assertNull(TestValues.NULL, testBAC.getMenuParams()); + assertNull(TestValues.NULL, testBAC.getVrCommands()); + assertNull(TestValues.NULL, testBAC.getCmdIcon()); + assertNotNull(TestValues.NOT_NULL, testBAC.getCorrelationID()); // Test -- buildAddCommand(Integer commandID, String menuText, Integer parentID, Integer position, Vector<String> vrCommands, String IconValue, ImageType IconType, Integer correlationID) testIconValue = "icon"; @@ -153,59 +153,59 @@ public class RPCRequestFactoryTests extends TestCase { testImage.setValue(testIconValue); testImage.setImageType(testIconType); testBAC = RPCRequestFactory.buildAddCommand(testCommandID, testMenuText, testParentID, testPosition, testVrCommands, testIconValue, testIconType, testCorrelationID); - assertEquals(Test.MATCH, testCommandID, testBAC.getCmdID()); - assertEquals(Test.MATCH, testMenuText, testBAC.getMenuParams().getMenuName()); - assertEquals(Test.MATCH, testParentID, testBAC.getMenuParams().getParentID()); - assertEquals(Test.MATCH, testPosition, testBAC.getMenuParams().getPosition()); - assertEquals(Test.MATCH, testVrCommands, testBAC.getVrCommands()); - assertEquals(Test.MATCH, testCorrelationID, testBAC.getCorrelationID()); - assertTrue(Test.TRUE, Validator.validateImage(testImage, testBAC.getCmdIcon())); + assertEquals(TestValues.MATCH, testCommandID, testBAC.getCmdID()); + assertEquals(TestValues.MATCH, testMenuText, testBAC.getMenuParams().getMenuName()); + assertEquals(TestValues.MATCH, testParentID, testBAC.getMenuParams().getParentID()); + assertEquals(TestValues.MATCH, testPosition, testBAC.getMenuParams().getPosition()); + assertEquals(TestValues.MATCH, testVrCommands, testBAC.getVrCommands()); + assertEquals(TestValues.MATCH, testCorrelationID, testBAC.getCorrelationID()); + assertTrue(TestValues.TRUE, Validator.validateImage(testImage, testBAC.getCmdIcon())); testBAC = RPCRequestFactory.buildAddCommand(null, null, null, null, null, null, null, null); - assertNull(Test.NULL, testBAC.getCmdID()); - assertNull(Test.NULL, testBAC.getMenuParams()); - assertNull(Test.NULL, testBAC.getVrCommands()); - assertNull(Test.NULL, testBAC.getCmdIcon()); - assertNotNull(Test.NOT_NULL, testBAC.getCorrelationID()); + assertNull(TestValues.NULL, testBAC.getCmdID()); + assertNull(TestValues.NULL, testBAC.getMenuParams()); + assertNull(TestValues.NULL, testBAC.getVrCommands()); + assertNull(TestValues.NULL, testBAC.getCmdIcon()); + assertNotNull(TestValues.NOT_NULL, testBAC.getCorrelationID()); // Test -- buildAddCommand(Integer commandID, String menuText, Integer parentID, Integer position, Vector<String> vrCommands, Integer correlationID) testBAC = RPCRequestFactory.buildAddCommand(testCommandID, testMenuText, testParentID, testPosition, testVrCommands, testCorrelationID); - assertEquals(Test.MATCH, testCommandID, testBAC.getCmdID()); - assertEquals(Test.MATCH, testMenuText, testBAC.getMenuParams().getMenuName()); - assertEquals(Test.MATCH, testParentID, testBAC.getMenuParams().getParentID()); - assertEquals(Test.MATCH, testPosition, testBAC.getMenuParams().getPosition()); - assertEquals(Test.MATCH, testVrCommands, testBAC.getVrCommands()); - assertEquals(Test.MATCH, testCorrelationID, testBAC.getCorrelationID()); + assertEquals(TestValues.MATCH, testCommandID, testBAC.getCmdID()); + assertEquals(TestValues.MATCH, testMenuText, testBAC.getMenuParams().getMenuName()); + assertEquals(TestValues.MATCH, testParentID, testBAC.getMenuParams().getParentID()); + assertEquals(TestValues.MATCH, testPosition, testBAC.getMenuParams().getPosition()); + assertEquals(TestValues.MATCH, testVrCommands, testBAC.getVrCommands()); + assertEquals(TestValues.MATCH, testCorrelationID, testBAC.getCorrelationID()); testBAC = RPCRequestFactory.buildAddCommand(null, null, null, null, null, null); - assertNull(Test.NULL, testBAC.getCmdID()); - assertNull(Test.NULL, testBAC.getMenuParams()); - assertNull(Test.NULL, testBAC.getVrCommands()); - assertNotNull(Test.NOT_NULL, testBAC.getCorrelationID()); + assertNull(TestValues.NULL, testBAC.getCmdID()); + assertNull(TestValues.NULL, testBAC.getMenuParams()); + assertNull(TestValues.NULL, testBAC.getVrCommands()); + assertNotNull(TestValues.NOT_NULL, testBAC.getCorrelationID()); // Test -- buildAddCommand(Integer commandID, String menuText, Vector<String> vrCommands, Integer correlationID) testBAC = RPCRequestFactory.buildAddCommand(testCommandID, testMenuText, testVrCommands, testCorrelationID); - assertEquals(Test.MATCH, testCommandID, testBAC.getCmdID()); - assertEquals(Test.MATCH, testMenuText, testBAC.getMenuParams().getMenuName()); - assertEquals(Test.MATCH, testVrCommands, testBAC.getVrCommands()); - assertEquals(Test.MATCH, testCorrelationID, testBAC.getCorrelationID()); + assertEquals(TestValues.MATCH, testCommandID, testBAC.getCmdID()); + assertEquals(TestValues.MATCH, testMenuText, testBAC.getMenuParams().getMenuName()); + assertEquals(TestValues.MATCH, testVrCommands, testBAC.getVrCommands()); + assertEquals(TestValues.MATCH, testCorrelationID, testBAC.getCorrelationID()); testBAC = RPCRequestFactory.buildAddCommand(null, null, null, null); - assertNull(Test.NULL, testBAC.getCmdID()); - assertNull(Test.NULL, testBAC.getMenuParams()); - assertNull(Test.NULL, testBAC.getVrCommands()); - assertNotNull(Test.NOT_NULL, testBAC.getCorrelationID()); + assertNull(TestValues.NULL, testBAC.getCmdID()); + assertNull(TestValues.NULL, testBAC.getMenuParams()); + assertNull(TestValues.NULL, testBAC.getVrCommands()); + assertNotNull(TestValues.NOT_NULL, testBAC.getCorrelationID()); // Test -- buildAddCommand(Integer commandID, Vector<String> vrCommands, Integer correlationID) testBAC = RPCRequestFactory.buildAddCommand(testCommandID, testVrCommands, testCorrelationID); - assertEquals(Test.MATCH, testCommandID, testBAC.getCmdID()); - assertEquals(Test.MATCH, testVrCommands, testBAC.getVrCommands()); - assertEquals(Test.MATCH, testCorrelationID, testBAC.getCorrelationID()); + assertEquals(TestValues.MATCH, testCommandID, testBAC.getCmdID()); + assertEquals(TestValues.MATCH, testVrCommands, testBAC.getVrCommands()); + assertEquals(TestValues.MATCH, testCorrelationID, testBAC.getCorrelationID()); testBAC = RPCRequestFactory.buildAddCommand(null, null, null); - assertNull(Test.NULL, testBAC.getCmdID()); - assertNull(Test.NULL, testBAC.getVrCommands()); - assertNotNull(Test.NOT_NULL, testBAC.getCorrelationID()); + assertNull(TestValues.NULL, testBAC.getCmdID()); + assertNull(TestValues.NULL, testBAC.getVrCommands()); + assertNotNull(TestValues.NOT_NULL, testBAC.getCorrelationID()); } public void testBuildAddSubMenu () { @@ -222,16 +222,16 @@ public class RPCRequestFactoryTests extends TestCase { testPosition = 1; testCorrelationID = 2; testBASM = RPCRequestFactory.buildAddSubMenu(testMenuID, testMenuName, testPosition, testCorrelationID); - assertEquals(Test.MATCH, testMenuID, testBASM.getMenuID()); - assertEquals(Test.MATCH, testMenuName, testBASM.getMenuName()); - assertEquals(Test.MATCH, testPosition, testBASM.getPosition()); - assertEquals(Test.MATCH, testCorrelationID, testBASM.getCorrelationID()); + assertEquals(TestValues.MATCH, testMenuID, testBASM.getMenuID()); + assertEquals(TestValues.MATCH, testMenuName, testBASM.getMenuName()); + assertEquals(TestValues.MATCH, testPosition, testBASM.getPosition()); + assertEquals(TestValues.MATCH, testCorrelationID, testBASM.getCorrelationID()); testBASM = RPCRequestFactory.buildAddSubMenu(null, null, null, null); - assertNull(Test.NULL, testBASM.getMenuID()); - assertNull(Test.NULL, testBASM.getMenuName()); - assertNull(Test.NULL, testBASM.getPosition()); - assertNotNull(Test.NOT_NULL, testBASM.getCorrelationID()); + assertNull(TestValues.NULL, testBASM.getMenuID()); + assertNull(TestValues.NULL, testBASM.getMenuName()); + assertNull(TestValues.NULL, testBASM.getPosition()); + assertNotNull(TestValues.NOT_NULL, testBASM.getCorrelationID()); } public void testBuildAlert () { @@ -255,7 +255,7 @@ public class RPCRequestFactoryTests extends TestCase { testSoftButtons.add(test1); testSoftButtons.add(test2); testAlert = RPCRequestFactory.buildAlert(testTTSText, testPlayTone, testSoftButtons, testCorrelationID); - assertTrue(Test.TRUE, Validator.validateTtsChunks(TTSChunkFactory.createSimpleTTSChunks(testTTSText), testAlert.getTtsChunks())); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(TTSChunkFactory.createSimpleTTSChunks(testTTSText), testAlert.getTtsChunks())); // ^ Calls another build method. // Test -- buildAlert(String alertText1, String alertText2, String alertText3, Integer duration, Vector<SoftButton> softButtons, Integer correlationID) @@ -267,7 +267,7 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- buildAlert(String ttsText, String alertText1, String alertText2, String alertText3, Boolean playTone, Integer duration, Vector<SoftButton> softButtons, Integer correlationID) testAlert = RPCRequestFactory.buildAlert(testTTSText, testAlertText1, testAlertText2, testAlertText3, testPlayTone, testDuration, testSoftButtons, testCorrelationID); - assertTrue(Test.TRUE, Validator.validateTtsChunks(TTSChunkFactory.createSimpleTTSChunks(testTTSText), testAlert.getTtsChunks())); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(TTSChunkFactory.createSimpleTTSChunks(testTTSText), testAlert.getTtsChunks())); // ^ Calls another build method. // Test -- buildAlert(Vector<TTSChunk> chunks, Boolean playTone, Vector<SoftButton> softButtons, Integer correlationID) @@ -276,24 +276,24 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- buildAlert(Vector<TTSChunk> ttsChunks, String alertText1, String alertText2, String alertText3, Boolean playTone, Integer duration, Vector<SoftButton> softButtons, Integer correlationID) testTtsChunks = TTSChunkFactory.createSimpleTTSChunks(testTTSText); testAlert = RPCRequestFactory.buildAlert(testTtsChunks, testAlertText1, testAlertText2, testAlertText3, testPlayTone, testDuration, testSoftButtons, testCorrelationID); - assertTrue(Test.TRUE, Validator.validateTtsChunks(testTtsChunks, testAlert.getTtsChunks())); - assertEquals(Test.MATCH, testAlertText1, testAlert.getAlertText1()); - assertEquals(Test.MATCH, testAlertText2, testAlert.getAlertText2()); - assertEquals(Test.MATCH, testAlertText3, testAlert.getAlertText3()); - assertEquals(Test.MATCH, testPlayTone, testAlert.getPlayTone()); - assertEquals(Test.MATCH, testDuration, testAlert.getDuration()); - assertTrue(Test.TRUE, Validator.validateSoftButtons(testSoftButtons, testAlert.getSoftButtons())); - assertEquals(Test.MATCH, testCorrelationID, testAlert.getCorrelationID()); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testTtsChunks, testAlert.getTtsChunks())); + assertEquals(TestValues.MATCH, testAlertText1, testAlert.getAlertText1()); + assertEquals(TestValues.MATCH, testAlertText2, testAlert.getAlertText2()); + assertEquals(TestValues.MATCH, testAlertText3, testAlert.getAlertText3()); + assertEquals(TestValues.MATCH, testPlayTone, testAlert.getPlayTone()); + assertEquals(TestValues.MATCH, testDuration, testAlert.getDuration()); + assertTrue(TestValues.TRUE, Validator.validateSoftButtons(testSoftButtons, testAlert.getSoftButtons())); + assertEquals(TestValues.MATCH, testCorrelationID, testAlert.getCorrelationID()); testAlert = RPCRequestFactory.buildAlert((Vector<TTSChunk>) null, null, null, null, null, null, null, null); - assertNull(Test.NULL, testAlert.getTtsChunks()); - assertNull(Test.NULL, testAlert.getAlertText1()); - assertNull(Test.NULL, testAlert.getAlertText2()); - assertNull(Test.NULL, testAlert.getAlertText3()); - assertNull(Test.NULL, testAlert.getPlayTone()); - assertNull(Test.NULL, testAlert.getDuration()); - assertNull(Test.NULL, testAlert.getSoftButtons()); - assertNotNull(Test.NOT_NULL, testAlert.getCorrelationID()); + assertNull(TestValues.NULL, testAlert.getTtsChunks()); + assertNull(TestValues.NULL, testAlert.getAlertText1()); + assertNull(TestValues.NULL, testAlert.getAlertText2()); + assertNull(TestValues.NULL, testAlert.getAlertText3()); + assertNull(TestValues.NULL, testAlert.getPlayTone()); + assertNull(TestValues.NULL, testAlert.getDuration()); + assertNull(TestValues.NULL, testAlert.getSoftButtons()); + assertNotNull(TestValues.NOT_NULL, testAlert.getCorrelationID()); // Test -- buildAlert(String ttsText, Boolean playTone, Integer correlationID) // ^ Calls another build method. @@ -309,20 +309,20 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- buildAlert(Vector<TTSChunk> ttsChunks, String alertText1, String alertText2, Boolean playTone, Integer duration, Integer correlationID) testAlert = RPCRequestFactory.buildAlert(testTtsChunks, testAlertText1, testAlertText2, testPlayTone, testDuration, testCorrelationID); - assertTrue(Test.TRUE, Validator.validateTtsChunks(testTtsChunks, testAlert.getTtsChunks())); - assertEquals(Test.MATCH, testAlertText1, testAlert.getAlertText1()); - assertEquals(Test.MATCH, testAlertText2, testAlert.getAlertText2()); - assertEquals(Test.MATCH, testPlayTone, testAlert.getPlayTone()); - assertEquals(Test.MATCH, testDuration, testAlert.getDuration()); - assertEquals(Test.MATCH, testCorrelationID, testAlert.getCorrelationID()); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testTtsChunks, testAlert.getTtsChunks())); + assertEquals(TestValues.MATCH, testAlertText1, testAlert.getAlertText1()); + assertEquals(TestValues.MATCH, testAlertText2, testAlert.getAlertText2()); + assertEquals(TestValues.MATCH, testPlayTone, testAlert.getPlayTone()); + assertEquals(TestValues.MATCH, testDuration, testAlert.getDuration()); + assertEquals(TestValues.MATCH, testCorrelationID, testAlert.getCorrelationID()); testAlert = RPCRequestFactory.buildAlert((Vector<TTSChunk>) null, null, null, null, null, null); - assertNull(Test.NULL, testAlert.getTtsChunks()); - assertNull(Test.NULL, testAlert.getAlertText1()); - assertNull(Test.NULL, testAlert.getAlertText2()); - assertNull(Test.NULL, testAlert.getPlayTone()); - assertNull(Test.NULL, testAlert.getDuration()); - assertNotNull(Test.NOT_NULL, testAlert.getCorrelationID()); + assertNull(TestValues.NULL, testAlert.getTtsChunks()); + assertNull(TestValues.NULL, testAlert.getAlertText1()); + assertNull(TestValues.NULL, testAlert.getAlertText2()); + assertNull(TestValues.NULL, testAlert.getPlayTone()); + assertNull(TestValues.NULL, testAlert.getDuration()); + assertNotNull(TestValues.NOT_NULL, testAlert.getCorrelationID()); } public void testBuildCreateInteractionChoiceSet () { @@ -338,14 +338,14 @@ public class RPCRequestFactoryTests extends TestCase { Choice testChoice = new Choice(); testChoiceSet.add(testChoice); testBCICS = RPCRequestFactory.buildCreateInteractionChoiceSet(testChoiceSet, testICSID, testCorrelationID); - assertEquals(Test.MATCH, testChoiceSet, testBCICS.getChoiceSet()); - assertEquals(Test.MATCH, testICSID, testBCICS.getInteractionChoiceSetID()); - assertEquals(Test.MATCH, testCorrelationID, testBCICS.getCorrelationID()); + assertEquals(TestValues.MATCH, testChoiceSet, testBCICS.getChoiceSet()); + assertEquals(TestValues.MATCH, testICSID, testBCICS.getInteractionChoiceSetID()); + assertEquals(TestValues.MATCH, testCorrelationID, testBCICS.getCorrelationID()); testBCICS = RPCRequestFactory.buildCreateInteractionChoiceSet(null, null, null); - assertNull(Test.NULL, testBCICS.getChoiceSet()); - assertNull(Test.NULL, testBCICS.getInteractionChoiceSetID()); - assertNotNull(Test.NOT_NULL, testBCICS.getCorrelationID()); + assertNull(TestValues.NULL, testBCICS.getChoiceSet()); + assertNull(TestValues.NULL, testBCICS.getInteractionChoiceSetID()); + assertNotNull(TestValues.NOT_NULL, testBCICS.getCorrelationID()); } public void testBuildDeleteCommand () { @@ -357,12 +357,12 @@ public class RPCRequestFactoryTests extends TestCase { testCID = 0; testCorrelationID = 1; testDC = RPCRequestFactory.buildDeleteCommand(testCID, testCorrelationID); - assertEquals(Test.MATCH, testCID, testDC.getCmdID()); - assertEquals(Test.MATCH, testCorrelationID, testDC.getCorrelationID()); + assertEquals(TestValues.MATCH, testCID, testDC.getCmdID()); + assertEquals(TestValues.MATCH, testCorrelationID, testDC.getCorrelationID()); testDC = RPCRequestFactory.buildDeleteCommand(null, null); - assertNull(Test.NULL, testDC.getCmdID()); - assertNotNull(Test.NOT_NULL, testDC.getCorrelationID()); + assertNull(TestValues.NULL, testDC.getCmdID()); + assertNotNull(TestValues.NOT_NULL, testDC.getCorrelationID()); } @@ -376,12 +376,12 @@ public class RPCRequestFactoryTests extends TestCase { testCorrelationID = 0; testFileName = "test"; testDF = RPCRequestFactory.buildDeleteFile(testFileName, testCorrelationID); - assertEquals(Test.MATCH, testCorrelationID, testDF.getCorrelationID()); - assertEquals(Test.MATCH, testFileName, testDF.getSdlFileName()); + assertEquals(TestValues.MATCH, testCorrelationID, testDF.getCorrelationID()); + assertEquals(TestValues.MATCH, testFileName, testDF.getSdlFileName()); testDF = RPCRequestFactory.buildDeleteFile(null, null); - assertNotNull(Test.NOT_NULL, testDF.getCorrelationID()); - assertNull(Test.NULL, testDF.getSdlFileName()); + assertNotNull(TestValues.NOT_NULL, testDF.getCorrelationID()); + assertNull(TestValues.NULL, testDF.getSdlFileName()); } @@ -394,12 +394,12 @@ public class RPCRequestFactoryTests extends TestCase { testICSID = 0; testCorrelationID = 1; testDICS = RPCRequestFactory.buildDeleteInteractionChoiceSet(testICSID, testCorrelationID); - assertEquals(Test.MATCH, testICSID, testDICS.getInteractionChoiceSetID()); - assertEquals(Test.MATCH, testCorrelationID, testDICS.getCorrelationID()); + assertEquals(TestValues.MATCH, testICSID, testDICS.getInteractionChoiceSetID()); + assertEquals(TestValues.MATCH, testCorrelationID, testDICS.getCorrelationID()); testDICS = RPCRequestFactory.buildDeleteInteractionChoiceSet(null, null); - assertNull(Test.NULL, testDICS.getInteractionChoiceSetID()); - assertNotNull(Test.NOT_NULL, testDICS.getCorrelationID()); + assertNull(TestValues.NULL, testDICS.getInteractionChoiceSetID()); + assertNotNull(TestValues.NOT_NULL, testDICS.getCorrelationID()); } public void testBuildDeleteSubMenu () { @@ -411,12 +411,12 @@ public class RPCRequestFactoryTests extends TestCase { testMenuID = 0; testCorrelationID = 1; testDSM = RPCRequestFactory.buildDeleteSubMenu(testMenuID, testCorrelationID); - assertEquals(Test.MATCH, testMenuID, testDSM.getMenuID()); - assertEquals(Test.MATCH, testCorrelationID, testDSM.getCorrelationID()); + assertEquals(TestValues.MATCH, testMenuID, testDSM.getMenuID()); + assertEquals(TestValues.MATCH, testCorrelationID, testDSM.getCorrelationID()); testDSM = RPCRequestFactory.buildDeleteSubMenu(null, null); - assertNull(Test.NULL, testDSM.getMenuID()); - assertNotNull(Test.NOT_NULL, testDSM.getCorrelationID()); + assertNull(TestValues.NULL, testDSM.getMenuID()); + assertNotNull(TestValues.NOT_NULL, testDSM.getCorrelationID()); } public void testBuildListFiles () { @@ -426,10 +426,10 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- buildListFiles(Integer correlationID) testLF = RPCRequestFactory.buildListFiles(testCorrelationID); - assertEquals(Test.MATCH, testCorrelationID, testLF.getCorrelationID()); + assertEquals(TestValues.MATCH, testCorrelationID, testLF.getCorrelationID()); testLF = RPCRequestFactory.buildListFiles(null); - assertNotNull(Test.NOT_NULL, testLF.getCorrelationID()); + assertNotNull(TestValues.NOT_NULL, testLF.getCorrelationID()); } @SuppressWarnings("deprecation") @@ -460,26 +460,26 @@ public class RPCRequestFactoryTests extends TestCase { testCSIDs.add(0); testCSIDs.add(1); testPI = RPCRequestFactory.buildPerformInteraction(testInitChunks, testDisplayText, testCSIDs, testHelpChunks, testTimeoutChunks, testIM, testTimeout, testVrHelpItems, testCorrelationID); - assertTrue(Test.TRUE, Validator.validateTtsChunks(testInitChunks, testPI.getInitialPrompt())); - assertEquals(Test.MATCH, testDisplayText, testPI.getInitialText()); - assertTrue(Test.TRUE, Validator.validateIntegerList(testCSIDs, testPI.getInteractionChoiceSetIDList())); - assertTrue(Test.TRUE, Validator.validateTtsChunks(testHelpChunks, testPI.getHelpPrompt())); - assertTrue(Test.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testPI.getTimeoutPrompt())); - assertEquals(Test.MATCH, testIM, testPI.getInteractionMode()); - assertEquals(Test.MATCH, testTimeout, testPI.getTimeout()); - assertTrue(Test.TRUE, Validator.validateVrHelpItems(testVrHelpItems, testPI.getVrHelp())); - assertEquals(Test.MATCH, testCorrelationID, testPI.getCorrelationID()); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testInitChunks, testPI.getInitialPrompt())); + assertEquals(TestValues.MATCH, testDisplayText, testPI.getInitialText()); + assertTrue(TestValues.TRUE, Validator.validateIntegerList(testCSIDs, testPI.getInteractionChoiceSetIDList())); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testHelpChunks, testPI.getHelpPrompt())); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testPI.getTimeoutPrompt())); + assertEquals(TestValues.MATCH, testIM, testPI.getInteractionMode()); + assertEquals(TestValues.MATCH, testTimeout, testPI.getTimeout()); + assertTrue(TestValues.TRUE, Validator.validateVrHelpItems(testVrHelpItems, testPI.getVrHelp())); + assertEquals(TestValues.MATCH, testCorrelationID, testPI.getCorrelationID()); testPI = RPCRequestFactory.buildPerformInteraction((Vector<TTSChunk>) null, null, null, null, null, null, null, null, null); - assertNull(Test.NULL, testPI.getInitialPrompt()); - assertNull(Test.NULL, testPI.getInitialText()); - assertNull(Test.NULL, testPI.getInteractionChoiceSetIDList()); - assertNull(Test.NULL, testPI.getHelpPrompt()); - assertNull(Test.NULL, testPI.getTimeoutPrompt()); - assertNull(Test.NULL, testPI.getInteractionMode()); - assertNull(Test.NULL, testPI.getTimeout()); - assertNull(Test.NULL, testPI.getVrHelp()); - assertNotNull(Test.NOT_NULL, testPI.getCorrelationID()); + assertNull(TestValues.NULL, testPI.getInitialPrompt()); + assertNull(TestValues.NULL, testPI.getInitialText()); + assertNull(TestValues.NULL, testPI.getInteractionChoiceSetIDList()); + assertNull(TestValues.NULL, testPI.getHelpPrompt()); + assertNull(TestValues.NULL, testPI.getTimeoutPrompt()); + assertNull(TestValues.NULL, testPI.getInteractionMode()); + assertNull(TestValues.NULL, testPI.getTimeout()); + assertNull(TestValues.NULL, testPI.getVrHelp()); + assertNotNull(TestValues.NOT_NULL, testPI.getCorrelationID()); // Test -- buildPerformInteraction(String initPrompt, String displayText, Vector<Integer> interactionChoiceSetIDList, String helpPrompt, String timeoutPrompt, InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp, Integer correlationID) // ^ Calls another build method. @@ -492,24 +492,24 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- buildPerformInteraction(Vector<TTSChunk> initChunks, String displayText, Vector<Integer> interactionChoiceSetIDList, Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks, InteractionMode interactionMode, Integer timeout, Integer correlationID) testPI = RPCRequestFactory.buildPerformInteraction(testInitChunks, testDisplayText, testCSIDs, testHelpChunks, testTimeoutChunks, testIM, testTimeout, testCorrelationID); - assertTrue(Test.TRUE, Validator.validateTtsChunks(testInitChunks, testPI.getInitialPrompt())); - assertEquals(Test.MATCH, testDisplayText, testPI.getInitialText()); - assertTrue(Test.TRUE, Validator.validateIntegerList(testCSIDs, testPI.getInteractionChoiceSetIDList())); - assertTrue(Test.TRUE, Validator.validateTtsChunks(testHelpChunks, testPI.getHelpPrompt())); - assertTrue(Test.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testPI.getTimeoutPrompt())); - assertEquals(Test.MATCH, testIM, testPI.getInteractionMode()); - assertEquals(Test.MATCH, testTimeout, testPI.getTimeout()); - assertEquals(Test.MATCH, testCorrelationID, testPI.getCorrelationID()); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testInitChunks, testPI.getInitialPrompt())); + assertEquals(TestValues.MATCH, testDisplayText, testPI.getInitialText()); + assertTrue(TestValues.TRUE, Validator.validateIntegerList(testCSIDs, testPI.getInteractionChoiceSetIDList())); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testHelpChunks, testPI.getHelpPrompt())); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testPI.getTimeoutPrompt())); + assertEquals(TestValues.MATCH, testIM, testPI.getInteractionMode()); + assertEquals(TestValues.MATCH, testTimeout, testPI.getTimeout()); + assertEquals(TestValues.MATCH, testCorrelationID, testPI.getCorrelationID()); testPI = RPCRequestFactory.buildPerformInteraction((Vector<TTSChunk>) null, null, null, null, null, null, null, null); - assertNull(Test.NULL, testPI.getInitialPrompt()); - assertNull(Test.NULL, testPI.getInitialText()); - assertNull(Test.NULL, testPI.getInteractionChoiceSetIDList()); - assertNull(Test.NULL, testPI.getHelpPrompt()); - assertNull(Test.NULL, testPI.getTimeoutPrompt()); - assertNull(Test.NULL, testPI.getInteractionMode()); - assertNull(Test.NULL, testPI.getTimeout()); - assertNotNull(Test.NOT_NULL, testPI.getCorrelationID()); + assertNull(TestValues.NULL, testPI.getInitialPrompt()); + assertNull(TestValues.NULL, testPI.getInitialText()); + assertNull(TestValues.NULL, testPI.getInteractionChoiceSetIDList()); + assertNull(TestValues.NULL, testPI.getHelpPrompt()); + assertNull(TestValues.NULL, testPI.getTimeoutPrompt()); + assertNull(TestValues.NULL, testPI.getInteractionMode()); + assertNull(TestValues.NULL, testPI.getTimeout()); + assertNotNull(TestValues.NOT_NULL, testPI.getCorrelationID()); // Test -- buildPerformInteraction(String initPrompt, String displayText, Vector<Integer> interactionChoiceSetIDList, String helpPrompt, String timeoutPrompt, InteractionMode interactionMode, Integer timeout, Integer correlationID) // ^ Calls another build method. @@ -522,22 +522,22 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- buildPerformInteraction(Vector<TTSChunk> initChunks, String displayText, Vector<Integer> interactionChoiceSetIDList, Vector<TTSChunk> helpChunks, InteractionMode interactionMode, Integer timeout, Integer correlationID) testPI = RPCRequestFactory.buildPerformInteraction(testInitChunks, testDisplayText, testCSIDs, testHelpChunks, testIM, testTimeout, testCorrelationID); - assertTrue(Test.TRUE, Validator.validateTtsChunks(testInitChunks, testPI.getInitialPrompt())); - assertEquals(Test.MATCH, testDisplayText, testPI.getInitialText()); - assertTrue(Test.TRUE, Validator.validateIntegerList(testCSIDs, testPI.getInteractionChoiceSetIDList())); - assertTrue(Test.TRUE, Validator.validateTtsChunks(testHelpChunks, testPI.getHelpPrompt())); - assertEquals(Test.MATCH, testIM, testPI.getInteractionMode()); - assertEquals(Test.MATCH, testTimeout, testPI.getTimeout()); - assertEquals(Test.MATCH, testCorrelationID, testPI.getCorrelationID()); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testInitChunks, testPI.getInitialPrompt())); + assertEquals(TestValues.MATCH, testDisplayText, testPI.getInitialText()); + assertTrue(TestValues.TRUE, Validator.validateIntegerList(testCSIDs, testPI.getInteractionChoiceSetIDList())); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testHelpChunks, testPI.getHelpPrompt())); + assertEquals(TestValues.MATCH, testIM, testPI.getInteractionMode()); + assertEquals(TestValues.MATCH, testTimeout, testPI.getTimeout()); + assertEquals(TestValues.MATCH, testCorrelationID, testPI.getCorrelationID()); testPI = RPCRequestFactory.buildPerformInteraction((Vector<TTSChunk>) null, null, null, null, null, null, null); - assertNull(Test.NULL, testPI.getInitialPrompt()); - assertNull(Test.NULL, testPI.getInitialText()); - assertNull(Test.NULL, testPI.getInteractionChoiceSetIDList()); - assertNull(Test.NULL, testPI.getHelpPrompt()); - assertNull(Test.NULL, testPI.getInteractionMode()); - assertNull(Test.NULL, testPI.getTimeout()); - assertNotNull(Test.NOT_NULL, testPI.getCorrelationID()); + assertNull(TestValues.NULL, testPI.getInitialPrompt()); + assertNull(TestValues.NULL, testPI.getInitialText()); + assertNull(TestValues.NULL, testPI.getInteractionChoiceSetIDList()); + assertNull(TestValues.NULL, testPI.getHelpPrompt()); + assertNull(TestValues.NULL, testPI.getInteractionMode()); + assertNull(TestValues.NULL, testPI.getTimeout()); + assertNotNull(TestValues.NOT_NULL, testPI.getCorrelationID()); // Test -- buildPerformInteraction(String initPrompt, String displayText, Vector<Integer> interactionChoiceSetIDList, String helpPrompt, InteractionMode interactionMode, Integer timeout, Integer correlationID) // ^ Calls another build method. @@ -555,45 +555,45 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- buildPutFile(String sdlFileName, FileType fileType, Boolean persistentFile, byte[] fileData, Integer correlationID) testPF = RPCRequestFactory.buildPutFile(testFileName, testFileType, testPFile, testFileData, testCorrelationID); - assertEquals(Test.MATCH, testFileName, testPF.getSdlFileName()); - assertEquals(Test.MATCH, testFileType, testPF.getFileType()); - assertEquals(Test.MATCH, testPFile, testPF.getPersistentFile()); - assertTrue(Test.TRUE, Validator.validateBulkData(testFileData, testPF.getFileData())); - assertEquals(Test.MATCH, testCorrelationID, testPF.getCorrelationID()); + assertEquals(TestValues.MATCH, testFileName, testPF.getSdlFileName()); + assertEquals(TestValues.MATCH, testFileType, testPF.getFileType()); + assertEquals(TestValues.MATCH, testPFile, testPF.getPersistentFile()); + assertTrue(TestValues.TRUE, Validator.validateBulkData(testFileData, testPF.getFileData())); + assertEquals(TestValues.MATCH, testCorrelationID, testPF.getCorrelationID()); testPF = RPCRequestFactory.buildPutFile(null, null, null, null, null); - assertNull(Test.NULL, testPF.getSdlFileName()); - assertNull(Test.NULL, testPF.getFileType()); - assertNull(Test.NULL, testPF.getPersistentFile()); - assertNull(Test.NULL, testPF.getFileData()); - assertNotNull(Test.NOT_NULL, testPF.getCorrelationID()); + assertNull(TestValues.NULL, testPF.getSdlFileName()); + assertNull(TestValues.NULL, testPF.getFileType()); + assertNull(TestValues.NULL, testPF.getPersistentFile()); + assertNull(TestValues.NULL, testPF.getFileData()); + assertNotNull(TestValues.NOT_NULL, testPF.getCorrelationID()); // Test -- buildPutFile(String sdlFileName, Integer iOffset, Integer iLength) testPF = RPCRequestFactory.buildPutFile(testFileName, testOffset, testLength); - assertEquals(Test.MATCH, testFileName, testPF.getSdlFileName()); - assertEquals(Test.MATCH, testOffset, testPF.getOffset()); - assertEquals(Test.MATCH, testLength, testPF.getLength()); + assertEquals(TestValues.MATCH, testFileName, testPF.getSdlFileName()); + assertEquals(TestValues.MATCH, testOffset, testPF.getOffset()); + assertEquals(TestValues.MATCH, testLength, testPF.getLength()); testPF = RPCRequestFactory.buildPutFile(NullValues.STRING, NullValues.INTEGER, NullValues.INTEGER); - assertNull(Test.NULL, testPF.getSdlFileName()); - assertNull(Test.NULL, testPF.getOffset()); - assertNull(Test.NULL, testPF.getLength()); + assertNull(TestValues.NULL, testPF.getSdlFileName()); + assertNull(TestValues.NULL, testPF.getOffset()); + assertNull(TestValues.NULL, testPF.getLength()); // Test -- buildPutFile(String syncFileName, Integer iOffset, Integer iLength, FileType fileType, Boolean bPersistentFile, Boolean bSystemFile) testPF = RPCRequestFactory.buildPutFile(testFileName, testOffset, testLength, testFileType, testPFile, testSystemFile); - assertEquals(Test.MATCH, testFileName, testPF.getSdlFileName()); - assertEquals(Test.MATCH, testOffset, testPF.getOffset()); - assertEquals(Test.MATCH, testLength, testPF.getLength()); - assertTrue(Test.TRUE, testPF.getPersistentFile()); - assertEquals(Test.MATCH, testSystemFile, testPF.getSystemFile()); + assertEquals(TestValues.MATCH, testFileName, testPF.getSdlFileName()); + assertEquals(TestValues.MATCH, testOffset, testPF.getOffset()); + assertEquals(TestValues.MATCH, testLength, testPF.getLength()); + assertTrue(TestValues.TRUE, testPF.getPersistentFile()); + assertEquals(TestValues.MATCH, testSystemFile, testPF.getSystemFile()); testPF = RPCRequestFactory.buildPutFile(NullValues.STRING, NullValues.INTEGER, NullValues.INTEGER, null, NullValues.BOOLEAN, NullValues.BOOLEAN); - assertNull(Test.NULL, testPF.getSdlFileName()); - assertNull(Test.NULL, testPF.getOffset()); - assertNull(Test.NULL, testPF.getLength()); - assertNull(Test.NULL, testPF.getFileType()); - assertNull(Test.NULL, testPF.getPersistentFile()); - assertNull(Test.NULL, testPF.getSystemFile()); + assertNull(TestValues.NULL, testPF.getSdlFileName()); + assertNull(TestValues.NULL, testPF.getOffset()); + assertNull(TestValues.NULL, testPF.getLength()); + assertNull(TestValues.NULL, testPF.getFileType()); + assertNull(TestValues.NULL, testPF.getPersistentFile()); + assertNull(TestValues.NULL, testPF.getSystemFile()); } public void testBuildRegisterAppInterface () { @@ -621,34 +621,34 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- buildRegisterAppInterface(SdlMsgVersion sdlMsgVersion, String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID, Integer correlationID) testRAI = RPCRequestFactory.buildRegisterAppInterface(testSMV, testAppName, testTTSName, testNGN, testSynonyms, testIMA, testLang, testHMILang, testHMIType, testAppID, testCorrelationID,testDI); - assertTrue(Test.TRUE, Validator.validateSdlMsgVersion(testSMV, testRAI.getSdlMsgVersion())); - assertEquals(Test.MATCH, testAppName, testRAI.getAppName()); - assertTrue(Test.TRUE, Validator.validateTtsChunks(testTTSName, testRAI.getTtsName())); - assertEquals(Test.MATCH, testNGN, testRAI.getNgnMediaScreenAppName()); - assertTrue(Test.TRUE, Validator.validateStringList(testSynonyms, testRAI.getVrSynonyms())); - assertEquals(Test.MATCH, testIMA, testRAI.getIsMediaApplication()); - assertEquals(Test.MATCH, testLang, testRAI.getLanguageDesired()); - assertEquals(Test.MATCH, testHMILang, testRAI.getHmiDisplayLanguageDesired()); - assertEquals(Test.MATCH, AppHMIType.DEFAULT, testRAI.getAppHMIType().get(0)); - assertEquals(Test.MATCH, testAppID, testRAI.getAppID()); - assertEquals(Test.MATCH, testCorrelationID, testRAI.getCorrelationID()); - assertEquals(Test.MATCH, testDI, testRAI.getDeviceInfo()); + assertTrue(TestValues.TRUE, Validator.validateSdlMsgVersion(testSMV, testRAI.getSdlMsgVersion())); + assertEquals(TestValues.MATCH, testAppName, testRAI.getAppName()); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testTTSName, testRAI.getTtsName())); + assertEquals(TestValues.MATCH, testNGN, testRAI.getNgnMediaScreenAppName()); + assertTrue(TestValues.TRUE, Validator.validateStringList(testSynonyms, testRAI.getVrSynonyms())); + assertEquals(TestValues.MATCH, testIMA, testRAI.getIsMediaApplication()); + assertEquals(TestValues.MATCH, testLang, testRAI.getLanguageDesired()); + assertEquals(TestValues.MATCH, testHMILang, testRAI.getHmiDisplayLanguageDesired()); + assertEquals(TestValues.MATCH, AppHMIType.DEFAULT, testRAI.getAppHMIType().get(0)); + assertEquals(TestValues.MATCH, testAppID, testRAI.getAppID()); + assertEquals(TestValues.MATCH, testCorrelationID, testRAI.getCorrelationID()); + assertEquals(TestValues.MATCH, testDI, testRAI.getDeviceInfo()); testRAI = RPCRequestFactory.buildRegisterAppInterface(null, null, null, null, null, null, null, null, null, null, null,null); - assertEquals(Test.MATCH, (Integer) 1, testRAI.getCorrelationID()); - assertEquals(Test.MATCH, testSMV.getMajorVersion(), testRAI.getSdlMsgVersion().getMajorVersion()); - assertEquals(Test.MATCH, testSMV.getMinorVersion(), testRAI.getSdlMsgVersion().getMinorVersion()); - assertNull(Test.NULL, testRAI.getAppName()); - assertNull(Test.NULL, testRAI.getTtsName()); - assertNull(Test.NULL, testRAI.getNgnMediaScreenAppName()); - assertNull(Test.NULL, testRAI.getVrSynonyms()); - assertNull(Test.NULL, testRAI.getIsMediaApplication()); - assertNotNull(Test.NOT_NULL, testRAI.getLanguageDesired()); - assertNotNull(Test.NOT_NULL, testRAI.getHmiDisplayLanguageDesired()); - assertNull(Test.NULL, testRAI.getAppHMIType()); - assertNull(Test.NULL, testRAI.getAppID()); - assertNull(Test.NULL, testRAI.getDeviceInfo()); + assertEquals(TestValues.MATCH, (Integer) 1, testRAI.getCorrelationID()); + assertEquals(TestValues.MATCH, testSMV.getMajorVersion(), testRAI.getSdlMsgVersion().getMajorVersion()); + assertEquals(TestValues.MATCH, testSMV.getMinorVersion(), testRAI.getSdlMsgVersion().getMinorVersion()); + assertNull(TestValues.NULL, testRAI.getAppName()); + assertNull(TestValues.NULL, testRAI.getTtsName()); + assertNull(TestValues.NULL, testRAI.getNgnMediaScreenAppName()); + assertNull(TestValues.NULL, testRAI.getVrSynonyms()); + assertNull(TestValues.NULL, testRAI.getIsMediaApplication()); + assertNotNull(TestValues.NOT_NULL, testRAI.getLanguageDesired()); + assertNotNull(TestValues.NOT_NULL, testRAI.getHmiDisplayLanguageDesired()); + assertNull(TestValues.NULL, testRAI.getAppHMIType()); + assertNull(TestValues.NULL, testRAI.getAppID()); + assertNull(TestValues.NULL, testRAI.getDeviceInfo()); } public void testBuildSetAppIcon () { @@ -659,12 +659,12 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- buildSetAppIcon(String sdlFileName, Integer correlationID) testSAI = RPCRequestFactory.buildSetAppIcon(testFileName, testCorrelationID); - assertEquals(Test.MATCH, testFileName, testSAI.getSdlFileName()); - assertEquals(Test.MATCH, testCorrelationID, testSAI.getCorrelationID()); + assertEquals(TestValues.MATCH, testFileName, testSAI.getSdlFileName()); + assertEquals(TestValues.MATCH, testCorrelationID, testSAI.getCorrelationID()); testSAI = RPCRequestFactory.buildSetAppIcon(null, null); - assertNull(Test.NULL, testSAI.getSdlFileName()); - assertNotNull(Test.NOT_NULL, testSAI.getCorrelationID()); + assertNull(TestValues.NULL, testSAI.getSdlFileName()); + assertNotNull(TestValues.NOT_NULL, testSAI.getCorrelationID()); } @@ -690,32 +690,32 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- buildSetGlobalProperties(Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks, Integer correlationID) testSBP = RPCRequestFactory.buildSetGlobalProperties(testHelpChunks, testTimeoutChunks, testCorrelationID); - assertTrue(Test.TRUE, Validator.validateTtsChunks(testHelpChunks, testSBP.getHelpPrompt())); - assertTrue(Test.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testSBP.getTimeoutPrompt())); - assertEquals(Test.MATCH, testCorrelationID, testSBP.getCorrelationID()); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testHelpChunks, testSBP.getHelpPrompt())); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testSBP.getTimeoutPrompt())); + assertEquals(TestValues.MATCH, testCorrelationID, testSBP.getCorrelationID()); testSBP = RPCRequestFactory.buildSetGlobalProperties((Vector<TTSChunk>) null, null, null); - assertNull(Test.NULL, testSBP.getHelpPrompt()); - assertNull(Test.NULL, testSBP.getTimeoutPrompt()); - assertNotNull(Test.NOT_NULL, testSBP.getCorrelationID()); + assertNull(TestValues.NULL, testSBP.getHelpPrompt()); + assertNull(TestValues.NULL, testSBP.getTimeoutPrompt()); + assertNotNull(TestValues.NOT_NULL, testSBP.getCorrelationID()); // Test -- buildSetGlobalProperties(String helpPrompt, String timeoutPrompt, String vrHelpTitle, Vector<VrHelpItem> vrHelp, Integer correlationID) // ^ Calls another build method. // Test -- buildSetGlobalProperties(Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks, String vrHelpTitle, Vector<VrHelpItem> vrHelp, Integer correlationID) testSBP = RPCRequestFactory.buildSetGlobalProperties(testHelpChunks, testTimeoutChunks, testHelpTitle, testVrHelp, testCorrelationID); - assertTrue(Test.TRUE, Validator.validateTtsChunks(testHelpChunks, testSBP.getHelpPrompt())); - assertTrue(Test.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testSBP.getTimeoutPrompt())); - assertEquals(Test.MATCH, testHelpTitle, testSBP.getVrHelpTitle()); - assertTrue(Test.TRUE, Validator.validateVrHelpItems(testVrHelp, testSBP.getVrHelp())); - assertEquals(Test.MATCH, testCorrelationID, testSBP.getCorrelationID()); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testHelpChunks, testSBP.getHelpPrompt())); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testSBP.getTimeoutPrompt())); + assertEquals(TestValues.MATCH, testHelpTitle, testSBP.getVrHelpTitle()); + assertTrue(TestValues.TRUE, Validator.validateVrHelpItems(testVrHelp, testSBP.getVrHelp())); + assertEquals(TestValues.MATCH, testCorrelationID, testSBP.getCorrelationID()); testSBP = RPCRequestFactory.buildSetGlobalProperties((Vector<TTSChunk>) null, null, null, null, null); - assertNull(Test.NULL, testSBP.getHelpPrompt()); - assertNull(Test.NULL, testSBP.getTimeoutPrompt()); - assertNull(Test.NULL, testSBP.getVrHelpTitle()); - assertNull(Test.NULL, testSBP.getVrHelp()); - assertNotNull(Test.NOT_NULL, testSBP.getCorrelationID()); + assertNull(TestValues.NULL, testSBP.getHelpPrompt()); + assertNull(TestValues.NULL, testSBP.getTimeoutPrompt()); + assertNull(TestValues.NULL, testSBP.getVrHelpTitle()); + assertNull(TestValues.NULL, testSBP.getVrHelp()); + assertNotNull(TestValues.NOT_NULL, testSBP.getCorrelationID()); } public void testBuildSetMediaClockTimer () { @@ -726,16 +726,16 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- buildSetMediaClockTimer(Integer hours, Integer minutes, Integer seconds, UpdateMode updateMode, Integer correlationID) testSMCT = RPCRequestFactory.buildSetMediaClockTimer(hours, minutes, seconds, testMode, testCorrelationID); - assertEquals(Test.MATCH, hours, testSMCT.getStartTime().getHours()); - assertEquals(Test.MATCH, minutes, testSMCT.getStartTime().getMinutes()); - assertEquals(Test.MATCH, seconds, testSMCT.getStartTime().getSeconds()); - assertEquals(Test.MATCH, testMode, testSMCT.getUpdateMode()); - assertEquals(Test.MATCH, testCorrelationID, testSMCT.getCorrelationID()); + assertEquals(TestValues.MATCH, hours, testSMCT.getStartTime().getHours()); + assertEquals(TestValues.MATCH, minutes, testSMCT.getStartTime().getMinutes()); + assertEquals(TestValues.MATCH, seconds, testSMCT.getStartTime().getSeconds()); + assertEquals(TestValues.MATCH, testMode, testSMCT.getUpdateMode()); + assertEquals(TestValues.MATCH, testCorrelationID, testSMCT.getCorrelationID()); testSMCT = RPCRequestFactory.buildSetMediaClockTimer(null, null, null, null, null); - assertNull(Test.NULL, testSMCT.getStartTime()); - assertNull(Test.NULL, testSMCT.getUpdateMode()); - assertNotNull(Test.NOT_NULL, testSMCT.getCorrelationID()); + assertNull(TestValues.NULL, testSMCT.getStartTime()); + assertNull(TestValues.NULL, testSMCT.getUpdateMode()); + assertNotNull(TestValues.NOT_NULL, testSMCT.getCorrelationID()); // Test -- buildSetMediaClockTimer(UpdateMode updateMode, Integer correlationID) // ^ Calls another build method. @@ -758,53 +758,53 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- buildShow(String mainText1, String mainText2, String mainText3, String mainText4, String statusBar, String mediaClock, String mediaTrack, Image graphic, Vector<SoftButton> softButtons, Vector <String> customPresets, TextAlignment alignment, Integer correlationID) testShow = RPCRequestFactory.buildShow(testText1, testText2, testText3, testText4, testStatusBar, testMediaClock, testMediaTrack, testGraphic, testSoftButtons, testCustomPresets, testAlignment, testCorrelationID); - assertEquals(Test.MATCH, testText1, testShow.getMainField1()); - assertEquals(Test.MATCH, testText2, testShow.getMainField2()); - assertEquals(Test.MATCH, testText3, testShow.getMainField3()); - assertEquals(Test.MATCH, testText4, testShow.getMainField4()); - assertEquals(Test.MATCH, testStatusBar, testShow.getStatusBar()); - assertEquals(Test.MATCH, testMediaClock, testShow.getMediaClock()); - assertEquals(Test.MATCH, testMediaTrack, testShow.getMediaTrack()); - assertTrue(Test.TRUE, Validator.validateImage(testGraphic, testShow.getGraphic())); - assertTrue(Test.TRUE, Validator.validateSoftButtons(testSoftButtons, testShow.getSoftButtons())); - assertTrue(Test.TRUE, Validator.validateStringList(testCustomPresets, testShow.getCustomPresets())); - assertEquals(Test.MATCH, testAlignment, testShow.getAlignment()); - assertEquals(Test.MATCH, testCorrelationID, testShow.getCorrelationID()); + assertEquals(TestValues.MATCH, testText1, testShow.getMainField1()); + assertEquals(TestValues.MATCH, testText2, testShow.getMainField2()); + assertEquals(TestValues.MATCH, testText3, testShow.getMainField3()); + assertEquals(TestValues.MATCH, testText4, testShow.getMainField4()); + assertEquals(TestValues.MATCH, testStatusBar, testShow.getStatusBar()); + assertEquals(TestValues.MATCH, testMediaClock, testShow.getMediaClock()); + assertEquals(TestValues.MATCH, testMediaTrack, testShow.getMediaTrack()); + assertTrue(TestValues.TRUE, Validator.validateImage(testGraphic, testShow.getGraphic())); + assertTrue(TestValues.TRUE, Validator.validateSoftButtons(testSoftButtons, testShow.getSoftButtons())); + assertTrue(TestValues.TRUE, Validator.validateStringList(testCustomPresets, testShow.getCustomPresets())); + assertEquals(TestValues.MATCH, testAlignment, testShow.getAlignment()); + assertEquals(TestValues.MATCH, testCorrelationID, testShow.getCorrelationID()); testShow = RPCRequestFactory.buildShow(null, null, null, null, null, null, null, null, null, null, null, null); - assertNull(Test.NULL, testShow.getMainField1()); - assertNull(Test.NULL, testShow.getMainField2()); - assertNull(Test.NULL, testShow.getMainField3()); - assertNull(Test.NULL, testShow.getMainField4()); - assertNull(Test.NULL, testShow.getStatusBar()); - assertNull(Test.NULL, testShow.getMediaClock()); - assertNull(Test.NULL, testShow.getMediaTrack()); - assertNull(Test.NULL, testShow.getGraphic()); - assertNull(Test.NULL, testShow.getSoftButtons()); - assertNull(Test.NULL, testShow.getCustomPresets()); - assertNull(Test.NULL, testShow.getAlignment()); - assertNotNull(Test.NOT_NULL, testShow.getCorrelationID()); + assertNull(TestValues.NULL, testShow.getMainField1()); + assertNull(TestValues.NULL, testShow.getMainField2()); + assertNull(TestValues.NULL, testShow.getMainField3()); + assertNull(TestValues.NULL, testShow.getMainField4()); + assertNull(TestValues.NULL, testShow.getStatusBar()); + assertNull(TestValues.NULL, testShow.getMediaClock()); + assertNull(TestValues.NULL, testShow.getMediaTrack()); + assertNull(TestValues.NULL, testShow.getGraphic()); + assertNull(TestValues.NULL, testShow.getSoftButtons()); + assertNull(TestValues.NULL, testShow.getCustomPresets()); + assertNull(TestValues.NULL, testShow.getAlignment()); + assertNotNull(TestValues.NOT_NULL, testShow.getCorrelationID()); // Test -- buildShow(String mainText1, String mainText2, String mainText3, String mainText4, TextAlignment alignment, Integer correlationID) // ^ Calls another build method. // Test -- buildShow(String mainText1, String mainText2, String statusBar, String mediaClock, String mediaTrack, TextAlignment alignment, Integer correlationID) testShow = RPCRequestFactory.buildShow(testText1, testText2, testStatusBar, testMediaClock, testMediaTrack, testAlignment, testCorrelationID); - assertEquals(Test.MATCH, testText1, testShow.getMainField1()); - assertEquals(Test.MATCH, testText2, testShow.getMainField2()); - assertEquals(Test.MATCH, testStatusBar, testShow.getStatusBar()); - assertEquals(Test.MATCH, testMediaClock, testShow.getMediaClock()); - assertEquals(Test.MATCH, testMediaTrack, testShow.getMediaTrack()); - assertEquals(Test.MATCH, testAlignment, testShow.getAlignment()); - assertEquals(Test.MATCH, testCorrelationID, testShow.getCorrelationID()); + assertEquals(TestValues.MATCH, testText1, testShow.getMainField1()); + assertEquals(TestValues.MATCH, testText2, testShow.getMainField2()); + assertEquals(TestValues.MATCH, testStatusBar, testShow.getStatusBar()); + assertEquals(TestValues.MATCH, testMediaClock, testShow.getMediaClock()); + assertEquals(TestValues.MATCH, testMediaTrack, testShow.getMediaTrack()); + assertEquals(TestValues.MATCH, testAlignment, testShow.getAlignment()); + assertEquals(TestValues.MATCH, testCorrelationID, testShow.getCorrelationID()); testShow = RPCRequestFactory.buildShow(null, null, null, null, null, null, null); - assertNull(Test.NULL, testShow.getMainField1()); - assertNull(Test.NULL, testShow.getMainField2()); - assertNull(Test.NULL, testShow.getStatusBar()); - assertNull(Test.NULL, testShow.getMediaClock()); - assertNull(Test.NULL, testShow.getMediaTrack()); - assertNull(Test.NULL, testShow.getAlignment()); - assertNotNull(Test.NOT_NULL, testShow.getCorrelationID()); + assertNull(TestValues.NULL, testShow.getMainField1()); + assertNull(TestValues.NULL, testShow.getMainField2()); + assertNull(TestValues.NULL, testShow.getStatusBar()); + assertNull(TestValues.NULL, testShow.getMediaClock()); + assertNull(TestValues.NULL, testShow.getMediaTrack()); + assertNull(TestValues.NULL, testShow.getAlignment()); + assertNotNull(TestValues.NOT_NULL, testShow.getCorrelationID()); // Test -- buildShow(String mainText1, String mainText2, TextAlignment alignment, Integer correlationID) // ^ Calls another build method. @@ -819,21 +819,21 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- buildSpeak(String ttsText, Integer correlationID) testSpeak = RPCRequestFactory.buildSpeak(testTTSText, testCorrelationID); - assertTrue(Test.TRUE, Validator.validateTtsChunks(testTTSChunks, testSpeak.getTtsChunks())); - assertEquals(Test.MATCH, testCorrelationID, testSpeak.getCorrelationID()); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testTTSChunks, testSpeak.getTtsChunks())); + assertEquals(TestValues.MATCH, testCorrelationID, testSpeak.getCorrelationID()); testSpeak = RPCRequestFactory.buildSpeak((String) null, null); - assertNull(Test.NULL, testSpeak.getTtsChunks()); - assertNotNull(Test.NOT_NULL, testSpeak.getCorrelationID()); + assertNull(TestValues.NULL, testSpeak.getTtsChunks()); + assertNotNull(TestValues.NOT_NULL, testSpeak.getCorrelationID()); // Test -- buildSpeak(Vector<TTSChunk> ttsChunks, Integer correlationID) testSpeak = RPCRequestFactory.buildSpeak(testTTSChunks, testCorrelationID); - assertTrue(Test.TRUE, Validator.validateTtsChunks(testTTSChunks, testSpeak.getTtsChunks())); - assertEquals(Test.MATCH, testCorrelationID, testSpeak.getCorrelationID()); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testTTSChunks, testSpeak.getTtsChunks())); + assertEquals(TestValues.MATCH, testCorrelationID, testSpeak.getCorrelationID()); testSpeak = RPCRequestFactory.buildSpeak((Vector<TTSChunk>) null, null); - assertNull(Test.NULL, testSpeak.getTtsChunks()); - assertNotNull(Test.NOT_NULL, testSpeak.getCorrelationID()); + assertNull(TestValues.NULL, testSpeak.getTtsChunks()); + assertNotNull(TestValues.NOT_NULL, testSpeak.getCorrelationID()); } public void testBuildSubscribeButton () { @@ -844,12 +844,12 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- buildSubscribeButton(ButtonName buttonName, Integer correlationID) testSB = RPCRequestFactory.buildSubscribeButton(testButtonName, testCorrelationID); - assertEquals(Test.MATCH, testButtonName, testSB.getButtonName()); - assertEquals(Test.MATCH, testCorrelationID, testSB.getCorrelationID()); + assertEquals(TestValues.MATCH, testButtonName, testSB.getButtonName()); + assertEquals(TestValues.MATCH, testCorrelationID, testSB.getCorrelationID()); testSB = RPCRequestFactory.buildSubscribeButton(null, null); - assertNull(Test.NULL, testSB.getButtonName()); - assertNotNull(Test.NOT_NULL, testSB.getCorrelationID()); + assertNull(TestValues.NULL, testSB.getButtonName()); + assertNotNull(TestValues.NOT_NULL, testSB.getCorrelationID()); } @@ -860,10 +860,10 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- buildUnregisterAppInterface(Integer correlationID) testUAI = RPCRequestFactory.buildUnregisterAppInterface(testCorrelationID); - assertEquals(Test.MATCH, testCorrelationID, testUAI.getCorrelationID()); + assertEquals(TestValues.MATCH, testCorrelationID, testUAI.getCorrelationID()); testUAI = RPCRequestFactory.buildUnregisterAppInterface(null); - assertNotNull(Test.NOT_NULL, testUAI.getCorrelationID()); + assertNotNull(TestValues.NOT_NULL, testUAI.getCorrelationID()); } public void testBuildUnsubscribeButton () { @@ -874,12 +874,12 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- buildUnsubscribeButton(ButtonName buttonName, Integer correlationID) testUB = RPCRequestFactory.buildUnsubscribeButton(testButtonName, testCorrelationID); - assertEquals(Test.MATCH, testButtonName, testUB.getButtonName()); - assertEquals(Test.MATCH, testCorrelationID, testUB.getCorrelationID()); + assertEquals(TestValues.MATCH, testButtonName, testUB.getButtonName()); + assertEquals(TestValues.MATCH, testCorrelationID, testUB.getCorrelationID()); testUB = RPCRequestFactory.buildUnsubscribeButton(null, null); - assertNull(Test.NULL, testUB.getButtonName()); - assertNotNull(Test.NOT_NULL, testUB.getCorrelationID()); + assertNull(TestValues.NULL, testUB.getButtonName()); + assertNotNull(TestValues.NOT_NULL, testUB.getCorrelationID()); } @@ -891,24 +891,24 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- BuildSubscribeVehicleData(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State, boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure, boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus, boolean driverBraking, Integer correlationID) testSVD = RPCRequestFactory.BuildSubscribeVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, testCorrelationID); - assertTrue(Test.TRUE, testSVD.getGps()); - assertTrue(Test.TRUE, testSVD.getSpeed()); - assertTrue(Test.TRUE, testSVD.getRpm()); - assertTrue(Test.TRUE, testSVD.getFuelLevel()); - assertTrue(Test.TRUE, testSVD.getFuelLevelState()); - assertTrue(Test.TRUE, testSVD.getInstantFuelConsumption()); - assertTrue(Test.TRUE, testSVD.getExternalTemperature()); - assertTrue(Test.TRUE, testSVD.getPrndl()); - assertTrue(Test.TRUE, testSVD.getTirePressure()); - assertTrue(Test.TRUE, testSVD.getOdometer()); - assertTrue(Test.TRUE, testSVD.getBeltStatus()); - assertTrue(Test.TRUE, testSVD.getBodyInformation()); - assertTrue(Test.TRUE, testSVD.getDeviceStatus()); - assertTrue(Test.TRUE, testSVD.getDriverBraking()); - assertEquals(Test.MATCH, testCorrelationID, testSVD.getCorrelationID()); + assertTrue(TestValues.TRUE, testSVD.getGps()); + assertTrue(TestValues.TRUE, testSVD.getSpeed()); + assertTrue(TestValues.TRUE, testSVD.getRpm()); + assertTrue(TestValues.TRUE, testSVD.getFuelLevel()); + assertTrue(TestValues.TRUE, testSVD.getFuelLevelState()); + assertTrue(TestValues.TRUE, testSVD.getInstantFuelConsumption()); + assertTrue(TestValues.TRUE, testSVD.getExternalTemperature()); + assertTrue(TestValues.TRUE, testSVD.getPrndl()); + assertTrue(TestValues.TRUE, testSVD.getTirePressure()); + assertTrue(TestValues.TRUE, testSVD.getOdometer()); + assertTrue(TestValues.TRUE, testSVD.getBeltStatus()); + assertTrue(TestValues.TRUE, testSVD.getBodyInformation()); + assertTrue(TestValues.TRUE, testSVD.getDeviceStatus()); + assertTrue(TestValues.TRUE, testSVD.getDriverBraking()); + assertEquals(TestValues.MATCH, testCorrelationID, testSVD.getCorrelationID()); testSVD = RPCRequestFactory.BuildSubscribeVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, null); - assertNotNull(Test.NULL, testSVD.getCorrelationID()); + assertNotNull(TestValues.NULL, testSVD.getCorrelationID()); } public void testBuildUnsubscribeVehicleData () { @@ -919,24 +919,24 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- BuildUnsubscribeVehicleData(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State, boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure, boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus, boolean driverBraking, Integer correlationID) testUVD = RPCRequestFactory.BuildUnsubscribeVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, testCorrelationID); - assertTrue(Test.TRUE, testUVD.getGps()); - assertTrue(Test.TRUE, testUVD.getSpeed()); - assertTrue(Test.TRUE, testUVD.getRpm()); - assertTrue(Test.TRUE, testUVD.getFuelLevel()); - assertTrue(Test.TRUE, testUVD.getFuelLevelState()); - assertTrue(Test.TRUE, testUVD.getInstantFuelConsumption()); - assertTrue(Test.TRUE, testUVD.getExternalTemperature()); - assertTrue(Test.TRUE, testUVD.getPrndl()); - assertTrue(Test.TRUE, testUVD.getTirePressure()); - assertTrue(Test.TRUE, testUVD.getOdometer()); - assertTrue(Test.TRUE, testUVD.getBeltStatus()); - assertTrue(Test.TRUE, testUVD.getBodyInformation()); - assertTrue(Test.TRUE, testUVD.getDeviceStatus()); - assertTrue(Test.TRUE, testUVD.getDriverBraking()); - assertEquals(Test.MATCH, testCorrelationID, testUVD.getCorrelationID()); + assertTrue(TestValues.TRUE, testUVD.getGps()); + assertTrue(TestValues.TRUE, testUVD.getSpeed()); + assertTrue(TestValues.TRUE, testUVD.getRpm()); + assertTrue(TestValues.TRUE, testUVD.getFuelLevel()); + assertTrue(TestValues.TRUE, testUVD.getFuelLevelState()); + assertTrue(TestValues.TRUE, testUVD.getInstantFuelConsumption()); + assertTrue(TestValues.TRUE, testUVD.getExternalTemperature()); + assertTrue(TestValues.TRUE, testUVD.getPrndl()); + assertTrue(TestValues.TRUE, testUVD.getTirePressure()); + assertTrue(TestValues.TRUE, testUVD.getOdometer()); + assertTrue(TestValues.TRUE, testUVD.getBeltStatus()); + assertTrue(TestValues.TRUE, testUVD.getBodyInformation()); + assertTrue(TestValues.TRUE, testUVD.getDeviceStatus()); + assertTrue(TestValues.TRUE, testUVD.getDriverBraking()); + assertEquals(TestValues.MATCH, testCorrelationID, testUVD.getCorrelationID()); testUVD = RPCRequestFactory.BuildUnsubscribeVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, null); - assertNotNull(Test.NULL, testUVD.getCorrelationID()); + assertNotNull(TestValues.NULL, testUVD.getCorrelationID()); } public void testBuildGetVehicleData () { @@ -947,25 +947,25 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- BuildGetVehicleData(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State, boolean instantFuelConsumption, boolean externalTemperature, boolean vin, boolean prndl, boolean tirePressure, boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus, boolean driverBraking, Integer correlationID) testGVD = RPCRequestFactory.BuildGetVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testVIN, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, testCorrelationID); - assertTrue(Test.TRUE, testGVD.getGps()); - assertTrue(Test.TRUE, testGVD.getSpeed()); - assertTrue(Test.TRUE, testGVD.getRpm()); - assertTrue(Test.TRUE, testGVD.getFuelLevel()); - assertTrue(Test.TRUE, testGVD.getFuelLevelState()); - assertTrue(Test.TRUE, testGVD.getInstantFuelConsumption()); - assertTrue(Test.TRUE, testGVD.getExternalTemperature()); - assertTrue(Test.TRUE, testGVD.getPrndl()); - assertTrue(Test.TRUE, testGVD.getTirePressure()); - assertTrue(Test.TRUE, testGVD.getOdometer()); - assertTrue(Test.TRUE, testGVD.getBeltStatus()); - assertTrue(Test.TRUE, testGVD.getBodyInformation()); - assertTrue(Test.TRUE, testGVD.getDeviceStatus()); - assertTrue(Test.TRUE, testGVD.getDriverBraking()); - assertTrue(Test.TRUE, testGVD.getVin()); - assertEquals(Test.MATCH, testCorrelationID, testGVD.getCorrelationID()); + assertTrue(TestValues.TRUE, testGVD.getGps()); + assertTrue(TestValues.TRUE, testGVD.getSpeed()); + assertTrue(TestValues.TRUE, testGVD.getRpm()); + assertTrue(TestValues.TRUE, testGVD.getFuelLevel()); + assertTrue(TestValues.TRUE, testGVD.getFuelLevelState()); + assertTrue(TestValues.TRUE, testGVD.getInstantFuelConsumption()); + assertTrue(TestValues.TRUE, testGVD.getExternalTemperature()); + assertTrue(TestValues.TRUE, testGVD.getPrndl()); + assertTrue(TestValues.TRUE, testGVD.getTirePressure()); + assertTrue(TestValues.TRUE, testGVD.getOdometer()); + assertTrue(TestValues.TRUE, testGVD.getBeltStatus()); + assertTrue(TestValues.TRUE, testGVD.getBodyInformation()); + assertTrue(TestValues.TRUE, testGVD.getDeviceStatus()); + assertTrue(TestValues.TRUE, testGVD.getDriverBraking()); + assertTrue(TestValues.TRUE, testGVD.getVin()); + assertEquals(TestValues.MATCH, testCorrelationID, testGVD.getCorrelationID()); testGVD = RPCRequestFactory.BuildGetVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testVIN, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, null); - assertNotNull(Test.NULL, testGVD.getCorrelationID()); + assertNotNull(TestValues.NULL, testGVD.getCorrelationID()); } public void testBuildScrollableMessage () { @@ -978,16 +978,16 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- BuildScrollableMessage(String scrollableMessageBody, Integer timeout, Vector<SoftButton> softButtons, Integer correlationID) testSM = RPCRequestFactory.BuildScrollableMessage(testSMB, testTimeout, testSoftButtons, testCorrelationID); - assertEquals(Test.MATCH, testSMB, testSM.getScrollableMessageBody()); - assertEquals(Test.MATCH, testTimeout, testSM.getTimeout()); - assertTrue(Test.TRUE, Validator.validateSoftButtons(testSoftButtons, testSM.getSoftButtons())); - assertEquals(Test.MATCH, testCorrelationID, testSM.getCorrelationID()); + assertEquals(TestValues.MATCH, testSMB, testSM.getScrollableMessageBody()); + assertEquals(TestValues.MATCH, testTimeout, testSM.getTimeout()); + assertTrue(TestValues.TRUE, Validator.validateSoftButtons(testSoftButtons, testSM.getSoftButtons())); + assertEquals(TestValues.MATCH, testCorrelationID, testSM.getCorrelationID()); testSM = RPCRequestFactory.BuildScrollableMessage(null, null, null, null); - assertNull(Test.NULL, testSM.getScrollableMessageBody()); - assertNull(Test.NULL, testSM.getTimeout()); - assertNull(Test.NULL, testSM.getSoftButtons()); - assertNotNull(Test.NOT_NULL, testSM.getCorrelationID()); + assertNull(TestValues.NULL, testSM.getScrollableMessageBody()); + assertNull(TestValues.NULL, testSM.getTimeout()); + assertNull(TestValues.NULL, testSM.getSoftButtons()); + assertNotNull(TestValues.NOT_NULL, testSM.getCorrelationID()); } public void testBuildSlider () { @@ -1000,19 +1000,19 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- BuildSlider(Integer numTicks, Integer position, String sliderHeader, Vector<String> sliderFooter, Integer timeout, Integer correlationID) testSlider = RPCRequestFactory.BuildSlider(testTicks, testPosition, testHeader, testFooter, testTimeout, testCorrelationID); - assertEquals(Test.MATCH, testTicks, testSlider.getNumTicks()); - assertEquals(Test.MATCH, testPosition, testSlider.getPosition()); - assertEquals(Test.MATCH, testHeader, testSlider.getSliderHeader()); - assertTrue(Test.TRUE, Validator.validateStringList(testFooter, testSlider.getSliderFooter())); - assertEquals(Test.MATCH, testCorrelationID, testSlider.getCorrelationID()); + assertEquals(TestValues.MATCH, testTicks, testSlider.getNumTicks()); + assertEquals(TestValues.MATCH, testPosition, testSlider.getPosition()); + assertEquals(TestValues.MATCH, testHeader, testSlider.getSliderHeader()); + assertTrue(TestValues.TRUE, Validator.validateStringList(testFooter, testSlider.getSliderFooter())); + assertEquals(TestValues.MATCH, testCorrelationID, testSlider.getCorrelationID()); testSlider = RPCRequestFactory.BuildSlider(null, null, null, null, null, null); - assertNull(Test.NULL, testSlider.getNumTicks()); - assertNull(Test.NULL, testSlider.getPosition()); - assertNull(Test.NULL, testSlider.getSliderHeader()); - assertNull(Test.NULL, testSlider.getSliderFooter()); - assertNull(Test.NULL, testSlider.getTimeout()); - assertNotNull(Test.NOT_NULL, testSlider.getCorrelationID()); + assertNull(TestValues.NULL, testSlider.getNumTicks()); + assertNull(TestValues.NULL, testSlider.getPosition()); + assertNull(TestValues.NULL, testSlider.getSliderHeader()); + assertNull(TestValues.NULL, testSlider.getSliderFooter()); + assertNull(TestValues.NULL, testSlider.getTimeout()); + assertNotNull(TestValues.NOT_NULL, testSlider.getCorrelationID()); } public void testBuildChangeRegistration () { @@ -1023,14 +1023,14 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- BuildChangeRegistration(Language language, Language hmiDisplayLanguage, Integer correlationID) testCR = RPCRequestFactory.BuildChangeRegistration(testLang, testHMILang, testCorrelationID); - assertEquals(Test.MATCH, testLang, testCR.getLanguage()); - assertEquals(Test.MATCH, testHMILang, testCR.getHmiDisplayLanguage()); - assertEquals(Test.MATCH, testCorrelationID, testCR.getCorrelationID()); + assertEquals(TestValues.MATCH, testLang, testCR.getLanguage()); + assertEquals(TestValues.MATCH, testHMILang, testCR.getHmiDisplayLanguage()); + assertEquals(TestValues.MATCH, testCorrelationID, testCR.getCorrelationID()); testCR = RPCRequestFactory.BuildChangeRegistration(null, null, null); - assertNull(Test.NULL, testCR.getLanguage()); - assertNull(Test.NULL, testCR.getHmiDisplayLanguage()); - assertNotNull(Test.NOT_NULL, testCR.getCorrelationID()); + assertNull(TestValues.NULL, testCR.getLanguage()); + assertNull(TestValues.NULL, testCR.getHmiDisplayLanguage()); + assertNotNull(TestValues.NOT_NULL, testCR.getCorrelationID()); } public void testBuildSetDisplayLayout () { @@ -1041,12 +1041,12 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- BuildSetDisplayLayout(String displayLayout, Integer correlationID) testSDL = RPCRequestFactory.BuildSetDisplayLayout(testDL, testCorrelationID); - assertEquals(Test.MATCH, testDL, testSDL.getDisplayLayout()); - assertEquals(Test.MATCH, testCorrelationID, testSDL.getCorrelationID()); + assertEquals(TestValues.MATCH, testDL, testSDL.getDisplayLayout()); + assertEquals(TestValues.MATCH, testCorrelationID, testSDL.getCorrelationID()); testSDL = RPCRequestFactory.BuildSetDisplayLayout(null, null); - assertNull(Test.NULL, testSDL.getDisplayLayout()); - assertNotNull(Test.NOT_NULL, testSDL.getCorrelationID()); + assertNull(TestValues.NULL, testSDL.getDisplayLayout()); + assertNotNull(TestValues.NOT_NULL, testSDL.getCorrelationID()); } public void testBuildPerformAudioPassThru () { @@ -1065,26 +1065,26 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- BuildPerformAudioPassThru(Vector<TTSChunk> initialPrompt, String audioPassThruDisplayText1, String audioPassThruDisplayText2, SamplingRate samplingRate, Integer maxDuration, BitsPerSample bitsPerSample, AudioType audioType, Boolean muteAudio, Integer correlationID) testPAPT = RPCRequestFactory.BuildPerformAudioPassThru(testInitialPrompt, testAPTDT1, testAPTDT2, testSR, testMaxDuration, testBits, testAT, testMute, testCorrelationID); - assertTrue(Test.TRUE, Validator.validateTtsChunks(testInitialPrompt, testPAPT.getInitialPrompt())); - assertEquals(Test.MATCH, testAPTDT1, testPAPT.getAudioPassThruDisplayText1()); - assertEquals(Test.MATCH, testAPTDT2, testPAPT.getAudioPassThruDisplayText2()); - assertEquals(Test.MATCH, testSR, testPAPT.getSamplingRate()); - assertEquals(Test.MATCH, testMaxDuration, testPAPT.getMaxDuration()); - assertEquals(Test.MATCH, testBits, testPAPT.getBitsPerSample()); - assertEquals(Test.MATCH, testAT, testPAPT.getAudioType()); - assertEquals(Test.MATCH, testMute, testPAPT.getMuteAudio()); - assertEquals(Test.MATCH, testCorrelationID, testPAPT.getCorrelationID()); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testInitialPrompt, testPAPT.getInitialPrompt())); + assertEquals(TestValues.MATCH, testAPTDT1, testPAPT.getAudioPassThruDisplayText1()); + assertEquals(TestValues.MATCH, testAPTDT2, testPAPT.getAudioPassThruDisplayText2()); + assertEquals(TestValues.MATCH, testSR, testPAPT.getSamplingRate()); + assertEquals(TestValues.MATCH, testMaxDuration, testPAPT.getMaxDuration()); + assertEquals(TestValues.MATCH, testBits, testPAPT.getBitsPerSample()); + assertEquals(TestValues.MATCH, testAT, testPAPT.getAudioType()); + assertEquals(TestValues.MATCH, testMute, testPAPT.getMuteAudio()); + assertEquals(TestValues.MATCH, testCorrelationID, testPAPT.getCorrelationID()); testPAPT = RPCRequestFactory.BuildPerformAudioPassThru((Vector<TTSChunk>) null, null, null, null, null, null, null, null, null); - assertNull(Test.NULL, testPAPT.getInitialPrompt()); - assertNull(Test.NULL, testPAPT.getAudioPassThruDisplayText1()); - assertNull(Test.NULL, testPAPT.getAudioPassThruDisplayText2()); - assertNull(Test.NULL, testPAPT.getSamplingRate()); - assertNull(Test.NULL, testPAPT.getMaxDuration()); - assertNull(Test.NULL, testPAPT.getBitsPerSample()); - assertNull(Test.NULL, testPAPT.getAudioType()); - assertNull(Test.NULL, testPAPT.getMuteAudio()); - assertNotNull(Test.NOT_NULL, testPAPT.getCorrelationID()); + assertNull(TestValues.NULL, testPAPT.getInitialPrompt()); + assertNull(TestValues.NULL, testPAPT.getAudioPassThruDisplayText1()); + assertNull(TestValues.NULL, testPAPT.getAudioPassThruDisplayText2()); + assertNull(TestValues.NULL, testPAPT.getSamplingRate()); + assertNull(TestValues.NULL, testPAPT.getMaxDuration()); + assertNull(TestValues.NULL, testPAPT.getBitsPerSample()); + assertNull(TestValues.NULL, testPAPT.getAudioType()); + assertNull(TestValues.NULL, testPAPT.getMuteAudio()); + assertNotNull(TestValues.NOT_NULL, testPAPT.getCorrelationID()); } public void testBuildEndAudioPassThru () { @@ -1094,9 +1094,9 @@ public class RPCRequestFactoryTests extends TestCase { // Test -- BuildEndAudioPassThru(Integer correlationID) testEAPT = RPCRequestFactory.BuildEndAudioPassThru(testCorrelationID); - assertEquals(Test.MATCH, testCorrelationID, testEAPT.getCorrelationID()); + assertEquals(TestValues.MATCH, testCorrelationID, testEAPT.getCorrelationID()); testEAPT = RPCRequestFactory.BuildEndAudioPassThru(null); - assertNotNull(Test.NOT_NULL, testEAPT.getCorrelationID()); + assertNotNull(TestValues.NOT_NULL, testEAPT.getCorrelationID()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCStructTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCStructTests.java index 370d30979..a61c9558e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCStructTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCStructTests.java @@ -8,7 +8,7 @@ import com.smartdevicelink.proxy.rpc.Image; import com.smartdevicelink.proxy.rpc.ImageField; import com.smartdevicelink.proxy.rpc.enums.MediaClockFormat; import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -38,11 +38,11 @@ public class RPCStructTests extends TestCase { } public void testGeneralGettersAndSetters(){ - String testKey = Test.GENERAL_STRING; - Integer testInt = Test.GENERAL_INT; + String testKey = TestValues.GENERAL_STRING; + Integer testInt = TestValues.GENERAL_INT; testStruct.setValue(testKey, testInt); - assertEquals(Test.MATCH, testInt, testStruct.getValue(testKey)); + assertEquals(TestValues.MATCH, testInt, testStruct.getValue(testKey)); testStruct.setValue(testKey, null); assertNull(testStruct.getValue(testKey)); @@ -50,38 +50,38 @@ public class RPCStructTests extends TestCase { public void testCommonObjectGetters(){ String stringKey = "String"; - String testString = Test.GENERAL_STRING; + String testString = TestValues.GENERAL_STRING; testStruct.setValue(stringKey, testString); - assertEquals(Test.MATCH, testStruct.getString(stringKey), testString); + assertEquals(TestValues.MATCH, testStruct.getString(stringKey), testString); String intKey = "Integer"; - Integer testInt = Test.GENERAL_INT; + Integer testInt = TestValues.GENERAL_INT; testStruct.setValue(intKey, testInt); - assertEquals(Test.MATCH, testStruct.getInteger(intKey), testInt); + assertEquals(TestValues.MATCH, testStruct.getInteger(intKey), testInt); String doubleKey = "Double"; - Double testDouble = Test.GENERAL_DOUBLE; + Double testDouble = TestValues.GENERAL_DOUBLE; testStruct.setValue(doubleKey, testDouble); - assertEquals(Test.MATCH, testStruct.getDouble(doubleKey), testDouble); + assertEquals(TestValues.MATCH, testStruct.getDouble(doubleKey), testDouble); String booleanKey = "Boolean"; - Boolean testBoolean = Test.GENERAL_BOOLEAN; + Boolean testBoolean = TestValues.GENERAL_BOOLEAN; testStruct.setValue(booleanKey, testBoolean); - assertEquals(Test.MATCH, testStruct.getBoolean(booleanKey), testBoolean); + assertEquals(TestValues.MATCH, testStruct.getBoolean(booleanKey), testBoolean); String longKey = "Long"; - Long testLong = Test.GENERAL_LONG; + Long testLong = TestValues.GENERAL_LONG; testStruct.setValue(longKey, testLong); - assertEquals(Test.MATCH, testStruct.getLong(longKey), testLong); + assertEquals(TestValues.MATCH, testStruct.getLong(longKey), testLong); testStruct.setValue(longKey, testInt); - assertEquals(Test.MATCH, testStruct.getLong(longKey), new Long(testInt.longValue())); + assertEquals(TestValues.MATCH, testStruct.getLong(longKey), new Long(testInt.longValue())); testStruct.setValue(longKey, testDouble); @@ -95,26 +95,26 @@ public class RPCStructTests extends TestCase { String keyAirbag = AirbagStatus.KEY_DRIVER_AIRBAG_DEPLOYED; VehicleDataEventStatus eventStatus = VehicleDataEventStatus.FAULT; testStruct.setValue(keyAirbag, eventStatus); - assertEquals(Test.MATCH, eventStatus, testStruct.getObject(VehicleDataEventStatus.class, keyAirbag)); + assertEquals(TestValues.MATCH, eventStatus, testStruct.getObject(VehicleDataEventStatus.class, keyAirbag)); String eventStatusString = VehicleDataEventStatus.FAULT.toString(); testStruct.setValue(keyAirbag, eventStatusString); - assertEquals(Test.MATCH, eventStatus, testStruct.getObject(VehicleDataEventStatus.class, keyAirbag)); + assertEquals(TestValues.MATCH, eventStatus, testStruct.getObject(VehicleDataEventStatus.class, keyAirbag)); String keyImage = Choice.KEY_IMAGE; - Image testImage = Test.GENERAL_IMAGE; + Image testImage = TestValues.GENERAL_IMAGE; testStruct.setValue(keyImage, testImage.getStore()); assertTrue(Validator.validateImage(testImage, (Image) testStruct.getObject(Image.class, keyImage))); String keyVrCommand = Choice.KEY_VR_COMMANDS; - List<String> testCommands = Test.GENERAL_STRING_LIST; + List<String> testCommands = TestValues.GENERAL_STRING_LIST; testStruct.setValue(keyVrCommand, testCommands); - assertEquals(Test.MATCH, testCommands, testStruct.getObject(String.class, keyVrCommand)); + assertEquals(TestValues.MATCH, testCommands, testStruct.getObject(String.class, keyVrCommand)); String keyImageFields = DisplayCapabilities.KEY_IMAGE_FIELDS; - List<ImageField> testImageFields = Test.GENERAL_IMAGEFIELD_LIST; + List<ImageField> testImageFields = TestValues.GENERAL_IMAGEFIELD_LIST; testStruct.setValue(keyImageFields, testImageFields); - assertEquals(Test.MATCH, testImageFields, testStruct.getObject(ImageField.class, keyImageFields)); + assertEquals(TestValues.MATCH, testImageFields, testStruct.getObject(ImageField.class, keyImageFields)); List<Hashtable<String, Object>> testListImageFields = new ArrayList<>(); for(ImageField imgField : testImageFields){ @@ -128,16 +128,16 @@ public class RPCStructTests extends TestCase { } String keyMediaClockFormats = DisplayCapabilities.KEY_MEDIA_CLOCK_FORMATS; - List<MediaClockFormat> testMediaClockFormats = Test.GENERAL_MEDIACLOCKFORMAT_LIST; + List<MediaClockFormat> testMediaClockFormats = TestValues.GENERAL_MEDIACLOCKFORMAT_LIST; testStruct.setValue(keyMediaClockFormats, testMediaClockFormats); - assertEquals(Test.MATCH, testMediaClockFormats, testStruct.getObject(MediaClockFormat.class, keyMediaClockFormats)); + assertEquals(TestValues.MATCH, testMediaClockFormats, testStruct.getObject(MediaClockFormat.class, keyMediaClockFormats)); List<String> testListMediaClockFormats = new ArrayList<>(); for(MediaClockFormat mcFormat : testMediaClockFormats){ testListMediaClockFormats.add(mcFormat.toString()); } testStruct.setValue(keyMediaClockFormats, testListMediaClockFormats); - assertEquals(Test.MATCH, testMediaClockFormats, testStruct.getObject(MediaClockFormat.class, keyMediaClockFormats)); + assertEquals(TestValues.MATCH, testMediaClockFormats, testStruct.getObject(MediaClockFormat.class, keyMediaClockFormats)); assertNull(testStruct.getObject(Image.class, keyAirbag)); // Test incorrect class } @@ -152,7 +152,7 @@ public class RPCStructTests extends TestCase { testStruct.setValue(invalidKey, list); assertNull(testStruct.getObject(Integer.class, invalidKey)); - testStruct.setValue(invalidKey, Test.GENERAL_STRING); + testStruct.setValue(invalidKey, TestValues.GENERAL_STRING); assertNull(testStruct.getObject(Integer.class, invalidKey)); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SystemCapabilityManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SystemCapabilityManagerTests.java index 7b4aa2a62..bbba3cb61 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SystemCapabilityManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SystemCapabilityManagerTests.java @@ -57,13 +57,14 @@ import com.smartdevicelink.proxy.rpc.listeners.OnRPCRequestListener; import com.smartdevicelink.streaming.audio.AudioStreamingCodec; import com.smartdevicelink.streaming.audio.AudioStreamingParams; import com.smartdevicelink.streaming.video.VideoStreamingParameters; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.utl.AppServiceFactory; import com.smartdevicelink.util.CorrelationIdGenerator; import com.smartdevicelink.util.Version; import org.junit.Before; +import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; @@ -98,9 +99,9 @@ public class SystemCapabilityManagerTests { systemCapability = new SystemCapability(SystemCapabilityType.VIDEO_STREAMING); videoStreamingCapability = new VideoStreamingCapability(); - videoStreamingCapability.setMaxBitrate(Test.GENERAL_INT); - videoStreamingCapability.setPreferredResolution(Test.GENERAL_IMAGERESOLUTION); - videoStreamingCapability.setSupportedFormats(Test.GENERAL_VIDEOSTREAMINGFORMAT_LIST); + videoStreamingCapability.setMaxBitrate(TestValues.GENERAL_INT); + videoStreamingCapability.setPreferredResolution(TestValues.GENERAL_IMAGERESOLUTION); + videoStreamingCapability.setSupportedFormats(TestValues.GENERAL_VIDEOSTREAMINGFORMAT_LIST); systemCapability.setCapabilityForType(SystemCapabilityType.VIDEO_STREAMING, videoStreamingCapability); } @@ -113,15 +114,15 @@ public class SystemCapabilityManagerTests { RegisterAppInterfaceResponse raiResponse = new RegisterAppInterfaceResponse(); - raiResponse.setHmiCapabilities(Test.GENERAL_HMICAPABILITIES); - raiResponse.setDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES); - raiResponse.setAudioPassThruCapabilities(Test.GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST); - raiResponse.setButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST); - raiResponse.setHmiZoneCapabilities(Test.GENERAL_HMIZONECAPABILITIES_LIST); - raiResponse.setPresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES); - raiResponse.setSoftButtonCapabilities(Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST); - raiResponse.setSpeechCapabilities(Test.GENERAL_SPEECHCAPABILITIES_LIST); - raiResponse.setPrerecordedSpeech(Test.GENERAL_PRERECORDEDSPEECH_LIST); + raiResponse.setHmiCapabilities(TestValues.GENERAL_HMICAPABILITIES); + raiResponse.setDisplayCapabilities(TestValues.GENERAL_DISPLAYCAPABILITIES); + raiResponse.setAudioPassThruCapabilities(TestValues.GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST); + raiResponse.setButtonCapabilities(TestValues.GENERAL_BUTTONCAPABILITIES_LIST); + raiResponse.setHmiZoneCapabilities(TestValues.GENERAL_HMIZONECAPABILITIES_LIST); + raiResponse.setPresetBankCapabilities(TestValues.GENERAL_PRESETBANKCAPABILITIES); + raiResponse.setSoftButtonCapabilities(TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST); + raiResponse.setSpeechCapabilities(TestValues.GENERAL_SPEECHCAPABILITIES_LIST); + raiResponse.setPrerecordedSpeech(TestValues.GENERAL_PRERECORDEDSPEECH_LIST); raiResponse.setSuccess(true); systemCapabilityManager.parseRAIResponse(raiResponse); @@ -176,47 +177,47 @@ public class SystemCapabilityManagerTests { return convertedCapabilities; } - @org.junit.Test + @Test public void testParseRAI() { systemCapabilityManager = createSampleManager(); - List<DisplayCapability> displayCapabilityList = createDisplayCapabilityList(Test.GENERAL_DISPLAYCAPABILITIES, Test.GENERAL_BUTTONCAPABILITIES_LIST, Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST); - assertTrue(Test.TRUE, + List<DisplayCapability> displayCapabilityList = createDisplayCapabilityList(TestValues.GENERAL_DISPLAYCAPABILITIES, TestValues.GENERAL_BUTTONCAPABILITIES_LIST, TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST); + assertTrue(TestValues.TRUE, Validator.validateDisplayCapabilityList(displayCapabilityList, (List<DisplayCapability>) systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAYS))); - assertTrue(Test.TRUE, - Validator.validateHMICapabilities(Test.GENERAL_HMICAPABILITIES, (HMICapabilities) systemCapabilityManager.getCapability(SystemCapabilityType.HMI))); - assertTrue(Test.TRUE, - Validator.validateDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES, (DisplayCapabilities) systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY))); - assertTrue(Test.TRUE, - Validator.validateAudioPassThruCapabilities(Test.GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST, (List<AudioPassThruCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.AUDIO_PASSTHROUGH))); - assertTrue(Test.TRUE, - Validator.validateButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST, (List<ButtonCapabilities> )systemCapabilityManager.getCapability(SystemCapabilityType.BUTTON))); - assertTrue(Test.TRUE, - Validator.validateHMIZoneCapabilities(Test.GENERAL_HMIZONECAPABILITIES_LIST, (List<HmiZoneCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.HMI_ZONE))); - assertTrue(Test.TRUE, - Validator.validatePresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES, (PresetBankCapabilities) systemCapabilityManager.getCapability(SystemCapabilityType.PRESET_BANK))); - assertTrue(Test.TRUE, - Validator.validateSoftButtonCapabilities(Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST, (List<SoftButtonCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.SOFTBUTTON))); - assertTrue(Test.TRUE, - Validator.validateSpeechCapabilities(Test.GENERAL_SPEECHCAPABILITIES_LIST, (List<SpeechCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.SPEECH))); - assertTrue(Test.TRUE, - Validator.validatePreRecordedSpeechCapabilities(Test.GENERAL_PRERECORDEDSPEECH_LIST, (List<PrerecordedSpeech>) systemCapabilityManager.getCapability(SystemCapabilityType.PRERECORDED_SPEECH))); + assertTrue(TestValues.TRUE, + Validator.validateHMICapabilities(TestValues.GENERAL_HMICAPABILITIES, (HMICapabilities) systemCapabilityManager.getCapability(SystemCapabilityType.HMI))); + assertTrue(TestValues.TRUE, + Validator.validateDisplayCapabilities(TestValues.GENERAL_DISPLAYCAPABILITIES, (DisplayCapabilities) systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY))); + assertTrue(TestValues.TRUE, + Validator.validateAudioPassThruCapabilities(TestValues.GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST, (List<AudioPassThruCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.AUDIO_PASSTHROUGH))); + assertTrue(TestValues.TRUE, + Validator.validateButtonCapabilities(TestValues.GENERAL_BUTTONCAPABILITIES_LIST, (List<ButtonCapabilities> )systemCapabilityManager.getCapability(SystemCapabilityType.BUTTON))); + assertTrue(TestValues.TRUE, + Validator.validateHMIZoneCapabilities(TestValues.GENERAL_HMIZONECAPABILITIES_LIST, (List<HmiZoneCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.HMI_ZONE))); + assertTrue(TestValues.TRUE, + Validator.validatePresetBankCapabilities(TestValues.GENERAL_PRESETBANKCAPABILITIES, (PresetBankCapabilities) systemCapabilityManager.getCapability(SystemCapabilityType.PRESET_BANK))); + assertTrue(TestValues.TRUE, + Validator.validateSoftButtonCapabilities(TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST, (List<SoftButtonCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.SOFTBUTTON))); + assertTrue(TestValues.TRUE, + Validator.validateSpeechCapabilities(TestValues.GENERAL_SPEECHCAPABILITIES_LIST, (List<SpeechCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.SPEECH))); + assertTrue(TestValues.TRUE, + Validator.validatePreRecordedSpeechCapabilities(TestValues.GENERAL_PRERECORDEDSPEECH_LIST, (List<PrerecordedSpeech>) systemCapabilityManager.getCapability(SystemCapabilityType.PRERECORDED_SPEECH))); } - @org.junit.Test + @Test public void testNullDisplayCapabilitiesEnablesAllTextAndImageFields() { - List<DisplayCapability> displayCapabilityList = createDisplayCapabilityList(null, Test.GENERAL_BUTTONCAPABILITIES_LIST, Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST); + List<DisplayCapability> displayCapabilityList = createDisplayCapabilityList(null, TestValues.GENERAL_BUTTONCAPABILITIES_LIST, TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST); assertEquals(displayCapabilityList.get(0).getWindowCapabilities().get(0).getTextFields().size(), 29); assertEquals(displayCapabilityList.get(0).getWindowCapabilities().get(0).getImageFields().size(), 14); } - @org.junit.Test + @Test public void testGetVSCapability(){ VideoStreamingCapability vsCapability = new VideoStreamingCapability(); - vsCapability.setMaxBitrate(Test.GENERAL_INT); - vsCapability.setPreferredResolution(Test.GENERAL_IMAGERESOLUTION); - vsCapability.setSupportedFormats(Test.GENERAL_VIDEOSTREAMINGFORMAT_LIST); + vsCapability.setMaxBitrate(TestValues.GENERAL_INT); + vsCapability.setPreferredResolution(TestValues.GENERAL_IMAGERESOLUTION); + vsCapability.setSupportedFormats(TestValues.GENERAL_VIDEOSTREAMINGFORMAT_LIST); SystemCapability cap = new SystemCapability(); cap.setSystemCapabilityType(SystemCapabilityType.VIDEO_STREAMING); @@ -245,7 +246,7 @@ public class SystemCapabilityManagerTests { systemCapabilityManager.getCapability(SystemCapabilityType.VIDEO_STREAMING, new OnSystemCapabilityListener() { @Override public void onCapabilityRetrieved(Object capability) { - assertTrue(Test.TRUE, + assertTrue(TestValues.TRUE, Validator.validateVideoStreamingCapability( (VideoStreamingCapability) referenceCapability.getCapabilityForType(SystemCapabilityType.VIDEO_STREAMING), (VideoStreamingCapability) capability)); @@ -296,7 +297,7 @@ public class SystemCapabilityManagerTests { return onSendGetSystemCapabilityAnswer; } - @org.junit.Test + @Test public void testGetCapability() { ISdl internalInterface; SystemCapabilityManager scm; @@ -325,7 +326,7 @@ public class SystemCapabilityManagerTests { doAnswer(createOnSendGetSystemCapabilityAnswer(true, null)).when(internalInterface).sendRPC(any(GetSystemCapability.class)); scm.setCapability(SystemCapabilityType.VIDEO_STREAMING, videoStreamingCapability); retrievedCapability = (VideoStreamingCapability) scm.getCapability(SystemCapabilityType.VIDEO_STREAMING, onSystemCapabilityListener, true); - assertTrue(Test.TRUE, Validator.validateVideoStreamingCapability((VideoStreamingCapability) systemCapability.getCapabilityForType(SystemCapabilityType.VIDEO_STREAMING), retrievedCapability)); + assertTrue(TestValues.TRUE, Validator.validateVideoStreamingCapability((VideoStreamingCapability) systemCapability.getCapabilityForType(SystemCapabilityType.VIDEO_STREAMING), retrievedCapability)); verify(internalInterface, times(1)).sendRPC(any(GetSystemCapability.class)); verify(onSystemCapabilityListener, times(1)).onCapabilityRetrieved(any(Object.class)); @@ -338,7 +339,7 @@ public class SystemCapabilityManagerTests { doAnswer(createOnSendGetSystemCapabilityAnswer(true, null)).when(internalInterface).sendRPC(any(GetSystemCapability.class)); scm.setCapability(SystemCapabilityType.VIDEO_STREAMING, videoStreamingCapability); retrievedCapability = (VideoStreamingCapability) scm.getCapability(SystemCapabilityType.VIDEO_STREAMING, onSystemCapabilityListener, true); - assertTrue(Test.TRUE, Validator.validateVideoStreamingCapability((VideoStreamingCapability) systemCapability.getCapabilityForType(SystemCapabilityType.VIDEO_STREAMING), retrievedCapability)); + assertTrue(TestValues.TRUE, Validator.validateVideoStreamingCapability((VideoStreamingCapability) systemCapability.getCapabilityForType(SystemCapabilityType.VIDEO_STREAMING), retrievedCapability)); verify(internalInterface, times(1)).sendRPC(any(GetSystemCapability.class)); @@ -350,11 +351,11 @@ public class SystemCapabilityManagerTests { doAnswer(createOnSendGetSystemCapabilityAnswer(true, null)).when(internalInterface).sendRPC(any(GetSystemCapability.class)); scm.setCapability(SystemCapabilityType.VIDEO_STREAMING, videoStreamingCapability); retrievedCapability = (VideoStreamingCapability) scm.getCapability(SystemCapabilityType.VIDEO_STREAMING, onSystemCapabilityListener, false); - assertTrue(Test.TRUE, Validator.validateVideoStreamingCapability((VideoStreamingCapability) systemCapability.getCapabilityForType(SystemCapabilityType.VIDEO_STREAMING), retrievedCapability)); + assertTrue(TestValues.TRUE, Validator.validateVideoStreamingCapability((VideoStreamingCapability) systemCapability.getCapabilityForType(SystemCapabilityType.VIDEO_STREAMING), retrievedCapability)); verify(internalInterface, times(0)).sendRPC(any(GetSystemCapability.class)); } - @org.junit.Test + @Test public void testGetCapabilityHmiNone() { ISdl internalInterface = mock(ISdl.class); doAnswer(createOnHMIStatusAnswer(HMILevel.HMI_NONE)).when(internalInterface).addOnRPCListener(eq(FunctionID.ON_HMI_STATUS), any(OnRPCListener.class)); @@ -369,7 +370,7 @@ public class SystemCapabilityManagerTests { verify(onSystemCapabilityListener, times(1)).onError(any(String.class)); } - @org.junit.Test + @Test public void testAddOnSystemCapabilityListenerWithSubscriptionsSupportedAndCapabilityCached() { SdlMsgVersion sdlMsgVersion = new SdlMsgVersion(6, 0); // This version supports capability subscriptions sdlMsgVersion.setPatchVersion(0); @@ -416,7 +417,7 @@ public class SystemCapabilityManagerTests { verify(internalInterface, times(2)).sendRPC(any(GetSystemCapability.class)); } - @org.junit.Test + @Test public void testAddOnSystemCapabilityListenerWithSubscriptionsSupportedAndCapabilityNotCached() { SdlMsgVersion sdlMsgVersion = new SdlMsgVersion(6, 0); // This version supports capability subscriptions sdlMsgVersion.setPatchVersion(0); @@ -463,7 +464,7 @@ public class SystemCapabilityManagerTests { verify(internalInterface, times(2)).sendRPC(any(GetSystemCapability.class)); } - @org.junit.Test + @Test public void testAddOnSystemCapabilityListenerWithSubscriptionsNotSupportedAndCapabilityCached() { SdlMsgVersion sdlMsgVersion = new SdlMsgVersion(5, 0); // This version doesn't support capability subscriptions sdlMsgVersion.setPatchVersion(0); @@ -510,7 +511,7 @@ public class SystemCapabilityManagerTests { verify(internalInterface, times(0)).sendRPC(any(GetSystemCapability.class)); } - @org.junit.Test + @Test public void testAddOnSystemCapabilityListenerWithSubscriptionsNotSupportedAndCapabilityNotCached() { SdlMsgVersion sdlMsgVersion = new SdlMsgVersion(5, 0); // This version doesn't support capability subscriptions sdlMsgVersion.setPatchVersion(0); @@ -557,7 +558,7 @@ public class SystemCapabilityManagerTests { verify(internalInterface, times(1)).sendRPC(any(GetSystemCapability.class)); } - @org.junit.Test + @Test public void testAddOnSystemCapabilityListenerThenGetCapabilityWhenSubscriptionsAreNotSupported() { SdlMsgVersion sdlMsgVersion = new SdlMsgVersion(5, 0); // This version doesn't support capability subscriptions sdlMsgVersion.setPatchVersion(0); @@ -647,7 +648,7 @@ public class SystemCapabilityManagerTests { verify(onSystemCapabilityListener3, times(4)).onCapabilityRetrieved(any(Object.class)); } - @org.junit.Test + @Test public void testGetAndAddListenerForDisplaysCapability() { ISdl internalInterface; SystemCapabilityManager scm; @@ -683,7 +684,7 @@ public class SystemCapabilityManagerTests { verify(internalInterface, times(0)).sendRPC(any(GetSystemCapability.class)); } - @org.junit.Test + @Test public void testListConversion(){ SystemCapabilityManager systemCapabilityManager = createSampleManager(); Object capability = systemCapabilityManager.getCapability(SystemCapabilityType.SOFTBUTTON); @@ -692,14 +693,14 @@ public class SystemCapabilityManagerTests { assertNotNull(list); } - @org.junit.Test + @Test public void testFalsePositive(){ SystemCapabilityManager systemCapabilityManager = createSampleManager(); systemCapabilityManager.setCapability(SystemCapabilityType.AUDIO_PASSTHROUGH, null); assertFalse(systemCapabilityManager.isCapabilitySupported(SystemCapabilityType.AUDIO_PASSTHROUGH)); } - @org.junit.Test + @Test public void testOnSystemCapabilityUpdateWithNoExistingCap(){ InternalSDLInterface iSDL = new InternalSDLInterface(); SystemCapabilityManager systemCapabilityManager = createSampleManager(iSDL); @@ -725,7 +726,7 @@ public class SystemCapabilityManagerTests { assertNotNull(systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES)); } - @org.junit.Test + @Test public void testOnSystemCapabilityUpdatedForDISPLAYS() { InternalSDLInterface iSDL = new InternalSDLInterface(); SystemCapabilityManager systemCapabilityManager = createSampleManager(iSDL); @@ -735,7 +736,7 @@ public class SystemCapabilityManagerTests { assertNotNull(systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAYS)); assertNotNull(systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY)); - List<DisplayCapability> newCaps = createDisplayCapabilityList(Test.GENERAL_DISPLAYCAPABILITIES, Test.GENERAL_BUTTONCAPABILITIES_LIST, Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST);; + List<DisplayCapability> newCaps = createDisplayCapabilityList(TestValues.GENERAL_DISPLAYCAPABILITIES, TestValues.GENERAL_BUTTONCAPABILITIES_LIST, TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST);; SystemCapability systemCapability = new SystemCapability(); systemCapability.setSystemCapabilityType(SystemCapabilityType.DISPLAYS); @@ -756,7 +757,7 @@ public class SystemCapabilityManagerTests { assertTrue(Validator.validateDisplayCapabilities(appliedConvertedCaps, testConvertedCaps)); } - @org.junit.Test + @Test public void testOnSystemCapabilityUpdated(){ InternalSDLInterface iSDL = new InternalSDLInterface(); String baseName = "NavTest", baseID = "37F98053AE"; @@ -872,13 +873,13 @@ public class SystemCapabilityManagerTests { SystemCapabilityManager systemCapabilityManager = createSampleManager(iSDL); OnRPCListener scmRpcListener = iSDL.rpcListeners.get(FunctionID.ON_SYSTEM_CAPABILITY_UPDATED.getId()).get(0); assertNotNull(scmRpcListener); - systemCapabilityManager.setCapability(SystemCapabilityType.PHONE_CALL, Test.GENERAL_PHONECAPABILITY); + systemCapabilityManager.setCapability(SystemCapabilityType.PHONE_CALL, TestValues.GENERAL_PHONECAPABILITY); PhoneCapability phoneCapability = (PhoneCapability)systemCapabilityManager.getCapability(SystemCapabilityType.PHONE_CALL); assertNotNull(phoneCapability); - assertEquals(phoneCapability, Test.GENERAL_PHONECAPABILITY); + assertEquals(phoneCapability, TestValues.GENERAL_PHONECAPABILITY); - phoneCapability.setDialNumberEnabled(!Test.GENERAL_PHONECAPABILITY.getDialNumberEnabled()); //Flip it + phoneCapability.setDialNumberEnabled(!TestValues.GENERAL_PHONECAPABILITY.getDialNumberEnabled()); //Flip it SystemCapability systemCapability = new SystemCapability(); systemCapability.setSystemCapabilityType(SystemCapabilityType.PHONE_CALL); systemCapability.setCapabilityForType(SystemCapabilityType.PHONE_CALL, phoneCapability); @@ -893,7 +894,7 @@ public class SystemCapabilityManagerTests { assertEquals(phoneCapability, phoneCapabilityUpdated); } - @org.junit.Test + @Test public void testOnSetDisplayLayout() { InternalSDLInterface iSDL = new InternalSDLInterface(); SystemCapabilityManager systemCapabilityManager = createSampleManager(iSDL); @@ -901,10 +902,10 @@ public class SystemCapabilityManagerTests { assertNotNull(dlRpcListener); SetDisplayLayoutResponse newLayout = new SetDisplayLayoutResponse(); - newLayout.setDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES); - newLayout.setButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST); - newLayout.setSoftButtonCapabilities(Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST); - newLayout.setPresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES); + newLayout.setDisplayCapabilities(TestValues.GENERAL_DISPLAYCAPABILITIES); + newLayout.setButtonCapabilities(TestValues.GENERAL_BUTTONCAPABILITIES_LIST); + newLayout.setSoftButtonCapabilities(TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST); + newLayout.setPresetBankCapabilities(TestValues.GENERAL_PRESETBANKCAPABILITIES); newLayout.setSuccess(true); newLayout.setResultCode(Result.SUCCESS); @@ -926,7 +927,7 @@ public class SystemCapabilityManagerTests { assertNull(systemCapabilityManager.getWindowCapability(42)); } - @org.junit.Test + @Test public void testManagerBeforeDisplayUpdate() { InternalSDLInterface iSDL = new InternalSDLInterface(); SystemCapabilityManager systemCapabilityManager = new SystemCapabilityManager(iSDL); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/TTSChunkFactoryTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/TTSChunkFactoryTests.java index 9349a22d9..ad1976cb1 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/TTSChunkFactoryTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/TTSChunkFactoryTests.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.proxy; import com.smartdevicelink.proxy.TTSChunkFactory; import com.smartdevicelink.proxy.rpc.TTSChunk; import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -24,40 +24,40 @@ public class TTSChunkFactoryTests extends TestCase { public void testCreateChunk () { // Valid Tests SpeechCapabilities testType = SpeechCapabilities.TEXT; - testChunk = TTSChunkFactory.createChunk(testType, Test.GENERAL_STRING); - assertNotNull(Test.NOT_NULL, testChunk); - assertEquals(Test.MATCH, testType, testChunk.getType()); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunk.getText()); + testChunk = TTSChunkFactory.createChunk(testType, TestValues.GENERAL_STRING); + assertNotNull(TestValues.NOT_NULL, testChunk); + assertEquals(TestValues.MATCH, testType, testChunk.getType()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testChunk.getText()); testType = SpeechCapabilities.SILENCE; - testChunk = TTSChunkFactory.createChunk(testType, Test.GENERAL_STRING); - assertNotNull(Test.NOT_NULL, testChunk); - assertEquals(Test.MATCH, testType, testChunk.getType()); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunk.getText()); + testChunk = TTSChunkFactory.createChunk(testType, TestValues.GENERAL_STRING); + assertNotNull(TestValues.NOT_NULL, testChunk); + assertEquals(TestValues.MATCH, testType, testChunk.getType()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testChunk.getText()); testType = SpeechCapabilities.SAPI_PHONEMES; - testChunk = TTSChunkFactory.createChunk(testType, Test.GENERAL_STRING); - assertNotNull(Test.NOT_NULL, testChunk); - assertEquals(Test.MATCH, testType, testChunk.getType()); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunk.getText()); + testChunk = TTSChunkFactory.createChunk(testType, TestValues.GENERAL_STRING); + assertNotNull(TestValues.NOT_NULL, testChunk); + assertEquals(TestValues.MATCH, testType, testChunk.getType()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testChunk.getText()); testType = SpeechCapabilities.PRE_RECORDED; - testChunk = TTSChunkFactory.createChunk(testType, Test.GENERAL_STRING); - assertNotNull(Test.NOT_NULL, testChunk); - assertEquals(Test.MATCH, testType, testChunk.getType()); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunk.getText()); + testChunk = TTSChunkFactory.createChunk(testType, TestValues.GENERAL_STRING); + assertNotNull(TestValues.NOT_NULL, testChunk); + assertEquals(TestValues.MATCH, testType, testChunk.getType()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testChunk.getText()); testType = SpeechCapabilities.LHPLUS_PHONEMES; - testChunk = TTSChunkFactory.createChunk(testType, Test.GENERAL_STRING); - assertNotNull(Test.NOT_NULL, testChunk); - assertEquals(Test.MATCH, testType, testChunk.getType()); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunk.getText()); + testChunk = TTSChunkFactory.createChunk(testType, TestValues.GENERAL_STRING); + assertNotNull(TestValues.NOT_NULL, testChunk); + assertEquals(TestValues.MATCH, testType, testChunk.getType()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testChunk.getText()); // Invalid/Null Tests testChunk = TTSChunkFactory.createChunk(null, null); - assertNotNull(Test.NOT_NULL, testChunk); - assertNull(Test.NULL, testChunk.getType()); - assertNull(Test.NULL, testChunk.getText()); + assertNotNull(TestValues.NOT_NULL, testChunk); + assertNull(TestValues.NULL, testChunk.getType()); + assertNull(TestValues.NULL, testChunk.getText()); } /** @@ -67,16 +67,16 @@ public class TTSChunkFactoryTests extends TestCase { public void testCreateSimpleTTSChunks () { // Test Values Vector<TTSChunk> testChunks; - testChunks = TTSChunkFactory.createSimpleTTSChunks(Test.GENERAL_STRING); + testChunks = TTSChunkFactory.createSimpleTTSChunks(TestValues.GENERAL_STRING); // Valid Tests - assertNotNull(Test.NOT_NULL, testChunks); - assertEquals(Test.MATCH, SpeechCapabilities.TEXT, testChunks.get(0).getType()); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunks.get(0).getText()); + assertNotNull(TestValues.NOT_NULL, testChunks); + assertEquals(TestValues.MATCH, SpeechCapabilities.TEXT, testChunks.get(0).getType()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testChunks.get(0).getText()); // Invalid/Null Tests testChunks = TTSChunkFactory.createSimpleTTSChunks(null); - assertNull(Test.NULL, testChunks); + assertNull(TestValues.NULL, testChunks); } /** @@ -86,15 +86,15 @@ public class TTSChunkFactoryTests extends TestCase { public void testCreatePrerecordedTTSChunks () { // Test Values Vector<TTSChunk> testChunks; - testChunks = TTSChunkFactory.createPrerecordedTTSChunks(Test.GENERAL_STRING); + testChunks = TTSChunkFactory.createPrerecordedTTSChunks(TestValues.GENERAL_STRING); // Valid Tests - assertNotNull(Test.NOT_NULL, testChunks); - assertEquals(Test.MATCH, SpeechCapabilities.PRE_RECORDED, testChunks.get(0).getType()); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testChunks.get(0).getText()); + assertNotNull(TestValues.NOT_NULL, testChunks); + assertEquals(TestValues.MATCH, SpeechCapabilities.PRE_RECORDED, testChunks.get(0).getType()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testChunks.get(0).getText()); // Invalid/Null Tests testChunks = TTSChunkFactory.createPrerecordedTTSChunks(null); - assertNull(Test.NULL, testChunks); + assertNull(TestValues.NULL, testChunks); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCConstructorsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCConstructorsTests.java index d17582da4..24ca214b8 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCConstructorsTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCConstructorsTests.java @@ -281,7 +281,7 @@ public class RPCConstructorsTests { if (param.isArray){ valueString += "_LIST"; } - value = Class.forName("com.smartdevicelink.test.Test").getDeclaredField(valueString).get(null); + value = Class.forName("com.smartdevicelink.test.TestValues").getDeclaredField(valueString).get(null); } } catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AirbagStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AirbagStatusTests.java index dae248b74..82fa603f6 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AirbagStatusTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AirbagStatusTests.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.AirbagStatus; import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,16 +23,16 @@ public class AirbagStatusTests extends TestCase{ @Override public void setUp(){ msg = new AirbagStatus(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - msg.setDriverAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setDriverCurtainAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setDriverKneeAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setDriverSideAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setPassengerAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setPassengerCurtainAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setPassengerKneeAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setPassengerSideAirbagDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setDriverAirbagDeployed(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setDriverCurtainAirbagDeployed(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setDriverKneeAirbagDeployed(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setDriverSideAirbagDeployed(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setPassengerAirbagDeployed(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setPassengerCurtainAirbagDeployed(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setPassengerKneeAirbagDeployed(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setPassengerSideAirbagDeployed(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); } @@ -51,52 +51,52 @@ public class AirbagStatusTests extends TestCase{ VehicleDataEventStatus passengerSideStatus = msg.getPassengerSideAirbagDeployed(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, airbagStatus); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, curtainStatus); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, kneeStatus); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, sideStatus); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, passengerStatus); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, passengerCurtainStatus); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, passengerKneeStatus); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, passengerSideStatus); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, airbagStatus); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, curtainStatus); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, kneeStatus); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, sideStatus); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, passengerStatus); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, passengerCurtainStatus); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, passengerKneeStatus); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, passengerSideStatus); // Invalid/Null Tests AirbagStatus msg = new AirbagStatus(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getDriverAirbagDeployed()); - assertNull(Test.NULL, msg.getDriverSideAirbagDeployed()); - assertNull(Test.NULL, msg.getDriverCurtainAirbagDeployed()); - assertNull(Test.NULL, msg.getPassengerAirbagDeployed()); - assertNull(Test.NULL, msg.getPassengerCurtainAirbagDeployed()); - assertNull(Test.NULL, msg.getDriverKneeAirbagDeployed()); - assertNull(Test.NULL, msg.getPassengerSideAirbagDeployed()); - assertNull(Test.NULL, msg.getPassengerKneeAirbagDeployed()); + assertNull(TestValues.NULL, msg.getDriverAirbagDeployed()); + assertNull(TestValues.NULL, msg.getDriverSideAirbagDeployed()); + assertNull(TestValues.NULL, msg.getDriverCurtainAirbagDeployed()); + assertNull(TestValues.NULL, msg.getPassengerAirbagDeployed()); + assertNull(TestValues.NULL, msg.getPassengerCurtainAirbagDeployed()); + assertNull(TestValues.NULL, msg.getDriverKneeAirbagDeployed()); + assertNull(TestValues.NULL, msg.getPassengerSideAirbagDeployed()); + assertNull(TestValues.NULL, msg.getPassengerKneeAirbagDeployed()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(AirbagStatus.KEY_DRIVER_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(AirbagStatus.KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(AirbagStatus.KEY_DRIVER_KNEE_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(AirbagStatus.KEY_DRIVER_SIDE_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(AirbagStatus.KEY_PASSENGER_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(AirbagStatus.KEY_PASSENGER_CURTAIN_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(AirbagStatus.KEY_PASSENGER_KNEE_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(AirbagStatus.KEY_PASSENGER_SIDE_AIRBAG_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(AirbagStatus.KEY_DRIVER_AIRBAG_DEPLOYED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(AirbagStatus.KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(AirbagStatus.KEY_DRIVER_KNEE_AIRBAG_DEPLOYED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(AirbagStatus.KEY_DRIVER_SIDE_AIRBAG_DEPLOYED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(AirbagStatus.KEY_PASSENGER_AIRBAG_DEPLOYED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(AirbagStatus.KEY_PASSENGER_CURTAIN_AIRBAG_DEPLOYED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(AirbagStatus.KEY_PASSENGER_KNEE_AIRBAG_DEPLOYED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(AirbagStatus.KEY_PASSENGER_SIDE_AIRBAG_DEPLOYED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppInfoTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppInfoTests.java index d67f49159..1f143cb61 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppInfoTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppInfoTests.java @@ -34,7 +34,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.AppInfo; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -55,10 +55,10 @@ public class AppInfoTests extends TestCase { public void setUp() { msg = new AppInfo(); - msg.setAppDisplayName(Test.GENERAL_STRING); - msg.setAppBundleID(Test.GENERAL_STRING); - msg.setAppVersion(Test.GENERAL_STRING); - msg.setAppIcon(Test.GENERAL_STRING); + msg.setAppDisplayName(TestValues.GENERAL_STRING); + msg.setAppBundleID(TestValues.GENERAL_STRING); + msg.setAppVersion(TestValues.GENERAL_STRING); + msg.setAppIcon(TestValues.GENERAL_STRING); } /** @@ -72,40 +72,40 @@ public class AppInfoTests extends TestCase { String appIcon = msg.getAppIcon(); // Valid Tests - assertEquals(Test.GENERAL_STRING, appDisplayName); - assertEquals(Test.GENERAL_STRING, appBundleID); - assertEquals(Test.GENERAL_STRING, appVersion); - assertEquals(Test.GENERAL_STRING, appIcon); + assertEquals(TestValues.GENERAL_STRING, appDisplayName); + assertEquals(TestValues.GENERAL_STRING, appBundleID); + assertEquals(TestValues.GENERAL_STRING, appVersion); + assertEquals(TestValues.GENERAL_STRING, appIcon); // Invalid/Null Tests AppInfo msg = new AppInfo(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getAppDisplayName()); - assertNull(Test.NULL, msg.getAppBundleID()); - assertNull(Test.NULL, msg.getAppVersion()); - assertNull(Test.NULL, msg.getAppIcon()); + assertNull(TestValues.NULL, msg.getAppDisplayName()); + assertNull(TestValues.NULL, msg.getAppBundleID()); + assertNull(TestValues.NULL, msg.getAppVersion()); + assertNull(TestValues.NULL, msg.getAppIcon()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(AppInfo.KEY_APP_DISPLAY_NAME, Test.GENERAL_STRING); - reference.put(AppInfo.KEY_APP_BUNDLE_ID, Test.GENERAL_STRING); - reference.put(AppInfo.KEY_APP_VERSION, Test.GENERAL_STRING); - reference.put(AppInfo.KEY_APP_ICON, Test.GENERAL_STRING); + reference.put(AppInfo.KEY_APP_DISPLAY_NAME, TestValues.GENERAL_STRING); + reference.put(AppInfo.KEY_APP_BUNDLE_ID, TestValues.GENERAL_STRING); + reference.put(AppInfo.KEY_APP_VERSION, TestValues.GENERAL_STRING); + reference.put(AppInfo.KEY_APP_ICON, TestValues.GENERAL_STRING); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceCapabilityTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceCapabilityTest.java index 997984514..1579e1ec1 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceCapabilityTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceCapabilityTest.java @@ -8,7 +8,7 @@ import com.smartdevicelink.proxy.rpc.AppServiceRecord; import com.smartdevicelink.proxy.rpc.enums.AppServiceType; import com.smartdevicelink.proxy.rpc.enums.ServiceUpdateReason; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.utl.AppServiceFactory; @@ -34,8 +34,8 @@ public class AppServiceCapabilityTest extends TestCase { public void setUp(){ msg = new AppServiceCapability(); - msg.setUpdatedAppServiceRecord(Test.GENERAL_APPSERVICERECORD); - msg.setUpdateReason(Test.GENERAL_SERVICE_UPDATE_REASON); + msg.setUpdatedAppServiceRecord(TestValues.GENERAL_APPSERVICERECORD); + msg.setUpdateReason(TestValues.GENERAL_SERVICE_UPDATE_REASON); } /** @@ -47,32 +47,32 @@ public class AppServiceCapabilityTest extends TestCase { ServiceUpdateReason updateReason = msg.getUpdateReason(); // Valid Tests - assertEquals(Test.MATCH, serviceRecord, Test.GENERAL_APPSERVICERECORD); - assertEquals(Test.MATCH, updateReason, Test.GENERAL_SERVICE_UPDATE_REASON); + assertEquals(TestValues.MATCH, serviceRecord, TestValues.GENERAL_APPSERVICERECORD); + assertEquals(TestValues.MATCH, updateReason, TestValues.GENERAL_SERVICE_UPDATE_REASON); // Invalid/Null Tests AppServiceCapability msg = new AppServiceCapability(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getUpdatedAppServiceRecord()); - assertNull(Test.NULL, msg.getUpdateReason()); + assertNull(TestValues.NULL, msg.getUpdatedAppServiceRecord()); + assertNull(TestValues.NULL, msg.getUpdateReason()); } public void testRequiredParamsConstructor(){ - msg = new AppServiceCapability(Test.GENERAL_APPSERVICERECORD); + msg = new AppServiceCapability(TestValues.GENERAL_APPSERVICERECORD); AppServiceRecord serviceRecord = msg.getUpdatedAppServiceRecord(); - assertEquals(Test.MATCH, serviceRecord, Test.GENERAL_APPSERVICERECORD); + assertEquals(TestValues.MATCH, serviceRecord, TestValues.GENERAL_APPSERVICERECORD); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(AppServiceCapability.KEY_UPDATE_REASON, Test.GENERAL_SERVICE_UPDATE_REASON); - reference.put(AppServiceCapability.KEY_UPDATED_APP_SERVICE_RECORD, Test.GENERAL_APPSERVICERECORD); + reference.put(AppServiceCapability.KEY_UPDATE_REASON, TestValues.GENERAL_SERVICE_UPDATE_REASON); + reference.put(AppServiceCapability.KEY_UPDATED_APP_SERVICE_RECORD, TestValues.GENERAL_APPSERVICERECORD); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()) { @@ -80,13 +80,13 @@ public class AppServiceCapabilityTest extends TestCase { if (key.equals(AppServiceCapability.KEY_UPDATED_APP_SERVICE_RECORD)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateAppServiceRecord(Test.GENERAL_APPSERVICERECORD, new AppServiceRecord(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateAppServiceRecord(TestValues.GENERAL_APPSERVICERECORD, new AppServiceRecord(hashTest))); } else{ - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceDataTests.java index 54aff3ef5..d909d0d5d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceDataTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.rpc.MediaServiceData; import com.smartdevicelink.proxy.rpc.NavigationServiceData; import com.smartdevicelink.proxy.rpc.WeatherServiceData; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -29,11 +29,11 @@ public class AppServiceDataTests extends TestCase { public void setUp() { msg = new AppServiceData(); - msg.setServiceType(Test.GENERAL_STRING); - msg.setServiceID(Test.GENERAL_STRING); - msg.setMediaServiceData(Test.GENERAL_MEDIASERVICEDATA); - msg.setWeatherServiceData(Test.GENERAL_WEATHERSERVICEDATA); - msg.setNavigationServiceData(Test.GENERAL_NAVIGATIONSERVICEDATA); + msg.setServiceType(TestValues.GENERAL_STRING); + msg.setServiceID(TestValues.GENERAL_STRING); + msg.setMediaServiceData(TestValues.GENERAL_MEDIASERVICEDATA); + msg.setWeatherServiceData(TestValues.GENERAL_WEATHERSERVICEDATA); + msg.setNavigationServiceData(TestValues.GENERAL_NAVIGATIONSERVICEDATA); } @@ -49,31 +49,31 @@ public class AppServiceDataTests extends TestCase { NavigationServiceData navigationServiceData = msg.getNavigationServiceData(); // Valid Tests - assertEquals(Test.GENERAL_STRING, appServiceType); - assertEquals(Test.GENERAL_STRING, serviceId); - assertEquals(Test.GENERAL_MEDIASERVICEDATA, mediaServiceData); - assertEquals(Test.GENERAL_WEATHERSERVICEDATA, weatherServiceData); - assertEquals(Test.GENERAL_NAVIGATIONSERVICEDATA, navigationServiceData); + assertEquals(TestValues.GENERAL_STRING, appServiceType); + assertEquals(TestValues.GENERAL_STRING, serviceId); + assertEquals(TestValues.GENERAL_MEDIASERVICEDATA, mediaServiceData); + assertEquals(TestValues.GENERAL_WEATHERSERVICEDATA, weatherServiceData); + assertEquals(TestValues.GENERAL_NAVIGATIONSERVICEDATA, navigationServiceData); // Invalid/Null Tests AppServiceData msg = new AppServiceData(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getServiceType()); - assertNull(Test.NULL, msg.getServiceID()); - assertNull(Test.NULL, msg.getMediaServiceData()); - assertNull(Test.NULL, msg.getWeatherServiceData()); - assertNull(Test.NULL, msg.getNavigationServiceData()); + assertNull(TestValues.NULL, msg.getServiceType()); + assertNull(TestValues.NULL, msg.getServiceID()); + assertNull(TestValues.NULL, msg.getMediaServiceData()); + assertNull(TestValues.NULL, msg.getWeatherServiceData()); + assertNull(TestValues.NULL, msg.getNavigationServiceData()); } public void testRequiredParamsConstructor(){ - msg = new AppServiceData(Test.GENERAL_STRING, Test.GENERAL_STRING); + msg = new AppServiceData(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING); String appServiceType = msg.getServiceType(); String serviceId = msg.getServiceID(); - assertEquals(Test.GENERAL_STRING, appServiceType); - assertEquals(Test.GENERAL_STRING, serviceId); + assertEquals(TestValues.GENERAL_STRING, appServiceType); + assertEquals(TestValues.GENERAL_STRING, serviceId); } @@ -81,14 +81,14 @@ public class AppServiceDataTests extends TestCase { JSONObject reference = new JSONObject(); try{ - reference.put(AppServiceData.KEY_SERVICE_TYPE, Test.GENERAL_STRING); - reference.put(AppServiceData.KEY_SERVICE_ID, Test.GENERAL_STRING); - reference.put(AppServiceData.KEY_MEDIA_SERVICE_DATA, Test.GENERAL_MEDIASERVICEDATA); - reference.put(AppServiceData.KEY_WEATHER_SERVICE_DATA, Test.GENERAL_WEATHERSERVICEDATA); - reference.put(AppServiceData.KEY_NAVIGATION_SERVICE_DATA, Test.GENERAL_NAVIGATIONSERVICEDATA); + reference.put(AppServiceData.KEY_SERVICE_TYPE, TestValues.GENERAL_STRING); + reference.put(AppServiceData.KEY_SERVICE_ID, TestValues.GENERAL_STRING); + reference.put(AppServiceData.KEY_MEDIA_SERVICE_DATA, TestValues.GENERAL_MEDIASERVICEDATA); + reference.put(AppServiceData.KEY_WEATHER_SERVICE_DATA, TestValues.GENERAL_WEATHERSERVICEDATA); + reference.put(AppServiceData.KEY_NAVIGATION_SERVICE_DATA, TestValues.GENERAL_NAVIGATIONSERVICEDATA); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -97,21 +97,21 @@ public class AppServiceDataTests extends TestCase { if (key.equals(AppServiceData.KEY_MEDIA_SERVICE_DATA)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateMediaServiceData(Test.GENERAL_MEDIASERVICEDATA, new MediaServiceData(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateMediaServiceData(TestValues.GENERAL_MEDIASERVICEDATA, new MediaServiceData(hashTest))); } else if (key.equals(AppServiceData.KEY_WEATHER_SERVICE_DATA)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateWeatherServiceData(Test.GENERAL_WEATHERSERVICEDATA, new WeatherServiceData(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateWeatherServiceData(TestValues.GENERAL_WEATHERSERVICEDATA, new WeatherServiceData(hashTest))); } else if (key.equals(AppServiceData.KEY_NAVIGATION_SERVICE_DATA)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateNavigationServiceData(Test.GENERAL_NAVIGATIONSERVICEDATA, new NavigationServiceData(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateNavigationServiceData(TestValues.GENERAL_NAVIGATIONSERVICEDATA, new NavigationServiceData(hashTest))); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceManifestTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceManifestTests.java index 99bd5b716..8a9f2b0ff 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceManifestTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceManifestTests.java @@ -8,7 +8,7 @@ import com.smartdevicelink.proxy.rpc.NavigationServiceManifest; import com.smartdevicelink.proxy.rpc.SdlMsgVersion; import com.smartdevicelink.proxy.rpc.WeatherServiceManifest; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -32,15 +32,15 @@ public class AppServiceManifestTests extends TestCase { public void setUp(){ msg = new AppServiceManifest(); - msg.setServiceType(Test.GENERAL_STRING); - msg.setAllowAppConsumers(Test.GENERAL_BOOLEAN); - msg.setHandledRpcs(Test.GENERAL_FUNCTION_ID_LIST); - msg.setMediaServiceManifest(Test.GENERAL_MEDIA_SERVICE_MANIFEST); - msg.setRpcSpecVersion(Test.GENERAL_SDLMSGVERSION); - msg.setServiceIcon(Test.GENERAL_IMAGE); - msg.setServiceName(Test.GENERAL_STRING); - msg.setWeatherServiceManifest(Test.GENERAL_WEATHER_SERVICE_MANIFEST); - msg.setNavigationServiceManifest(Test.GENERAL_NAVIGATION_SERVICE_MANIFEST); + msg.setServiceType(TestValues.GENERAL_STRING); + msg.setAllowAppConsumers(TestValues.GENERAL_BOOLEAN); + msg.setHandledRpcs(TestValues.GENERAL_FUNCTION_ID_LIST); + msg.setMediaServiceManifest(TestValues.GENERAL_MEDIA_SERVICE_MANIFEST); + msg.setRpcSpecVersion(TestValues.GENERAL_SDLMSGVERSION); + msg.setServiceIcon(TestValues.GENERAL_IMAGE); + msg.setServiceName(TestValues.GENERAL_STRING); + msg.setWeatherServiceManifest(TestValues.GENERAL_WEATHER_SERVICE_MANIFEST); + msg.setNavigationServiceManifest(TestValues.GENERAL_NAVIGATION_SERVICE_MANIFEST); } /** @@ -59,53 +59,53 @@ public class AppServiceManifestTests extends TestCase { NavigationServiceManifest navigationServiceManifest = msg.getNavigationServiceManifest(); // Valid Tests - assertEquals(Test.GENERAL_BOOLEAN, allowAppConsumers); - assertEquals(Test.GENERAL_IMAGE, serviceIcon); - assertEquals(Test.GENERAL_STRING, serviceName); - assertEquals(Test.GENERAL_STRING, appServiceType); - assertEquals(Test.GENERAL_SDLMSGVERSION, version); - assertEquals(Test.MATCH, Test.GENERAL_FUNCTION_ID_LIST, handledRPCs); - assertEquals(Test.GENERAL_WEATHER_SERVICE_MANIFEST, weatherServiceManifestTest); - assertEquals(Test.GENERAL_MEDIA_SERVICE_MANIFEST, mediaServiceManifestTest); - assertEquals(Test.GENERAL_NAVIGATION_SERVICE_MANIFEST, navigationServiceManifest); + assertEquals(TestValues.GENERAL_BOOLEAN, allowAppConsumers); + assertEquals(TestValues.GENERAL_IMAGE, serviceIcon); + assertEquals(TestValues.GENERAL_STRING, serviceName); + assertEquals(TestValues.GENERAL_STRING, appServiceType); + assertEquals(TestValues.GENERAL_SDLMSGVERSION, version); + assertEquals(TestValues.MATCH, TestValues.GENERAL_FUNCTION_ID_LIST, handledRPCs); + assertEquals(TestValues.GENERAL_WEATHER_SERVICE_MANIFEST, weatherServiceManifestTest); + assertEquals(TestValues.GENERAL_MEDIA_SERVICE_MANIFEST, mediaServiceManifestTest); + assertEquals(TestValues.GENERAL_NAVIGATION_SERVICE_MANIFEST, navigationServiceManifest); // Invalid/Null Tests AppServiceManifest msg = new AppServiceManifest(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getServiceIcon()); - assertNull(Test.NULL, msg.getServiceName()); - assertNull(Test.NULL, msg.getServiceType()); - assertNull(Test.NULL, msg.getAllowAppConsumers()); - assertNull(Test.NULL, msg.getRpcSpecVersion()); - assertNull(Test.NULL, msg.getHandledRpcs()); - assertNull(Test.NULL, msg.getWeatherServiceManifest()); - assertNull(Test.NULL, msg.getMediaServiceManifest()); - assertNull(Test.NULL, msg.getNavigationServiceManifest()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getServiceIcon()); + assertNull(TestValues.NULL, msg.getServiceName()); + assertNull(TestValues.NULL, msg.getServiceType()); + assertNull(TestValues.NULL, msg.getAllowAppConsumers()); + assertNull(TestValues.NULL, msg.getRpcSpecVersion()); + assertNull(TestValues.NULL, msg.getHandledRpcs()); + assertNull(TestValues.NULL, msg.getWeatherServiceManifest()); + assertNull(TestValues.NULL, msg.getMediaServiceManifest()); + assertNull(TestValues.NULL, msg.getNavigationServiceManifest()); } public void testRequiredParamsConstructor(){ - msg = new AppServiceManifest(Test.GENERAL_STRING); + msg = new AppServiceManifest(TestValues.GENERAL_STRING); String appServiceType = msg.getServiceType(); - assertEquals(Test.GENERAL_STRING, appServiceType); + assertEquals(TestValues.GENERAL_STRING, appServiceType); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(AppServiceManifest.KEY_SERVICE_NAME, Test.GENERAL_STRING); - reference.put(AppServiceManifest.KEY_SERVICE_ICON, Test.GENERAL_IMAGE); - reference.put(AppServiceManifest.KEY_SERVICE_TYPE, Test.GENERAL_STRING); - reference.put(AppServiceManifest.KEY_ALLOW_APP_CONSUMERS, Test.GENERAL_BOOLEAN); - reference.put(AppServiceManifest.KEY_RPC_SPEC_VERSION, Test.GENERAL_SDLMSGVERSION.serializeJSON()); - reference.put(AppServiceManifest.KEY_HANDLED_RPCS, Test.GENERAL_FUNCTION_ID_LIST); - reference.put(AppServiceManifest.KEY_WEATHER_SERVICE_MANIFEST, Test.GENERAL_WEATHER_SERVICE_MANIFEST); - reference.put(AppServiceManifest.KEY_MEDIA_SERVICE_MANIFEST, Test.GENERAL_MEDIA_SERVICE_MANIFEST); - reference.put(AppServiceManifest.KEY_NAVIGATION_SERVICE_MANIFEST, Test.GENERAL_NAVIGATION_SERVICE_MANIFEST); + reference.put(AppServiceManifest.KEY_SERVICE_NAME, TestValues.GENERAL_STRING); + reference.put(AppServiceManifest.KEY_SERVICE_ICON, TestValues.GENERAL_IMAGE); + reference.put(AppServiceManifest.KEY_SERVICE_TYPE, TestValues.GENERAL_STRING); + reference.put(AppServiceManifest.KEY_ALLOW_APP_CONSUMERS, TestValues.GENERAL_BOOLEAN); + reference.put(AppServiceManifest.KEY_RPC_SPEC_VERSION, TestValues.GENERAL_SDLMSGVERSION.serializeJSON()); + reference.put(AppServiceManifest.KEY_HANDLED_RPCS, TestValues.GENERAL_FUNCTION_ID_LIST); + reference.put(AppServiceManifest.KEY_WEATHER_SERVICE_MANIFEST, TestValues.GENERAL_WEATHER_SERVICE_MANIFEST); + reference.put(AppServiceManifest.KEY_MEDIA_SERVICE_MANIFEST, TestValues.GENERAL_MEDIA_SERVICE_MANIFEST); + reference.put(AppServiceManifest.KEY_NAVIGATION_SERVICE_MANIFEST, TestValues.GENERAL_NAVIGATION_SERVICE_MANIFEST); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -116,33 +116,33 @@ public class AppServiceManifestTests extends TestCase { JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateSdlMsgVersion( new SdlMsgVersion(hashReference), new SdlMsgVersion(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateSdlMsgVersion( new SdlMsgVersion(hashReference), new SdlMsgVersion(hashTest))); }else if(key.equals(AppServiceManifest.KEY_HANDLED_RPCS)){ - List<Integer> list1 = Test.GENERAL_FUNCTION_ID_LIST; + List<Integer> list1 = TestValues.GENERAL_FUNCTION_ID_LIST; List<Integer> list2 = JsonUtils.readIntegerListFromJsonObject(underTest, key); - assertTrue(Test.TRUE, Validator.validateIntegerList(list1,list2)); + assertTrue(TestValues.TRUE, Validator.validateIntegerList(list1,list2)); }else if(key.equals(AppServiceManifest.KEY_WEATHER_SERVICE_MANIFEST)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateWeatherServiceManifest( Test.GENERAL_WEATHER_SERVICE_MANIFEST, new WeatherServiceManifest(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateWeatherServiceManifest( TestValues.GENERAL_WEATHER_SERVICE_MANIFEST, new WeatherServiceManifest(hashTest))); }else if(key.equals(AppServiceManifest.KEY_MEDIA_SERVICE_MANIFEST)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateMediaServiceManifest( Test.GENERAL_MEDIA_SERVICE_MANIFEST, new MediaServiceManifest(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateMediaServiceManifest( TestValues.GENERAL_MEDIA_SERVICE_MANIFEST, new MediaServiceManifest(hashTest))); } else if(key.equals(AppServiceManifest.KEY_NAVIGATION_SERVICE_MANIFEST)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateNavigationServiceManifest( Test.GENERAL_NAVIGATION_SERVICE_MANIFEST, new NavigationServiceManifest(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateNavigationServiceManifest( TestValues.GENERAL_NAVIGATION_SERVICE_MANIFEST, new NavigationServiceManifest(hashTest))); }else if(key.equals(AppServiceManifest.KEY_SERVICE_ICON)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Image refIcon1 = new Image(JsonRPCMarshaller.deserializeJSONObject(testEquals)); - assertTrue(Test.TRUE, Validator.validateImage(refIcon1, msg.getServiceIcon())); + assertTrue(TestValues.TRUE, Validator.validateImage(refIcon1, msg.getServiceIcon())); }else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceRecordTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceRecordTests.java index 0e00a1d70..c8c70f0de 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceRecordTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServiceRecordTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.rpc.AppServiceManifest; import com.smartdevicelink.proxy.rpc.AppServiceRecord; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -27,10 +27,10 @@ public class AppServiceRecordTests extends TestCase { public void setUp(){ msg = new AppServiceRecord(); - msg.setServicePublished(Test.GENERAL_BOOLEAN); - msg.setServiceActive(Test.GENERAL_BOOLEAN); - msg.setServiceManifest(Test.GENERAL_APPSERVICEMANIFEST); - msg.setServiceID(Test.GENERAL_STRING); + msg.setServicePublished(TestValues.GENERAL_BOOLEAN); + msg.setServiceActive(TestValues.GENERAL_BOOLEAN); + msg.setServiceManifest(TestValues.GENERAL_APPSERVICEMANIFEST); + msg.setServiceID(TestValues.GENERAL_STRING); } @@ -46,23 +46,23 @@ public class AppServiceRecordTests extends TestCase { String serviceID = msg.getServiceID(); // Valid Tests - assertEquals(Test.GENERAL_BOOLEAN, isServicePublished); - assertEquals(Test.GENERAL_BOOLEAN, isServiceActive); - assertEquals(Test.GENERAL_APPSERVICEMANIFEST, serviceManifest); - assertEquals(Test.GENERAL_STRING, serviceID); + assertEquals(TestValues.GENERAL_BOOLEAN, isServicePublished); + assertEquals(TestValues.GENERAL_BOOLEAN, isServiceActive); + assertEquals(TestValues.GENERAL_APPSERVICEMANIFEST, serviceManifest); + assertEquals(TestValues.GENERAL_STRING, serviceID); // Invalid/Null Tests AppServiceRecord msg = new AppServiceRecord(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getServicePublished()); - assertNull(Test.NULL, msg.getServiceActive()); - assertNull(Test.NULL, msg.getServiceManifest()); - assertNull(Test.NULL, msg.getServiceID()); + assertNull(TestValues.NULL, msg.getServicePublished()); + assertNull(TestValues.NULL, msg.getServiceActive()); + assertNull(TestValues.NULL, msg.getServiceManifest()); + assertNull(TestValues.NULL, msg.getServiceID()); } public void testRequiredParamsConstructor(){ - msg = new AppServiceRecord(Test.GENERAL_STRING, Test.GENERAL_APPSERVICEMANIFEST, Test.GENERAL_BOOLEAN, Test.GENERAL_BOOLEAN); + msg = new AppServiceRecord(TestValues.GENERAL_STRING, TestValues.GENERAL_APPSERVICEMANIFEST, TestValues.GENERAL_BOOLEAN, TestValues.GENERAL_BOOLEAN); boolean isServicePublished = msg.getServicePublished(); boolean isServiceActive = msg.getServiceActive(); @@ -70,23 +70,23 @@ public class AppServiceRecordTests extends TestCase { String serviceID = msg.getServiceID(); // Valid Tests - assertEquals(Test.GENERAL_BOOLEAN, isServicePublished); - assertEquals(Test.GENERAL_BOOLEAN, isServiceActive); - assertEquals(Test.GENERAL_APPSERVICEMANIFEST, serviceManifest); - assertEquals(Test.GENERAL_STRING, serviceID); + assertEquals(TestValues.GENERAL_BOOLEAN, isServicePublished); + assertEquals(TestValues.GENERAL_BOOLEAN, isServiceActive); + assertEquals(TestValues.GENERAL_APPSERVICEMANIFEST, serviceManifest); + assertEquals(TestValues.GENERAL_STRING, serviceID); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(AppServiceRecord.KEY_SERVICE_ACTIVE, Test.GENERAL_BOOLEAN); - reference.put(AppServiceRecord.KEY_SERVICE_PUBLISHED, Test.GENERAL_BOOLEAN); - reference.put(AppServiceRecord.KEY_SERVICE_ID, Test.GENERAL_STRING); - reference.put(AppServiceRecord.KEY_SERVICE_MANIFEST, Test.GENERAL_APPSERVICEMANIFEST); + reference.put(AppServiceRecord.KEY_SERVICE_ACTIVE, TestValues.GENERAL_BOOLEAN); + reference.put(AppServiceRecord.KEY_SERVICE_PUBLISHED, TestValues.GENERAL_BOOLEAN); + reference.put(AppServiceRecord.KEY_SERVICE_ID, TestValues.GENERAL_STRING); + reference.put(AppServiceRecord.KEY_SERVICE_MANIFEST, TestValues.GENERAL_APPSERVICEMANIFEST); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -95,13 +95,13 @@ public class AppServiceRecordTests extends TestCase { if(key.equals(AppServiceRecord.KEY_SERVICE_MANIFEST)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateAppServiceManifest( Test.GENERAL_APPSERVICEMANIFEST, new AppServiceManifest(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateAppServiceManifest( TestValues.GENERAL_APPSERVICEMANIFEST, new AppServiceManifest(hashTest))); }else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServicesCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServicesCapabilitiesTests.java index a069e2b69..f39df464a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServicesCapabilitiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AppServicesCapabilitiesTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.rpc.AppServicesCapabilities; import com.smartdevicelink.proxy.rpc.enums.AppServiceType; import com.smartdevicelink.proxy.rpc.enums.ServiceUpdateReason; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.utl.AppServiceFactory; @@ -31,7 +31,7 @@ public class AppServicesCapabilitiesTests extends TestCase { public void setUp(){ msg = new AppServicesCapabilities(); - msg.setAppServices(Test.GENERAL_APPSERVICECAPABILITY_LIST); + msg.setAppServices(TestValues.GENERAL_APPSERVICECAPABILITY_LIST); } /** @@ -42,37 +42,37 @@ public class AppServicesCapabilitiesTests extends TestCase { List<AppServiceCapability> serviceCapabilityList = msg.getAppServices(); // Valid Tests - assertEquals(Test.MATCH, serviceCapabilityList, Test.GENERAL_APPSERVICECAPABILITY_LIST); + assertEquals(TestValues.MATCH, serviceCapabilityList, TestValues.GENERAL_APPSERVICECAPABILITY_LIST); // Invalid/Null Tests AppServicesCapabilities msg = new AppServicesCapabilities(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getAppServices()); + assertNull(TestValues.NULL, msg.getAppServices()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(AppServicesCapabilities.KEY_APP_SERVICES, Test.GENERAL_APPSERVICETYPE_LIST); + reference.put(AppServicesCapabilities.KEY_APP_SERVICES, TestValues.GENERAL_APPSERVICETYPE_LIST); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()) { String key = (String) iterator.next(); if (key.equals(AppServicesCapabilities.KEY_APP_SERVICES)) { - List<AppServiceCapability> list1 = Test.GENERAL_APPSERVICECAPABILITY_LIST; + List<AppServiceCapability> list1 = TestValues.GENERAL_APPSERVICECAPABILITY_LIST; List<AppServiceCapability> list2 = JsonUtils.readAppServiceCapabilityListFromJsonObject(underTest, key); - assertTrue(Test.TRUE, Validator.validateAppServiceCapabilityList(list1,list2)); + assertTrue(TestValues.TRUE, Validator.validateAppServiceCapabilityList(list1,list2)); }else{ - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlCapabilitiesTests.java index 5351bf7a1..905c568c9 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlCapabilitiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlCapabilitiesTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.rpc.AudioControlCapabilities; import com.smartdevicelink.proxy.rpc.ModuleInfo; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -27,14 +27,14 @@ public class AudioControlCapabilitiesTests extends TestCase { public void setUp() { msg = new AudioControlCapabilities(); - msg.setModuleName(Test.GENERAL_STRING); - msg.setSourceAvailable(Test.GENERAL_BOOLEAN); - msg.setKeepContextAvailable(Test.GENERAL_BOOLEAN); - msg.setVolumeAvailable(Test.GENERAL_BOOLEAN); - msg.setEqualizerAvailable(Test.GENERAL_BOOLEAN); - msg.setVolumeAvailable(Test.GENERAL_BOOLEAN); - msg.setEqualizerMaxChannelId(Test.GENERAL_INT); - msg.setModuleInfo(Test.GENERAL_MODULE_INFO); + msg.setModuleName(TestValues.GENERAL_STRING); + msg.setSourceAvailable(TestValues.GENERAL_BOOLEAN); + msg.setKeepContextAvailable(TestValues.GENERAL_BOOLEAN); + msg.setVolumeAvailable(TestValues.GENERAL_BOOLEAN); + msg.setEqualizerAvailable(TestValues.GENERAL_BOOLEAN); + msg.setVolumeAvailable(TestValues.GENERAL_BOOLEAN); + msg.setEqualizerMaxChannelId(TestValues.GENERAL_INT); + msg.setModuleInfo(TestValues.GENERAL_MODULE_INFO); } /** @@ -52,25 +52,25 @@ public class AudioControlCapabilitiesTests extends TestCase { ModuleInfo info = msg.getModuleInfo(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, moduleName); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) sourceAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) keepContextAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) volumeAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) equalizerAvailable); - assertEquals(Test.MATCH, Test.GENERAL_INT, equalizerMaxChannelId); - assertEquals(Test.MATCH, Test.GENERAL_MODULE_INFO, info); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, moduleName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, (boolean) sourceAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, (boolean) keepContextAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, (boolean) volumeAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, (boolean) equalizerAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, equalizerMaxChannelId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MODULE_INFO, info); // Invalid/Null Tests AudioControlCapabilities msg = new AudioControlCapabilities(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getModuleName()); - assertNull(Test.NULL, msg.getSourceAvailable()); - assertNull(Test.NULL, msg.getKeepContextAvailable()); - assertNull(Test.NULL, msg.getVolumeAvailable()); - assertNull(Test.NULL, msg.getEqualizerAvailable()); - assertNull(Test.NULL, msg.getEqualizerMaxChannelId()); - assertNull(Test.NULL, msg.getModuleInfo()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getModuleName()); + assertNull(TestValues.NULL, msg.getSourceAvailable()); + assertNull(TestValues.NULL, msg.getKeepContextAvailable()); + assertNull(TestValues.NULL, msg.getVolumeAvailable()); + assertNull(TestValues.NULL, msg.getEqualizerAvailable()); + assertNull(TestValues.NULL, msg.getEqualizerMaxChannelId()); + assertNull(TestValues.NULL, msg.getModuleInfo()); } public void testJson() { @@ -78,16 +78,16 @@ public class AudioControlCapabilitiesTests extends TestCase { try { - reference.put(AudioControlCapabilities.KEY_MODULE_NAME, Test.GENERAL_STRING); - reference.put(AudioControlCapabilities.KEY_SOURCE_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(AudioControlCapabilities.KEY_KEEP_CONTEXT_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(AudioControlCapabilities.KEY_VOLUME_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(AudioControlCapabilities.KEY_EQUALIZER_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(AudioControlCapabilities.KEY_EQUALIZER_MAX_CHANNEL_ID, Test.GENERAL_INT); - reference.put(AudioControlCapabilities.KEY_MODULE_INFO, Test.JSON_MODULE_INFO); + reference.put(AudioControlCapabilities.KEY_MODULE_NAME, TestValues.GENERAL_STRING); + reference.put(AudioControlCapabilities.KEY_SOURCE_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(AudioControlCapabilities.KEY_KEEP_CONTEXT_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(AudioControlCapabilities.KEY_VOLUME_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(AudioControlCapabilities.KEY_EQUALIZER_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(AudioControlCapabilities.KEY_EQUALIZER_MAX_CHANNEL_ID, TestValues.GENERAL_INT); + reference.put(AudioControlCapabilities.KEY_MODULE_INFO, TestValues.JSON_MODULE_INFO); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { @@ -97,13 +97,13 @@ public class AudioControlCapabilitiesTests extends TestCase { JSONObject o2 = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> h1 = JsonRPCMarshaller.deserializeJSONObject(o1); Hashtable<String, Object> h2 = JsonRPCMarshaller.deserializeJSONObject(o2); - assertTrue(Test.TRUE, Validator.validateModuleInfo(new ModuleInfo(h1), new ModuleInfo(h2))); + assertTrue(TestValues.TRUE, Validator.validateModuleInfo(new ModuleInfo(h1), new ModuleInfo(h2))); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlDataTests.java index 4dba080ac..dee89750c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlDataTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.rpc.AudioControlData; import com.smartdevicelink.proxy.rpc.EqualizerSettings; import com.smartdevicelink.proxy.rpc.enums.PrimaryAudioSource; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -29,10 +29,10 @@ public class AudioControlDataTests extends TestCase { public void setUp() { msg = new AudioControlData(); - msg.setSource(Test.GENERAL_PRIMARYAUDIOSOURCE); - msg.setKeepContext(Test.GENERAL_BOOLEAN); - msg.setVolume(Test.GENERAL_INT); - msg.setEqualizerSettings(Test.GENERAL_EQUALIZERSETTINGS_LIST); + msg.setSource(TestValues.GENERAL_PRIMARYAUDIOSOURCE); + msg.setKeepContext(TestValues.GENERAL_BOOLEAN); + msg.setVolume(TestValues.GENERAL_INT); + msg.setEqualizerSettings(TestValues.GENERAL_EQUALIZERSETTINGS_LIST); } /** @@ -46,34 +46,34 @@ public class AudioControlDataTests extends TestCase { List<EqualizerSettings> equalizerSettings = msg.getEqualizerSettings(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_PRIMARYAUDIOSOURCE, source); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) keepContext); - assertEquals(Test.MATCH, Test.GENERAL_INT, volume); - assertEquals(Test.MATCH, Test.GENERAL_EQUALIZERSETTINGS_LIST.size(), equalizerSettings.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_PRIMARYAUDIOSOURCE, source); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, (boolean) keepContext); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, volume); + assertEquals(TestValues.MATCH, TestValues.GENERAL_EQUALIZERSETTINGS_LIST.size(), equalizerSettings.size()); - assertTrue(Test.TRUE, Validator.validateEqualizerSettingsList(Test.GENERAL_EQUALIZERSETTINGS_LIST, equalizerSettings)); + assertTrue(TestValues.TRUE, Validator.validateEqualizerSettingsList(TestValues.GENERAL_EQUALIZERSETTINGS_LIST, equalizerSettings)); // Invalid/Null Tests AudioControlData msg = new AudioControlData(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getSource()); - assertNull(Test.NULL, msg.getVolume()); - assertNull(Test.NULL, msg.getKeepContext()); - assertNull(Test.NULL, msg.getEqualizerSettings()); + assertNull(TestValues.NULL, msg.getSource()); + assertNull(TestValues.NULL, msg.getVolume()); + assertNull(TestValues.NULL, msg.getKeepContext()); + assertNull(TestValues.NULL, msg.getEqualizerSettings()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(AudioControlData.KEY_SOURCE, Test.GENERAL_PRIMARYAUDIOSOURCE); - reference.put(AudioControlData.KEY_KEEP_CONTEXT, Test.GENERAL_BOOLEAN); - reference.put(AudioControlData.KEY_VOLUME, Test.GENERAL_INT); - reference.put(AudioControlData.KEY_EQUALIZER_SETTINGS, Test.GENERAL_EQUALIZERSETTINGS_LIST); + reference.put(AudioControlData.KEY_SOURCE, TestValues.GENERAL_PRIMARYAUDIOSOURCE); + reference.put(AudioControlData.KEY_KEEP_CONTEXT, TestValues.GENERAL_BOOLEAN); + reference.put(AudioControlData.KEY_VOLUME, TestValues.GENERAL_INT); + reference.put(AudioControlData.KEY_EQUALIZER_SETTINGS, TestValues.GENERAL_EQUALIZERSETTINGS_LIST); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { @@ -87,12 +87,12 @@ public class AudioControlDataTests extends TestCase { assertTrue(Validator.validateEqualizerSettings(es, new EqualizerSettings(JsonRPCMarshaller.deserializeJSONObject(esArray.getJSONObject(i++))))); } } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioPassThruCapabilitiesTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioPassThruCapabilitiesTest.java index 55af9d881..6e03961bc 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioPassThruCapabilitiesTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioPassThruCapabilitiesTest.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.rpc.enums.AudioType; import com.smartdevicelink.proxy.rpc.enums.BitsPerSample; import com.smartdevicelink.proxy.rpc.enums.SamplingRate; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -25,11 +25,11 @@ public class AudioPassThruCapabilitiesTest extends TestCase{ @Override public void setUp(){ msg = new AudioPassThruCapabilities(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - msg.setAudioType(Test.GENERAL_AUDIOTYPE); - msg.setBitsPerSample(Test.GENERAL_BITSPERSAMPLE); - msg.setSamplingRate(Test.GENERAL_SAMPLINGRATE); + msg.setAudioType(TestValues.GENERAL_AUDIOTYPE); + msg.setBitsPerSample(TestValues.GENERAL_BITSPERSAMPLE); + msg.setSamplingRate(TestValues.GENERAL_SAMPLINGRATE); } /** @@ -42,37 +42,37 @@ public class AudioPassThruCapabilitiesTest extends TestCase{ AudioType audioType = msg.getAudioType(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_SAMPLINGRATE, samplingRate); - assertEquals(Test.MATCH, Test.GENERAL_BITSPERSAMPLE, bitsPerSample); - assertEquals(Test.MATCH, Test.GENERAL_AUDIOTYPE, audioType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_SAMPLINGRATE, samplingRate); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BITSPERSAMPLE, bitsPerSample); + assertEquals(TestValues.MATCH, TestValues.GENERAL_AUDIOTYPE, audioType); // Invalid/Null Tests AudioPassThruCapabilities msg = new AudioPassThruCapabilities(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getAudioType()); - assertNull(Test.NULL, msg.getBitsPerSample()); - assertNull(Test.NULL, msg.getSamplingRate()); + assertNull(TestValues.NULL, msg.getAudioType()); + assertNull(TestValues.NULL, msg.getBitsPerSample()); + assertNull(TestValues.NULL, msg.getSamplingRate()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(AudioPassThruCapabilities.KEY_AUDIO_TYPE, Test.GENERAL_AUDIOTYPE); - reference.put(AudioPassThruCapabilities.KEY_BITS_PER_SAMPLE, Test.GENERAL_BITSPERSAMPLE); - reference.put(AudioPassThruCapabilities.KEY_SAMPLING_RATE, Test.GENERAL_SAMPLINGRATE); + reference.put(AudioPassThruCapabilities.KEY_AUDIO_TYPE, TestValues.GENERAL_AUDIOTYPE); + reference.put(AudioPassThruCapabilities.KEY_BITS_PER_SAMPLE, TestValues.GENERAL_BITSPERSAMPLE); + reference.put(AudioPassThruCapabilities.KEY_SAMPLING_RATE, TestValues.GENERAL_SAMPLINGRATE); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BeltStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BeltStatusTests.java index a5f613aed..3b437d0ad 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BeltStatusTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BeltStatusTests.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.BeltStatus; import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,23 +23,23 @@ public class BeltStatusTests extends TestCase{ @Override protected void setUp() throws Exception{ msg = new BeltStatus(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - msg.setLeftRearInflatableBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setPassengerChildDetected(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setRightRearInflatableBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setDriverBuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setPassengerBuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setRightRow2BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setDriverBeltDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setPassengerBeltDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setMiddleRow1BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setMiddleRow1BeltDeployed(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setLeftRow2BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setMiddleRow2BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setMiddleRow3BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setLeftRow3BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setRightRow3BuckleBelted(Test.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setLeftRearInflatableBelted(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setPassengerChildDetected(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setRightRearInflatableBelted(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setDriverBuckleBelted(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setPassengerBuckleBelted(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setRightRow2BuckleBelted(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setDriverBeltDeployed(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setPassengerBeltDeployed(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setMiddleRow1BuckleBelted(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setMiddleRow1BeltDeployed(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setLeftRow2BuckleBelted(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setMiddleRow2BuckleBelted(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setMiddleRow3BuckleBelted(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setLeftRow3BuckleBelted(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setRightRow3BuckleBelted(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); } /** @@ -48,90 +48,90 @@ public class BeltStatusTests extends TestCase{ public void testRpcValues () { // Valid Tests VehicleDataEventStatus leftRearInflatable = msg.getLeftRearInflatableBelted(); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, leftRearInflatable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, leftRearInflatable); VehicleDataEventStatus rightRearInflatable = msg.getRightRearInflatableBelted(); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, rightRearInflatable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, rightRearInflatable); VehicleDataEventStatus passengerChild = msg.getPassengerChildDetected(); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, passengerChild); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, passengerChild); VehicleDataEventStatus driverBuckled = msg.getDriverBuckleBelted(); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled); driverBuckled = msg.getPassengerBuckleBelted(); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled); driverBuckled = msg.getRightRow2BuckleBelted(); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled); driverBuckled = msg.getMiddleRow1BuckleBelted(); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled); driverBuckled = msg.getLeftRow2BuckleBelted(); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled); driverBuckled = msg.getMiddleRow2BuckleBelted(); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled); driverBuckled = msg.getMiddleRow3BuckleBelted(); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled); driverBuckled = msg.getLeftRow3BuckleBelted(); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled); driverBuckled = msg.getRightRow3BuckleBelted(); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, driverBuckled); VehicleDataEventStatus driverBeltDeployed = msg.getDriverBeltDeployed(); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBeltDeployed); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, driverBeltDeployed); driverBeltDeployed = msg.getPassengerBeltDeployed(); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBeltDeployed); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, driverBeltDeployed); driverBeltDeployed = msg.getMiddleRow1BeltDeployed(); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, driverBeltDeployed); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, driverBeltDeployed); // Invalid/Null Tests BeltStatus msg = new BeltStatus(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getLeftRearInflatableBelted()); - assertNull(Test.NULL, msg.getRightRearInflatableBelted()); - assertNull(Test.NULL, msg.getPassengerChildDetected()); - assertNull(Test.NULL, msg.getDriverBuckleBelted()); - assertNull(Test.NULL, msg.getPassengerBuckleBelted()); - assertNull(Test.NULL, msg.getRightRow2BuckleBelted()); - assertNull(Test.NULL, msg.getMiddleRow1BuckleBelted()); - assertNull(Test.NULL, msg.getLeftRow2BuckleBelted()); - assertNull(Test.NULL, msg.getMiddleRow2BuckleBelted()); - assertNull(Test.NULL, msg.getMiddleRow3BuckleBelted()); - assertNull(Test.NULL, msg.getLeftRow3BuckleBelted()); - assertNull(Test.NULL, msg.getRightRow3BuckleBelted()); - assertNull(Test.NULL, msg.getPassengerBeltDeployed()); - assertNull(Test.NULL, msg.getMiddleRow1BeltDeployed()); + assertNull(TestValues.NULL, msg.getLeftRearInflatableBelted()); + assertNull(TestValues.NULL, msg.getRightRearInflatableBelted()); + assertNull(TestValues.NULL, msg.getPassengerChildDetected()); + assertNull(TestValues.NULL, msg.getDriverBuckleBelted()); + assertNull(TestValues.NULL, msg.getPassengerBuckleBelted()); + assertNull(TestValues.NULL, msg.getRightRow2BuckleBelted()); + assertNull(TestValues.NULL, msg.getMiddleRow1BuckleBelted()); + assertNull(TestValues.NULL, msg.getLeftRow2BuckleBelted()); + assertNull(TestValues.NULL, msg.getMiddleRow2BuckleBelted()); + assertNull(TestValues.NULL, msg.getMiddleRow3BuckleBelted()); + assertNull(TestValues.NULL, msg.getLeftRow3BuckleBelted()); + assertNull(TestValues.NULL, msg.getRightRow3BuckleBelted()); + assertNull(TestValues.NULL, msg.getPassengerBeltDeployed()); + assertNull(TestValues.NULL, msg.getMiddleRow1BeltDeployed()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(BeltStatus.KEY_PASSENGER_CHILD_DETECTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(BeltStatus.KEY_LEFT_REAR_INFLATABLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(BeltStatus.KEY_RIGHT_REAR_INFLATABLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(BeltStatus.KEY_DRIVER_BELT_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(BeltStatus.KEY_DRIVER_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(BeltStatus.KEY_PASSENGER_BELT_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(BeltStatus.KEY_PASSENGER_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(BeltStatus.KEY_LEFT_ROW_2_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(BeltStatus.KEY_RIGHT_ROW_2_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(BeltStatus.KEY_MIDDLE_ROW_2_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(BeltStatus.KEY_MIDDLE_ROW_3_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(BeltStatus.KEY_LEFT_ROW_3_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(BeltStatus.KEY_RIGHT_ROW_3_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(BeltStatus.KEY_MIDDLE_ROW_1_BELT_DEPLOYED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(BeltStatus.KEY_MIDDLE_ROW_1_BUCKLE_BELTED, Test.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(BeltStatus.KEY_PASSENGER_CHILD_DETECTED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(BeltStatus.KEY_LEFT_REAR_INFLATABLE_BELTED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(BeltStatus.KEY_RIGHT_REAR_INFLATABLE_BELTED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(BeltStatus.KEY_DRIVER_BELT_DEPLOYED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(BeltStatus.KEY_DRIVER_BUCKLE_BELTED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(BeltStatus.KEY_PASSENGER_BELT_DEPLOYED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(BeltStatus.KEY_PASSENGER_BUCKLE_BELTED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(BeltStatus.KEY_LEFT_ROW_2_BUCKLE_BELTED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(BeltStatus.KEY_RIGHT_ROW_2_BUCKLE_BELTED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(BeltStatus.KEY_MIDDLE_ROW_2_BUCKLE_BELTED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(BeltStatus.KEY_MIDDLE_ROW_3_BUCKLE_BELTED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(BeltStatus.KEY_LEFT_ROW_3_BUCKLE_BELTED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(BeltStatus.KEY_RIGHT_ROW_3_BUCKLE_BELTED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(BeltStatus.KEY_MIDDLE_ROW_1_BELT_DEPLOYED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(BeltStatus.KEY_MIDDLE_ROW_1_BUCKLE_BELTED, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BodyInformationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BodyInformationTests.java index ce3d8b9a0..ea342a00f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BodyInformationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/BodyInformationTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.proxy.rpc.BodyInformation; import com.smartdevicelink.proxy.rpc.enums.IgnitionStableStatus; import com.smartdevicelink.proxy.rpc.enums.IgnitionStatus; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -24,14 +24,14 @@ public class BodyInformationTests extends TestCase{ @Override public void setUp(){ msg = new BodyInformation(); - msg.setParkBrakeActive(Test.GENERAL_BOOLEAN); - msg.setIgnitionStatus(Test.GENERAL_IGNITIONSTATUS); - msg.setIgnitionStableStatus(Test.GENERAL_IGNITIONSTABLESTATUS); + msg.setParkBrakeActive(TestValues.GENERAL_BOOLEAN); + msg.setIgnitionStatus(TestValues.GENERAL_IGNITIONSTATUS); + msg.setIgnitionStableStatus(TestValues.GENERAL_IGNITIONSTABLESTATUS); - msg.setDriverDoorAjar(Test.GENERAL_BOOLEAN); - msg.setPassengerDoorAjar(Test.GENERAL_BOOLEAN); - msg.setRearLeftDoorAjar(Test.GENERAL_BOOLEAN); - msg.setRearRightDoorAjar(Test.GENERAL_BOOLEAN); + msg.setDriverDoorAjar(TestValues.GENERAL_BOOLEAN); + msg.setPassengerDoorAjar(TestValues.GENERAL_BOOLEAN); + msg.setRearLeftDoorAjar(TestValues.GENERAL_BOOLEAN); + msg.setRearRightDoorAjar(TestValues.GENERAL_BOOLEAN); } /** @@ -44,50 +44,50 @@ public class BodyInformationTests extends TestCase{ IgnitionStableStatus ignitionStable = msg.getIgnitionStableStatus(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, parkBrake); - assertEquals(Test.MATCH, Test.GENERAL_IGNITIONSTATUS, ignitionStatus); - assertEquals(Test.MATCH, Test.GENERAL_IGNITIONSTABLESTATUS, ignitionStable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, parkBrake); + assertEquals(TestValues.MATCH, TestValues.GENERAL_IGNITIONSTATUS, ignitionStatus); + assertEquals(TestValues.MATCH, TestValues.GENERAL_IGNITIONSTABLESTATUS, ignitionStable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) msg.getDriverDoorAjar()); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) msg.getPassengerDoorAjar()); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) msg.getRearLeftDoorAjar()); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) msg.getRearRightDoorAjar()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, (boolean) msg.getDriverDoorAjar()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, (boolean) msg.getPassengerDoorAjar()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, (boolean) msg.getRearLeftDoorAjar()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, (boolean) msg.getRearRightDoorAjar()); // Invalid/Null Tests BodyInformation msg = new BodyInformation(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getParkBrakeActive()); - assertNull(Test.NULL, msg.getIgnitionStatus()); - assertNull(Test.NULL, msg.getIgnitionStatus()); - assertNull(Test.NULL, msg.getDriverDoorAjar()); - assertNull(Test.NULL, msg.getPassengerDoorAjar()); - assertNull(Test.NULL, msg.getRearLeftDoorAjar()); - assertNull(Test.NULL, msg.getRearRightDoorAjar()); + assertNull(TestValues.NULL, msg.getParkBrakeActive()); + assertNull(TestValues.NULL, msg.getIgnitionStatus()); + assertNull(TestValues.NULL, msg.getIgnitionStatus()); + assertNull(TestValues.NULL, msg.getDriverDoorAjar()); + assertNull(TestValues.NULL, msg.getPassengerDoorAjar()); + assertNull(TestValues.NULL, msg.getRearLeftDoorAjar()); + assertNull(TestValues.NULL, msg.getRearRightDoorAjar()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(BodyInformation.KEY_PARK_BRAKE_ACTIVE, Test.GENERAL_BOOLEAN); - reference.put(BodyInformation.KEY_IGNITION_STATUS, Test.GENERAL_IGNITIONSTATUS); - reference.put(BodyInformation.KEY_IGNITION_STABLE_STATUS, Test.GENERAL_IGNITIONSTABLESTATUS); - reference.put(BodyInformation.KEY_DRIVER_DOOR_AJAR, Test.GENERAL_BOOLEAN); - reference.put(BodyInformation.KEY_PASSENGER_DOOR_AJAR, Test.GENERAL_BOOLEAN); - reference.put(BodyInformation.KEY_REAR_LEFT_DOOR_AJAR, Test.GENERAL_BOOLEAN); - reference.put(BodyInformation.KEY_REAR_RIGHT_DOOR_AJAR, Test.GENERAL_BOOLEAN); + reference.put(BodyInformation.KEY_PARK_BRAKE_ACTIVE, TestValues.GENERAL_BOOLEAN); + reference.put(BodyInformation.KEY_IGNITION_STATUS, TestValues.GENERAL_IGNITIONSTATUS); + reference.put(BodyInformation.KEY_IGNITION_STABLE_STATUS, TestValues.GENERAL_IGNITIONSTABLESTATUS); + reference.put(BodyInformation.KEY_DRIVER_DOOR_AJAR, TestValues.GENERAL_BOOLEAN); + reference.put(BodyInformation.KEY_PASSENGER_DOOR_AJAR, TestValues.GENERAL_BOOLEAN); + reference.put(BodyInformation.KEY_REAR_LEFT_DOOR_AJAR, TestValues.GENERAL_BOOLEAN); + reference.put(BodyInformation.KEY_REAR_RIGHT_DOOR_AJAR, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ButtonCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ButtonCapabilitiesTests.java index 71f7d3ecf..c6977324d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ButtonCapabilitiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ButtonCapabilitiesTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.rpc.ButtonCapabilities; import com.smartdevicelink.proxy.rpc.ModuleInfo; import com.smartdevicelink.proxy.rpc.enums.ButtonName; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -28,11 +28,11 @@ public class ButtonCapabilitiesTests extends TestCase{ public void setUp(){ msg = new ButtonCapabilities(); - msg.setLongPressAvailable(Test.GENERAL_BOOLEAN); - msg.setName(Test.GENERAL_BUTTONNAME); - msg.setShortPressAvailable(Test.GENERAL_BOOLEAN); - msg.setUpDownAvailable(Test.GENERAL_BOOLEAN); - msg.setModuleInfo(Test.GENERAL_MODULE_INFO); + msg.setLongPressAvailable(TestValues.GENERAL_BOOLEAN); + msg.setName(TestValues.GENERAL_BUTTONNAME); + msg.setShortPressAvailable(TestValues.GENERAL_BOOLEAN); + msg.setUpDownAvailable(TestValues.GENERAL_BOOLEAN); + msg.setModuleInfo(TestValues.GENERAL_MODULE_INFO); } @@ -48,35 +48,35 @@ public class ButtonCapabilitiesTests extends TestCase{ ModuleInfo info = msg.getModuleInfo(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, shortPress); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, longPress); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, upDown); - assertEquals(Test.MATCH, Test.GENERAL_BUTTONNAME, buttonName); - assertEquals(Test.MATCH, Test.GENERAL_MODULE_INFO, info); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, shortPress); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, longPress); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, upDown); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BUTTONNAME, buttonName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MODULE_INFO, info); // Invalid/Null Tests ButtonCapabilities msg = new ButtonCapabilities(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getShortPressAvailable()); - assertNull(Test.NULL, msg.getLongPressAvailable()); - assertNull(Test.NULL, msg.getUpDownAvailable()); - assertNull(Test.NULL, msg.getName()); + assertNull(TestValues.NULL, msg.getShortPressAvailable()); + assertNull(TestValues.NULL, msg.getLongPressAvailable()); + assertNull(TestValues.NULL, msg.getUpDownAvailable()); + assertNull(TestValues.NULL, msg.getName()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(ButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(ButtonCapabilities.KEY_LONG_PRESS_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(ButtonCapabilities.KEY_UP_DOWN_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(ButtonCapabilities.KEY_NAME, Test.GENERAL_BUTTONNAME); - reference.put(ButtonCapabilities.KEY_MODULE_INFO, Test.JSON_MODULE_INFO); + reference.put(ButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ButtonCapabilities.KEY_LONG_PRESS_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ButtonCapabilities.KEY_UP_DOWN_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ButtonCapabilities.KEY_NAME, TestValues.GENERAL_BUTTONNAME); + reference.put(ButtonCapabilities.KEY_MODULE_INFO, TestValues.JSON_MODULE_INFO); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { @@ -86,13 +86,13 @@ public class ButtonCapabilitiesTests extends TestCase{ JSONObject o2 = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> h1 = JsonRPCMarshaller.deserializeJSONObject(o1); Hashtable<String, Object> h2 = JsonRPCMarshaller.deserializeJSONObject(o2); - assertTrue(Test.TRUE, Validator.validateModuleInfo(new ModuleInfo(h1), new ModuleInfo(h2))); + assertTrue(TestValues.TRUE, Validator.validateModuleInfo(new ModuleInfo(h1), new ModuleInfo(h2))); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ChoiceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ChoiceTests.java index 5374ae2bf..6eecece4e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ChoiceTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ChoiceTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.rpc.Choice; import com.smartdevicelink.proxy.rpc.Image; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -28,13 +28,13 @@ public class ChoiceTests extends TestCase{ public void setUp(){ msg = new Choice(); - msg.setChoiceID(Test.GENERAL_INT); - msg.setMenuName(Test.GENERAL_STRING); - msg.setImage(Test.GENERAL_IMAGE); - msg.setSecondaryImage(Test.GENERAL_IMAGE); - msg.setSecondaryText(Test.GENERAL_STRING); - msg.setTertiaryText(Test.GENERAL_STRING); - msg.setVrCommands(Test.GENERAL_STRING_LIST); + msg.setChoiceID(TestValues.GENERAL_INT); + msg.setMenuName(TestValues.GENERAL_STRING); + msg.setImage(TestValues.GENERAL_IMAGE); + msg.setSecondaryImage(TestValues.GENERAL_IMAGE); + msg.setSecondaryText(TestValues.GENERAL_STRING); + msg.setTertiaryText(TestValues.GENERAL_STRING); + msg.setVrCommands(TestValues.GENERAL_STRING_LIST); } /** @@ -51,48 +51,48 @@ public class ChoiceTests extends TestCase{ Image image = msg.getImage(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, text3); - assertEquals(Test.MATCH, Test.GENERAL_STRING, text2); - assertEquals(Test.MATCH, Test.GENERAL_STRING, menuName); - assertEquals(Test.MATCH, Test.GENERAL_INT, choiceId); - assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, vrCommands)); - assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, image2)); - assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, image)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, text3); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, text2); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, menuName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, choiceId); + assertTrue(TestValues.TRUE, Validator.validateStringList(TestValues.GENERAL_STRING_LIST, vrCommands)); + assertTrue(TestValues.TRUE, Validator.validateImage(TestValues.GENERAL_IMAGE, image2)); + assertTrue(TestValues.TRUE, Validator.validateImage(TestValues.GENERAL_IMAGE, image)); // Invalid/Null Tests Choice msg = new Choice(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getChoiceID()); - assertNull(Test.NULL, msg.getImage()); - assertNull(Test.NULL, msg.getSecondaryImage()); - assertNull(Test.NULL, msg.getMenuName()); - assertNull(Test.NULL, msg.getSecondaryText()); - assertNull(Test.NULL, msg.getTertiaryText()); - assertNull(Test.NULL, msg.getVrCommands()); + assertNull(TestValues.NULL, msg.getChoiceID()); + assertNull(TestValues.NULL, msg.getImage()); + assertNull(TestValues.NULL, msg.getSecondaryImage()); + assertNull(TestValues.NULL, msg.getMenuName()); + assertNull(TestValues.NULL, msg.getSecondaryText()); + assertNull(TestValues.NULL, msg.getTertiaryText()); + assertNull(TestValues.NULL, msg.getVrCommands()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(Choice.KEY_CHOICE_ID, Test.GENERAL_INT); - reference.put(Choice.KEY_MENU_NAME, Test.GENERAL_STRING); - reference.put(Choice.KEY_SECONDARY_TEXT, Test.GENERAL_STRING); - reference.put(Choice.KEY_TERTIARY_TEXT, Test.GENERAL_STRING); - reference.put(Choice.KEY_IMAGE, Test.JSON_IMAGE); - reference.put(Choice.KEY_SECONDARY_IMAGE, Test.JSON_IMAGE); - reference.put(Choice.KEY_VR_COMMANDS, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST)); + reference.put(Choice.KEY_CHOICE_ID, TestValues.GENERAL_INT); + reference.put(Choice.KEY_MENU_NAME, TestValues.GENERAL_STRING); + reference.put(Choice.KEY_SECONDARY_TEXT, TestValues.GENERAL_STRING); + reference.put(Choice.KEY_TERTIARY_TEXT, TestValues.GENERAL_STRING); + reference.put(Choice.KEY_IMAGE, TestValues.JSON_IMAGE); + reference.put(Choice.KEY_SECONDARY_IMAGE, TestValues.JSON_IMAGE); + reference.put(Choice.KEY_VR_COMMANDS, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); if(key.equals(Choice.KEY_VR_COMMANDS)){ - assertTrue(Test.TRUE, + assertTrue(TestValues.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key))); } else if(key.equals(Choice.KEY_IMAGE) || key.equals(Choice.KEY_SECONDARY_IMAGE)){ @@ -101,13 +101,13 @@ public class ChoiceTests extends TestCase{ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateImage(new Image(hashReference), new Image(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateImage(new Image(hashReference), new Image(hashTest))); } else{ - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlCapabilitiesTests.java index a33f35b27..ee494ff43 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlCapabilitiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlCapabilitiesTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.rpc.ModuleInfo; import com.smartdevicelink.proxy.rpc.enums.DefrostZone; import com.smartdevicelink.proxy.rpc.enums.VentilationMode; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -32,24 +32,24 @@ public class ClimateControlCapabilitiesTests extends TestCase{ public void setUp(){ msg = new ClimateControlCapabilities(); - msg.setModuleName(Test.GENERAL_STRING); - msg.setFanSpeedAvailable(Test.GENERAL_BOOLEAN); - msg.setDesiredTemperatureAvailable(Test.GENERAL_BOOLEAN); - msg.setAcEnableAvailable(Test.GENERAL_BOOLEAN); - msg.setAcMaxEnableAvailable(Test.GENERAL_BOOLEAN); - msg.setCirculateAirEnableAvailable(Test.GENERAL_BOOLEAN); - msg.setAutoModeEnableAvailable(Test.GENERAL_BOOLEAN); - msg.setDualModeEnableAvailable(Test.GENERAL_BOOLEAN); - msg.setDefrostZoneAvailable(Test.GENERAL_BOOLEAN); - msg.setDefrostZone(Test.GENERAL_DEFROSTZONE_LIST); - msg.setVentilationModeAvailable(Test.GENERAL_BOOLEAN); - msg.setVentilationMode(Test.GENERAL_VENTILATIONMODE_LIST); - msg.setHeatedSteeringWheelAvailable(Test.GENERAL_BOOLEAN); - msg.setHeatedWindshieldAvailable(Test.GENERAL_BOOLEAN); - msg.setHeatedRearWindowAvailable(Test.GENERAL_BOOLEAN); - msg.setHeatedMirrorsAvailable(Test.GENERAL_BOOLEAN); - msg.setModuleInfo(Test.GENERAL_MODULE_INFO); - msg.setClimateEnableAvailable(Test.GENERAL_BOOLEAN); + msg.setModuleName(TestValues.GENERAL_STRING); + msg.setFanSpeedAvailable(TestValues.GENERAL_BOOLEAN); + msg.setDesiredTemperatureAvailable(TestValues.GENERAL_BOOLEAN); + msg.setAcEnableAvailable(TestValues.GENERAL_BOOLEAN); + msg.setAcMaxEnableAvailable(TestValues.GENERAL_BOOLEAN); + msg.setCirculateAirEnableAvailable(TestValues.GENERAL_BOOLEAN); + msg.setAutoModeEnableAvailable(TestValues.GENERAL_BOOLEAN); + msg.setDualModeEnableAvailable(TestValues.GENERAL_BOOLEAN); + msg.setDefrostZoneAvailable(TestValues.GENERAL_BOOLEAN); + msg.setDefrostZone(TestValues.GENERAL_DEFROSTZONE_LIST); + msg.setVentilationModeAvailable(TestValues.GENERAL_BOOLEAN); + msg.setVentilationMode(TestValues.GENERAL_VENTILATIONMODE_LIST); + msg.setHeatedSteeringWheelAvailable(TestValues.GENERAL_BOOLEAN); + msg.setHeatedWindshieldAvailable(TestValues.GENERAL_BOOLEAN); + msg.setHeatedRearWindowAvailable(TestValues.GENERAL_BOOLEAN); + msg.setHeatedMirrorsAvailable(TestValues.GENERAL_BOOLEAN); + msg.setModuleInfo(TestValues.GENERAL_MODULE_INFO); + msg.setClimateEnableAvailable(TestValues.GENERAL_BOOLEAN); } /** @@ -77,82 +77,82 @@ public class ClimateControlCapabilitiesTests extends TestCase{ boolean climateEnableAvailable = msg.getClimateEnableAvailable(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, moduleName); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, fanSpeedAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, desiredTemperatureAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, acEnableAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, acMaxEnableAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, circulateAirEnableAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, autoModeEnableAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, dualModeEnableAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, defrostZoneAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, ventilationModeAvailable); - assertEquals(Test.MATCH, Test.GENERAL_MODULE_INFO, info); - - assertEquals(Test.MATCH, Test.GENERAL_DEFROSTZONE_LIST.size(), defrostZone.size()); - assertEquals(Test.MATCH, Test.GENERAL_VENTILATIONMODE_LIST.size(), ventilationMode.size()); - - for(int i = 0; i < Test.GENERAL_DEFROSTZONE_LIST.size(); i++){ - assertEquals(Test.MATCH, Test.GENERAL_DEFROSTZONE_LIST.get(i), defrostZone.get(i)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, moduleName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, fanSpeedAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, desiredTemperatureAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, acEnableAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, acMaxEnableAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, circulateAirEnableAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, autoModeEnableAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, dualModeEnableAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, defrostZoneAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, ventilationModeAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MODULE_INFO, info); + + assertEquals(TestValues.MATCH, TestValues.GENERAL_DEFROSTZONE_LIST.size(), defrostZone.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VENTILATIONMODE_LIST.size(), ventilationMode.size()); + + for(int i = 0; i < TestValues.GENERAL_DEFROSTZONE_LIST.size(); i++){ + assertEquals(TestValues.MATCH, TestValues.GENERAL_DEFROSTZONE_LIST.get(i), defrostZone.get(i)); } - for(int i = 0; i < Test.GENERAL_VENTILATIONMODE_LIST.size(); i++){ - assertEquals(Test.MATCH, Test.GENERAL_VENTILATIONMODE_LIST.get(i), ventilationMode.get(i)); + for(int i = 0; i < TestValues.GENERAL_VENTILATIONMODE_LIST.size(); i++){ + assertEquals(TestValues.MATCH, TestValues.GENERAL_VENTILATIONMODE_LIST.get(i), ventilationMode.get(i)); } - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, heatedSteeringWheelAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, heatedWindshieldAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, heatedRearWindowAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, heatedMirrorsAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, climateEnableAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, heatedSteeringWheelAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, heatedWindshieldAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, heatedRearWindowAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, heatedMirrorsAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, climateEnableAvailable); // Invalid/Null Tests ClimateControlCapabilities msg = new ClimateControlCapabilities(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getModuleName()); - assertNull(Test.NULL, msg.getFanSpeedAvailable()); - assertNull(Test.NULL, msg.getDesiredTemperatureAvailable()); - assertNull(Test.NULL, msg.getAcEnableAvailable()); - assertNull(Test.NULL, msg.getAcMaxEnableAvailable()); - assertNull(Test.NULL, msg.getAutoModeEnableAvailable()); - assertNull(Test.NULL, msg.getDualModeEnableAvailable()); - assertNull(Test.NULL, msg.getDefrostZoneAvailable()); - assertNull(Test.NULL, msg.getDefrostZone()); - assertNull(Test.NULL, msg.getVentilationModeAvailable()); - assertNull(Test.NULL, msg.getVentilationMode()); - assertNull(Test.NULL, msg.getHeatedSteeringWheelAvailable()); - assertNull(Test.NULL, msg.getHeatedWindshieldAvailable()); - assertNull(Test.NULL, msg.getHeatedRearWindowAvailable()); - assertNull(Test.NULL, msg.getHeatedMirrorsAvailable()); - assertNull(Test.NULL, msg.getModuleInfo()); - assertNull(Test.NULL, msg.getClimateEnableAvailable()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getModuleName()); + assertNull(TestValues.NULL, msg.getFanSpeedAvailable()); + assertNull(TestValues.NULL, msg.getDesiredTemperatureAvailable()); + assertNull(TestValues.NULL, msg.getAcEnableAvailable()); + assertNull(TestValues.NULL, msg.getAcMaxEnableAvailable()); + assertNull(TestValues.NULL, msg.getAutoModeEnableAvailable()); + assertNull(TestValues.NULL, msg.getDualModeEnableAvailable()); + assertNull(TestValues.NULL, msg.getDefrostZoneAvailable()); + assertNull(TestValues.NULL, msg.getDefrostZone()); + assertNull(TestValues.NULL, msg.getVentilationModeAvailable()); + assertNull(TestValues.NULL, msg.getVentilationMode()); + assertNull(TestValues.NULL, msg.getHeatedSteeringWheelAvailable()); + assertNull(TestValues.NULL, msg.getHeatedWindshieldAvailable()); + assertNull(TestValues.NULL, msg.getHeatedRearWindowAvailable()); + assertNull(TestValues.NULL, msg.getHeatedMirrorsAvailable()); + assertNull(TestValues.NULL, msg.getModuleInfo()); + assertNull(TestValues.NULL, msg.getClimateEnableAvailable()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(ClimateControlCapabilities.KEY_MODULE_NAME, Test.GENERAL_STRING); - reference.put(ClimateControlCapabilities.KEY_FAN_SPEED_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlCapabilities.KEY_DESIRED_TEMPERATURE_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlCapabilities.KEY_AC_ENABLE_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlCapabilities.KEY_AC_MAX_ENABLE_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlCapabilities.KEY_CIRCULATE_AIR_ENABLE_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlCapabilities.KEY_AUTO_MODE_ENABLE_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlCapabilities.KEY_DUAL_MODE_ENABLE_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlCapabilities.KEY_DEFROST_ZONE_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlCapabilities.KEY_VENTILATION_MODE_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlCapabilities.KEY_DEFROST_ZONE, JsonUtils.createJsonArray(Test.GENERAL_DEFROSTZONE_LIST)); - reference.put(ClimateControlCapabilities.KEY_VENTILATION_MODE, JsonUtils.createJsonArray(Test.GENERAL_VENTILATIONMODE_LIST)); - reference.put(ClimateControlCapabilities.KEY_HEATED_STEERING_WHEEL_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlCapabilities.KEY_HEATED_WIND_SHIELD_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlCapabilities.KEY_HEATED_REAR_WINDOW_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlCapabilities.KEY_HEATED_MIRRORS_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlCapabilities.KEY_MODULE_INFO, Test.JSON_MODULE_INFO); - reference.put(ClimateControlCapabilities.KEY_CLIMATE_ENABLE_AVAILABLE, Test.GENERAL_BOOLEAN); + reference.put(ClimateControlCapabilities.KEY_MODULE_NAME, TestValues.GENERAL_STRING); + reference.put(ClimateControlCapabilities.KEY_FAN_SPEED_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlCapabilities.KEY_DESIRED_TEMPERATURE_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlCapabilities.KEY_AC_ENABLE_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlCapabilities.KEY_AC_MAX_ENABLE_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlCapabilities.KEY_CIRCULATE_AIR_ENABLE_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlCapabilities.KEY_AUTO_MODE_ENABLE_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlCapabilities.KEY_DUAL_MODE_ENABLE_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlCapabilities.KEY_DEFROST_ZONE_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlCapabilities.KEY_VENTILATION_MODE_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlCapabilities.KEY_DEFROST_ZONE, JsonUtils.createJsonArray(TestValues.GENERAL_DEFROSTZONE_LIST)); + reference.put(ClimateControlCapabilities.KEY_VENTILATION_MODE, JsonUtils.createJsonArray(TestValues.GENERAL_VENTILATIONMODE_LIST)); + reference.put(ClimateControlCapabilities.KEY_HEATED_STEERING_WHEEL_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlCapabilities.KEY_HEATED_WIND_SHIELD_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlCapabilities.KEY_HEATED_REAR_WINDOW_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlCapabilities.KEY_HEATED_MIRRORS_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlCapabilities.KEY_MODULE_INFO, TestValues.JSON_MODULE_INFO); + reference.put(ClimateControlCapabilities.KEY_CLIMATE_ENABLE_AVAILABLE, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -164,38 +164,38 @@ public class ClimateControlCapabilitiesTests extends TestCase{ List<DefrostZone> defrostZoneListReference = new ArrayList<DefrostZone>(); List<DefrostZone> defrostZoneListTest = new ArrayList<DefrostZone>(); - assertEquals(Test.MATCH, defrostZoneArrayReference.length(), defrostZoneArrayTest.length()); + assertEquals(TestValues.MATCH, defrostZoneArrayReference.length(), defrostZoneArrayTest.length()); for (int index = 0 ; index < defrostZoneArrayReference.length(); index++) { defrostZoneListReference.add( (DefrostZone)defrostZoneArrayReference.get(index) ); defrostZoneListTest.add( (DefrostZone)defrostZoneArrayTest.get(index) ); } - assertTrue(Test.TRUE, defrostZoneListReference.containsAll(defrostZoneListTest) && defrostZoneListTest.containsAll(defrostZoneListReference)); + assertTrue(TestValues.TRUE, defrostZoneListReference.containsAll(defrostZoneListTest) && defrostZoneListTest.containsAll(defrostZoneListReference)); } else if(key.equals(ClimateControlCapabilities.KEY_VENTILATION_MODE)) { JSONArray ventilationModeArrayReference = JsonUtils.readJsonArrayFromJsonObject(reference, key); JSONArray ventilationModeArrayTest = JsonUtils.readJsonArrayFromJsonObject(underTest, key); List<VentilationMode> ventilationModeListReference = new ArrayList<VentilationMode>(); List<VentilationMode> ventilationModeListTest = new ArrayList<VentilationMode>(); - assertEquals(Test.MATCH, ventilationModeArrayReference.length(), ventilationModeArrayTest.length()); + assertEquals(TestValues.MATCH, ventilationModeArrayReference.length(), ventilationModeArrayTest.length()); for (int index = 0 ; index < ventilationModeArrayReference.length(); index++) { ventilationModeListReference.add( (VentilationMode)ventilationModeArrayReference.get(index) ); ventilationModeListTest.add( (VentilationMode)ventilationModeArrayTest.get(index) ); } - assertTrue(Test.TRUE, ventilationModeListReference.containsAll(ventilationModeListTest) && ventilationModeListTest.containsAll(ventilationModeListReference)); + assertTrue(TestValues.TRUE, ventilationModeListReference.containsAll(ventilationModeListTest) && ventilationModeListTest.containsAll(ventilationModeListReference)); } else if (key.equals(ClimateControlCapabilities.KEY_MODULE_INFO)) { JSONObject o1 = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key); JSONObject o2 = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> h1 = JsonRPCMarshaller.deserializeJSONObject(o1); Hashtable<String, Object> h2 = JsonRPCMarshaller.deserializeJSONObject(o2); - assertTrue(Test.TRUE, Validator.validateModuleInfo(new ModuleInfo(h1), new ModuleInfo(h2))); + assertTrue(TestValues.TRUE, Validator.validateModuleInfo(new ModuleInfo(h1), new ModuleInfo(h2))); } else{ - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlDataTests.java index 7aeeb76cd..fba46eb9a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlDataTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.rpc.Temperature; import com.smartdevicelink.proxy.rpc.enums.DefrostZone; import com.smartdevicelink.proxy.rpc.enums.VentilationMode; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -29,21 +29,21 @@ public class ClimateControlDataTests extends TestCase{ public void setUp(){ msg = new ClimateControlData(); - msg.setFanSpeed(Test.GENERAL_INT); - msg.setCurrentTemperature(Test.GENERAL_TEMPERATURE); - msg.setDesiredTemperature(Test.GENERAL_TEMPERATURE); - msg.setAcEnable(Test.GENERAL_BOOLEAN); - msg.setCirculateAirEnable(Test.GENERAL_BOOLEAN); - msg.setAutoModeEnable(Test.GENERAL_BOOLEAN); - msg.setDefrostZone(Test.GENERAL_DEFROSTZONE); - msg.setDualModeEnable(Test.GENERAL_BOOLEAN); - msg.setAcMaxEnable(Test.GENERAL_BOOLEAN); - msg.setVentilationMode(Test.GENERAL_VENTILATIONMODE); - msg.setHeatedSteeringWheelEnable(Test.GENERAL_BOOLEAN); - msg.setHeatedWindshieldEnable(Test.GENERAL_BOOLEAN); - msg.setHeatedRearWindowEnable(Test.GENERAL_BOOLEAN); - msg.setHeatedMirrorsEnable(Test.GENERAL_BOOLEAN); - msg.setClimateEnable(Test.GENERAL_BOOLEAN); + msg.setFanSpeed(TestValues.GENERAL_INT); + msg.setCurrentTemperature(TestValues.GENERAL_TEMPERATURE); + msg.setDesiredTemperature(TestValues.GENERAL_TEMPERATURE); + msg.setAcEnable(TestValues.GENERAL_BOOLEAN); + msg.setCirculateAirEnable(TestValues.GENERAL_BOOLEAN); + msg.setAutoModeEnable(TestValues.GENERAL_BOOLEAN); + msg.setDefrostZone(TestValues.GENERAL_DEFROSTZONE); + msg.setDualModeEnable(TestValues.GENERAL_BOOLEAN); + msg.setAcMaxEnable(TestValues.GENERAL_BOOLEAN); + msg.setVentilationMode(TestValues.GENERAL_VENTILATIONMODE); + msg.setHeatedSteeringWheelEnable(TestValues.GENERAL_BOOLEAN); + msg.setHeatedWindshieldEnable(TestValues.GENERAL_BOOLEAN); + msg.setHeatedRearWindowEnable(TestValues.GENERAL_BOOLEAN); + msg.setHeatedMirrorsEnable(TestValues.GENERAL_BOOLEAN); + msg.setClimateEnable(TestValues.GENERAL_BOOLEAN); } /** @@ -68,65 +68,65 @@ public class ClimateControlDataTests extends TestCase{ boolean climateEnable = msg.getClimateEnable(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, fanSpeed); - assertTrue(Test.TRUE, Validator.validateTemperature(Test.GENERAL_TEMPERATURE, currentTemperature)); - assertTrue(Test.TRUE, Validator.validateTemperature(Test.GENERAL_TEMPERATURE, desiredTemperature)); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, acEnable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, circulateAirEnable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, autoModeEnable); - assertEquals(Test.MATCH, Test.GENERAL_DEFROSTZONE, defrostZone); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, dualModeEnable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, acMaxEnable); - assertEquals(Test.MATCH, Test.GENERAL_VENTILATIONMODE, ventilationMode); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, heatedSteeringWheelEnable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, heatedWindshieldEnable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, heatedRearWindowEnable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, heatedMirrorsEnable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, climateEnable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, fanSpeed); + assertTrue(TestValues.TRUE, Validator.validateTemperature(TestValues.GENERAL_TEMPERATURE, currentTemperature)); + assertTrue(TestValues.TRUE, Validator.validateTemperature(TestValues.GENERAL_TEMPERATURE, desiredTemperature)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, acEnable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, circulateAirEnable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, autoModeEnable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DEFROSTZONE, defrostZone); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, dualModeEnable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, acMaxEnable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VENTILATIONMODE, ventilationMode); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, heatedSteeringWheelEnable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, heatedWindshieldEnable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, heatedRearWindowEnable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, heatedMirrorsEnable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, climateEnable); // Invalid/Null Tests ClimateControlData msg = new ClimateControlData(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getFanSpeed()); - assertNull(Test.NULL, msg.getCurrentTemperature()); - assertNull(Test.NULL, msg.getDesiredTemperature()); - assertNull(Test.NULL, msg.getAcEnable()); - assertNull(Test.NULL, msg.getCirculateAirEnable()); - assertNull(Test.NULL, msg.getAutoModeEnable()); - assertNull(Test.NULL, msg.getDefrostZone()); - assertNull(Test.NULL, msg.getDualModeEnable()); - assertNull(Test.NULL, msg.getAcMaxEnable()); - assertNull(Test.NULL, msg.getVentilationMode()); - assertNull(Test.NULL, msg.getHeatedSteeringWheelEnable()); - assertNull(Test.NULL, msg.getHeatedWindshieldEnable()); - assertNull(Test.NULL, msg.getHeatedRearWindowEnable()); - assertNull(Test.NULL, msg.getHeatedMirrorsEnable()); - assertNull(Test.NULL, msg.getClimateEnable()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getFanSpeed()); + assertNull(TestValues.NULL, msg.getCurrentTemperature()); + assertNull(TestValues.NULL, msg.getDesiredTemperature()); + assertNull(TestValues.NULL, msg.getAcEnable()); + assertNull(TestValues.NULL, msg.getCirculateAirEnable()); + assertNull(TestValues.NULL, msg.getAutoModeEnable()); + assertNull(TestValues.NULL, msg.getDefrostZone()); + assertNull(TestValues.NULL, msg.getDualModeEnable()); + assertNull(TestValues.NULL, msg.getAcMaxEnable()); + assertNull(TestValues.NULL, msg.getVentilationMode()); + assertNull(TestValues.NULL, msg.getHeatedSteeringWheelEnable()); + assertNull(TestValues.NULL, msg.getHeatedWindshieldEnable()); + assertNull(TestValues.NULL, msg.getHeatedRearWindowEnable()); + assertNull(TestValues.NULL, msg.getHeatedMirrorsEnable()); + assertNull(TestValues.NULL, msg.getClimateEnable()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(ClimateControlData.KEY_FAN_SPEED, Test.GENERAL_INT); - reference.put(ClimateControlData.KEY_CURRENT_TEMPERATURE, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_TEMPERATURE.getStore())); - reference.put(ClimateControlData.KEY_DESIRED_TEMPERATURE, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_TEMPERATURE.getStore())); - reference.put(ClimateControlData.KEY_AC_ENABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlData.KEY_CIRCULATE_AIR_ENABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlData.KEY_AUTO_MODE_ENABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlData.KEY_DUAL_MODE_ENABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlData.KEY_AC_MAX_ENABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlData.KEY_DEFROST_ZONE, Test.GENERAL_DEFROSTZONE); - reference.put(ClimateControlData.KEY_VENTILATION_MODE, Test.GENERAL_VENTILATIONMODE); - reference.put(ClimateControlData.KEY_HEATED_STEERING_WHEEL_ENABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlData.KEY_HEATED_WIND_SHIELD_ENABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlData.KEY_HEATED_REAR_WINDOW_ENABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlData.KEY_HEATED_MIRRORS_ENABLE, Test.GENERAL_BOOLEAN); - reference.put(ClimateControlData.KEY_CLIMATE_ENABLE, Test.GENERAL_BOOLEAN); + reference.put(ClimateControlData.KEY_FAN_SPEED, TestValues.GENERAL_INT); + reference.put(ClimateControlData.KEY_CURRENT_TEMPERATURE, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_TEMPERATURE.getStore())); + reference.put(ClimateControlData.KEY_DESIRED_TEMPERATURE, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_TEMPERATURE.getStore())); + reference.put(ClimateControlData.KEY_AC_ENABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlData.KEY_CIRCULATE_AIR_ENABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlData.KEY_AUTO_MODE_ENABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlData.KEY_DUAL_MODE_ENABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlData.KEY_AC_MAX_ENABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlData.KEY_DEFROST_ZONE, TestValues.GENERAL_DEFROSTZONE); + reference.put(ClimateControlData.KEY_VENTILATION_MODE, TestValues.GENERAL_VENTILATIONMODE); + reference.put(ClimateControlData.KEY_HEATED_STEERING_WHEEL_ENABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlData.KEY_HEATED_WIND_SHIELD_ENABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlData.KEY_HEATED_REAR_WINDOW_ENABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlData.KEY_HEATED_MIRRORS_ENABLE, TestValues.GENERAL_BOOLEAN); + reference.put(ClimateControlData.KEY_CLIMATE_ENABLE, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -137,19 +137,19 @@ public class ClimateControlDataTests extends TestCase{ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateTemperature( new Temperature(hashReference), new Temperature(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateTemperature( new Temperature(hashReference), new Temperature(hashTest))); } else if(key.equals(ClimateControlData.KEY_DESIRED_TEMPERATURE)){ JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key); JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateTemperature( new Temperature(hashReference), new Temperature(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateTemperature( new Temperature(hashReference), new Temperature(hashTest))); } else{ - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/CloudAppPropertiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/CloudAppPropertiesTests.java index 75be1e9cc..5b1ac322d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/CloudAppPropertiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/CloudAppPropertiesTests.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.CloudAppProperties; import com.smartdevicelink.proxy.rpc.enums.HybridAppPreference; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -26,13 +26,13 @@ public class CloudAppPropertiesTests extends TestCase{ public void setUp(){ msg = new CloudAppProperties(); - msg.setNicknames(Test.GENERAL_STRING_LIST); - msg.setAppID(Test.GENERAL_STRING); - msg.setEnabled(Test.GENERAL_BOOLEAN); - msg.setAuthToken(Test.GENERAL_STRING); - msg.setCloudTransportType(Test.GENERAL_STRING); - msg.setHybridAppPreference(Test.GENERAL_HYBRID_APP_PREFERENCE); - msg.setEndpoint(Test.GENERAL_STRING); + msg.setNicknames(TestValues.GENERAL_STRING_LIST); + msg.setAppID(TestValues.GENERAL_STRING); + msg.setEnabled(TestValues.GENERAL_BOOLEAN); + msg.setAuthToken(TestValues.GENERAL_STRING); + msg.setCloudTransportType(TestValues.GENERAL_STRING); + msg.setHybridAppPreference(TestValues.GENERAL_HYBRID_APP_PREFERENCE); + msg.setEndpoint(TestValues.GENERAL_STRING); } /** @@ -49,42 +49,42 @@ public class CloudAppPropertiesTests extends TestCase{ String endpoint = msg.getEndpoint(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST, nicknames); - assertEquals(Test.MATCH, Test.GENERAL_STRING, appID); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, enabled); - assertEquals(Test.MATCH, Test.GENERAL_STRING, authToken); - assertEquals(Test.MATCH, Test.GENERAL_STRING, cloudTransportType); - assertEquals(Test.MATCH, Test.GENERAL_HYBRID_APP_PREFERENCE, hybridAppPreference); - assertEquals(Test.MATCH, Test.GENERAL_STRING, endpoint); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING_LIST, nicknames); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, appID); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, enabled); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, authToken); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, cloudTransportType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_HYBRID_APP_PREFERENCE, hybridAppPreference); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, endpoint); // Invalid/Null Tests CloudAppProperties msg = new CloudAppProperties(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getNicknames()); - assertNull(Test.NULL, msg.getAppID()); - assertNull(Test.NULL, msg.isEnabled()); - assertNull(Test.NULL, msg.getAuthToken()); - assertNull(Test.NULL, msg.getCloudTransportType()); - assertNull(Test.NULL, msg.getHybridAppPreference()); - assertNull(Test.NULL, msg.getEndpoint()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getNicknames()); + assertNull(TestValues.NULL, msg.getAppID()); + assertNull(TestValues.NULL, msg.isEnabled()); + assertNull(TestValues.NULL, msg.getAuthToken()); + assertNull(TestValues.NULL, msg.getCloudTransportType()); + assertNull(TestValues.NULL, msg.getHybridAppPreference()); + assertNull(TestValues.NULL, msg.getEndpoint()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(CloudAppProperties.KEY_NICKNAMES, Test.GENERAL_STRING_LIST); - reference.put(CloudAppProperties.KEY_APP_ID, Test.GENERAL_STRING); - reference.put(CloudAppProperties.KEY_ENABLED, Test.GENERAL_BOOLEAN); - reference.put(CloudAppProperties.KEY_AUTH_TOKEN, Test.GENERAL_STRING); - reference.put(CloudAppProperties.KEY_CLOUD_TRANSPORT_TYPE, Test.GENERAL_STRING); - reference.put(CloudAppProperties.KEY_HYBRID_APP_PREFERENCE, Test.GENERAL_HYBRID_APP_PREFERENCE); - reference.put(CloudAppProperties.KEY_ENDPOINT, Test.GENERAL_STRING); + reference.put(CloudAppProperties.KEY_NICKNAMES, TestValues.GENERAL_STRING_LIST); + reference.put(CloudAppProperties.KEY_APP_ID, TestValues.GENERAL_STRING); + reference.put(CloudAppProperties.KEY_ENABLED, TestValues.GENERAL_BOOLEAN); + reference.put(CloudAppProperties.KEY_AUTH_TOKEN, TestValues.GENERAL_STRING); + reference.put(CloudAppProperties.KEY_CLOUD_TRANSPORT_TYPE, TestValues.GENERAL_STRING); + reference.put(CloudAppProperties.KEY_HYBRID_APP_PREFERENCE, TestValues.GENERAL_HYBRID_APP_PREFERENCE); + reference.put(CloudAppProperties.KEY_ENDPOINT, TestValues.GENERAL_STRING); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -94,11 +94,11 @@ public class CloudAppPropertiesTests extends TestCase{ Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key)); }else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClusterModeStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClusterModeStatusTests.java index 366339818..4c500ab48 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClusterModeStatusTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClusterModeStatusTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.rpc.enums.CarModeStatus; import com.smartdevicelink.proxy.rpc.enums.PowerModeQualificationStatus; import com.smartdevicelink.proxy.rpc.enums.PowerModeStatus; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -26,10 +26,10 @@ public class ClusterModeStatusTests extends TestCase{ public void setUp(){ msg = new ClusterModeStatus(); - msg.setPowerModeActive(Test.GENERAL_BOOLEAN); - msg.setCarModeStatus(Test.GENERAL_CARMODESTATUS); - msg.setPowerModeQualificationStatus(Test.GENERAL_POWERMODEQUALIFICATIONSTATUS); - msg.setPowerModeStatus(Test.GENERAL_POWERMODESTATUS); + msg.setPowerModeActive(TestValues.GENERAL_BOOLEAN); + msg.setCarModeStatus(TestValues.GENERAL_CARMODESTATUS); + msg.setPowerModeQualificationStatus(TestValues.GENERAL_POWERMODEQUALIFICATIONSTATUS); + msg.setPowerModeStatus(TestValues.GENERAL_POWERMODESTATUS); } /** @@ -43,40 +43,40 @@ public class ClusterModeStatusTests extends TestCase{ CarModeStatus carStatus = msg.getCarModeStatus(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, powerMode); - assertEquals(Test.MATCH, Test.GENERAL_POWERMODEQUALIFICATIONSTATUS, qualification); - assertEquals(Test.MATCH, Test.GENERAL_POWERMODESTATUS, status); - assertEquals(Test.MATCH, Test.GENERAL_CARMODESTATUS, carStatus); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, powerMode); + assertEquals(TestValues.MATCH, TestValues.GENERAL_POWERMODEQUALIFICATIONSTATUS, qualification); + assertEquals(TestValues.MATCH, TestValues.GENERAL_POWERMODESTATUS, status); + assertEquals(TestValues.MATCH, TestValues.GENERAL_CARMODESTATUS, carStatus); // Invalid/Null Tests ClusterModeStatus msg = new ClusterModeStatus(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getPowerModeActive()); - assertNull(Test.NULL, msg.getPowerModeStatus()); - assertNull(Test.NULL, msg.getPowerModeQualificationStatus()); - assertNull(Test.NULL, msg.getCarModeStatus()); + assertNull(TestValues.NULL, msg.getPowerModeActive()); + assertNull(TestValues.NULL, msg.getPowerModeStatus()); + assertNull(TestValues.NULL, msg.getPowerModeQualificationStatus()); + assertNull(TestValues.NULL, msg.getCarModeStatus()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(ClusterModeStatus.KEY_POWER_MODE_ACTIVE, Test.GENERAL_BOOLEAN); - reference.put(ClusterModeStatus.KEY_POWER_MODE_STATUS, Test.GENERAL_POWERMODESTATUS); - reference.put(ClusterModeStatus.KEY_POWER_MODE_QUALIFICATION_STATUS, Test.GENERAL_POWERMODEQUALIFICATIONSTATUS); - reference.put(ClusterModeStatus.KEY_CAR_MODE_STATUS, Test.GENERAL_CARMODESTATUS); + reference.put(ClusterModeStatus.KEY_POWER_MODE_ACTIVE, TestValues.GENERAL_BOOLEAN); + reference.put(ClusterModeStatus.KEY_POWER_MODE_STATUS, TestValues.GENERAL_POWERMODESTATUS); + reference.put(ClusterModeStatus.KEY_POWER_MODE_QUALIFICATION_STATUS, TestValues.GENERAL_POWERMODEQUALIFICATIONSTATUS); + reference.put(ClusterModeStatus.KEY_CAR_MODE_STATUS, TestValues.GENERAL_CARMODESTATUS); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/CoordinateTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/CoordinateTests.java index 5f8a8327f..40931dc1e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/CoordinateTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/CoordinateTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.Coordinate; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,8 +23,8 @@ public class CoordinateTests extends TestCase { public void setUp(){ msg = new Coordinate(); - msg.setLatitudeDegrees(Test.GENERAL_FLOAT); - msg.setLongitudeDegrees(Test.GENERAL_FLOAT); + msg.setLatitudeDegrees(TestValues.GENERAL_FLOAT); + msg.setLongitudeDegrees(TestValues.GENERAL_FLOAT); } /** @@ -36,26 +36,26 @@ public class CoordinateTests extends TestCase { float floatLong = msg.getLongitudeDegrees(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_FLOAT, floatLat); - assertEquals(Test.MATCH, Test.GENERAL_FLOAT, floatLong); + assertEquals(TestValues.MATCH, TestValues.GENERAL_FLOAT, floatLat); + assertEquals(TestValues.MATCH, TestValues.GENERAL_FLOAT, floatLong); // Invalid/Null Tests Coordinate msg = new Coordinate(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getLatitudeDegrees()); - assertNull(Test.NULL, msg.getLongitudeDegrees()); + assertNull(TestValues.NULL, msg.getLatitudeDegrees()); + assertNull(TestValues.NULL, msg.getLongitudeDegrees()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(Coordinate.KEY_LATITUDE_DEGREES, (Float) Test.GENERAL_FLOAT); - reference.put(Coordinate.KEY_LONGITUDE_DEGREES, (Float) Test.GENERAL_FLOAT); + reference.put(Coordinate.KEY_LATITUDE_DEGREES, (Float) TestValues.GENERAL_FLOAT); + reference.put(Coordinate.KEY_LONGITUDE_DEGREES, (Float) TestValues.GENERAL_FLOAT); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -64,10 +64,10 @@ public class CoordinateTests extends TestCase { Object a = JsonUtils.readObjectFromJsonObject(reference, key); Object b = JsonUtils.readObjectFromJsonObject(underTest, key); - assertEquals(Test.MATCH, a, b); + assertEquals(TestValues.MATCH, a, b); } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DIDResultTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DIDResultTests.java index 245abf45b..85f0d41fa 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DIDResultTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DIDResultTests.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.DIDResult; import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -24,8 +24,8 @@ public class DIDResultTests extends TestCase { public void setUp(){ msg = new DIDResult(); - msg.setData(Test.GENERAL_STRING); - msg.setResultCode(Test.GENERAL_VEHICLEDATARESULTCODE); + msg.setData(TestValues.GENERAL_STRING); + msg.setResultCode(TestValues.GENERAL_VEHICLEDATARESULTCODE); } /** @@ -37,34 +37,34 @@ public class DIDResultTests extends TestCase { VehicleDataResultCode resultCode = msg.getResultCode(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, data); - assertEquals(Test.MATCH, Test.GENERAL_VEHICLEDATARESULTCODE, resultCode); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, data); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHICLEDATARESULTCODE, resultCode); // Invalid/Null Tests DIDResult msg = new DIDResult(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getData()); - assertNull(Test.NULL, msg.getResultCode()); + assertNull(TestValues.NULL, msg.getData()); + assertNull(TestValues.NULL, msg.getResultCode()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(DIDResult.KEY_DATA, Test.GENERAL_STRING); - reference.put(DIDResult.KEY_RESULT_CODE, Test.GENERAL_VEHICLEDATARESULTCODE); + reference.put(DIDResult.KEY_DATA, TestValues.GENERAL_STRING); + reference.put(DIDResult.KEY_RESULT_CODE, TestValues.GENERAL_VEHICLEDATARESULTCODE); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DTCTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DTCTests.java index 7104e8c6d..09457ef60 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DTCTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DTCTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.DTC; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,8 +23,8 @@ public class DTCTests extends TestCase{ public void setUp(){ msg = new DTC(); - msg.setIdentifier(Test.GENERAL_STRING); - msg.setStatusByte(Test.GENERAL_STRING); + msg.setIdentifier(TestValues.GENERAL_STRING); + msg.setStatusByte(TestValues.GENERAL_STRING); } /** @@ -36,34 +36,34 @@ public class DTCTests extends TestCase{ String statusByte = msg.getStatusByte(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, identifier); - assertEquals(Test.MATCH, Test.GENERAL_STRING, statusByte); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, identifier); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, statusByte); // Invalid/Null Tests DTC msg = new DTC(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getIdentifier()); - assertNull(Test.NULL, msg.getStatusByte()); + assertNull(TestValues.NULL, msg.getIdentifier()); + assertNull(TestValues.NULL, msg.getStatusByte()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(DTC.KEY_IDENTIFIER, Test.GENERAL_STRING); - reference.put(DTC.KEY_STATUS_BYTE, Test.GENERAL_STRING); + reference.put(DTC.KEY_IDENTIFIER, TestValues.GENERAL_STRING); + reference.put(DTC.KEY_STATUS_BYTE, TestValues.GENERAL_STRING); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DateTimeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DateTimeTests.java index 2cf38b68f..b0bd3a2dd 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DateTimeTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DateTimeTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.DateTime; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,15 +23,15 @@ public class DateTimeTests extends TestCase { public void setUp(){ msg = new DateTime(); - msg.setYear(Test.GENERAL_INT); - msg.setMonth(Test.GENERAL_INT); - msg.setDay(Test.GENERAL_INT); - msg.setHour(Test.GENERAL_INT); - msg.setMinute(Test.GENERAL_INT); - msg.setSecond(Test.GENERAL_INT); - msg.setMilliSecond(Test.GENERAL_INT); - msg.setTzHour(Test.GENERAL_INT); - msg.setTzMinute(Test.GENERAL_INT); + msg.setYear(TestValues.GENERAL_INT); + msg.setMonth(TestValues.GENERAL_INT); + msg.setDay(TestValues.GENERAL_INT); + msg.setHour(TestValues.GENERAL_INT); + msg.setMinute(TestValues.GENERAL_INT); + msg.setSecond(TestValues.GENERAL_INT); + msg.setMilliSecond(TestValues.GENERAL_INT); + msg.setTzHour(TestValues.GENERAL_INT); + msg.setTzMinute(TestValues.GENERAL_INT); } /** @@ -50,48 +50,48 @@ public class DateTimeTests extends TestCase { Integer tzMin = msg.getTzMinute(); // Valid Tests - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, year); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, month); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, day); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, hour); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, min); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, sec); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, ms); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, tzHour); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, tzMin); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, year); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, month); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, day); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, hour); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, min); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, sec); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, ms); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, tzHour); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, tzMin); // Invalid/Null Tests DateTime msg = new DateTime(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getYear()); - assertNull(Test.NULL, msg.getMonth()); - assertNull(Test.NULL, msg.getDay()); - assertNull(Test.NULL, msg.getHour()); - assertNull(Test.NULL, msg.getMinute()); - assertNull(Test.NULL, msg.getSecond()); - assertNull(Test.NULL, msg.getMilliSecond()); - assertNull(Test.NULL, msg.getTzHour()); - assertNull(Test.NULL, msg.getTzMinute()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getYear()); + assertNull(TestValues.NULL, msg.getMonth()); + assertNull(TestValues.NULL, msg.getDay()); + assertNull(TestValues.NULL, msg.getHour()); + assertNull(TestValues.NULL, msg.getMinute()); + assertNull(TestValues.NULL, msg.getSecond()); + assertNull(TestValues.NULL, msg.getMilliSecond()); + assertNull(TestValues.NULL, msg.getTzHour()); + assertNull(TestValues.NULL, msg.getTzMinute()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(DateTime.KEY_YEAR, (Integer) Test.GENERAL_INT); - reference.put(DateTime.KEY_MONTH, (Integer) Test.GENERAL_INT); - reference.put(DateTime.KEY_DAY, (Integer) Test.GENERAL_INT); - reference.put(DateTime.KEY_HOUR, (Integer) Test.GENERAL_INT); - reference.put(DateTime.KEY_MINUTE, (Integer) Test.GENERAL_INT); - reference.put(DateTime.KEY_SECOND, (Integer) Test.GENERAL_INT); - reference.put(DateTime.KEY_MILLISECOND, (Integer) Test.GENERAL_INT); - reference.put(DateTime.KEY_TZ_HOUR, (Integer) Test.GENERAL_INT); - reference.put(DateTime.KEY_TZ_MINUTE, (Integer) Test.GENERAL_INT); + reference.put(DateTime.KEY_YEAR, (Integer) TestValues.GENERAL_INT); + reference.put(DateTime.KEY_MONTH, (Integer) TestValues.GENERAL_INT); + reference.put(DateTime.KEY_DAY, (Integer) TestValues.GENERAL_INT); + reference.put(DateTime.KEY_HOUR, (Integer) TestValues.GENERAL_INT); + reference.put(DateTime.KEY_MINUTE, (Integer) TestValues.GENERAL_INT); + reference.put(DateTime.KEY_SECOND, (Integer) TestValues.GENERAL_INT); + reference.put(DateTime.KEY_MILLISECOND, (Integer) TestValues.GENERAL_INT); + reference.put(DateTime.KEY_TZ_HOUR, (Integer) TestValues.GENERAL_INT); + reference.put(DateTime.KEY_TZ_MINUTE, (Integer) TestValues.GENERAL_INT); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -100,10 +100,10 @@ public class DateTimeTests extends TestCase { Object a = JsonUtils.readObjectFromJsonObject(reference, key); Object b = JsonUtils.readObjectFromJsonObject(underTest, key); - assertEquals(Test.MATCH, a, b); + assertEquals(TestValues.MATCH, a, b); } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceInfoTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceInfoTests.java index dfe75fd30..451f1475e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceInfoTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceInfoTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.DeviceInfo; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,12 +23,12 @@ public class DeviceInfoTests extends TestCase{ public void setUp(){ msg = new DeviceInfo(); - msg.setCarrier(Test.GENERAL_STRING); - msg.setFirmwareRev(Test.GENERAL_STRING); - msg.setHardware(Test.GENERAL_STRING); - msg.setMaxNumberRFCOMMPorts(Test.GENERAL_INT); - msg.setOs(Test.GENERAL_STRING); - msg.setOsVersion(Test.GENERAL_STRING); + msg.setCarrier(TestValues.GENERAL_STRING); + msg.setFirmwareRev(TestValues.GENERAL_STRING); + msg.setHardware(TestValues.GENERAL_STRING); + msg.setMaxNumberRFCOMMPorts(TestValues.GENERAL_INT); + msg.setOs(TestValues.GENERAL_STRING); + msg.setOsVersion(TestValues.GENERAL_STRING); } /** @@ -44,46 +44,46 @@ public class DeviceInfoTests extends TestCase{ int maxNum = msg.getMaxNumberRFCOMMPorts(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, maxNum); - assertEquals(Test.MATCH, Test.GENERAL_STRING, osVer); - assertEquals(Test.MATCH, Test.GENERAL_STRING, os); - assertEquals(Test.MATCH, Test.GENERAL_STRING, firmwareRev); - assertEquals(Test.MATCH, Test.GENERAL_STRING, hardware); - assertEquals(Test.MATCH, Test.GENERAL_STRING, carrier); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, maxNum); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, osVer); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, os); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, firmwareRev); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, hardware); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, carrier); // Invalid/Null Tests DeviceInfo msg = new DeviceInfo(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getCarrier()); - assertNull(Test.NULL, msg.getHardware()); - assertNull(Test.NULL, msg.getFirmwareRev()); - assertNull(Test.NULL, msg.getOs()); - assertNull(Test.NULL, msg.getOsVersion()); - assertNull(Test.NULL, msg.getMaxNumberRFCOMMPorts()); + assertNull(TestValues.NULL, msg.getCarrier()); + assertNull(TestValues.NULL, msg.getHardware()); + assertNull(TestValues.NULL, msg.getFirmwareRev()); + assertNull(TestValues.NULL, msg.getOs()); + assertNull(TestValues.NULL, msg.getOsVersion()); + assertNull(TestValues.NULL, msg.getMaxNumberRFCOMMPorts()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(DeviceInfo.KEY_CARRIER, Test.GENERAL_STRING); - reference.put(DeviceInfo.KEY_HARDWARE, Test.GENERAL_STRING); - reference.put(DeviceInfo.KEY_FIRMWARE_REV, Test.GENERAL_STRING); - reference.put(DeviceInfo.KEY_OS, Test.GENERAL_STRING); - reference.put(DeviceInfo.KEY_OS_VERSION, Test.GENERAL_STRING); - reference.put(DeviceInfo.KEY_MAX_NUMBER_RFCOMM_PORTS, Test.GENERAL_INT); + reference.put(DeviceInfo.KEY_CARRIER, TestValues.GENERAL_STRING); + reference.put(DeviceInfo.KEY_HARDWARE, TestValues.GENERAL_STRING); + reference.put(DeviceInfo.KEY_FIRMWARE_REV, TestValues.GENERAL_STRING); + reference.put(DeviceInfo.KEY_OS, TestValues.GENERAL_STRING); + reference.put(DeviceInfo.KEY_OS_VERSION, TestValues.GENERAL_STRING); + reference.put(DeviceInfo.KEY_MAX_NUMBER_RFCOMM_PORTS, TestValues.GENERAL_INT); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceStatusTests.java index e696e48c2..cc7b23cce 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceStatusTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DeviceStatusTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.proxy.rpc.DeviceStatus; import com.smartdevicelink.proxy.rpc.enums.DeviceLevelStatus; import com.smartdevicelink.proxy.rpc.enums.PrimaryAudioSource; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -25,17 +25,17 @@ public class DeviceStatusTests extends TestCase { public void setUp(){ msg = new DeviceStatus(); - msg.setBattLevelStatus(Test.GENERAL_DEVICELEVELSTATUS); - msg.setBtIconOn(Test.GENERAL_BOOLEAN); - msg.setCallActive(Test.GENERAL_BOOLEAN); - msg.setECallEventActive(Test.GENERAL_BOOLEAN); - msg.setMonoAudioOutputMuted(Test.GENERAL_BOOLEAN); - msg.setPhoneRoaming(Test.GENERAL_BOOLEAN); - msg.setPrimaryAudioSource(Test.GENERAL_PRIMARYAUDIOSOURCE); - msg.setSignalLevelStatus(Test.GENERAL_DEVICELEVELSTATUS); - msg.setStereoAudioOutputMuted(Test.GENERAL_BOOLEAN); - msg.setTextMsgAvailable(Test.GENERAL_BOOLEAN); - msg.setVoiceRecOn(Test.GENERAL_BOOLEAN); + msg.setBattLevelStatus(TestValues.GENERAL_DEVICELEVELSTATUS); + msg.setBtIconOn(TestValues.GENERAL_BOOLEAN); + msg.setCallActive(TestValues.GENERAL_BOOLEAN); + msg.setECallEventActive(TestValues.GENERAL_BOOLEAN); + msg.setMonoAudioOutputMuted(TestValues.GENERAL_BOOLEAN); + msg.setPhoneRoaming(TestValues.GENERAL_BOOLEAN); + msg.setPrimaryAudioSource(TestValues.GENERAL_PRIMARYAUDIOSOURCE); + msg.setSignalLevelStatus(TestValues.GENERAL_DEVICELEVELSTATUS); + msg.setStereoAudioOutputMuted(TestValues.GENERAL_BOOLEAN); + msg.setTextMsgAvailable(TestValues.GENERAL_BOOLEAN); + msg.setVoiceRecOn(TestValues.GENERAL_BOOLEAN); } /** @@ -56,61 +56,61 @@ public class DeviceStatusTests extends TestCase { boolean voiceRec = msg.getVoiceRecOn(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_DEVICELEVELSTATUS, battLevel); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, btIcon); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, callActive); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, ecall); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, monoAudio); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, phoneRoaming); - assertEquals(Test.MATCH, Test.GENERAL_PRIMARYAUDIOSOURCE, primaryAudio); - assertEquals(Test.MATCH, Test.GENERAL_DEVICELEVELSTATUS, signalLevel); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, stereoAudio); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, textAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, voiceRec); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DEVICELEVELSTATUS, battLevel); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, btIcon); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, callActive); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, ecall); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, monoAudio); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, phoneRoaming); + assertEquals(TestValues.MATCH, TestValues.GENERAL_PRIMARYAUDIOSOURCE, primaryAudio); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DEVICELEVELSTATUS, signalLevel); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, stereoAudio); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, textAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, voiceRec); // Invalid/Null Tests DeviceStatus msg = new DeviceStatus(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getBattLevelStatus()); - assertNull(Test.NULL, msg.getBtIconOn()); - assertNull(Test.NULL, msg.getCallActive()); - assertNull(Test.NULL, msg.getECallEventActive()); - assertNull(Test.NULL, msg.getMonoAudioOutputMuted()); - assertNull(Test.NULL, msg.getPhoneRoaming()); - assertNull(Test.NULL, msg.getPrimaryAudioSource()); - assertNull(Test.NULL, msg.getSignalLevelStatus()); - assertNull(Test.NULL, msg.getStereoAudioOutputMuted()); - assertNull(Test.NULL, msg.getTextMsgAvailable()); - assertNull(Test.NULL, msg.getVoiceRecOn()); + assertNull(TestValues.NULL, msg.getBattLevelStatus()); + assertNull(TestValues.NULL, msg.getBtIconOn()); + assertNull(TestValues.NULL, msg.getCallActive()); + assertNull(TestValues.NULL, msg.getECallEventActive()); + assertNull(TestValues.NULL, msg.getMonoAudioOutputMuted()); + assertNull(TestValues.NULL, msg.getPhoneRoaming()); + assertNull(TestValues.NULL, msg.getPrimaryAudioSource()); + assertNull(TestValues.NULL, msg.getSignalLevelStatus()); + assertNull(TestValues.NULL, msg.getStereoAudioOutputMuted()); + assertNull(TestValues.NULL, msg.getTextMsgAvailable()); + assertNull(TestValues.NULL, msg.getVoiceRecOn()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(DeviceStatus.KEY_BATT_LEVEL_STATUS, Test.GENERAL_DEVICELEVELSTATUS); - reference.put(DeviceStatus.KEY_SIGNAL_LEVEL_STATUS, Test.GENERAL_DEVICELEVELSTATUS); - reference.put(DeviceStatus.KEY_PRIMARY_AUDIO_SOURCE, Test.GENERAL_PRIMARYAUDIOSOURCE); - reference.put(DeviceStatus.KEY_BT_ICON_ON, Test.GENERAL_BOOLEAN); - reference.put(DeviceStatus.KEY_CALL_ACTIVE, Test.GENERAL_BOOLEAN); - reference.put(DeviceStatus.KEY_E_CALL_EVENT_ACTIVE, Test.GENERAL_BOOLEAN); - reference.put(DeviceStatus.KEY_MONO_AUDIO_OUTPUT_MUTED, Test.GENERAL_BOOLEAN); - reference.put(DeviceStatus.KEY_STEREO_AUDIO_OUTPUT_MUTED, Test.GENERAL_BOOLEAN); - reference.put(DeviceStatus.KEY_TEXT_MSG_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(DeviceStatus.KEY_PHONE_ROAMING, Test.GENERAL_BOOLEAN); - reference.put(DeviceStatus.KEY_VOICE_REC_ON, Test.GENERAL_BOOLEAN); + reference.put(DeviceStatus.KEY_BATT_LEVEL_STATUS, TestValues.GENERAL_DEVICELEVELSTATUS); + reference.put(DeviceStatus.KEY_SIGNAL_LEVEL_STATUS, TestValues.GENERAL_DEVICELEVELSTATUS); + reference.put(DeviceStatus.KEY_PRIMARY_AUDIO_SOURCE, TestValues.GENERAL_PRIMARYAUDIOSOURCE); + reference.put(DeviceStatus.KEY_BT_ICON_ON, TestValues.GENERAL_BOOLEAN); + reference.put(DeviceStatus.KEY_CALL_ACTIVE, TestValues.GENERAL_BOOLEAN); + reference.put(DeviceStatus.KEY_E_CALL_EVENT_ACTIVE, TestValues.GENERAL_BOOLEAN); + reference.put(DeviceStatus.KEY_MONO_AUDIO_OUTPUT_MUTED, TestValues.GENERAL_BOOLEAN); + reference.put(DeviceStatus.KEY_STEREO_AUDIO_OUTPUT_MUTED, TestValues.GENERAL_BOOLEAN); + reference.put(DeviceStatus.KEY_TEXT_MSG_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(DeviceStatus.KEY_PHONE_ROAMING, TestValues.GENERAL_BOOLEAN); + reference.put(DeviceStatus.KEY_VOICE_REC_ON, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DisplayCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DisplayCapabilitiesTests.java index 4f0256f79..a533df277 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DisplayCapabilitiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DisplayCapabilitiesTests.java @@ -8,7 +8,7 @@ import com.smartdevicelink.proxy.rpc.TextField; import com.smartdevicelink.proxy.rpc.enums.DisplayType; import com.smartdevicelink.proxy.rpc.enums.MediaClockFormat; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -33,15 +33,15 @@ public class DisplayCapabilitiesTests extends TestCase{ public void setUp(){ msg = new DisplayCapabilities(); - msg.setGraphicSupported(Test.GENERAL_BOOLEAN); - msg.setNumCustomPresetsAvailable(Test.GENERAL_INT); - msg.setDisplayType(Test.GENERAL_DISPLAYTYPE); - msg.setDisplayName(Test.GENERAL_STRING); - msg.setImageFields(Test.GENERAL_IMAGEFIELD_LIST); - msg.setTextFields(Test.GENERAL_TEXTFIELD_LIST); - msg.setMediaClockFormats(Test.GENERAL_MEDIACLOCKFORMAT_LIST); - msg.setScreenParams(Test.GENERAL_SCREENPARAMS); - msg.setTemplatesAvailable(Test.GENERAL_STRING_LIST); + msg.setGraphicSupported(TestValues.GENERAL_BOOLEAN); + msg.setNumCustomPresetsAvailable(TestValues.GENERAL_INT); + msg.setDisplayType(TestValues.GENERAL_DISPLAYTYPE); + msg.setDisplayName(TestValues.GENERAL_STRING); + msg.setImageFields(TestValues.GENERAL_IMAGEFIELD_LIST); + msg.setTextFields(TestValues.GENERAL_TEXTFIELD_LIST); + msg.setMediaClockFormats(TestValues.GENERAL_MEDIACLOCKFORMAT_LIST); + msg.setScreenParams(TestValues.GENERAL_SCREENPARAMS); + msg.setTemplatesAvailable(TestValues.GENERAL_STRING_LIST); } /** @@ -60,64 +60,64 @@ public class DisplayCapabilitiesTests extends TestCase{ List<ImageField> imageFields = msg.getImageFields(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, graphicSupported); - assertEquals(Test.MATCH, Test.GENERAL_INT, numPresets); - assertEquals(Test.MATCH, Test.GENERAL_DISPLAYTYPE, displayType); - assertEquals(Test.MATCH, Test.GENERAL_STRING, displayName); - assertTrue(Test.TRUE, Validator.validateScreenParams(Test.GENERAL_SCREENPARAMS, screenParams)); - assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), templatesAvailable.size()); - assertEquals(Test.MATCH, Test.GENERAL_MEDIACLOCKFORMAT_LIST.size(), mediaClock.size()); - assertEquals(Test.MATCH, Test.GENERAL_TEXTFIELD_LIST.size(), textFields.size()); - assertEquals(Test.MATCH, Test.GENERAL_IMAGEFIELD_LIST.size(), imageFields.size()); - - for(int i = 0; i < Test.GENERAL_STRING_LIST.size(); i++){ - assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.get(i), templatesAvailable.get(i)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, graphicSupported); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, numPresets); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DISPLAYTYPE, displayType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, displayName); + assertTrue(TestValues.TRUE, Validator.validateScreenParams(TestValues.GENERAL_SCREENPARAMS, screenParams)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING_LIST.size(), templatesAvailable.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MEDIACLOCKFORMAT_LIST.size(), mediaClock.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_TEXTFIELD_LIST.size(), textFields.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_IMAGEFIELD_LIST.size(), imageFields.size()); + + for(int i = 0; i < TestValues.GENERAL_STRING_LIST.size(); i++){ + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING_LIST.get(i), templatesAvailable.get(i)); } - for(int i = 0; i < Test.GENERAL_MEDIACLOCKFORMAT_LIST.size(); i++){ - assertEquals(Test.MATCH, Test.GENERAL_MEDIACLOCKFORMAT_LIST.get(i), mediaClock.get(i)); + for(int i = 0; i < TestValues.GENERAL_MEDIACLOCKFORMAT_LIST.size(); i++){ + assertEquals(TestValues.MATCH, TestValues.GENERAL_MEDIACLOCKFORMAT_LIST.get(i), mediaClock.get(i)); } - for(int i = 0; i < Test.GENERAL_TEXTFIELD_LIST.size(); i++){ - assertTrue(Test.TRUE, Validator.validateTextFields(Test.GENERAL_TEXTFIELD_LIST.get(i), textFields.get(i))); + for(int i = 0; i < TestValues.GENERAL_TEXTFIELD_LIST.size(); i++){ + assertTrue(TestValues.TRUE, Validator.validateTextFields(TestValues.GENERAL_TEXTFIELD_LIST.get(i), textFields.get(i))); } - for(int i = 0; i < Test.GENERAL_IMAGEFIELD_LIST.size(); i++){ - assertTrue(Test.TRUE, Validator.validateImageFields(Test.GENERAL_IMAGEFIELD_LIST.get(i), imageFields.get(i))); + for(int i = 0; i < TestValues.GENERAL_IMAGEFIELD_LIST.size(); i++){ + assertTrue(TestValues.TRUE, Validator.validateImageFields(TestValues.GENERAL_IMAGEFIELD_LIST.get(i), imageFields.get(i))); } // Invalid/Null Tests DisplayCapabilities msg = new DisplayCapabilities(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getDisplayType()); - assertNull(Test.NULL, msg.getDisplayName()); - assertNull(Test.NULL, msg.getGraphicSupported()); - assertNull(Test.NULL, msg.getImageFields()); - assertNull(Test.NULL, msg.getMediaClockFormats()); - assertNull(Test.NULL, msg.getNumCustomPresetsAvailable()); - assertNull(Test.NULL, msg.getScreenParams()); - assertNull(Test.NULL, msg.getTemplatesAvailable()); - assertNull(Test.NULL, msg.getTextFields()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getDisplayType()); + assertNull(TestValues.NULL, msg.getDisplayName()); + assertNull(TestValues.NULL, msg.getGraphicSupported()); + assertNull(TestValues.NULL, msg.getImageFields()); + assertNull(TestValues.NULL, msg.getMediaClockFormats()); + assertNull(TestValues.NULL, msg.getNumCustomPresetsAvailable()); + assertNull(TestValues.NULL, msg.getScreenParams()); + assertNull(TestValues.NULL, msg.getTemplatesAvailable()); + assertNull(TestValues.NULL, msg.getTextFields()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(DisplayCapabilities.KEY_NUM_CUSTOM_PRESETS_AVAILABLE, Test.GENERAL_INT); - reference.put(DisplayCapabilities.KEY_GRAPHIC_SUPPORTED, Test.GENERAL_BOOLEAN); - reference.put(DisplayCapabilities.KEY_DISPLAY_TYPE, Test.GENERAL_DISPLAYTYPE); - reference.put(DisplayCapabilities.KEY_DISPLAY_NAME, Test.GENERAL_STRING); - reference.put(DisplayCapabilities.KEY_TEMPLATES_AVAILABLE, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST)); - reference.put(DisplayCapabilities.KEY_MEDIA_CLOCK_FORMATS, JsonUtils.createJsonArray(Test.GENERAL_MEDIACLOCKFORMAT_LIST)); - reference.put(DisplayCapabilities.KEY_TEXT_FIELDS, Test.JSON_TEXTFIELDS); - reference.put(DisplayCapabilities.KEY_IMAGE_FIELDS, Test.JSON_IMAGEFIELDS); - reference.put(DisplayCapabilities.KEY_SCREEN_PARAMS, Test.JSON_SCREENPARAMS); + reference.put(DisplayCapabilities.KEY_NUM_CUSTOM_PRESETS_AVAILABLE, TestValues.GENERAL_INT); + reference.put(DisplayCapabilities.KEY_GRAPHIC_SUPPORTED, TestValues.GENERAL_BOOLEAN); + reference.put(DisplayCapabilities.KEY_DISPLAY_TYPE, TestValues.GENERAL_DISPLAYTYPE); + reference.put(DisplayCapabilities.KEY_DISPLAY_NAME, TestValues.GENERAL_STRING); + reference.put(DisplayCapabilities.KEY_TEMPLATES_AVAILABLE, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); + reference.put(DisplayCapabilities.KEY_MEDIA_CLOCK_FORMATS, JsonUtils.createJsonArray(TestValues.GENERAL_MEDIACLOCKFORMAT_LIST)); + reference.put(DisplayCapabilities.KEY_TEXT_FIELDS, TestValues.JSON_TEXTFIELDS); + reference.put(DisplayCapabilities.KEY_IMAGE_FIELDS, TestValues.JSON_IMAGEFIELDS); + reference.put(DisplayCapabilities.KEY_SCREEN_PARAMS, TestValues.JSON_SCREENPARAMS); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -125,49 +125,49 @@ public class DisplayCapabilitiesTests extends TestCase{ if(key.equals(DisplayCapabilities.KEY_IMAGE_FIELDS)){ JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key); JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); - assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length()); + assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length()); for(int i = 0; i < referenceArray.length(); i++){ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i)); Hashtable<String, Object> hashTest= JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); - assertTrue(Test.TRUE, Validator.validateImageFields(new ImageField(hashReference), new ImageField(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateImageFields(new ImageField(hashReference), new ImageField(hashTest))); } } else if(key.equals(DisplayCapabilities.KEY_TEXT_FIELDS)){ JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key); JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); - assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length()); + assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length()); for(int i = 0; i < referenceArray.length(); i++){ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i)); Hashtable<String, Object> hashTest= JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); - assertTrue(Test.TRUE, Validator.validateTextFields(new TextField(hashReference), new TextField(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateTextFields(new TextField(hashReference), new TextField(hashTest))); } } else if(key.equals(DisplayCapabilities.KEY_TEMPLATES_AVAILABLE)){ JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key); JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); - assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length()); - assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key))); + assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length()); + assertTrue(TestValues.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key))); } else if(key.equals(DisplayCapabilities.KEY_SCREEN_PARAMS)){ JSONObject referenceArray = JsonUtils.readJsonObjectFromJsonObject(reference, key); JSONObject underTestArray = JsonUtils.readJsonObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray); Hashtable<String, Object> hashTest= JsonRPCMarshaller.deserializeJSONObject(underTestArray); - assertTrue(Test.TRUE, Validator.validateScreenParams(new ScreenParams(hashReference), new ScreenParams(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateScreenParams(new ScreenParams(hashReference), new ScreenParams(hashTest))); } else if(key.equals(DisplayCapabilities.KEY_MEDIA_CLOCK_FORMATS)){ JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key); JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); - assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length()); + assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length()); for(int i = 0; i < referenceArray.length(); i++){ - assertTrue(Test.TRUE, Validator.validateText(referenceArray.getString(i), underTestArray.getString(i)));// not a string? + assertTrue(TestValues.TRUE, Validator.validateText(referenceArray.getString(i), underTestArray.getString(i)));// not a string? } } else{ - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DisplayCapabilityTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DisplayCapabilityTests.java index 6bb57761f..4d745edbd 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DisplayCapabilityTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DisplayCapabilityTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.rpc.DisplayCapability; import com.smartdevicelink.proxy.rpc.WindowCapability; import com.smartdevicelink.proxy.rpc.WindowTypeCapabilities; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -30,9 +30,9 @@ public class DisplayCapabilityTests extends TestCase { public void setUp() { msg = new DisplayCapability(); - msg.setDisplayName(Test.GENERAL_STRING); - msg.setWindowTypeSupported(Test.GENERAL_WINDOW_TYPE_CAPABILITIES_LIST); - msg.setWindowCapabilities(Test.GENERAL_WINDOW_CAPABILITY_LIST); + msg.setDisplayName(TestValues.GENERAL_STRING); + msg.setWindowTypeSupported(TestValues.GENERAL_WINDOW_TYPE_CAPABILITIES_LIST); + msg.setWindowCapabilities(TestValues.GENERAL_WINDOW_CAPABILITY_LIST); } /** @@ -45,37 +45,37 @@ public class DisplayCapabilityTests extends TestCase { List<WindowCapability> windowCapabilities = msg.getWindowCapabilities(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, displayName); - assertEquals(Test.MATCH, Test.GENERAL_WINDOW_TYPE_CAPABILITIES_LIST.size(), windowTypeSupported.size()); - assertEquals(Test.MATCH, Test.GENERAL_WINDOW_CAPABILITY_LIST.size(), windowCapabilities.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, displayName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_WINDOW_TYPE_CAPABILITIES_LIST.size(), windowTypeSupported.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_WINDOW_CAPABILITY_LIST.size(), windowCapabilities.size()); - for (int i = 0; i < Test.GENERAL_WINDOW_TYPE_CAPABILITIES_LIST.size(); i++) { - assertTrue(Test.TRUE, Validator.validateWindowTypeCapabilities(Test.GENERAL_WINDOW_TYPE_CAPABILITIES_LIST.get(i), windowTypeSupported.get(i))); + for (int i = 0; i < TestValues.GENERAL_WINDOW_TYPE_CAPABILITIES_LIST.size(); i++) { + assertTrue(TestValues.TRUE, Validator.validateWindowTypeCapabilities(TestValues.GENERAL_WINDOW_TYPE_CAPABILITIES_LIST.get(i), windowTypeSupported.get(i))); } - for (int i = 0; i < Test.GENERAL_WINDOW_CAPABILITY_LIST.size(); i++) { - assertTrue(Test.TRUE, Validator.validateWindowCapability(Test.GENERAL_WINDOW_CAPABILITY_LIST.get(i), windowCapabilities.get(i))); + for (int i = 0; i < TestValues.GENERAL_WINDOW_CAPABILITY_LIST.size(); i++) { + assertTrue(TestValues.TRUE, Validator.validateWindowCapability(TestValues.GENERAL_WINDOW_CAPABILITY_LIST.get(i), windowCapabilities.get(i))); } // Invalid/Null Tests DisplayCapability msg = new DisplayCapability(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getDisplayName()); - assertNull(Test.NULL, msg.getWindowTypeSupported()); - assertNull(Test.NULL, msg.getWindowCapabilities()); + assertNull(TestValues.NULL, msg.getDisplayName()); + assertNull(TestValues.NULL, msg.getWindowTypeSupported()); + assertNull(TestValues.NULL, msg.getWindowCapabilities()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(DisplayCapability.KEY_DISPLAY_NAME, Test.GENERAL_STRING); - reference.put(DisplayCapability.KEY_WINDOW_TYPE_SUPPORTED, Test.JSON_WINDOW_TYPE_CAPABILITIES_LIST); - reference.put(DisplayCapability.KEY_WINDOW_CAPABILITIES, Test.JSON_WINDOW_CAPABILITIES); + reference.put(DisplayCapability.KEY_DISPLAY_NAME, TestValues.GENERAL_STRING); + reference.put(DisplayCapability.KEY_WINDOW_TYPE_SUPPORTED, TestValues.JSON_WINDOW_TYPE_CAPABILITIES_LIST); + reference.put(DisplayCapability.KEY_WINDOW_CAPABILITIES, TestValues.JSON_WINDOW_CAPABILITIES); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { @@ -83,29 +83,29 @@ public class DisplayCapabilityTests extends TestCase { if (key.equals(DisplayCapability.KEY_WINDOW_TYPE_SUPPORTED)) { JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key); JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); - assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length()); + assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length()); for (int i = 0; i < referenceArray.length(); i++) { Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i)); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); - assertTrue(Test.TRUE, Validator.validateWindowTypeCapabilities(new WindowTypeCapabilities(hashReference), new WindowTypeCapabilities(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateWindowTypeCapabilities(new WindowTypeCapabilities(hashReference), new WindowTypeCapabilities(hashTest))); } } else if (key.equals(DisplayCapability.KEY_WINDOW_CAPABILITIES)) { JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key); JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); - assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length()); + assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length()); for (int i = 0; i < referenceArray.length(); i++) { Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i)); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); - assertTrue(Test.TRUE, Validator.validateWindowCapability(new WindowCapability(hashReference), new WindowCapability(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateWindowCapability(new WindowCapability(hashReference), new WindowCapability(hashTest))); } } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ECallInfoTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ECallInfoTests.java index 229b2300d..31b068570 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ECallInfoTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ECallInfoTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.proxy.rpc.ECallInfo; import com.smartdevicelink.proxy.rpc.enums.ECallConfirmationStatus; import com.smartdevicelink.proxy.rpc.enums.VehicleDataNotificationStatus; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -25,9 +25,9 @@ public class ECallInfoTests extends TestCase{ public void setUp(){ msg = new ECallInfo(); - msg.setAuxECallNotificationStatus(Test.GENERAL_VEHICLEDATANOTIFICATIONSTATUS); - msg.setECallConfirmationStatus(Test.GENERAL_ECALLCONFIRMATIONSTATUS); - msg.setECallNotificationStatus(Test.GENERAL_VEHICLEDATANOTIFICATIONSTATUS); + msg.setAuxECallNotificationStatus(TestValues.GENERAL_VEHICLEDATANOTIFICATIONSTATUS); + msg.setECallConfirmationStatus(TestValues.GENERAL_ECALLCONFIRMATIONSTATUS); + msg.setECallNotificationStatus(TestValues.GENERAL_VEHICLEDATANOTIFICATIONSTATUS); } /** @@ -40,37 +40,37 @@ public class ECallInfoTests extends TestCase{ ECallConfirmationStatus ecallConfirm = msg.getECallConfirmationStatus(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_VEHICLEDATANOTIFICATIONSTATUS, auxEcall); - assertEquals(Test.MATCH, Test.GENERAL_VEHICLEDATANOTIFICATIONSTATUS, ecallNotify); - assertEquals(Test.MATCH, Test.GENERAL_ECALLCONFIRMATIONSTATUS, ecallConfirm); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHICLEDATANOTIFICATIONSTATUS, auxEcall); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHICLEDATANOTIFICATIONSTATUS, ecallNotify); + assertEquals(TestValues.MATCH, TestValues.GENERAL_ECALLCONFIRMATIONSTATUS, ecallConfirm); // Invalid/Null Tests ECallInfo msg = new ECallInfo(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getECallConfirmationStatus()); - assertNull(Test.NULL, msg.getECallNotificationStatus()); - assertNull(Test.NULL, msg.getAuxECallNotificationStatus()); + assertNull(TestValues.NULL, msg.getECallConfirmationStatus()); + assertNull(TestValues.NULL, msg.getECallNotificationStatus()); + assertNull(TestValues.NULL, msg.getAuxECallNotificationStatus()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(ECallInfo.KEY_AUX_E_CALL_NOTIFICATION_STATUS, Test.GENERAL_VEHICLEDATANOTIFICATIONSTATUS); - reference.put(ECallInfo.KEY_E_CALL_NOTIFICATION_STATUS, Test.GENERAL_VEHICLEDATANOTIFICATIONSTATUS); - reference.put(ECallInfo.KEY_E_CALL_CONFIRMATION_STATUS, Test.GENERAL_ECALLCONFIRMATIONSTATUS); + reference.put(ECallInfo.KEY_AUX_E_CALL_NOTIFICATION_STATUS, TestValues.GENERAL_VEHICLEDATANOTIFICATIONSTATUS); + reference.put(ECallInfo.KEY_E_CALL_NOTIFICATION_STATUS, TestValues.GENERAL_VEHICLEDATANOTIFICATIONSTATUS); + reference.put(ECallInfo.KEY_E_CALL_CONFIRMATION_STATUS, TestValues.GENERAL_ECALLCONFIRMATIONSTATUS); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EmergencyEventTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EmergencyEventTests.java index 1380c211d..60b2ee390 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EmergencyEventTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EmergencyEventTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.rpc.enums.EmergencyEventType; import com.smartdevicelink.proxy.rpc.enums.FuelCutoffStatus; import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -26,11 +26,11 @@ public class EmergencyEventTests extends TestCase{ public void setUp(){ msg = new EmergencyEvent(); - msg.setEmergencyEventType(Test.GENERAL_EMERGENCYEVENTTYPE); - msg.setFuelCutoffStatus(Test.GENERAL_FUELCUTOFFSTATUS); - msg.setMaximumChangeVelocity(Test.GENERAL_INT); - msg.setMultipleEvents(Test.GENERAL_VEHCILEDATAEVENTSTATUS); - msg.setRolloverEvent(Test.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setEmergencyEventType(TestValues.GENERAL_EMERGENCYEVENTTYPE); + msg.setFuelCutoffStatus(TestValues.GENERAL_FUELCUTOFFSTATUS); + msg.setMaximumChangeVelocity(TestValues.GENERAL_INT); + msg.setMultipleEvents(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + msg.setRolloverEvent(TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); } /** @@ -45,43 +45,43 @@ public class EmergencyEventTests extends TestCase{ VehicleDataEventStatus rollover = msg.getRolloverEvent(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_EMERGENCYEVENTTYPE, type); - assertEquals(Test.MATCH, Test.GENERAL_FUELCUTOFFSTATUS, cutoffStatus); - assertEquals(Test.MATCH, Test.GENERAL_INT, changeVelocity); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, multipleEvents); - assertEquals(Test.MATCH, Test.GENERAL_VEHCILEDATAEVENTSTATUS, rollover); + assertEquals(TestValues.MATCH, TestValues.GENERAL_EMERGENCYEVENTTYPE, type); + assertEquals(TestValues.MATCH, TestValues.GENERAL_FUELCUTOFFSTATUS, cutoffStatus); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, changeVelocity); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, multipleEvents); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS, rollover); // Invalid/Null Tests EmergencyEvent msg = new EmergencyEvent(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getEmergencyEventType()); - assertNull(Test.NULL, msg.getFuelCutoffStatus()); - assertNull(Test.NULL, msg.getMaximumChangeVelocity()); - assertNull(Test.NULL, msg.getMultipleEvents()); - assertNull(Test.NULL, msg.getRolloverEvent()); + assertNull(TestValues.NULL, msg.getEmergencyEventType()); + assertNull(TestValues.NULL, msg.getFuelCutoffStatus()); + assertNull(TestValues.NULL, msg.getMaximumChangeVelocity()); + assertNull(TestValues.NULL, msg.getMultipleEvents()); + assertNull(TestValues.NULL, msg.getRolloverEvent()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(EmergencyEvent.KEY_FUEL_CUTOFF_STATUS, Test.GENERAL_FUELCUTOFFSTATUS); - reference.put(EmergencyEvent.KEY_MULTIPLE_EVENTS, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(EmergencyEvent.KEY_ROLLOVER_EVENT, Test.GENERAL_VEHCILEDATAEVENTSTATUS); - reference.put(EmergencyEvent.KEY_EMERGENCY_EVENT_TYPE, Test.GENERAL_EMERGENCYEVENTTYPE); - reference.put(EmergencyEvent.KEY_MAXIMUM_CHANGE_VELOCITY, Test.GENERAL_INT); + reference.put(EmergencyEvent.KEY_FUEL_CUTOFF_STATUS, TestValues.GENERAL_FUELCUTOFFSTATUS); + reference.put(EmergencyEvent.KEY_MULTIPLE_EVENTS, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(EmergencyEvent.KEY_ROLLOVER_EVENT, TestValues.GENERAL_VEHCILEDATAEVENTSTATUS); + reference.put(EmergencyEvent.KEY_EMERGENCY_EVENT_TYPE, TestValues.GENERAL_EMERGENCYEVENTTYPE); + reference.put(EmergencyEvent.KEY_MAXIMUM_CHANGE_VELOCITY, TestValues.GENERAL_INT); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EqualizerSettingsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EqualizerSettingsTests.java index a803b1ded..f15e74962 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EqualizerSettingsTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EqualizerSettingsTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.EqualizerSettings; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,9 +23,9 @@ public class EqualizerSettingsTests extends TestCase { public void setUp() { msg = new EqualizerSettings(); - msg.setChannelId(Test.GENERAL_INT); - msg.setChannelName(Test.GENERAL_STRING); - msg.setChannelSetting(Test.GENERAL_INT); + msg.setChannelId(TestValues.GENERAL_INT); + msg.setChannelName(TestValues.GENERAL_STRING); + msg.setChannelSetting(TestValues.GENERAL_INT); } /** @@ -39,17 +39,17 @@ public class EqualizerSettingsTests extends TestCase { int channelSetting = msg.getChannelSetting(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, channelId); - assertEquals(Test.MATCH, Test.GENERAL_STRING, channelName); - assertEquals(Test.MATCH, Test.GENERAL_INT, channelSetting); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, channelId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, channelName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, channelSetting); // Invalid/Null Tests EqualizerSettings msg = new EqualizerSettings(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getChannelId()); - assertNull(Test.NULL, msg.getChannelName()); - assertNull(Test.NULL, msg.getChannelSetting()); + assertNull(TestValues.NULL, msg.getChannelId()); + assertNull(TestValues.NULL, msg.getChannelName()); + assertNull(TestValues.NULL, msg.getChannelSetting()); } public void testJson() { @@ -57,22 +57,22 @@ public class EqualizerSettingsTests extends TestCase { try { - reference.put(EqualizerSettings.KEY_CHANNEL_ID, Test.GENERAL_INT); - reference.put(EqualizerSettings.KEY_CHANNEL_NAME, Test.GENERAL_STRING); - reference.put(EqualizerSettings.KEY_CHANNEL_SETTING, Test.GENERAL_INT); + reference.put(EqualizerSettings.KEY_CHANNEL_ID, TestValues.GENERAL_INT); + reference.put(EqualizerSettings.KEY_CHANNEL_NAME, TestValues.GENERAL_STRING); + reference.put(EqualizerSettings.KEY_CHANNEL_SETTING, TestValues.GENERAL_INT); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/FuelRangeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/FuelRangeTests.java index 2dffd2f5b..f8bb07caf 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/FuelRangeTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/FuelRangeTests.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.FuelRange; import com.smartdevicelink.proxy.rpc.enums.FuelType; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -24,8 +24,8 @@ public class FuelRangeTests extends TestCase{ public void setUp(){ msg = new FuelRange(); - msg.setType(Test.GENERAL_FUELTYPE); - msg.setRange(Test.GENERAL_FLOAT); + msg.setType(TestValues.GENERAL_FUELTYPE); + msg.setRange(TestValues.GENERAL_FLOAT); } /** @@ -37,35 +37,35 @@ public class FuelRangeTests extends TestCase{ float range = msg.getRange(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_FLOAT, range); - assertEquals(Test.MATCH, Test.GENERAL_FUELTYPE, fuelType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_FLOAT, range); + assertEquals(TestValues.MATCH, TestValues.GENERAL_FUELTYPE, fuelType); // Invalid/Null Tests FuelRange msg = new FuelRange(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getType()); - assertNull(Test.NULL, msg.getRange()); + assertNull(TestValues.NULL, msg.getType()); + assertNull(TestValues.NULL, msg.getRange()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(FuelRange.KEY_TYPE, Test.GENERAL_FUELTYPE); - reference.put(FuelRange.KEY_RANGE, (Float) Test.GENERAL_FLOAT); + reference.put(FuelRange.KEY_TYPE, TestValues.GENERAL_FUELTYPE); + reference.put(FuelRange.KEY_RANGE, (Float) TestValues.GENERAL_FLOAT); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GPSDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GPSDataTests.java index 357e178c0..050473ad6 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GPSDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GPSDataTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.proxy.rpc.GPSData; import com.smartdevicelink.proxy.rpc.enums.CompassDirection; import com.smartdevicelink.proxy.rpc.enums.Dimension; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -25,25 +25,25 @@ public class GPSDataTests extends TestCase{ public void setUp(){ msg = new GPSData(); - msg.setActual(Test.GENERAL_BOOLEAN); - msg.setAltitude(Test.GENERAL_DOUBLE); - msg.setCompassDirection(Test.GENERAL_COMPASSDIRECTION); - msg.setDimension(Test.GENERAL_DIMENSION); - msg.setHdop(Test.GENERAL_DOUBLE); - msg.setHeading(Test.GENERAL_DOUBLE); - msg.setLatitudeDegrees(Test.GENERAL_DOUBLE); - msg.setLongitudeDegrees(Test.GENERAL_DOUBLE); - msg.setPdop(Test.GENERAL_DOUBLE); - msg.setSatellites(Test.GENERAL_INT); - msg.setSpeed(Test.GENERAL_DOUBLE); - msg.setUtcDay(Test.GENERAL_INT); - msg.setUtcHours(Test.GENERAL_INT); - msg.setUtcMinutes(Test.GENERAL_INT); - msg.setUtcMonth(Test.GENERAL_INT); - msg.setUtcSeconds(Test.GENERAL_INT); - msg.setUtcYear(Test.GENERAL_INT); - msg.setVdop(Test.GENERAL_DOUBLE); - msg.setShifted(Test.GENERAL_BOOLEAN); + msg.setActual(TestValues.GENERAL_BOOLEAN); + msg.setAltitude(TestValues.GENERAL_DOUBLE); + msg.setCompassDirection(TestValues.GENERAL_COMPASSDIRECTION); + msg.setDimension(TestValues.GENERAL_DIMENSION); + msg.setHdop(TestValues.GENERAL_DOUBLE); + msg.setHeading(TestValues.GENERAL_DOUBLE); + msg.setLatitudeDegrees(TestValues.GENERAL_DOUBLE); + msg.setLongitudeDegrees(TestValues.GENERAL_DOUBLE); + msg.setPdop(TestValues.GENERAL_DOUBLE); + msg.setSatellites(TestValues.GENERAL_INT); + msg.setSpeed(TestValues.GENERAL_DOUBLE); + msg.setUtcDay(TestValues.GENERAL_INT); + msg.setUtcHours(TestValues.GENERAL_INT); + msg.setUtcMinutes(TestValues.GENERAL_INT); + msg.setUtcMonth(TestValues.GENERAL_INT); + msg.setUtcSeconds(TestValues.GENERAL_INT); + msg.setUtcYear(TestValues.GENERAL_INT); + msg.setVdop(TestValues.GENERAL_DOUBLE); + msg.setShifted(TestValues.GENERAL_BOOLEAN); } /** @@ -72,85 +72,85 @@ public class GPSDataTests extends TestCase{ boolean shifted = msg.getShifted(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, actual); - assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, latitude); - assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, longitude); - assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, altitude); - assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, heading); - assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, speed); - assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, pdop); - assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, hdop); - assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, vdop); - assertEquals(Test.MATCH, Test.GENERAL_INT, utcYear); - assertEquals(Test.MATCH, Test.GENERAL_INT, utcMin); - assertEquals(Test.MATCH, Test.GENERAL_INT, utcMonths); - assertEquals(Test.MATCH, Test.GENERAL_INT, utcDay); - assertEquals(Test.MATCH, Test.GENERAL_INT, utcHours); - assertEquals(Test.MATCH, Test.GENERAL_INT, utcSec); - assertEquals(Test.MATCH, Test.GENERAL_INT, satellites); - assertEquals(Test.MATCH, Test.GENERAL_DIMENSION, dimension); - assertEquals(Test.MATCH, Test.GENERAL_COMPASSDIRECTION, direction); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, shifted); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, actual); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DOUBLE, latitude); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DOUBLE, longitude); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DOUBLE, altitude); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DOUBLE, heading); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DOUBLE, speed); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DOUBLE, pdop); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DOUBLE, hdop); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DOUBLE, vdop); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, utcYear); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, utcMin); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, utcMonths); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, utcDay); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, utcHours); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, utcSec); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, satellites); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DIMENSION, dimension); + assertEquals(TestValues.MATCH, TestValues.GENERAL_COMPASSDIRECTION, direction); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, shifted); // Invalid/Null Tests GPSData msg = new GPSData(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getActual()); - assertNull(Test.NULL, msg.getAltitude()); - assertNull(Test.NULL, msg.getCompassDirection()); - assertNull(Test.NULL, msg.getDimension()); - assertNull(Test.NULL, msg.getHdop()); - assertNull(Test.NULL, msg.getHeading()); - assertNull(Test.NULL, msg.getLatitudeDegrees()); - assertNull(Test.NULL, msg.getLongitudeDegrees()); - assertNull(Test.NULL, msg.getPdop()); - assertNull(Test.NULL, msg.getSatellites()); - assertNull(Test.NULL, msg.getSpeed()); - assertNull(Test.NULL, msg.getUtcDay()); - assertNull(Test.NULL, msg.getUtcHours()); - assertNull(Test.NULL, msg.getUtcMinutes()); - assertNull(Test.NULL, msg.getUtcMonth()); - assertNull(Test.NULL, msg.getUtcSeconds()); - assertNull(Test.NULL, msg.getUtcYear()); - assertNull(Test.NULL, msg.getVdop()); - assertNull(Test.NULL, msg.getShifted()); + assertNull(TestValues.NULL, msg.getActual()); + assertNull(TestValues.NULL, msg.getAltitude()); + assertNull(TestValues.NULL, msg.getCompassDirection()); + assertNull(TestValues.NULL, msg.getDimension()); + assertNull(TestValues.NULL, msg.getHdop()); + assertNull(TestValues.NULL, msg.getHeading()); + assertNull(TestValues.NULL, msg.getLatitudeDegrees()); + assertNull(TestValues.NULL, msg.getLongitudeDegrees()); + assertNull(TestValues.NULL, msg.getPdop()); + assertNull(TestValues.NULL, msg.getSatellites()); + assertNull(TestValues.NULL, msg.getSpeed()); + assertNull(TestValues.NULL, msg.getUtcDay()); + assertNull(TestValues.NULL, msg.getUtcHours()); + assertNull(TestValues.NULL, msg.getUtcMinutes()); + assertNull(TestValues.NULL, msg.getUtcMonth()); + assertNull(TestValues.NULL, msg.getUtcSeconds()); + assertNull(TestValues.NULL, msg.getUtcYear()); + assertNull(TestValues.NULL, msg.getVdop()); + assertNull(TestValues.NULL, msg.getShifted()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(GPSData.KEY_ACTUAL, Test.GENERAL_BOOLEAN); - reference.put(GPSData.KEY_LATITUDE_DEGREES, Test.GENERAL_DOUBLE); - reference.put(GPSData.KEY_LONGITUDE_DEGREES, Test.GENERAL_DOUBLE); - reference.put(GPSData.KEY_ALTITUDE, Test.GENERAL_DOUBLE); - reference.put(GPSData.KEY_HEADING, Test.GENERAL_DOUBLE); - reference.put(GPSData.KEY_SPEED, Test.GENERAL_DOUBLE); - reference.put(GPSData.KEY_PDOP, Test.GENERAL_DOUBLE); - reference.put(GPSData.KEY_HDOP, Test.GENERAL_DOUBLE); - reference.put(GPSData.KEY_VDOP, Test.GENERAL_DOUBLE); - reference.put(GPSData.KEY_UTC_YEAR, Test.GENERAL_INT); - reference.put(GPSData.KEY_UTC_MONTH, Test.GENERAL_INT); - reference.put(GPSData.KEY_UTC_HOURS, Test.GENERAL_INT); - reference.put(GPSData.KEY_UTC_DAY, Test.GENERAL_INT); - reference.put(GPSData.KEY_UTC_MINUTES, Test.GENERAL_INT); - reference.put(GPSData.KEY_UTC_SECONDS, Test.GENERAL_INT); - reference.put(GPSData.KEY_SATELLITES, Test.GENERAL_INT); - reference.put(GPSData.KEY_DIMENSION, Test.GENERAL_DIMENSION); - reference.put(GPSData.KEY_COMPASS_DIRECTION, Test.GENERAL_COMPASSDIRECTION); - reference.put(GPSData.KEY_SHIFTED, Test.GENERAL_BOOLEAN); + reference.put(GPSData.KEY_ACTUAL, TestValues.GENERAL_BOOLEAN); + reference.put(GPSData.KEY_LATITUDE_DEGREES, TestValues.GENERAL_DOUBLE); + reference.put(GPSData.KEY_LONGITUDE_DEGREES, TestValues.GENERAL_DOUBLE); + reference.put(GPSData.KEY_ALTITUDE, TestValues.GENERAL_DOUBLE); + reference.put(GPSData.KEY_HEADING, TestValues.GENERAL_DOUBLE); + reference.put(GPSData.KEY_SPEED, TestValues.GENERAL_DOUBLE); + reference.put(GPSData.KEY_PDOP, TestValues.GENERAL_DOUBLE); + reference.put(GPSData.KEY_HDOP, TestValues.GENERAL_DOUBLE); + reference.put(GPSData.KEY_VDOP, TestValues.GENERAL_DOUBLE); + reference.put(GPSData.KEY_UTC_YEAR, TestValues.GENERAL_INT); + reference.put(GPSData.KEY_UTC_MONTH, TestValues.GENERAL_INT); + reference.put(GPSData.KEY_UTC_HOURS, TestValues.GENERAL_INT); + reference.put(GPSData.KEY_UTC_DAY, TestValues.GENERAL_INT); + reference.put(GPSData.KEY_UTC_MINUTES, TestValues.GENERAL_INT); + reference.put(GPSData.KEY_UTC_SECONDS, TestValues.GENERAL_INT); + reference.put(GPSData.KEY_SATELLITES, TestValues.GENERAL_INT); + reference.put(GPSData.KEY_DIMENSION, TestValues.GENERAL_DIMENSION); + reference.put(GPSData.KEY_COMPASS_DIRECTION, TestValues.GENERAL_COMPASSDIRECTION); + reference.put(GPSData.KEY_SHIFTED, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GridTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GridTests.java index 1d9bccf92..ab45ec434 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GridTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GridTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.rpc.Grid; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -18,12 +18,12 @@ public class GridTests extends TestCase { @Override public void setUp() { msg = new Grid(); - msg.setCol(Test.GENERAL_INT); - msg.setRow(Test.GENERAL_INT); - msg.setLevel(Test.GENERAL_INT); - msg.setColSpan(Test.GENERAL_INT); - msg.setRowSpan(Test.GENERAL_INT); - msg.setLevelSpan(Test.GENERAL_INT); + msg.setCol(TestValues.GENERAL_INT); + msg.setRow(TestValues.GENERAL_INT); + msg.setLevel(TestValues.GENERAL_INT); + msg.setColSpan(TestValues.GENERAL_INT); + msg.setRowSpan(TestValues.GENERAL_INT); + msg.setLevelSpan(TestValues.GENERAL_INT); } public void testRpcValues() { @@ -35,39 +35,39 @@ public class GridTests extends TestCase { int levelSpan = msg.getLevelSpan(); //valid tests - assertEquals(Test.MATCH, col, Test.GENERAL_INT); - assertEquals(Test.MATCH, row, Test.GENERAL_INT); - assertEquals(Test.MATCH, level, Test.GENERAL_INT); - assertEquals(Test.MATCH, colSpan, Test.GENERAL_INT); - assertEquals(Test.MATCH, rowSpan, Test.GENERAL_INT); - assertEquals(Test.MATCH, levelSpan, Test.GENERAL_INT); + assertEquals(TestValues.MATCH, col, TestValues.GENERAL_INT); + assertEquals(TestValues.MATCH, row, TestValues.GENERAL_INT); + assertEquals(TestValues.MATCH, level, TestValues.GENERAL_INT); + assertEquals(TestValues.MATCH, colSpan, TestValues.GENERAL_INT); + assertEquals(TestValues.MATCH, rowSpan, TestValues.GENERAL_INT); + assertEquals(TestValues.MATCH, levelSpan, TestValues.GENERAL_INT); //null tests Grid msg = new Grid(); - assertNull(Test.NULL, msg.getCol()); - assertNull(Test.NULL, msg.getRow()); - assertNull(Test.NULL, msg.getLevel()); - assertNull(Test.NULL, msg.getColSpan()); - assertNull(Test.NULL, msg.getRowSpan()); - assertNull(Test.NULL, msg.getLevelSpan()); + assertNull(TestValues.NULL, msg.getCol()); + assertNull(TestValues.NULL, msg.getRow()); + assertNull(TestValues.NULL, msg.getLevel()); + assertNull(TestValues.NULL, msg.getColSpan()); + assertNull(TestValues.NULL, msg.getRowSpan()); + assertNull(TestValues.NULL, msg.getLevelSpan()); //test required constructor - Grid msg2 = new Grid(Test.GENERAL_INT, Test.GENERAL_INT); + Grid msg2 = new Grid(TestValues.GENERAL_INT, TestValues.GENERAL_INT); int row2 = msg2.getRow(); int col2 = msg2.getCol(); - assertEquals(Test.MATCH, col2, Test.GENERAL_INT); - assertEquals(Test.MATCH, row2, Test.GENERAL_INT); + assertEquals(TestValues.MATCH, col2, TestValues.GENERAL_INT); + assertEquals(TestValues.MATCH, row2, TestValues.GENERAL_INT); } public void testJson() { JSONObject original = new JSONObject(); try { - original.put(Grid.KEY_COL, Test.GENERAL_INT); - original.put(Grid.KEY_ROW, Test.GENERAL_INT); - original.put(Grid.KEY_LEVEL, Test.GENERAL_INT); - original.put(Grid.KEY_COL_SPAN, Test.GENERAL_INT); - original.put(Grid.KEY_ROW_SPAN, Test.GENERAL_INT); - original.put(Grid.KEY_LEVEL_SPAN, Test.GENERAL_INT); + original.put(Grid.KEY_COL, TestValues.GENERAL_INT); + original.put(Grid.KEY_ROW, TestValues.GENERAL_INT); + original.put(Grid.KEY_LEVEL, TestValues.GENERAL_INT); + original.put(Grid.KEY_COL_SPAN, TestValues.GENERAL_INT); + original.put(Grid.KEY_ROW_SPAN, TestValues.GENERAL_INT); + original.put(Grid.KEY_LEVEL_SPAN, TestValues.GENERAL_INT); JSONObject serialized = msg.serializeJSON(); assertEquals(serialized.length(), original.length()); @@ -80,21 +80,21 @@ public class GridTests extends TestCase { grid1 = new Grid(JsonRPCMarshaller.deserializeJSONObject(original)); grid2 = new Grid(JsonRPCMarshaller.deserializeJSONObject(serialized)); if (key.equals(Grid.KEY_COL)) { - assertEquals(Test.MATCH, grid1.getCol(), grid2.getCol()); + assertEquals(TestValues.MATCH, grid1.getCol(), grid2.getCol()); } else if (key.equals(Grid.KEY_ROW)) { - assertEquals(Test.MATCH, grid1.getRow(), grid2.getRow()); + assertEquals(TestValues.MATCH, grid1.getRow(), grid2.getRow()); } else if (key.equals(Grid.KEY_LEVEL)) { - assertEquals(Test.MATCH, grid1.getLevel(), grid2.getLevel()); + assertEquals(TestValues.MATCH, grid1.getLevel(), grid2.getLevel()); } else if (key.equals(Grid.KEY_COL_SPAN)) { - assertEquals(Test.MATCH, grid1.getColSpan(), grid2.getColSpan()); + assertEquals(TestValues.MATCH, grid1.getColSpan(), grid2.getColSpan()); } else if (key.equals(Grid.KEY_ROW_SPAN)) { - assertEquals(Test.MATCH, grid1.getRowSpan(), grid2.getRowSpan()); + assertEquals(TestValues.MATCH, grid1.getRowSpan(), grid2.getRowSpan()); } else if (key.equals(Grid.KEY_LEVEL_SPAN)) { - assertEquals(Test.MATCH, grid1.getLevelSpan(), grid2.getLevelSpan()); + assertEquals(TestValues.MATCH, grid1.getLevelSpan(), grid2.getLevelSpan()); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMICapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMICapabilitiesTests.java index cc4813caa..87c83cb74 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMICapabilitiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMICapabilitiesTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.HMICapabilities; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -20,9 +20,9 @@ public class HMICapabilitiesTests extends TestCase { public void setUp(){ msg = new HMICapabilities(); - msg.setNavigationAvilable(Test.GENERAL_BOOLEAN); - msg.setPhoneCallAvilable(Test.GENERAL_BOOLEAN); - msg.setVideoStreamingAvailable(Test.GENERAL_BOOLEAN); + msg.setNavigationAvilable(TestValues.GENERAL_BOOLEAN); + msg.setPhoneCallAvilable(TestValues.GENERAL_BOOLEAN); + msg.setVideoStreamingAvailable(TestValues.GENERAL_BOOLEAN); } /** @@ -35,13 +35,13 @@ public class HMICapabilitiesTests extends TestCase { Boolean vidStreamAvail = msg.isVideoStreamingAvailable(); // Valid Tests - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, navAvail); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, phoneAvail); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, vidStreamAvail); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, navAvail); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, phoneAvail); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, vidStreamAvail); // Invalid/Null Tests HMICapabilities msg = new HMICapabilities(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); assertFalse(msg.isNavigationAvailable()); assertFalse(msg.isPhoneCallAvailable()); @@ -52,23 +52,23 @@ public class HMICapabilitiesTests extends TestCase { JSONObject reference = new JSONObject(); try{ - reference.put(KEY_NAVIGATION, Test.GENERAL_BOOLEAN); - reference.put(HMICapabilities.KEY_PHONE_CALL, Test.GENERAL_BOOLEAN); - reference.put(HMICapabilities.KEY_VIDEO_STREAMING, Test.GENERAL_BOOLEAN); + reference.put(KEY_NAVIGATION, TestValues.GENERAL_BOOLEAN); + reference.put(HMICapabilities.KEY_PHONE_CALL, TestValues.GENERAL_BOOLEAN); + reference.put(HMICapabilities.KEY_VIDEO_STREAMING, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); - assertEquals(Test.MATCH, JsonUtils.readStringListFromJsonObject(reference, KEY_NAVIGATION), + assertEquals(TestValues.MATCH, JsonUtils.readStringListFromJsonObject(reference, KEY_NAVIGATION), JsonUtils.readStringListFromJsonObject(underTest, KEY_NAVIGATION)); - assertEquals(Test.MATCH, JsonUtils.readStringListFromJsonObject(reference, KEY_PHONE_CALL), + assertEquals(TestValues.MATCH, JsonUtils.readStringListFromJsonObject(reference, KEY_PHONE_CALL), JsonUtils.readStringListFromJsonObject(underTest, KEY_PHONE_CALL)); - assertEquals(Test.MATCH, JsonUtils.readStringListFromJsonObject(reference, KEY_VIDEO_STREAMING), + assertEquals(TestValues.MATCH, JsonUtils.readStringListFromJsonObject(reference, KEY_VIDEO_STREAMING), JsonUtils.readStringListFromJsonObject(underTest, KEY_VIDEO_STREAMING)); } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMIPermissionsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMIPermissionsTests.java index 7c66ba6c7..3a73e425f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMIPermissionsTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMIPermissionsTests.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.HMIPermissions; import com.smartdevicelink.proxy.rpc.enums.HMILevel; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -25,8 +25,8 @@ public class HMIPermissionsTests extends TestCase{ public void setUp(){ msg = new HMIPermissions(); - msg.setAllowed(Test.GENERAL_HMILEVEL_LIST); - msg.setUserDisallowed(Test.GENERAL_HMILEVEL_LIST); + msg.setAllowed(TestValues.GENERAL_HMILEVEL_LIST); + msg.setUserDisallowed(TestValues.GENERAL_HMILEVEL_LIST); } /** @@ -38,33 +38,33 @@ public class HMIPermissionsTests extends TestCase{ List<HMILevel> disallowed = msg.getUserDisallowed(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_HMILEVEL_LIST.size(), allowed.size()); - assertEquals(Test.MATCH, Test.GENERAL_HMILEVEL_LIST.size(), disallowed.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_HMILEVEL_LIST.size(), allowed.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_HMILEVEL_LIST.size(), disallowed.size()); - for(int i = 0; i < Test.GENERAL_HMILEVEL_LIST.size(); i++){ - assertEquals(Test.MATCH, Test.GENERAL_HMILEVEL_LIST.get(i), allowed.get(i)); + for(int i = 0; i < TestValues.GENERAL_HMILEVEL_LIST.size(); i++){ + assertEquals(TestValues.MATCH, TestValues.GENERAL_HMILEVEL_LIST.get(i), allowed.get(i)); } - for(int i = 0; i < Test.GENERAL_HMILEVEL_LIST.size(); i++){ - assertEquals(Test.MATCH, Test.GENERAL_HMILEVEL_LIST.get(i), disallowed.get(i)); + for(int i = 0; i < TestValues.GENERAL_HMILEVEL_LIST.size(); i++){ + assertEquals(TestValues.MATCH, TestValues.GENERAL_HMILEVEL_LIST.get(i), disallowed.get(i)); } // Invalid/Null Tests HMIPermissions msg = new HMIPermissions(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getAllowed()); - assertNull(Test.NULL, msg.getUserDisallowed()); + assertNull(TestValues.NULL, msg.getAllowed()); + assertNull(TestValues.NULL, msg.getUserDisallowed()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(HMIPermissions.KEY_ALLOWED, Test.JSON_HMILEVELS); - reference.put(HMIPermissions.KEY_USER_DISALLOWED, Test.JSON_HMILEVELS); + reference.put(HMIPermissions.KEY_ALLOWED, TestValues.JSON_HMILEVELS); + reference.put(HMIPermissions.KEY_USER_DISALLOWED, TestValues.JSON_HMILEVELS); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -72,13 +72,13 @@ public class HMIPermissionsTests extends TestCase{ List<String> referenceList = JsonUtils.readStringListFromJsonObject(reference, key); List<String> underTestList = JsonUtils.readStringListFromJsonObject(underTest, key); - assertEquals(Test.MATCH, referenceList.size(), underTestList.size()); + assertEquals(TestValues.MATCH, referenceList.size(), underTestList.size()); for(int i = 0; i < referenceList.size(); i++){ - assertEquals(Test.MATCH, referenceList.get(i), underTestList.get(i)); + assertEquals(TestValues.MATCH, referenceList.get(i), underTestList.get(i)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlCapabilitiesTests.java index aa49bf0ac..413d0e394 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlCapabilitiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlCapabilitiesTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.rpc.HMISettingsControlCapabilities; import com.smartdevicelink.proxy.rpc.ModuleInfo; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -27,11 +27,11 @@ public class HMISettingsControlCapabilitiesTests extends TestCase { public void setUp() { msg = new HMISettingsControlCapabilities(); - msg.setModuleName(Test.GENERAL_STRING); - msg.setDistanceUnitAvailable(Test.GENERAL_BOOLEAN); - msg.setTemperatureUnitAvailable(Test.GENERAL_BOOLEAN); - msg.setDisplayModeUnitAvailable(Test.GENERAL_BOOLEAN); - msg.setModuleInfo(Test.GENERAL_MODULE_INFO); + msg.setModuleName(TestValues.GENERAL_STRING); + msg.setDistanceUnitAvailable(TestValues.GENERAL_BOOLEAN); + msg.setTemperatureUnitAvailable(TestValues.GENERAL_BOOLEAN); + msg.setDisplayModeUnitAvailable(TestValues.GENERAL_BOOLEAN); + msg.setModuleInfo(TestValues.GENERAL_MODULE_INFO); } /** @@ -46,35 +46,35 @@ public class HMISettingsControlCapabilitiesTests extends TestCase { ModuleInfo info = msg.getModuleInfo(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, moduleName); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) distanceUnitAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) temperatureUnitAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) displayModeUnitAvailable); - assertEquals(Test.MATCH, Test.GENERAL_MODULE_INFO, info); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, moduleName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, (boolean) distanceUnitAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, (boolean) temperatureUnitAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, (boolean) displayModeUnitAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MODULE_INFO, info); // Invalid/Null Tests HMISettingsControlCapabilities msg = new HMISettingsControlCapabilities(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getModuleName()); - assertNull(Test.NULL, msg.getDistanceUnitAvailable()); - assertNull(Test.NULL, msg.getTemperatureUnitAvailable()); - assertNull(Test.NULL, msg.getDisplayModeUnitAvailable()); - assertNull(Test.NULL, msg.getModuleInfo()); + assertNull(TestValues.NULL, msg.getModuleName()); + assertNull(TestValues.NULL, msg.getDistanceUnitAvailable()); + assertNull(TestValues.NULL, msg.getTemperatureUnitAvailable()); + assertNull(TestValues.NULL, msg.getDisplayModeUnitAvailable()); + assertNull(TestValues.NULL, msg.getModuleInfo()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(HMISettingsControlCapabilities.KEY_MODULE_NAME, Test.GENERAL_STRING); - reference.put(HMISettingsControlCapabilities.KEY_DISTANCE_UNIT_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(HMISettingsControlCapabilities.KEY_TEMPERATURE_UNIT_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(HMISettingsControlCapabilities.KEY_DISPLAY_MODE_UNIT_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(HMISettingsControlCapabilities.KEY_MODULE_INFO, Test.JSON_MODULE_INFO); + reference.put(HMISettingsControlCapabilities.KEY_MODULE_NAME, TestValues.GENERAL_STRING); + reference.put(HMISettingsControlCapabilities.KEY_DISTANCE_UNIT_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(HMISettingsControlCapabilities.KEY_TEMPERATURE_UNIT_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(HMISettingsControlCapabilities.KEY_DISPLAY_MODE_UNIT_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(HMISettingsControlCapabilities.KEY_MODULE_INFO, TestValues.JSON_MODULE_INFO); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { @@ -84,13 +84,13 @@ public class HMISettingsControlCapabilitiesTests extends TestCase { JSONObject o2 = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> h1 = JsonRPCMarshaller.deserializeJSONObject(o1); Hashtable<String, Object> h2 = JsonRPCMarshaller.deserializeJSONObject(o2); - assertTrue(Test.TRUE, Validator.validateModuleInfo(new ModuleInfo(h1), new ModuleInfo(h2))); + assertTrue(TestValues.TRUE, Validator.validateModuleInfo(new ModuleInfo(h1), new ModuleInfo(h2))); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlDataTests.java index 85205f617..8b1ae345a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlDataTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.rpc.enums.DisplayMode; import com.smartdevicelink.proxy.rpc.enums.DistanceUnit; import com.smartdevicelink.proxy.rpc.enums.TemperatureUnit; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -26,9 +26,9 @@ public class HMISettingsControlDataTests extends TestCase { public void setUp() { msg = new HMISettingsControlData(); - msg.setDisplayMode(Test.GENERAL_DISPLAYMODE); - msg.setTemperatureUnit(Test.GENERAL_TEMPERATUREUNIT); - msg.setDistanceUnit(Test.GENERAL_DISTANCEUNIT); + msg.setDisplayMode(TestValues.GENERAL_DISPLAYMODE); + msg.setTemperatureUnit(TestValues.GENERAL_TEMPERATUREUNIT); + msg.setDistanceUnit(TestValues.GENERAL_DISTANCEUNIT); } /** @@ -41,38 +41,38 @@ public class HMISettingsControlDataTests extends TestCase { DistanceUnit distanceUnit = msg.getDistanceUnit(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_DISPLAYMODE, displayMode); - assertEquals(Test.MATCH, Test.GENERAL_TEMPERATUREUNIT, temperatureUnit); - assertEquals(Test.MATCH, Test.GENERAL_DISTANCEUNIT, distanceUnit); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DISPLAYMODE, displayMode); + assertEquals(TestValues.MATCH, TestValues.GENERAL_TEMPERATUREUNIT, temperatureUnit); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DISTANCEUNIT, distanceUnit); // Invalid/Null Tests HMISettingsControlData msg = new HMISettingsControlData(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getDisplayMode()); - assertNull(Test.NULL, msg.getTemperatureUnit()); - assertNull(Test.NULL, msg.getDistanceUnit()); + assertNull(TestValues.NULL, msg.getDisplayMode()); + assertNull(TestValues.NULL, msg.getTemperatureUnit()); + assertNull(TestValues.NULL, msg.getDistanceUnit()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(HMISettingsControlData.KEY_DISPLAY_MODE, Test.GENERAL_DISPLAYMODE); - reference.put(HMISettingsControlData.KEY_TEMPERATURE_UNIT, Test.GENERAL_TEMPERATUREUNIT); - reference.put(HMISettingsControlData.KEY_DISTANCE_UNIT, Test.GENERAL_DISTANCEUNIT); + reference.put(HMISettingsControlData.KEY_DISPLAY_MODE, TestValues.GENERAL_DISPLAYMODE); + reference.put(HMISettingsControlData.KEY_TEMPERATURE_UNIT, TestValues.GENERAL_TEMPERATUREUNIT); + reference.put(HMISettingsControlData.KEY_DISTANCE_UNIT, TestValues.GENERAL_DISTANCEUNIT); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HapticRectTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HapticRectTests.java index c72204640..f235761bf 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HapticRectTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HapticRectTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.rpc.HapticRect; import com.smartdevicelink.proxy.rpc.Rectangle; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -24,8 +24,8 @@ public class HapticRectTests extends TestCase { public void setUp() { msg = new HapticRect(); - msg.setId(Test.GENERAL_INTEGER); - msg.setRect(Test.GENERAL_RECTANGLE); + msg.setId(TestValues.GENERAL_INTEGER); + msg.setRect(TestValues.GENERAL_RECTANGLE); } /** @@ -37,28 +37,28 @@ public class HapticRectTests extends TestCase { Rectangle rect = msg.getRect(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INTEGER, id); - assertEquals(Test.MATCH, Test.GENERAL_RECTANGLE, rect); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER, id); + assertEquals(TestValues.MATCH, TestValues.GENERAL_RECTANGLE, rect); // Invalid/Null Tests HapticRect msg = new HapticRect(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getId()); - assertNull(Test.NULL, msg.getRect()); + assertNull(TestValues.NULL, msg.getId()); + assertNull(TestValues.NULL, msg.getRect()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(HapticRect.KEY_ID, Test.GENERAL_INTEGER); - reference.put(HapticRect.KEY_RECT, Test.GENERAL_RECTANGLE); + reference.put(HapticRect.KEY_ID, TestValues.GENERAL_INTEGER); + reference.put(HapticRect.KEY_RECT, TestValues.GENERAL_RECTANGLE); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(reference, HapticRect.KEY_ID), + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(reference, HapticRect.KEY_ID), JsonUtils.readIntegerFromJsonObject(underTest, HapticRect.KEY_ID)); assertTrue(Validator.validateRectangle( @@ -67,7 +67,7 @@ public class HapticRectTests extends TestCase { ); } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadLampStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadLampStatusTests.java index ecce440c5..8aa7f3b01 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadLampStatusTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadLampStatusTests.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.HeadLampStatus; import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -24,9 +24,9 @@ public class HeadLampStatusTests extends TestCase{ public void setUp(){ msg = new HeadLampStatus(); - msg.setAmbientLightStatus(Test.GENERAL_AMBIENTLIGHTSTATUS); - msg.setLowBeamsOn(Test.GENERAL_BOOLEAN); - msg.setHighBeamsOn(Test.GENERAL_BOOLEAN); + msg.setAmbientLightStatus(TestValues.GENERAL_AMBIENTLIGHTSTATUS); + msg.setLowBeamsOn(TestValues.GENERAL_BOOLEAN); + msg.setHighBeamsOn(TestValues.GENERAL_BOOLEAN); } /** @@ -39,37 +39,37 @@ public class HeadLampStatusTests extends TestCase{ AmbientLightStatus ambientLights = msg.getAmbientLightStatus(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_AMBIENTLIGHTSTATUS, ambientLights); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, highBeams); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, lowBeams); + assertEquals(TestValues.MATCH, TestValues.GENERAL_AMBIENTLIGHTSTATUS, ambientLights); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, highBeams); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, lowBeams); // Invalid/Null Tests HeadLampStatus msg = new HeadLampStatus(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getLowBeamsOn()); - assertNull(Test.NULL, msg.getHighBeamsOn()); - assertNull(Test.NULL, msg.getAmbientLightStatus()); + assertNull(TestValues.NULL, msg.getLowBeamsOn()); + assertNull(TestValues.NULL, msg.getHighBeamsOn()); + assertNull(TestValues.NULL, msg.getAmbientLightStatus()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(HeadLampStatus.KEY_HIGH_BEAMS_ON, Test.GENERAL_BOOLEAN); - reference.put(HeadLampStatus.KEY_LOW_BEAMS_ON, Test.GENERAL_BOOLEAN); - reference.put(HeadLampStatus.KEY_AMBIENT_LIGHT_SENSOR_STATUS, Test.GENERAL_AMBIENTLIGHTSTATUS); + reference.put(HeadLampStatus.KEY_HIGH_BEAMS_ON, TestValues.GENERAL_BOOLEAN); + reference.put(HeadLampStatus.KEY_LOW_BEAMS_ON, TestValues.GENERAL_BOOLEAN); + reference.put(HeadLampStatus.KEY_AMBIENT_LIGHT_SENSOR_STATUS, TestValues.GENERAL_AMBIENTLIGHTSTATUS); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadersTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadersTests.java index e271ccd3c..f4baa874b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadersTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HeadersTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.Headers; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,16 +23,16 @@ public class HeadersTests extends TestCase{ public void setUp(){ msg = new Headers(); - msg.setCharset(Test.GENERAL_STRING); - msg.setConnectTimeout(Test.GENERAL_INT); - msg.setContentLength(Test.GENERAL_INT); - msg.setContentType(Test.GENERAL_STRING); - msg.setDoInput(Test.GENERAL_BOOLEAN); - msg.setDoOutput(Test.GENERAL_BOOLEAN); - msg.setInstanceFollowRedirects(Test.GENERAL_BOOLEAN); - msg.setReadTimeout(Test.GENERAL_INT); - msg.setRequestMethod(Test.GENERAL_STRING); - msg.setUseCaches(Test.GENERAL_BOOLEAN); + msg.setCharset(TestValues.GENERAL_STRING); + msg.setConnectTimeout(TestValues.GENERAL_INT); + msg.setContentLength(TestValues.GENERAL_INT); + msg.setContentType(TestValues.GENERAL_STRING); + msg.setDoInput(TestValues.GENERAL_BOOLEAN); + msg.setDoOutput(TestValues.GENERAL_BOOLEAN); + msg.setInstanceFollowRedirects(TestValues.GENERAL_BOOLEAN); + msg.setReadTimeout(TestValues.GENERAL_INT); + msg.setRequestMethod(TestValues.GENERAL_STRING); + msg.setUseCaches(TestValues.GENERAL_BOOLEAN); } /** @@ -52,58 +52,58 @@ public class HeadersTests extends TestCase{ boolean instanceFollow = msg.getInstanceFollowRedirects(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, charset); - assertEquals(Test.MATCH, Test.GENERAL_STRING, contentType); - assertEquals(Test.MATCH, Test.GENERAL_STRING, requestMode); - assertEquals(Test.MATCH, Test.GENERAL_INT, connectTimeout); - assertEquals(Test.MATCH, Test.GENERAL_INT, readTimeout); - assertEquals(Test.MATCH, Test.GENERAL_INT, contentLength); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, doOutput); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, doInput); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, useCache); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, instanceFollow); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, charset); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, contentType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, requestMode); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, connectTimeout); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, readTimeout); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, contentLength); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, doOutput); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, doInput); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, useCache); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, instanceFollow); // Invalid/Null Tests Headers msg = new Headers(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getCharset()); - assertNull(Test.NULL, msg.getConnectTimeout()); - assertNull(Test.NULL, msg.getContentLength()); - assertNull(Test.NULL, msg.getContentType()); - assertNull(Test.NULL, msg.getDoInput()); - assertNull(Test.NULL, msg.getDoOutput()); - assertNull(Test.NULL, msg.getInstanceFollowRedirects()); - assertNull(Test.NULL, msg.getReadTimeout()); - assertNull(Test.NULL, msg.getRequestMethod()); - assertNull(Test.NULL, msg.getUseCaches()); + assertNull(TestValues.NULL, msg.getCharset()); + assertNull(TestValues.NULL, msg.getConnectTimeout()); + assertNull(TestValues.NULL, msg.getContentLength()); + assertNull(TestValues.NULL, msg.getContentType()); + assertNull(TestValues.NULL, msg.getDoInput()); + assertNull(TestValues.NULL, msg.getDoOutput()); + assertNull(TestValues.NULL, msg.getInstanceFollowRedirects()); + assertNull(TestValues.NULL, msg.getReadTimeout()); + assertNull(TestValues.NULL, msg.getRequestMethod()); + assertNull(TestValues.NULL, msg.getUseCaches()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(Headers.KEY_CHARSET, Test.GENERAL_STRING); - reference.put(Headers.KEY_CONTENT_TYPE, Test.GENERAL_STRING); - reference.put(Headers.KEY_REQUEST_METHOD, Test.GENERAL_STRING); - reference.put(Headers.KEY_CONNECT_TIMEOUT, Test.GENERAL_INT); - reference.put(Headers.KEY_READ_TIMEOUT, Test.GENERAL_INT); - reference.put(Headers.KEY_CONTENT_LENGTH, Test.GENERAL_INT); - reference.put(Headers.KEY_DO_OUTPUT, Test.GENERAL_BOOLEAN); - reference.put(Headers.KEY_DO_INPUT, Test.GENERAL_BOOLEAN); - reference.put(Headers.KEY_USE_CACHES, Test.GENERAL_BOOLEAN); - reference.put(Headers.KEY_INSTANCE_FOLLOW_REDIRECTS, Test.GENERAL_BOOLEAN); + reference.put(Headers.KEY_CHARSET, TestValues.GENERAL_STRING); + reference.put(Headers.KEY_CONTENT_TYPE, TestValues.GENERAL_STRING); + reference.put(Headers.KEY_REQUEST_METHOD, TestValues.GENERAL_STRING); + reference.put(Headers.KEY_CONNECT_TIMEOUT, TestValues.GENERAL_INT); + reference.put(Headers.KEY_READ_TIMEOUT, TestValues.GENERAL_INT); + reference.put(Headers.KEY_CONTENT_LENGTH, TestValues.GENERAL_INT); + reference.put(Headers.KEY_DO_OUTPUT, TestValues.GENERAL_BOOLEAN); + reference.put(Headers.KEY_DO_INPUT, TestValues.GENERAL_BOOLEAN); + reference.put(Headers.KEY_USE_CACHES, TestValues.GENERAL_BOOLEAN); + reference.put(Headers.KEY_INSTANCE_FOLLOW_REDIRECTS, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageFieldTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageFieldTests.java index 98f4639a8..d8715e4ac 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageFieldTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageFieldTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.rpc.ImageResolution; import com.smartdevicelink.proxy.rpc.enums.FileType; import com.smartdevicelink.proxy.rpc.enums.ImageFieldName; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -32,9 +32,9 @@ public class ImageFieldTests extends TestCase{ public void setUp(){ msg = new ImageField(); - msg.setImageResolution(Test.GENERAL_IMAGERESOLUTION); - msg.setImageTypeSupported(Test.GENERAL_FILETYPE_LIST); - msg.setName(Test.GENERAL_IMAGEFIELDNAME); + msg.setImageResolution(TestValues.GENERAL_IMAGERESOLUTION); + msg.setImageTypeSupported(TestValues.GENERAL_FILETYPE_LIST); + msg.setName(TestValues.GENERAL_IMAGEFIELDNAME); } /** @@ -47,29 +47,29 @@ public class ImageFieldTests extends TestCase{ ImageFieldName name = msg.getName(); // Valid Tests - assertTrue(Test.TRUE, Validator.validateImageResolution(Test.GENERAL_IMAGERESOLUTION, imageRes)); - assertEquals(Test.MATCH, Test.GENERAL_IMAGEFIELDNAME, name); - assertTrue(Test.TRUE, Validator.validateFileTypes(Test.GENERAL_FILETYPE_LIST, imageTypes)); + assertTrue(TestValues.TRUE, Validator.validateImageResolution(TestValues.GENERAL_IMAGERESOLUTION, imageRes)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_IMAGEFIELDNAME, name); + assertTrue(TestValues.TRUE, Validator.validateFileTypes(TestValues.GENERAL_FILETYPE_LIST, imageTypes)); // Invalid/Null Tests ImageField msg = new ImageField(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getImageResolution()); - assertNull(Test.NULL, msg.getImageTypeSupported()); - assertNull(Test.NULL, msg.getName()); + assertNull(TestValues.NULL, msg.getImageResolution()); + assertNull(TestValues.NULL, msg.getImageTypeSupported()); + assertNull(TestValues.NULL, msg.getName()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(ImageField.KEY_IMAGE_RESOLUTION, Test.JSON_IMAGERESOLUTION); - reference.put(ImageField.KEY_IMAGE_TYPE_SUPPORTED, JsonUtils.createJsonArray(Test.GENERAL_FILETYPE_LIST)); - reference.put(ImageField.KEY_NAME, Test.GENERAL_IMAGEFIELDNAME); + reference.put(ImageField.KEY_IMAGE_RESOLUTION, TestValues.JSON_IMAGERESOLUTION); + reference.put(ImageField.KEY_IMAGE_TYPE_SUPPORTED, JsonUtils.createJsonArray(TestValues.GENERAL_FILETYPE_LIST)); + reference.put(ImageField.KEY_NAME, TestValues.GENERAL_IMAGEFIELDNAME); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -80,26 +80,26 @@ public class ImageFieldTests extends TestCase{ JSONObject testEquals = JsonUtils.readJsonObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateImageResolution( new ImageResolution(hashReference), new ImageResolution(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateImageResolution( new ImageResolution(hashReference), new ImageResolution(hashTest))); } else if(key.equals(ImageField.KEY_IMAGE_TYPE_SUPPORTED)) { JSONArray imageTypeArrayReference = JsonUtils.readJsonArrayFromJsonObject(reference, key); JSONArray imageTypeArrayTest = JsonUtils.readJsonArrayFromJsonObject(underTest, key); List<FileType> imageTypeListReference = new ArrayList<FileType>(); List<FileType> imageTypeListTest = new ArrayList<FileType>(); - assertEquals(Test.MATCH, imageTypeArrayReference.length(), imageTypeArrayTest.length()); + assertEquals(TestValues.MATCH, imageTypeArrayReference.length(), imageTypeArrayTest.length()); for (int index = 0 ; index < imageTypeArrayReference.length(); index++) { imageTypeListReference.add( (FileType)imageTypeArrayReference.get(index) ); imageTypeListTest.add( (FileType)imageTypeArrayTest.get(index) ); } - assertTrue(Test.TRUE, imageTypeListReference.containsAll(imageTypeListTest) && imageTypeListTest.containsAll(imageTypeListReference)); + assertTrue(TestValues.TRUE, imageTypeListReference.containsAll(imageTypeListTest) && imageTypeListTest.containsAll(imageTypeListReference)); } else{ - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageResolutionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageResolutionTests.java index 68baaba62..f62ddad4c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageResolutionTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageResolutionTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.ImageResolution; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -24,8 +24,8 @@ public class ImageResolutionTests extends TestCase{ public void setUp(){ msg = new ImageResolution(); - msg.setResolutionHeight(Test.GENERAL_INT); - msg.setResolutionWidth(Test.GENERAL_INT); + msg.setResolutionHeight(TestValues.GENERAL_INT); + msg.setResolutionWidth(TestValues.GENERAL_INT); } /** @@ -37,34 +37,34 @@ public class ImageResolutionTests extends TestCase{ int width = msg.getResolutionWidth(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, height); - assertEquals(Test.MATCH, Test.GENERAL_INT, width); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, height); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, width); // Invalid/Null Tests ImageResolution msg = new ImageResolution(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getResolutionHeight()); - assertNull(Test.NULL, msg.getResolutionWidth()); + assertNull(TestValues.NULL, msg.getResolutionHeight()); + assertNull(TestValues.NULL, msg.getResolutionWidth()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(ImageResolution.KEY_RESOLUTION_HEIGHT, Test.GENERAL_INT); - reference.put(ImageResolution.KEY_RESOLUTION_WIDTH, Test.GENERAL_INT); + reference.put(ImageResolution.KEY_RESOLUTION_HEIGHT, TestValues.GENERAL_INT); + reference.put(ImageResolution.KEY_RESOLUTION_WIDTH, TestValues.GENERAL_INT); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageTests.java index ccc9b2bdb..4b1cb50f1 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ImageTests.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.Image; import com.smartdevicelink.proxy.rpc.enums.ImageType; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -24,9 +24,9 @@ public class ImageTests extends TestCase{ public void setUp(){ msg = new Image(); - msg.setImageType(Test.GENERAL_IMAGETYPE); - msg.setValue(Test.GENERAL_STRING); - msg.setIsTemplate(Test.GENERAL_BOOLEAN); + msg.setImageType(TestValues.GENERAL_IMAGETYPE); + msg.setValue(TestValues.GENERAL_STRING); + msg.setIsTemplate(TestValues.GENERAL_BOOLEAN); } /** @@ -39,38 +39,38 @@ public class ImageTests extends TestCase{ Boolean isTemplate = msg.getIsTemplate(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_IMAGETYPE, imageType); - assertEquals(Test.MATCH, Test.GENERAL_STRING, value); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, isTemplate); + assertEquals(TestValues.MATCH, TestValues.GENERAL_IMAGETYPE, imageType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, value); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, isTemplate); // Invalid/Null Tests Image msg = new Image(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getImageType()); - assertNull(Test.NULL, msg.getValue()); - assertNull(Test.NULL, msg.getBulkData()); - assertNull(Test.NULL, msg.getIsTemplate()); + assertNull(TestValues.NULL, msg.getImageType()); + assertNull(TestValues.NULL, msg.getValue()); + assertNull(TestValues.NULL, msg.getBulkData()); + assertNull(TestValues.NULL, msg.getIsTemplate()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(Image.KEY_IMAGE_TYPE, Test.GENERAL_IMAGETYPE); - reference.put(Image.KEY_VALUE, Test.GENERAL_STRING); - reference.put(Image.KEY_IS_TEMPLATE, Test.GENERAL_BOOLEAN); + reference.put(Image.KEY_IMAGE_TYPE, TestValues.GENERAL_IMAGETYPE); + reference.put(Image.KEY_VALUE, TestValues.GENERAL_STRING); + reference.put(Image.KEY_IS_TEMPLATE, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/KeyboardPropertiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/KeyboardPropertiesTests.java index 9d627258b..cfb0c1c7d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/KeyboardPropertiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/KeyboardPropertiesTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.rpc.enums.KeyboardLayout; import com.smartdevicelink.proxy.rpc.enums.KeypressMode; import com.smartdevicelink.proxy.rpc.enums.Language; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -28,12 +28,12 @@ public class KeyboardPropertiesTests extends TestCase{ public void setUp(){ msg = new KeyboardProperties(); - msg.setAutoCompleteText(Test.GENERAL_STRING); - msg.setAutoCompleteList(Test.GENERAL_STRING_LIST); - msg.setKeyboardLayout(Test.GENERAL_KEYBOARDLAYOUT); - msg.setKeypressMode(Test.GENERAL_KEYPRESSMODE); - msg.setLanguage(Test.GENERAL_LANGUAGE); - msg.setLimitedCharacterList(Test.GENERAL_STRING_LIST); + msg.setAutoCompleteText(TestValues.GENERAL_STRING); + msg.setAutoCompleteList(TestValues.GENERAL_STRING_LIST); + msg.setKeyboardLayout(TestValues.GENERAL_KEYBOARDLAYOUT); + msg.setKeypressMode(TestValues.GENERAL_KEYPRESSMODE); + msg.setLanguage(TestValues.GENERAL_LANGUAGE); + msg.setLimitedCharacterList(TestValues.GENERAL_STRING_LIST); } /** @@ -49,53 +49,53 @@ public class KeyboardPropertiesTests extends TestCase{ List<String> limitedChars = msg.getLimitedCharacterList(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, autoCompleteText); - assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), autoCompleteList.size()); - assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, autoCompleteList)); - assertEquals(Test.MATCH, Test.GENERAL_KEYBOARDLAYOUT, keyboardLayout); - assertEquals(Test.MATCH, Test.GENERAL_KEYPRESSMODE, keypressMode); - assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, language); - assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), limitedChars.size()); - assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, limitedChars)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, autoCompleteText); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING_LIST.size(), autoCompleteList.size()); + assertTrue(TestValues.TRUE, Validator.validateStringList(TestValues.GENERAL_STRING_LIST, autoCompleteList)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_KEYBOARDLAYOUT, keyboardLayout); + assertEquals(TestValues.MATCH, TestValues.GENERAL_KEYPRESSMODE, keypressMode); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LANGUAGE, language); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING_LIST.size(), limitedChars.size()); + assertTrue(TestValues.TRUE, Validator.validateStringList(TestValues.GENERAL_STRING_LIST, limitedChars)); // Invalid/Null Tests KeyboardProperties msg = new KeyboardProperties(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); // Keypress mode is created in the object constructor - assertNotNull(Test.NOT_NULL, msg.getKeypressMode()); - assertNull(Test.NULL, msg.getAutoCompleteText()); - assertNull(Test.NULL, msg.getAutoCompleteList()); - assertNull(Test.NULL, msg.getLanguage()); - assertNull(Test.NULL, msg.getKeyboardLayout()); - assertNull(Test.NULL, msg.getLimitedCharacterList()); + assertNotNull(TestValues.NOT_NULL, msg.getKeypressMode()); + assertNull(TestValues.NULL, msg.getAutoCompleteText()); + assertNull(TestValues.NULL, msg.getAutoCompleteList()); + assertNull(TestValues.NULL, msg.getLanguage()); + assertNull(TestValues.NULL, msg.getKeyboardLayout()); + assertNull(TestValues.NULL, msg.getLimitedCharacterList()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(KeyboardProperties.KEY_AUTO_COMPLETE_TEXT, Test.GENERAL_STRING); - reference.put(KeyboardProperties.KEY_AUTO_COMPLETE_LIST, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST)); - reference.put(KeyboardProperties.KEY_KEYBOARD_LAYOUT, Test.GENERAL_KEYBOARDLAYOUT); - reference.put(KeyboardProperties.KEY_KEYPRESS_MODE, Test.GENERAL_KEYPRESSMODE); - reference.put(KeyboardProperties.KEY_LANGUAGE, Test.GENERAL_LANGUAGE); - reference.put(KeyboardProperties.KEY_LIMITED_CHARACTER_LIST, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST)); + reference.put(KeyboardProperties.KEY_AUTO_COMPLETE_TEXT, TestValues.GENERAL_STRING); + reference.put(KeyboardProperties.KEY_AUTO_COMPLETE_LIST, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); + reference.put(KeyboardProperties.KEY_KEYBOARD_LAYOUT, TestValues.GENERAL_KEYBOARDLAYOUT); + reference.put(KeyboardProperties.KEY_KEYPRESS_MODE, TestValues.GENERAL_KEYPRESSMODE); + reference.put(KeyboardProperties.KEY_LANGUAGE, TestValues.GENERAL_LANGUAGE); + reference.put(KeyboardProperties.KEY_LIMITED_CHARACTER_LIST, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); if(key.equals(KeyboardProperties.KEY_LIMITED_CHARACTER_LIST) || key.equals(KeyboardProperties.KEY_AUTO_COMPLETE_LIST)){ - assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key))); + assertTrue(TestValues.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key))); } else{ - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightCapabilitiesTests.java index 6122f4305..fba90ca79 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightCapabilitiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightCapabilitiesTests.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.LightCapabilities; import com.smartdevicelink.proxy.rpc.enums.LightName; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -24,10 +24,10 @@ public class LightCapabilitiesTests extends TestCase { public void setUp() { msg = new LightCapabilities(); - msg.setName(Test.GENERAL_LIGHTNAME); - msg.setDensityAvailable(Test.GENERAL_BOOLEAN); - msg.setRGBColorSpaceAvailable(Test.GENERAL_BOOLEAN); - msg.setStatusAvailable(Test.GENERAL_BOOLEAN); + msg.setName(TestValues.GENERAL_LIGHTNAME); + msg.setDensityAvailable(TestValues.GENERAL_BOOLEAN); + msg.setRGBColorSpaceAvailable(TestValues.GENERAL_BOOLEAN); + msg.setStatusAvailable(TestValues.GENERAL_BOOLEAN); } /** @@ -41,41 +41,41 @@ public class LightCapabilitiesTests extends TestCase { Boolean statusAvailable = msg.getStatusAvailable(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_LIGHTNAME, name); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) densityAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) rgbColorSpaceAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) statusAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LIGHTNAME, name); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, (boolean) densityAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, (boolean) rgbColorSpaceAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, (boolean) statusAvailable); // Invalid/Null Tests LightCapabilities msg = new LightCapabilities(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getName()); - assertNull(Test.NULL, msg.getDensityAvailable()); - assertNull(Test.NULL, msg.getRGBColorSpaceAvailable()); - assertNull(Test.NULL, msg.getStatusAvailable()); + assertNull(TestValues.NULL, msg.getName()); + assertNull(TestValues.NULL, msg.getDensityAvailable()); + assertNull(TestValues.NULL, msg.getRGBColorSpaceAvailable()); + assertNull(TestValues.NULL, msg.getStatusAvailable()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(LightCapabilities.KEY_NAME, Test.GENERAL_LIGHTNAME); - reference.put(LightCapabilities.KEY_DENSITY_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(LightCapabilities.KEY_RGB_COLOR_SPACE_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(LightCapabilities.KEY_STATUS_AVAILABLE, Test.GENERAL_BOOLEAN); + reference.put(LightCapabilities.KEY_NAME, TestValues.GENERAL_LIGHTNAME); + reference.put(LightCapabilities.KEY_DENSITY_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(LightCapabilities.KEY_RGB_COLOR_SPACE_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(LightCapabilities.KEY_STATUS_AVAILABLE, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlCapabilitiesTests.java index ad6e5a4ac..24c5a54c7 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlCapabilitiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlCapabilitiesTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.rpc.LightCapabilities; import com.smartdevicelink.proxy.rpc.LightControlCapabilities; import com.smartdevicelink.proxy.rpc.ModuleInfo; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -30,9 +30,9 @@ public class LightControlCapabilitiesTests extends TestCase { public void setUp() { msg = new LightControlCapabilities(); - msg.setModuleName(Test.GENERAL_STRING); - msg.setSupportedLights(Test.GENERAL_LIGHTCAPABILITIES_LIST); - msg.setModuleInfo(Test.GENERAL_MODULE_INFO); + msg.setModuleName(TestValues.GENERAL_STRING); + msg.setSupportedLights(TestValues.GENERAL_LIGHTCAPABILITIES_LIST); + msg.setModuleInfo(TestValues.GENERAL_MODULE_INFO); } /** @@ -45,31 +45,31 @@ public class LightControlCapabilitiesTests extends TestCase { ModuleInfo info = msg.getModuleInfo(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, moduleName); - assertEquals(Test.MATCH, Test.GENERAL_LIGHTCAPABILITIES_LIST.size(), supportedLights.size()); - assertEquals(Test.MATCH, Test.GENERAL_MODULE_INFO, info); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, moduleName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LIGHTCAPABILITIES_LIST.size(), supportedLights.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MODULE_INFO, info); - assertTrue(Test.TRUE, Validator.validateLightCapabilitiesList(Test.GENERAL_LIGHTCAPABILITIES_LIST, supportedLights)); + assertTrue(TestValues.TRUE, Validator.validateLightCapabilitiesList(TestValues.GENERAL_LIGHTCAPABILITIES_LIST, supportedLights)); // Invalid/Null Tests LightControlCapabilities msg = new LightControlCapabilities(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getModuleName()); - assertNull(Test.NULL, msg.getSupportedLights()); - assertNull(Test.NULL, msg.getModuleInfo()); + assertNull(TestValues.NULL, msg.getModuleName()); + assertNull(TestValues.NULL, msg.getSupportedLights()); + assertNull(TestValues.NULL, msg.getModuleInfo()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(LightControlCapabilities.KEY_MODULE_NAME, Test.GENERAL_STRING); - reference.put(LightControlCapabilities.KEY_SUPPORTED_LIGHTS, Test.GENERAL_LIGHTCAPABILITIES_LIST); - reference.put(LightControlCapabilities.KEY_MODULE_INFO, Test.JSON_MODULE_INFO); + reference.put(LightControlCapabilities.KEY_MODULE_NAME, TestValues.GENERAL_STRING); + reference.put(LightControlCapabilities.KEY_SUPPORTED_LIGHTS, TestValues.GENERAL_LIGHTCAPABILITIES_LIST); + reference.put(LightControlCapabilities.KEY_MODULE_INFO, TestValues.JSON_MODULE_INFO); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { @@ -87,14 +87,14 @@ public class LightControlCapabilitiesTests extends TestCase { JSONObject o2 = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> h1 = JsonRPCMarshaller.deserializeJSONObject(o1); Hashtable<String, Object> h2 = JsonRPCMarshaller.deserializeJSONObject(o2); - assertTrue(Test.TRUE, Validator.validateModuleInfo(new ModuleInfo(h1), new ModuleInfo(h2))); + assertTrue(TestValues.TRUE, Validator.validateModuleInfo(new ModuleInfo(h1), new ModuleInfo(h2))); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlDataTests.java index c891e0769..d35c6568f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlDataTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.rpc.LightControlData; import com.smartdevicelink.proxy.rpc.LightState; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -28,7 +28,7 @@ public class LightControlDataTests extends TestCase { public void setUp() { msg = new LightControlData(); - msg.setLightState(Test.GENERAL_LIGHTSTATE_LIST); + msg.setLightState(TestValues.GENERAL_LIGHTSTATE_LIST); } /** @@ -39,25 +39,25 @@ public class LightControlDataTests extends TestCase { List<LightState> lightState = msg.getLightState(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_LIGHTSTATE_LIST.size(), lightState.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LIGHTSTATE_LIST.size(), lightState.size()); - assertTrue(Test.TRUE, Validator.validateLightStateList(Test.GENERAL_LIGHTSTATE_LIST, lightState)); + assertTrue(TestValues.TRUE, Validator.validateLightStateList(TestValues.GENERAL_LIGHTSTATE_LIST, lightState)); // Invalid/Null Tests LightControlData msg = new LightControlData(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getLightState()); + assertNull(TestValues.NULL, msg.getLightState()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(LightControlData.KEY_LIGHT_STATE, Test.GENERAL_LIGHTSTATE_LIST); + reference.put(LightControlData.KEY_LIGHT_STATE, TestValues.GENERAL_LIGHTSTATE_LIST); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { @@ -73,7 +73,7 @@ public class LightControlDataTests extends TestCase { } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightStateTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightStateTests.java index 196769e00..d2094d501 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightStateTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightStateTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.rpc.RGBColor; import com.smartdevicelink.proxy.rpc.enums.LightName; import com.smartdevicelink.proxy.rpc.enums.LightStatus; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -29,10 +29,10 @@ public class LightStateTests extends TestCase { public void setUp() { msg = new LightState(); - msg.setId(Test.GENERAL_LIGHTNAME); - msg.setStatus(Test.GENERAL_LIGHTSTATUS); - msg.setDensity(Test.GENERAL_FLOAT); - msg.setColor(Test.GENERAL_RGBCOLOR); + msg.setId(TestValues.GENERAL_LIGHTNAME); + msg.setStatus(TestValues.GENERAL_LIGHTSTATUS); + msg.setDensity(TestValues.GENERAL_FLOAT); + msg.setColor(TestValues.GENERAL_RGBCOLOR); } /** @@ -46,32 +46,32 @@ public class LightStateTests extends TestCase { RGBColor color = msg.getColor(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_LIGHTNAME, id); - assertEquals(Test.MATCH, Test.GENERAL_LIGHTSTATUS, status); - assertEquals(Test.MATCH, Test.GENERAL_FLOAT, (float) density); - assertEquals(Test.MATCH, Test.GENERAL_RGBCOLOR, color); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LIGHTNAME, id); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LIGHTSTATUS, status); + assertEquals(TestValues.MATCH, TestValues.GENERAL_FLOAT, (float) density); + assertEquals(TestValues.MATCH, TestValues.GENERAL_RGBCOLOR, color); // Invalid/Null Tests LightState msg = new LightState(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getId()); - assertNull(Test.NULL, msg.getStatus()); - assertNull(Test.NULL, msg.getDensity()); - assertNull(Test.NULL, msg.getColor()); + assertNull(TestValues.NULL, msg.getId()); + assertNull(TestValues.NULL, msg.getStatus()); + assertNull(TestValues.NULL, msg.getDensity()); + assertNull(TestValues.NULL, msg.getColor()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(LightState.KEY_ID, Test.GENERAL_LIGHTNAME); - reference.put(LightState.KEY_STATUS, Test.GENERAL_LIGHTSTATUS); - reference.put(LightState.KEY_DENSITY, Test.GENERAL_FLOAT); - reference.put(LightState.KEY_COLOR, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_RGBCOLOR.getStore())); + reference.put(LightState.KEY_ID, TestValues.GENERAL_LIGHTNAME); + reference.put(LightState.KEY_STATUS, TestValues.GENERAL_LIGHTSTATUS); + reference.put(LightState.KEY_DENSITY, TestValues.GENERAL_FLOAT); + reference.put(LightState.KEY_COLOR, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_RGBCOLOR.getStore())); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { @@ -82,13 +82,13 @@ public class LightStateTests extends TestCase { JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateRGBColor(new RGBColor(hashReference), new RGBColor(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateRGBColor(new RGBColor(hashReference), new RGBColor(hashTest))); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LocationDetailsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LocationDetailsTests.java index 18da17eac..3792f64b7 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LocationDetailsTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LocationDetailsTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.rpc.Image; import com.smartdevicelink.proxy.rpc.LocationDetails; import com.smartdevicelink.proxy.rpc.OasisAddress; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -25,7 +25,7 @@ public class LocationDetailsTests extends TestCase { @Override public void setUp(){ - msg = Test.GENERAL_LOCATIONDETAILS; + msg = TestValues.GENERAL_LOCATIONDETAILS; } /** @@ -42,17 +42,17 @@ public class LocationDetailsTests extends TestCase { OasisAddress field7 = msg.getSearchAddress(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST, field1); - assertEquals(Test.MATCH, Test.GENERAL_STRING, field2); - assertEquals(Test.MATCH, Test.GENERAL_STRING, field3); - assertEquals(Test.MATCH, Test.GENERAL_STRING, field4); - assertEquals(Test.MATCH, Test.GENERAL_COORDINATE, field5); - assertEquals(Test.MATCH, Test.GENERAL_IMAGE, field6); - assertEquals(Test.MATCH, Test.GENERAL_OASISADDRESS, field7); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING_LIST, field1); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, field2); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, field3); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, field4); + assertEquals(TestValues.MATCH, TestValues.GENERAL_COORDINATE, field5); + assertEquals(TestValues.MATCH, TestValues.GENERAL_IMAGE, field6); + assertEquals(TestValues.MATCH, TestValues.GENERAL_OASISADDRESS, field7); // Invalid/Null Tests LocationDetails msg = new LocationDetails(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); assertNull(msg.getAddressLines()); @@ -68,27 +68,27 @@ public class LocationDetailsTests extends TestCase { JSONObject reference = new JSONObject(); try{ - reference.put(LocationDetails.KEY_ADDRESS_LINES, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST)); - reference.put(LocationDetails.KEY_LOCATION_DESCRIPTION, Test.GENERAL_STRING); - reference.put(LocationDetails.KEY_LOCATION_NAME, Test.GENERAL_STRING); - reference.put(LocationDetails.KEY_PHONE_NUMBER, Test.GENERAL_STRING); - reference.put(LocationDetails.KEY_COORDINATE, Test.GENERAL_COORDINATE); - reference.put(LocationDetails.KEY_LOCATION_IMAGE, Test.GENERAL_IMAGE); - reference.put(LocationDetails.KEY_SEARCH_ADDRESS, Test.GENERAL_OASISADDRESS); + reference.put(LocationDetails.KEY_ADDRESS_LINES, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); + reference.put(LocationDetails.KEY_LOCATION_DESCRIPTION, TestValues.GENERAL_STRING); + reference.put(LocationDetails.KEY_LOCATION_NAME, TestValues.GENERAL_STRING); + reference.put(LocationDetails.KEY_PHONE_NUMBER, TestValues.GENERAL_STRING); + reference.put(LocationDetails.KEY_COORDINATE, TestValues.GENERAL_COORDINATE); + reference.put(LocationDetails.KEY_LOCATION_IMAGE, TestValues.GENERAL_IMAGE); + reference.put(LocationDetails.KEY_SEARCH_ADDRESS, TestValues.GENERAL_OASISADDRESS); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, LocationDetails.KEY_ADDRESS_LINES), + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, LocationDetails.KEY_ADDRESS_LINES), JsonUtils.readObjectFromJsonObject(underTest, LocationDetails.KEY_ADDRESS_LINES)); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(reference, LocationDetails.KEY_LOCATION_DESCRIPTION), + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(reference, LocationDetails.KEY_LOCATION_DESCRIPTION), JsonUtils.readStringFromJsonObject(underTest, LocationDetails.KEY_LOCATION_DESCRIPTION)); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(reference, LocationDetails.KEY_LOCATION_NAME), + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(reference, LocationDetails.KEY_LOCATION_NAME), JsonUtils.readStringFromJsonObject(underTest, LocationDetails.KEY_LOCATION_NAME)); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(reference, LocationDetails.KEY_PHONE_NUMBER), + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(reference, LocationDetails.KEY_PHONE_NUMBER), JsonUtils.readStringFromJsonObject(underTest, LocationDetails.KEY_PHONE_NUMBER)); assertTrue(Validator.validateCoordinate( @@ -107,7 +107,7 @@ public class LocationDetailsTests extends TestCase { )); } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java index da8a7cbfe..d3454ab8e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.MassageCushionFirmness; import com.smartdevicelink.proxy.rpc.enums.MassageCushion; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -24,8 +24,8 @@ public class MassageCushionFirmnessTest extends TestCase { public void setUp() { msg = new MassageCushionFirmness(); - msg.setCushion(Test.GENERAL_MASSAGECUSHION); - msg.setFirmness(Test.GENERAL_INT); + msg.setCushion(TestValues.GENERAL_MASSAGECUSHION); + msg.setFirmness(TestValues.GENERAL_INT); } /** @@ -37,35 +37,35 @@ public class MassageCushionFirmnessTest extends TestCase { Integer firmness = msg.getFirmness(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_MASSAGECUSHION, cushion); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, firmness); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MASSAGECUSHION, cushion); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, firmness); // Invalid/Null Tests MassageCushionFirmness msg = new MassageCushionFirmness(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getCushion()); - assertNull(Test.NULL, msg.getFirmness()); + assertNull(TestValues.NULL, msg.getCushion()); + assertNull(TestValues.NULL, msg.getFirmness()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(MassageCushionFirmness.KEY_CUSHION, Test.GENERAL_MASSAGECUSHION); - reference.put(MassageCushionFirmness.KEY_FIRMNESS, Test.GENERAL_INT); + reference.put(MassageCushionFirmness.KEY_CUSHION, TestValues.GENERAL_MASSAGECUSHION); + reference.put(MassageCushionFirmness.KEY_FIRMNESS, TestValues.GENERAL_INT); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageModeDataTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageModeDataTest.java index 958de9fa2..3b9f38e3e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageModeDataTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageModeDataTest.java @@ -4,7 +4,7 @@ import com.smartdevicelink.proxy.rpc.MassageModeData; import com.smartdevicelink.proxy.rpc.enums.MassageMode; import com.smartdevicelink.proxy.rpc.enums.MassageZone; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -25,8 +25,8 @@ public class MassageModeDataTest extends TestCase { public void setUp() { msg = new MassageModeData(); - msg.setMassageZone(Test.GENERAL_MASSAGEZONE); - msg.setMassageMode(Test.GENERAL_MASSAGEMODE); + msg.setMassageZone(TestValues.GENERAL_MASSAGEZONE); + msg.setMassageMode(TestValues.GENERAL_MASSAGEMODE); } /** @@ -38,37 +38,37 @@ public class MassageModeDataTest extends TestCase { MassageMode massageMode = msg.getMassageMode(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_MASSAGEZONE, massageZone); - assertEquals(Test.MATCH, Test.GENERAL_MASSAGEMODE, massageMode); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MASSAGEZONE, massageZone); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MASSAGEMODE, massageMode); // Invalid/Null Tests MassageModeData msg = new MassageModeData(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getMassageMode()); - assertNull(Test.NULL, msg.getMassageZone()); + assertNull(TestValues.NULL, msg.getMassageMode()); + assertNull(TestValues.NULL, msg.getMassageZone()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(MassageModeData.KEY_MASSAGE_MODE, Test.GENERAL_MASSAGEMODE); - reference.put(MassageModeData.KEY_MASSAGE_ZONE, Test.GENERAL_MASSAGEZONE); + reference.put(MassageModeData.KEY_MASSAGE_MODE, TestValues.GENERAL_MASSAGEMODE); + reference.put(MassageModeData.KEY_MASSAGE_ZONE, TestValues.GENERAL_MASSAGEZONE); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MediaServiceDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MediaServiceDataTests.java index 2883fca6b..5d1baded5 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MediaServiceDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MediaServiceDataTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.rpc.Image; import com.smartdevicelink.proxy.rpc.MediaServiceData; import com.smartdevicelink.proxy.rpc.enums.MediaType; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -28,19 +28,19 @@ public class MediaServiceDataTests extends TestCase { public void setUp(){ msg = new MediaServiceData(); - msg.setMediaType(Test.GENERAL_MEDIATYPE); - msg.setMediaTitle(Test.GENERAL_STRING); - msg.setMediaArtist(Test.GENERAL_STRING); - msg.setMediaAlbum(Test.GENERAL_STRING); - msg.setMediaImage(Test.GENERAL_IMAGE); - msg.setPlaylistName(Test.GENERAL_STRING); - msg.setIsExplicit(Test.GENERAL_BOOLEAN); - msg.setTrackPlaybackProgress(Test.GENERAL_INTEGER); - msg.setTrackPlaybackDuration(Test.GENERAL_INTEGER); - msg.setQueuePlaybackProgress(Test.GENERAL_INTEGER); - msg.setQueuePlaybackDuration(Test.GENERAL_INTEGER); - msg.setQueueCurrentTrackNumber(Test.GENERAL_INTEGER); - msg.setQueueTotalTrackCount(Test.GENERAL_INTEGER); + msg.setMediaType(TestValues.GENERAL_MEDIATYPE); + msg.setMediaTitle(TestValues.GENERAL_STRING); + msg.setMediaArtist(TestValues.GENERAL_STRING); + msg.setMediaAlbum(TestValues.GENERAL_STRING); + msg.setMediaImage(TestValues.GENERAL_IMAGE); + msg.setPlaylistName(TestValues.GENERAL_STRING); + msg.setIsExplicit(TestValues.GENERAL_BOOLEAN); + msg.setTrackPlaybackProgress(TestValues.GENERAL_INTEGER); + msg.setTrackPlaybackDuration(TestValues.GENERAL_INTEGER); + msg.setQueuePlaybackProgress(TestValues.GENERAL_INTEGER); + msg.setQueuePlaybackDuration(TestValues.GENERAL_INTEGER); + msg.setQueueCurrentTrackNumber(TestValues.GENERAL_INTEGER); + msg.setQueueTotalTrackCount(TestValues.GENERAL_INTEGER); } /** @@ -63,59 +63,59 @@ public class MediaServiceDataTests extends TestCase { Integer queueTotalTrackCount = msg.getQueueTotalTrackCount(); // Valid Tests - assertEquals(Test.GENERAL_MEDIATYPE, mediaType); - assertEquals(Test.GENERAL_STRING, mediaTitle); - assertEquals(Test.GENERAL_STRING, mediaArtist); - assertEquals(Test.GENERAL_STRING, mediaAlbum); - assertEquals(Test.GENERAL_IMAGE, mediaImage); - assertEquals(Test.GENERAL_STRING, playlistName); - assertEquals(Test.GENERAL_BOOLEAN, isExplicit); - assertEquals(Test.GENERAL_INTEGER, trackPlaybackProgress); - assertEquals(Test.GENERAL_INTEGER, trackPlaybackDuration); - assertEquals(Test.GENERAL_INTEGER, queuePlaybackProgress); - assertEquals(Test.GENERAL_INTEGER, queuePlaybackDuration); - assertEquals(Test.GENERAL_INTEGER, queueCurrentTrackNumber); - assertEquals(Test.GENERAL_INTEGER, queueTotalTrackCount); + assertEquals(TestValues.GENERAL_MEDIATYPE, mediaType); + assertEquals(TestValues.GENERAL_STRING, mediaTitle); + assertEquals(TestValues.GENERAL_STRING, mediaArtist); + assertEquals(TestValues.GENERAL_STRING, mediaAlbum); + assertEquals(TestValues.GENERAL_IMAGE, mediaImage); + assertEquals(TestValues.GENERAL_STRING, playlistName); + assertEquals(TestValues.GENERAL_BOOLEAN, isExplicit); + assertEquals(TestValues.GENERAL_INTEGER, trackPlaybackProgress); + assertEquals(TestValues.GENERAL_INTEGER, trackPlaybackDuration); + assertEquals(TestValues.GENERAL_INTEGER, queuePlaybackProgress); + assertEquals(TestValues.GENERAL_INTEGER, queuePlaybackDuration); + assertEquals(TestValues.GENERAL_INTEGER, queueCurrentTrackNumber); + assertEquals(TestValues.GENERAL_INTEGER, queueTotalTrackCount); // Invalid/Null Tests MediaServiceData msg = new MediaServiceData(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getMediaType()); - assertNull(Test.NULL, msg.getMediaTitle()); - assertNull(Test.NULL, msg.getMediaArtist()); - assertNull(Test.NULL, msg.getMediaAlbum()); - assertNull(Test.NULL, msg.getMediaImage()); - assertNull(Test.NULL, msg.getPlaylistName()); - assertNull(Test.NULL, msg.getIsExplicit()); - assertNull(Test.NULL, msg.getTrackPlaybackProgress()); - assertNull(Test.NULL, msg.getTrackPlaybackDuration()); - assertNull(Test.NULL, msg.getQueuePlaybackProgress()); - assertNull(Test.NULL, msg.getQueuePlaybackDuration()); - assertNull(Test.NULL, msg.getQueueCurrentTrackNumber()); - assertNull(Test.NULL, msg.getQueueTotalTrackCount()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getMediaType()); + assertNull(TestValues.NULL, msg.getMediaTitle()); + assertNull(TestValues.NULL, msg.getMediaArtist()); + assertNull(TestValues.NULL, msg.getMediaAlbum()); + assertNull(TestValues.NULL, msg.getMediaImage()); + assertNull(TestValues.NULL, msg.getPlaylistName()); + assertNull(TestValues.NULL, msg.getIsExplicit()); + assertNull(TestValues.NULL, msg.getTrackPlaybackProgress()); + assertNull(TestValues.NULL, msg.getTrackPlaybackDuration()); + assertNull(TestValues.NULL, msg.getQueuePlaybackProgress()); + assertNull(TestValues.NULL, msg.getQueuePlaybackDuration()); + assertNull(TestValues.NULL, msg.getQueueCurrentTrackNumber()); + assertNull(TestValues.NULL, msg.getQueueTotalTrackCount()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(MediaServiceData.KEY_MEDIA_TYPE, Test.GENERAL_MEDIATYPE); - reference.put(MediaServiceData.KEY_MEDIA_TITLE, Test.GENERAL_STRING); - reference.put(MediaServiceData.KEY_MEDIA_ARTIST, Test.GENERAL_STRING); - reference.put(MediaServiceData.KEY_MEDIA_ALBUM, Test.GENERAL_STRING); - reference.put(MediaServiceData.KEY_MEDIA_IMAGE, Test.GENERAL_IMAGE); - reference.put(MediaServiceData.KEY_PLAYLIST_NAME, Test.GENERAL_STRING); - reference.put(MediaServiceData.KEY_IS_EXPLICIT, Test.GENERAL_BOOLEAN); - reference.put(MediaServiceData.KEY_TRACK_PLAYBACK_PROGRESS, Test.GENERAL_INTEGER); - reference.put(MediaServiceData.KEY_TRACK_PLAYBACK_DURATION, Test.GENERAL_INTEGER); - reference.put(MediaServiceData.KEY_QUEUE_PLAYBACK_PROGRESS, Test.GENERAL_INTEGER); - reference.put(MediaServiceData.KEY_QUEUE_PLAYBACK_DURATION, Test.GENERAL_INTEGER); - reference.put(MediaServiceData.KEY_QUEUE_CURRENT_TRACK_NUMBER, Test.GENERAL_INTEGER); - reference.put(MediaServiceData.KEY_QUEUE_TOTAL_TRACK_COUNT, Test.GENERAL_INTEGER); + reference.put(MediaServiceData.KEY_MEDIA_TYPE, TestValues.GENERAL_MEDIATYPE); + reference.put(MediaServiceData.KEY_MEDIA_TITLE, TestValues.GENERAL_STRING); + reference.put(MediaServiceData.KEY_MEDIA_ARTIST, TestValues.GENERAL_STRING); + reference.put(MediaServiceData.KEY_MEDIA_ALBUM, TestValues.GENERAL_STRING); + reference.put(MediaServiceData.KEY_MEDIA_IMAGE, TestValues.GENERAL_IMAGE); + reference.put(MediaServiceData.KEY_PLAYLIST_NAME, TestValues.GENERAL_STRING); + reference.put(MediaServiceData.KEY_IS_EXPLICIT, TestValues.GENERAL_BOOLEAN); + reference.put(MediaServiceData.KEY_TRACK_PLAYBACK_PROGRESS, TestValues.GENERAL_INTEGER); + reference.put(MediaServiceData.KEY_TRACK_PLAYBACK_DURATION, TestValues.GENERAL_INTEGER); + reference.put(MediaServiceData.KEY_QUEUE_PLAYBACK_PROGRESS, TestValues.GENERAL_INTEGER); + reference.put(MediaServiceData.KEY_QUEUE_PLAYBACK_DURATION, TestValues.GENERAL_INTEGER); + reference.put(MediaServiceData.KEY_QUEUE_CURRENT_TRACK_NUMBER, TestValues.GENERAL_INTEGER); + reference.put(MediaServiceData.KEY_QUEUE_TOTAL_TRACK_COUNT, TestValues.GENERAL_INTEGER); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -124,13 +124,13 @@ public class MediaServiceDataTests extends TestCase { if (key.equals(MediaServiceData.KEY_MEDIA_IMAGE)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, new Image(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateImage(TestValues.GENERAL_IMAGE, new Image(hashTest))); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MediaServiceManifestTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MediaServiceManifestTests.java index 85332bc0c..d85e064f4 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MediaServiceManifestTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MediaServiceManifestTests.java @@ -1,7 +1,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.MediaServiceManifest; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -24,7 +24,7 @@ public class MediaServiceManifestTests extends TestCase { // Invalid/Null Tests MediaServiceManifest msg = new MediaServiceManifest(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MenuParamsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MenuParamsTests.java index b839d9247..0d74473e2 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MenuParamsTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MenuParamsTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.MenuParams; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,9 +23,9 @@ public class MenuParamsTests extends TestCase{ public void setUp(){ msg = new MenuParams(); - msg.setMenuName(Test.GENERAL_STRING); - msg.setParentID(Test.GENERAL_INT); - msg.setPosition(Test.GENERAL_INT); + msg.setMenuName(TestValues.GENERAL_STRING); + msg.setParentID(TestValues.GENERAL_INT); + msg.setPosition(TestValues.GENERAL_INT); } /** @@ -38,37 +38,37 @@ public class MenuParamsTests extends TestCase{ int position = msg.getPosition(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, menuName); - assertEquals(Test.MATCH, Test.GENERAL_INT, parentId); - assertEquals(Test.MATCH, Test.GENERAL_INT, position); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, menuName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, parentId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, position); // Invalid/Null Tests MenuParams msg = new MenuParams(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getMenuName()); - assertNull(Test.NULL, msg.getParentID()); - assertNull(Test.NULL, msg.getPosition()); + assertNull(TestValues.NULL, msg.getMenuName()); + assertNull(TestValues.NULL, msg.getParentID()); + assertNull(TestValues.NULL, msg.getPosition()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(MenuParams.KEY_MENU_NAME, Test.GENERAL_STRING); - reference.put(MenuParams.KEY_PARENT_ID, Test.GENERAL_INT); - reference.put(MenuParams.KEY_POSITION, Test.GENERAL_INT); + reference.put(MenuParams.KEY_MENU_NAME, TestValues.GENERAL_STRING); + reference.put(MenuParams.KEY_PARENT_ID, TestValues.GENERAL_INT); + reference.put(MenuParams.KEY_POSITION, TestValues.GENERAL_INT); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MetadataTagsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MetadataTagsTests.java index 5f27cc132..9b08c8e73 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MetadataTagsTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MetadataTagsTests.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.MetadataTags; import com.smartdevicelink.proxy.rpc.enums.MetadataType; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -59,10 +59,10 @@ public class MetadataTagsTests extends TestCase { List<MetadataType> mainField4Types = msg.getMainField4(); // Valid Tests - assertEquals(Test.MATCH, exampleList, mainField1Types); - assertEquals(Test.MATCH, exampleList, mainField2Types); - assertEquals(Test.MATCH, exampleList, mainField3Types); - assertEquals(Test.MATCH, exampleList, mainField4Types); + assertEquals(TestValues.MATCH, exampleList, mainField1Types); + assertEquals(TestValues.MATCH, exampleList, mainField2Types); + assertEquals(TestValues.MATCH, exampleList, mainField3Types); + assertEquals(TestValues.MATCH, exampleList, mainField4Types); // Test metadata set without a list mainField1Types = msg2.getMainField1(); @@ -71,40 +71,40 @@ public class MetadataTagsTests extends TestCase { mainField4Types = msg2.getMainField4(); // Valid Tests - assertEquals(Test.MATCH, MetadataType.CURRENT_TEMPERATURE, mainField1Types.get(0)); - assertEquals(Test.MATCH, MetadataType.HUMIDITY, mainField2Types.get(0)); - assertEquals(Test.MATCH, MetadataType.MAXIMUM_TEMPERATURE, mainField3Types.get(0)); - assertEquals(Test.MATCH, MetadataType.MEDIA_ALBUM, mainField4Types.get(0)); + assertEquals(TestValues.MATCH, MetadataType.CURRENT_TEMPERATURE, mainField1Types.get(0)); + assertEquals(TestValues.MATCH, MetadataType.HUMIDITY, mainField2Types.get(0)); + assertEquals(TestValues.MATCH, MetadataType.MAXIMUM_TEMPERATURE, mainField3Types.get(0)); + assertEquals(TestValues.MATCH, MetadataType.MEDIA_ALBUM, mainField4Types.get(0)); // Invalid/Null Tests MetadataTags msg = new MetadataTags(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getMainField1()); - assertNull(Test.NULL, msg.getMainField2()); - assertNull(Test.NULL, msg.getMainField3()); - assertNull(Test.NULL, msg.getMainField4()); + assertNull(TestValues.NULL, msg.getMainField1()); + assertNull(TestValues.NULL, msg.getMainField2()); + assertNull(TestValues.NULL, msg.getMainField3()); + assertNull(TestValues.NULL, msg.getMainField4()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(MetadataTags.KEY_MAIN_FIELD_1_TYPE, Test.JSON_TEXTFIELDTYPES); - reference.put(MetadataTags.KEY_MAIN_FIELD_2_TYPE, Test.JSON_TEXTFIELDTYPES); - reference.put(MetadataTags.KEY_MAIN_FIELD_3_TYPE, Test.JSON_TEXTFIELDTYPES); - reference.put(MetadataTags.KEY_MAIN_FIELD_4_TYPE, Test.JSON_TEXTFIELDTYPES); + reference.put(MetadataTags.KEY_MAIN_FIELD_1_TYPE, TestValues.JSON_TEXTFIELDTYPES); + reference.put(MetadataTags.KEY_MAIN_FIELD_2_TYPE, TestValues.JSON_TEXTFIELDTYPES); + reference.put(MetadataTags.KEY_MAIN_FIELD_3_TYPE, TestValues.JSON_TEXTFIELDTYPES); + reference.put(MetadataTags.KEY_MAIN_FIELD_4_TYPE, TestValues.JSON_TEXTFIELDTYPES); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java index 7f4a78b27..dc7cdf2ce 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java @@ -10,7 +10,7 @@ import com.smartdevicelink.proxy.rpc.RadioControlData; import com.smartdevicelink.proxy.rpc.SeatControlData; import com.smartdevicelink.proxy.rpc.enums.ModuleType; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -32,14 +32,14 @@ public class ModuleDataTests extends TestCase { @Override public void setUp() { msg = new ModuleData(); - msg.setModuleType(Test.GENERAL_MODULETYPE); - msg.setRadioControlData(Test.GENERAL_RADIOCONTROLDATA); - msg.setClimateControlData(Test.GENERAL_CLIMATECONTROLDATA); - msg.setSeatControlData(Test.GENERAL_SEATCONTROLDATA); - msg.setAudioControlData(Test.GENERAL_AUDIOCONTROLDATA); - msg.setHmiSettingsControlData(Test.GENERAL_HMISETTINGSCONTROLDATA); - msg.setLightControlData(Test.GENERAL_LIGHTCONTROLDATA); - msg.setModuleId(Test.GENERAL_STRING); + msg.setModuleType(TestValues.GENERAL_MODULETYPE); + msg.setRadioControlData(TestValues.GENERAL_RADIOCONTROLDATA); + msg.setClimateControlData(TestValues.GENERAL_CLIMATECONTROLDATA); + msg.setSeatControlData(TestValues.GENERAL_SEATCONTROLDATA); + msg.setAudioControlData(TestValues.GENERAL_AUDIOCONTROLDATA); + msg.setHmiSettingsControlData(TestValues.GENERAL_HMISETTINGSCONTROLDATA); + msg.setLightControlData(TestValues.GENERAL_LIGHTCONTROLDATA); + msg.setModuleId(TestValues.GENERAL_STRING); } /** @@ -57,44 +57,44 @@ public class ModuleDataTests extends TestCase { String moduleId = msg.getModuleId(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_MODULETYPE, moduleType); - assertTrue(Test.TRUE, Validator.validateRadioControlData(Test.GENERAL_RADIOCONTROLDATA, radioControlData)); - assertTrue(Test.TRUE, Validator.validateClimateControlData(Test.GENERAL_CLIMATECONTROLDATA, climateControlData)); - assertTrue(Test.TRUE, Validator.validateSeatControlData(Test.GENERAL_SEATCONTROLDATA, seatControlData)); - assertTrue(Test.TRUE, Validator.validateAudioControlData(Test.GENERAL_AUDIOCONTROLDATA, audioControlData)); - assertTrue(Test.TRUE, Validator.validateHMISettingsControlData(Test.GENERAL_HMISETTINGSCONTROLDATA, hmiSettingsControlData)); - assertTrue(Test.TRUE, Validator.validateLightControlData(Test.GENERAL_LIGHTCONTROLDATA, lightControlData)); - assertEquals(Test.MATCH, Test.GENERAL_STRING, moduleId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MODULETYPE, moduleType); + assertTrue(TestValues.TRUE, Validator.validateRadioControlData(TestValues.GENERAL_RADIOCONTROLDATA, radioControlData)); + assertTrue(TestValues.TRUE, Validator.validateClimateControlData(TestValues.GENERAL_CLIMATECONTROLDATA, climateControlData)); + assertTrue(TestValues.TRUE, Validator.validateSeatControlData(TestValues.GENERAL_SEATCONTROLDATA, seatControlData)); + assertTrue(TestValues.TRUE, Validator.validateAudioControlData(TestValues.GENERAL_AUDIOCONTROLDATA, audioControlData)); + assertTrue(TestValues.TRUE, Validator.validateHMISettingsControlData(TestValues.GENERAL_HMISETTINGSCONTROLDATA, hmiSettingsControlData)); + assertTrue(TestValues.TRUE, Validator.validateLightControlData(TestValues.GENERAL_LIGHTCONTROLDATA, lightControlData)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, moduleId); // Invalid/Null Tests ModuleData msg = new ModuleData(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getModuleType()); - assertNull(Test.NULL, msg.getRadioControlData()); - assertNull(Test.NULL, msg.getClimateControlData()); - assertNull(Test.NULL, msg.getSeatControlData()); - assertNull(Test.NULL, msg.getAudioControlData()); - assertNull(Test.NULL, msg.getHmiSettingsControlData()); - assertNull(Test.NULL, msg.getLightControlData()); - assertNull(Test.NULL, msg.getModuleId()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getModuleType()); + assertNull(TestValues.NULL, msg.getRadioControlData()); + assertNull(TestValues.NULL, msg.getClimateControlData()); + assertNull(TestValues.NULL, msg.getSeatControlData()); + assertNull(TestValues.NULL, msg.getAudioControlData()); + assertNull(TestValues.NULL, msg.getHmiSettingsControlData()); + assertNull(TestValues.NULL, msg.getLightControlData()); + assertNull(TestValues.NULL, msg.getModuleId()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(ModuleData.KEY_MODULE_TYPE, Test.GENERAL_MODULETYPE); - reference.put(ModuleData.KEY_RADIO_CONTROL_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_RADIOCONTROLDATA.getStore())); - reference.put(ModuleData.KEY_CLIMATE_CONTROL_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_CLIMATECONTROLDATA.getStore())); - reference.put(ModuleData.KEY_SEAT_CONTROL_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_SEATCONTROLDATA.getStore())); - reference.put(ModuleData.KEY_AUDIO_CONTROL_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_AUDIOCONTROLDATA.getStore())); - reference.put(ModuleData.KEY_HMI_SETTINGS_CONTROL_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_HMISETTINGSCONTROLDATA.getStore())); - reference.put(ModuleData.KEY_LIGHT_CONTROL_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_LIGHTCONTROLDATA.getStore())); - reference.put(ModuleData.KEY_MODULE_ID, Test.GENERAL_STRING); + reference.put(ModuleData.KEY_MODULE_TYPE, TestValues.GENERAL_MODULETYPE); + reference.put(ModuleData.KEY_RADIO_CONTROL_DATA, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_RADIOCONTROLDATA.getStore())); + reference.put(ModuleData.KEY_CLIMATE_CONTROL_DATA, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_CLIMATECONTROLDATA.getStore())); + reference.put(ModuleData.KEY_SEAT_CONTROL_DATA, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_SEATCONTROLDATA.getStore())); + reference.put(ModuleData.KEY_AUDIO_CONTROL_DATA, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_AUDIOCONTROLDATA.getStore())); + reference.put(ModuleData.KEY_HMI_SETTINGS_CONTROL_DATA, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_HMISETTINGSCONTROLDATA.getStore())); + reference.put(ModuleData.KEY_LIGHT_CONTROL_DATA, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_LIGHTCONTROLDATA.getStore())); + reference.put(ModuleData.KEY_MODULE_ID, TestValues.GENERAL_STRING); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { @@ -105,43 +105,43 @@ public class ModuleDataTests extends TestCase { JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateRadioControlData(new RadioControlData(hashReference), new RadioControlData(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateRadioControlData(new RadioControlData(hashReference), new RadioControlData(hashTest))); } else if (key.equals(ModuleData.KEY_CLIMATE_CONTROL_DATA)) { JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key); JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateClimateControlData(new ClimateControlData(hashReference), new ClimateControlData(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateClimateControlData(new ClimateControlData(hashReference), new ClimateControlData(hashTest))); } else if (key.equals(ModuleData.KEY_SEAT_CONTROL_DATA)) { JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key); JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateSeatControlData(new SeatControlData(hashReference), new SeatControlData(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateSeatControlData(new SeatControlData(hashReference), new SeatControlData(hashTest))); } else if (key.equals(ModuleData.KEY_AUDIO_CONTROL_DATA)) { JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key); JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateAudioControlData(new AudioControlData(hashReference), new AudioControlData(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateAudioControlData(new AudioControlData(hashReference), new AudioControlData(hashTest))); } else if (key.equals(ModuleData.KEY_HMI_SETTINGS_CONTROL_DATA)) { JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key); JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateHMISettingsControlData(new HMISettingsControlData(hashReference), new HMISettingsControlData(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateHMISettingsControlData(new HMISettingsControlData(hashReference), new HMISettingsControlData(hashTest))); } else if (key.equals(ModuleData.KEY_LIGHT_CONTROL_DATA)) { JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key); JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateLightControlData(new LightControlData(hashReference), new LightControlData(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateLightControlData(new LightControlData(hashReference), new LightControlData(hashTest))); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleInfoTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleInfoTests.java index 282e43b4f..ef09a270f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleInfoTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleInfoTests.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.rpc.Grid; import com.smartdevicelink.proxy.rpc.ModuleInfo; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -19,10 +19,10 @@ public class ModuleInfoTests extends TestCase { @Override public void setUp() { msg = new ModuleInfo(); - msg.setModuleId(Test.GENERAL_STRING); - msg.setModuleLocation(Test.GENERAL_GRID); - msg.setModuleServiceArea(Test.GENERAL_GRID); - msg.setMultipleAccessAllowance(Test.GENERAL_BOOLEAN); + msg.setModuleId(TestValues.GENERAL_STRING); + msg.setModuleLocation(TestValues.GENERAL_GRID); + msg.setModuleServiceArea(TestValues.GENERAL_GRID); + msg.setMultipleAccessAllowance(TestValues.GENERAL_BOOLEAN); } public void testRpcValues() { @@ -32,39 +32,39 @@ public class ModuleInfoTests extends TestCase { boolean isAllowed = msg.getMultipleAccessAllowance(); //valid tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, id); - assertEquals(Test.MATCH, Test.GENERAL_GRID, loc); - assertEquals(Test.MATCH, Test.GENERAL_GRID, area); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, isAllowed); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, id); + assertEquals(TestValues.MATCH, TestValues.GENERAL_GRID, loc); + assertEquals(TestValues.MATCH, TestValues.GENERAL_GRID, area); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, isAllowed); //null test ModuleInfo msg = new ModuleInfo(); - assertNull(Test.NULL, msg.getModuleId()); - assertNull(Test.NULL, msg.getModuleLocation()); - assertNull(Test.NULL, msg.getModuleServiceArea()); - assertNull(Test.NULL, msg.getMultipleAccessAllowance()); + assertNull(TestValues.NULL, msg.getModuleId()); + assertNull(TestValues.NULL, msg.getModuleLocation()); + assertNull(TestValues.NULL, msg.getModuleServiceArea()); + assertNull(TestValues.NULL, msg.getMultipleAccessAllowance()); //test required params constructor - ModuleInfo msg2 = new ModuleInfo(Test.GENERAL_STRING); - assertEquals(Test.MATCH, msg2.getModuleId(), Test.GENERAL_STRING); + ModuleInfo msg2 = new ModuleInfo(TestValues.GENERAL_STRING); + assertEquals(TestValues.MATCH, msg2.getModuleId(), TestValues.GENERAL_STRING); } public void testJson() { JSONObject original = new JSONObject(); try { - original.put(ModuleInfo.KEY_MODULE_ID, Test.GENERAL_STRING); - original.put(ModuleInfo.KEY_MODULE_LOCATION, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_GRID.getStore())); - original.put(ModuleInfo.KEY_MODULE_SERVICE_AREA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_GRID.getStore())); - original.put(ModuleInfo.KEY_MULTIPLE_ACCESS_ALLOWED, Test.GENERAL_BOOLEAN); + original.put(ModuleInfo.KEY_MODULE_ID, TestValues.GENERAL_STRING); + original.put(ModuleInfo.KEY_MODULE_LOCATION, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_GRID.getStore())); + original.put(ModuleInfo.KEY_MODULE_SERVICE_AREA, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_GRID.getStore())); + original.put(ModuleInfo.KEY_MULTIPLE_ACCESS_ALLOWED, TestValues.GENERAL_BOOLEAN); JSONObject serialized = msg.serializeJSON(); - assertEquals(Test.MATCH, original.length(), serialized.length()); + assertEquals(TestValues.MATCH, original.length(), serialized.length()); Hashtable<String, Object> h1 = JsonRPCMarshaller.deserializeJSONObject(original); Hashtable<String, Object> h2 = JsonRPCMarshaller.deserializeJSONObject(serialized); - assertTrue(Test.TRUE, Validator.validateModuleInfo(new ModuleInfo(h1), new ModuleInfo(h2))); + assertTrue(TestValues.TRUE, Validator.validateModuleInfo(new ModuleInfo(h1), new ModuleInfo(h2))); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MyKeyTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MyKeyTests.java index a496964ad..deda0f886 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MyKeyTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MyKeyTests.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.MyKey; import com.smartdevicelink.proxy.rpc.enums.VehicleDataStatus; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,7 +23,7 @@ public class MyKeyTests extends TestCase{ @Override public void setUp(){ msg = new MyKey(); - msg.setE911Override(Test.GENERAL_VEHICLEDATASTATUS); + msg.setE911Override(TestValues.GENERAL_VEHICLEDATASTATUS); } /** @@ -34,31 +34,31 @@ public class MyKeyTests extends TestCase{ VehicleDataStatus override = msg.getE911Override(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_VEHICLEDATASTATUS, override); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHICLEDATASTATUS, override); // Invalid/Null Tests MyKey msg = new MyKey(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getE911Override()); + assertNull(TestValues.NULL, msg.getE911Override()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(MyKey.KEY_E_911_OVERRIDE, Test.GENERAL_VEHICLEDATASTATUS); + reference.put(MyKey.KEY_E_911_OVERRIDE, TestValues.GENERAL_VEHICLEDATASTATUS); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationCapabilityTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationCapabilityTests.java index efbf7e30d..518eb6a95 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationCapabilityTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationCapabilityTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.NavigationCapability; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,8 +23,8 @@ public class NavigationCapabilityTests extends TestCase{ public void setUp(){ msg = new NavigationCapability(); - msg.setSendLocationEnabled(Test.GENERAL_BOOLEAN); - msg.setWayPointsEnabled(Test.GENERAL_BOOLEAN); + msg.setSendLocationEnabled(TestValues.GENERAL_BOOLEAN); + msg.setWayPointsEnabled(TestValues.GENERAL_BOOLEAN); } /** @@ -36,34 +36,34 @@ public class NavigationCapabilityTests extends TestCase{ boolean getWayPointsEnabled = msg.getWayPointsEnabled(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, sendLocationEnabled); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, getWayPointsEnabled); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, sendLocationEnabled); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, getWayPointsEnabled); // Invalid/Null Tests NavigationCapability msg = new NavigationCapability(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getSendLocationEnabled()); - assertNull(Test.NULL, msg.getWayPointsEnabled()); + assertNull(TestValues.NULL, msg.getSendLocationEnabled()); + assertNull(TestValues.NULL, msg.getWayPointsEnabled()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(NavigationCapability.KEY_GETWAYPOINTS_ENABLED, Test.GENERAL_BOOLEAN); - reference.put(NavigationCapability.KEY_LOCATION_ENABLED, Test.GENERAL_BOOLEAN); + reference.put(NavigationCapability.KEY_GETWAYPOINTS_ENABLED, TestValues.GENERAL_BOOLEAN); + reference.put(NavigationCapability.KEY_LOCATION_ENABLED, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationInstructionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationInstructionTests.java index c27d33ee2..cfb791f02 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationInstructionTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationInstructionTests.java @@ -9,7 +9,7 @@ import com.smartdevicelink.proxy.rpc.enums.Direction; import com.smartdevicelink.proxy.rpc.enums.NavigationAction; import com.smartdevicelink.proxy.rpc.enums.NavigationJunction; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -32,14 +32,14 @@ public class NavigationInstructionTests extends TestCase { public void setUp(){ msg = new NavigationInstruction(); - msg.setLocationDetails(Test.GENERAL_LOCATIONDETAILS); - msg.setAction(Test.GENERAL_NAVIGATIONACTION); - msg.setEta(Test.GENERAL_DATETIME); - msg.setBearing(Test.GENERAL_INTEGER); - msg.setJunctionType(Test.GENERAL_NAVIGATION_JUNCTION); - msg.setDrivingSide(Test.GENERAL_DIRECTION); - msg.setDetails(Test.GENERAL_STRING); - msg.setImage(Test.GENERAL_IMAGE); + msg.setLocationDetails(TestValues.GENERAL_LOCATIONDETAILS); + msg.setAction(TestValues.GENERAL_NAVIGATIONACTION); + msg.setEta(TestValues.GENERAL_DATETIME); + msg.setBearing(TestValues.GENERAL_INTEGER); + msg.setJunctionType(TestValues.GENERAL_NAVIGATION_JUNCTION); + msg.setDrivingSide(TestValues.GENERAL_DIRECTION); + msg.setDetails(TestValues.GENERAL_STRING); + msg.setImage(TestValues.GENERAL_IMAGE); } /** @@ -57,55 +57,55 @@ public class NavigationInstructionTests extends TestCase { Image image = msg.getImage(); // Valid Tests - assertEquals(Test.GENERAL_LOCATIONDETAILS, locationDetails); - assertEquals(Test.GENERAL_NAVIGATIONACTION, action); - assertEquals(Test.GENERAL_DATETIME, eta); - assertEquals(Test.GENERAL_INTEGER, bearing); - assertEquals(Test.GENERAL_NAVIGATION_JUNCTION, junctionType); - assertEquals(Test.GENERAL_DIRECTION, drivingSide); - assertEquals(Test.GENERAL_STRING, details); - assertEquals(Test.GENERAL_IMAGE, image); + assertEquals(TestValues.GENERAL_LOCATIONDETAILS, locationDetails); + assertEquals(TestValues.GENERAL_NAVIGATIONACTION, action); + assertEquals(TestValues.GENERAL_DATETIME, eta); + assertEquals(TestValues.GENERAL_INTEGER, bearing); + assertEquals(TestValues.GENERAL_NAVIGATION_JUNCTION, junctionType); + assertEquals(TestValues.GENERAL_DIRECTION, drivingSide); + assertEquals(TestValues.GENERAL_STRING, details); + assertEquals(TestValues.GENERAL_IMAGE, image); // Invalid/Null Tests NavigationInstruction msg = new NavigationInstruction(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getLocationDetails()); - assertNull(Test.NULL, msg.getAction()); - assertNull(Test.NULL, msg.getEta()); - assertNull(Test.NULL, msg.getBearing()); - assertNull(Test.NULL, msg.getJunctionType()); - assertNull(Test.NULL, msg.getDrivingSide()); - assertNull(Test.NULL, msg.getDetails()); - assertNull(Test.NULL, msg.getImage()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getLocationDetails()); + assertNull(TestValues.NULL, msg.getAction()); + assertNull(TestValues.NULL, msg.getEta()); + assertNull(TestValues.NULL, msg.getBearing()); + assertNull(TestValues.NULL, msg.getJunctionType()); + assertNull(TestValues.NULL, msg.getDrivingSide()); + assertNull(TestValues.NULL, msg.getDetails()); + assertNull(TestValues.NULL, msg.getImage()); } public void testRequiredConstructor(){ - NavigationInstruction msg = new NavigationInstruction(Test.GENERAL_LOCATIONDETAILS, Test.GENERAL_NAVIGATIONACTION); - assertNotNull(Test.NOT_NULL, msg); + NavigationInstruction msg = new NavigationInstruction(TestValues.GENERAL_LOCATIONDETAILS, TestValues.GENERAL_NAVIGATIONACTION); + assertNotNull(TestValues.NOT_NULL, msg); LocationDetails locationDetails = msg.getLocationDetails(); NavigationAction action = msg.getAction(); - assertEquals(Test.GENERAL_LOCATIONDETAILS, locationDetails); - assertEquals(Test.GENERAL_NAVIGATIONACTION, action); + assertEquals(TestValues.GENERAL_LOCATIONDETAILS, locationDetails); + assertEquals(TestValues.GENERAL_NAVIGATIONACTION, action); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(NavigationInstruction.KEY_LOCATION_DETAILS, Test.GENERAL_LOCATIONDETAILS); - reference.put(NavigationInstruction.KEY_ACTION, Test.GENERAL_NAVIGATIONACTION); - reference.put(NavigationInstruction.KEY_ETA, Test.GENERAL_DATETIME); - reference.put(NavigationInstruction.KEY_BEARING, Test.GENERAL_INTEGER); - reference.put(NavigationInstruction.KEY_JUNCTION_TYPE, Test.GENERAL_NAVIGATION_JUNCTION); - reference.put(NavigationInstruction.KEY_DRIVING_SIDE, Test.GENERAL_DIRECTION); - reference.put(NavigationInstruction.KEY_DETAILS, Test.GENERAL_STRING); - reference.put(NavigationInstruction.KEY_IMAGE, Test.GENERAL_IMAGE); + reference.put(NavigationInstruction.KEY_LOCATION_DETAILS, TestValues.GENERAL_LOCATIONDETAILS); + reference.put(NavigationInstruction.KEY_ACTION, TestValues.GENERAL_NAVIGATIONACTION); + reference.put(NavigationInstruction.KEY_ETA, TestValues.GENERAL_DATETIME); + reference.put(NavigationInstruction.KEY_BEARING, TestValues.GENERAL_INTEGER); + reference.put(NavigationInstruction.KEY_JUNCTION_TYPE, TestValues.GENERAL_NAVIGATION_JUNCTION); + reference.put(NavigationInstruction.KEY_DRIVING_SIDE, TestValues.GENERAL_DIRECTION); + reference.put(NavigationInstruction.KEY_DETAILS, TestValues.GENERAL_STRING); + reference.put(NavigationInstruction.KEY_IMAGE, TestValues.GENERAL_IMAGE); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -114,21 +114,21 @@ public class NavigationInstructionTests extends TestCase { if(key.equals(NavigationInstruction.KEY_IMAGE)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Image refIcon1 = new Image(JsonRPCMarshaller.deserializeJSONObject(testEquals)); - assertTrue(Test.TRUE, Validator.validateImage(refIcon1, msg.getImage())); + assertTrue(TestValues.TRUE, Validator.validateImage(refIcon1, msg.getImage())); }else if(key.equals(NavigationInstruction.KEY_LOCATION_DETAILS)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateLocationDetails( Test.GENERAL_LOCATIONDETAILS, new LocationDetails(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateLocationDetails( TestValues.GENERAL_LOCATIONDETAILS, new LocationDetails(hashTest))); }else if (key.equals(NavigationInstruction.KEY_ETA)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateDateTime(Test.GENERAL_DATETIME, new DateTime(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateDateTime(TestValues.GENERAL_DATETIME, new DateTime(hashTest))); }else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationServiceDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationServiceDataTests.java index 9b59062d4..9276fc091 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationServiceDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationServiceDataTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.rpc.LocationDetails; import com.smartdevicelink.proxy.rpc.NavigationInstruction; import com.smartdevicelink.proxy.rpc.NavigationServiceData; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -32,15 +32,15 @@ public class NavigationServiceDataTests extends TestCase { public void setUp(){ msg = new NavigationServiceData(); - msg.setTimeStamp(Test.GENERAL_DATETIME); - msg.setOrigin(Test.GENERAL_LOCATIONDETAILS); - msg.setDestination(Test.GENERAL_LOCATIONDETAILS); - msg.setDestinationETA(Test.GENERAL_DATETIME); - msg.setInstructions(Test.GENERAL_NAVIGATION_INSTRUCTION_LIST); - msg.setNextInstructionETA(Test.GENERAL_DATETIME); - msg.setNextInstructionDistance(Test.GENERAL_FLOAT); - msg.setNextInstructionDistanceScale(Test.GENERAL_FLOAT); - msg.setPrompt(Test.GENERAL_STRING); + msg.setTimeStamp(TestValues.GENERAL_DATETIME); + msg.setOrigin(TestValues.GENERAL_LOCATIONDETAILS); + msg.setDestination(TestValues.GENERAL_LOCATIONDETAILS); + msg.setDestinationETA(TestValues.GENERAL_DATETIME); + msg.setInstructions(TestValues.GENERAL_NAVIGATION_INSTRUCTION_LIST); + msg.setNextInstructionETA(TestValues.GENERAL_DATETIME); + msg.setNextInstructionDistance(TestValues.GENERAL_FLOAT); + msg.setNextInstructionDistanceScale(TestValues.GENERAL_FLOAT); + msg.setPrompt(TestValues.GENERAL_STRING); } /** @@ -59,57 +59,57 @@ public class NavigationServiceDataTests extends TestCase { String prompt = msg.getPrompt(); // Valid Tests - assertEquals(Test.GENERAL_DATETIME, timestamp); - assertEquals(Test.GENERAL_LOCATIONDETAILS, origin); - assertEquals(Test.GENERAL_LOCATIONDETAILS, destination); - assertEquals(Test.GENERAL_DATETIME, destinationETA); - assertEquals(Test.GENERAL_NAVIGATION_INSTRUCTION_LIST, instructions); - assertEquals(Test.GENERAL_DATETIME, nextInstructionETA); - assertEquals(Test.GENERAL_FLOAT, nextInstructionDistance); - assertEquals(Test.GENERAL_FLOAT, nextInstructionDistanceScale); - assertEquals(Test.GENERAL_STRING, prompt); + assertEquals(TestValues.GENERAL_DATETIME, timestamp); + assertEquals(TestValues.GENERAL_LOCATIONDETAILS, origin); + assertEquals(TestValues.GENERAL_LOCATIONDETAILS, destination); + assertEquals(TestValues.GENERAL_DATETIME, destinationETA); + assertEquals(TestValues.GENERAL_NAVIGATION_INSTRUCTION_LIST, instructions); + assertEquals(TestValues.GENERAL_DATETIME, nextInstructionETA); + assertEquals(TestValues.GENERAL_FLOAT, nextInstructionDistance); + assertEquals(TestValues.GENERAL_FLOAT, nextInstructionDistanceScale); + assertEquals(TestValues.GENERAL_STRING, prompt); // Invalid/Null Tests NavigationServiceData msg = new NavigationServiceData(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getTimeStamp()); - assertNull(Test.NULL, msg.getOrigin()); - assertNull(Test.NULL, msg.getDestination()); - assertNull(Test.NULL, msg.getDestinationETA()); - assertNull(Test.NULL, msg.getInstructions()); - assertNull(Test.NULL, msg.getNextInstructionETA()); - assertNull(Test.NULL, msg.getNextInstructionDistance()); - assertNull(Test.NULL, msg.getNextInstructionDistanceScale()); - assertNull(Test.NULL, msg.getPrompt()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getTimeStamp()); + assertNull(TestValues.NULL, msg.getOrigin()); + assertNull(TestValues.NULL, msg.getDestination()); + assertNull(TestValues.NULL, msg.getDestinationETA()); + assertNull(TestValues.NULL, msg.getInstructions()); + assertNull(TestValues.NULL, msg.getNextInstructionETA()); + assertNull(TestValues.NULL, msg.getNextInstructionDistance()); + assertNull(TestValues.NULL, msg.getNextInstructionDistanceScale()); + assertNull(TestValues.NULL, msg.getPrompt()); } public void testRequiredConstructor(){ - NavigationServiceData msg = new NavigationServiceData(Test.GENERAL_DATETIME); - assertNotNull(Test.NOT_NULL, msg); + NavigationServiceData msg = new NavigationServiceData(TestValues.GENERAL_DATETIME); + assertNotNull(TestValues.NOT_NULL, msg); DateTime locationDetails = msg.getTimeStamp(); - assertEquals(Test.GENERAL_DATETIME, locationDetails); + assertEquals(TestValues.GENERAL_DATETIME, locationDetails); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(NavigationServiceData.KEY_TIMESTAMP, Test.GENERAL_DATETIME); - reference.put(NavigationServiceData.KEY_ORIGIN, Test.GENERAL_LOCATIONDETAILS); - reference.put(NavigationServiceData.KEY_DESTINATION, Test.GENERAL_LOCATIONDETAILS); - reference.put(NavigationServiceData.KEY_DESTINATION_ETA, Test.GENERAL_DATETIME); - reference.put(NavigationServiceData.KEY_INSTRUCTIONS, Test.GENERAL_NAVIGATION_INSTRUCTION_LIST); - reference.put(NavigationServiceData.KEY_NEXT_INSTRUCTION_ETA, Test.GENERAL_DATETIME); - reference.put(NavigationServiceData.KEY_NEXT_INSTRUCTION_DISTANCE, Test.GENERAL_FLOAT); - reference.put(NavigationServiceData.KEY_NEXT_INSTRUCTION_DISTANCE_SCALE, Test.GENERAL_FLOAT); - reference.put(NavigationServiceData.KEY_PROMPT, Test.GENERAL_STRING); + reference.put(NavigationServiceData.KEY_TIMESTAMP, TestValues.GENERAL_DATETIME); + reference.put(NavigationServiceData.KEY_ORIGIN, TestValues.GENERAL_LOCATIONDETAILS); + reference.put(NavigationServiceData.KEY_DESTINATION, TestValues.GENERAL_LOCATIONDETAILS); + reference.put(NavigationServiceData.KEY_DESTINATION_ETA, TestValues.GENERAL_DATETIME); + reference.put(NavigationServiceData.KEY_INSTRUCTIONS, TestValues.GENERAL_NAVIGATION_INSTRUCTION_LIST); + reference.put(NavigationServiceData.KEY_NEXT_INSTRUCTION_ETA, TestValues.GENERAL_DATETIME); + reference.put(NavigationServiceData.KEY_NEXT_INSTRUCTION_DISTANCE, TestValues.GENERAL_FLOAT); + reference.put(NavigationServiceData.KEY_NEXT_INSTRUCTION_DISTANCE_SCALE, TestValues.GENERAL_FLOAT); + reference.put(NavigationServiceData.KEY_PROMPT, TestValues.GENERAL_STRING); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -118,11 +118,11 @@ public class NavigationServiceDataTests extends TestCase { if(key.equals(NavigationServiceData.KEY_TIMESTAMP)||key.equals(NavigationServiceData.KEY_DESTINATION_ETA)||key.equals(NavigationServiceData.KEY_NEXT_INSTRUCTION_ETA)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateDateTime(Test.GENERAL_DATETIME, new DateTime(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateDateTime(TestValues.GENERAL_DATETIME, new DateTime(hashTest))); }else if(key.equals(NavigationServiceData.KEY_DESTINATION)||key.equals(NavigationServiceData.KEY_ORIGIN)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateLocationDetails( Test.GENERAL_LOCATIONDETAILS, new LocationDetails(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateLocationDetails( TestValues.GENERAL_LOCATIONDETAILS, new LocationDetails(hashTest))); }else if (key.equals(NavigationServiceData.KEY_INSTRUCTIONS)){ JSONArray NavigationInstructionUnderTestListArrayObjTest = JsonUtils.readJsonArrayFromJsonObject(underTest, key); List<NavigationInstruction> NavigationInstructionUnderTestList = new ArrayList<>(); @@ -131,13 +131,13 @@ public class NavigationServiceDataTests extends TestCase { NavigationInstructionUnderTestList.add(NavigationInstructionData); } assertTrue("JSON value didn't match expected value for key \"" + key + "\".", - Validator.validateNavigationInstructionList(Test.GENERAL_NAVIGATION_INSTRUCTION_LIST, NavigationInstructionUnderTestList)); + Validator.validateNavigationInstructionList(TestValues.GENERAL_NAVIGATION_INSTRUCTION_LIST, NavigationInstructionUnderTestList)); }else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationServiceManifestTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationServiceManifestTests.java index de4144677..b9298dcf6 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationServiceManifestTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/NavigationServiceManifestTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.NavigationServiceManifest; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,7 +23,7 @@ public class NavigationServiceManifestTests extends TestCase { public void setUp(){ msg = new NavigationServiceManifest(); - msg.setAcceptsWayPoints(Test.GENERAL_BOOLEAN); + msg.setAcceptsWayPoints(TestValues.GENERAL_BOOLEAN); } /** @@ -34,31 +34,31 @@ public class NavigationServiceManifestTests extends TestCase { boolean acceptsWayPoints = msg.getAcceptsWayPoints(); // Valid Tests - assertEquals(Test.GENERAL_BOOLEAN, acceptsWayPoints); + assertEquals(TestValues.GENERAL_BOOLEAN, acceptsWayPoints); // Invalid/Null Tests NavigationServiceManifest msg = new NavigationServiceManifest(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getAcceptsWayPoints()); + assertNull(TestValues.NULL, msg.getAcceptsWayPoints()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(NavigationServiceManifest.KEY_ACCEPTS_WAY_POINTS, Test.GENERAL_BOOLEAN); + reference.put(NavigationServiceManifest.KEY_ACCEPTS_WAY_POINTS, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/OasisAddressTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/OasisAddressTests.java index cf39a3c18..2ea76cd1d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/OasisAddressTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/OasisAddressTests.java @@ -1,7 +1,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.OasisAddress; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -19,7 +19,7 @@ public class OasisAddressTests extends TestCase { @Override public void setUp(){ - msg = Test.GENERAL_OASISADDRESS; + msg = TestValues.GENERAL_OASISADDRESS; } /** @@ -39,19 +39,19 @@ public class OasisAddressTests extends TestCase { // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, f1); - assertEquals(Test.MATCH, Test.GENERAL_STRING, f2); - assertEquals(Test.MATCH, Test.GENERAL_STRING, f3); - assertEquals(Test.MATCH, Test.GENERAL_STRING, f4); - assertEquals(Test.MATCH, Test.GENERAL_STRING, f5); - assertEquals(Test.MATCH, Test.GENERAL_STRING, f6); - assertEquals(Test.MATCH, Test.GENERAL_STRING, f7); - assertEquals(Test.MATCH, Test.GENERAL_STRING, f8); - assertEquals(Test.MATCH, Test.GENERAL_STRING, f9); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, f1); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, f2); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, f3); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, f4); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, f5); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, f6); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, f7); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, f8); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, f9); // Invalid/Null Tests OasisAddress msg = new OasisAddress(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); assertNull(msg.getAdministrativeArea()); assertNull(msg.getSubAdministrativeArea()); @@ -68,28 +68,28 @@ public class OasisAddressTests extends TestCase { JSONObject reference = new JSONObject(); try{ - reference.put(OasisAddress.KEY_ADMINISTRATIVE_AREA, Test.GENERAL_STRING); - reference.put(OasisAddress.KEY_SUB_ADMINISTRATIVE_AREA, Test.GENERAL_STRING); - reference.put(OasisAddress.KEY_COUNTRY_CODE, Test.GENERAL_STRING); - reference.put(OasisAddress.KEY_COUNTRY_NAME, Test.GENERAL_STRING); - reference.put(OasisAddress.KEY_LOCALITY, Test.GENERAL_STRING); - reference.put(OasisAddress.KEY_SUB_LOCALITY, Test.GENERAL_STRING); - reference.put(OasisAddress.KEY_POSTAL_CODE, Test.GENERAL_STRING); - reference.put(OasisAddress.KEY_THOROUGH_FARE, Test.GENERAL_STRING); - reference.put(OasisAddress.KEY_SUB_THOROUGH_FARE, Test.GENERAL_STRING); + reference.put(OasisAddress.KEY_ADMINISTRATIVE_AREA, TestValues.GENERAL_STRING); + reference.put(OasisAddress.KEY_SUB_ADMINISTRATIVE_AREA, TestValues.GENERAL_STRING); + reference.put(OasisAddress.KEY_COUNTRY_CODE, TestValues.GENERAL_STRING); + reference.put(OasisAddress.KEY_COUNTRY_NAME, TestValues.GENERAL_STRING); + reference.put(OasisAddress.KEY_LOCALITY, TestValues.GENERAL_STRING); + reference.put(OasisAddress.KEY_SUB_LOCALITY, TestValues.GENERAL_STRING); + reference.put(OasisAddress.KEY_POSTAL_CODE, TestValues.GENERAL_STRING); + reference.put(OasisAddress.KEY_THOROUGH_FARE, TestValues.GENERAL_STRING); + reference.put(OasisAddress.KEY_SUB_THOROUGH_FARE, TestValues.GENERAL_STRING); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, reference.get(key), + assertEquals(TestValues.MATCH, reference.get(key), underTest.get(key)); } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ParameterPermissionsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ParameterPermissionsTests.java index a76b1e754..d62d2bdc8 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ParameterPermissionsTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ParameterPermissionsTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.ParameterPermissions; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -25,8 +25,8 @@ public class ParameterPermissionsTests extends TestCase{ public void setUp(){ msg = new ParameterPermissions(); - msg.setAllowed(Test.GENERAL_STRING_LIST); - msg.setUserDisallowed(Test.GENERAL_STRING_LIST); + msg.setAllowed(TestValues.GENERAL_STRING_LIST); + msg.setUserDisallowed(TestValues.GENERAL_STRING_LIST); } /** @@ -38,34 +38,34 @@ public class ParameterPermissionsTests extends TestCase{ List<String> disallowed = msg.getUserDisallowed(); // Valid Tests - assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, allowed)); - assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, disallowed)); + assertTrue(TestValues.TRUE, Validator.validateStringList(TestValues.GENERAL_STRING_LIST, allowed)); + assertTrue(TestValues.TRUE, Validator.validateStringList(TestValues.GENERAL_STRING_LIST, disallowed)); // Invalid/Null Tests ParameterPermissions msg = new ParameterPermissions(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getAllowed()); - assertNull(Test.NULL, msg.getUserDisallowed()); + assertNull(TestValues.NULL, msg.getAllowed()); + assertNull(TestValues.NULL, msg.getUserDisallowed()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(ParameterPermissions.KEY_ALLOWED, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST)); - reference.put(ParameterPermissions.KEY_USER_DISALLOWED, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST)); + reference.put(ParameterPermissions.KEY_ALLOWED, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); + reference.put(ParameterPermissions.KEY_USER_DISALLOWED, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key))); + assertTrue(TestValues.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key))); } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PermissionItemTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PermissionItemTest.java index 491803317..819fff516 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PermissionItemTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PermissionItemTest.java @@ -4,7 +4,7 @@ import com.smartdevicelink.proxy.rpc.HMIPermissions; import com.smartdevicelink.proxy.rpc.ParameterPermissions; import com.smartdevicelink.proxy.rpc.PermissionItem; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -26,10 +26,10 @@ public class PermissionItemTest extends TestCase { public void setUp() { msg = new PermissionItem(); - msg.setRpcName(Test.GENERAL_STRING); - msg.setHMIPermissions(Test.GENERAL_HMIPERMISSIONS); - msg.setParameterPermissions(Test.GENERAL_PARAMETERPERMISSIONS); - msg.setRequireEncryption(Test.GENERAL_BOOLEAN); + msg.setRpcName(TestValues.GENERAL_STRING); + msg.setHMIPermissions(TestValues.GENERAL_HMIPERMISSIONS); + msg.setParameterPermissions(TestValues.GENERAL_PARAMETERPERMISSIONS); + msg.setRequireEncryption(TestValues.GENERAL_BOOLEAN); } /** @@ -43,49 +43,49 @@ public class PermissionItemTest extends TestCase { boolean isEncryptionRequired = msg.getRequireEncryption(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, rpcName); - assertTrue(Test.TRUE, Validator.validateHmiPermissions(Test.GENERAL_HMIPERMISSIONS, hmiPermissions)); - assertTrue(Test.TRUE, Validator.validateParameterPermissions(Test.GENERAL_PARAMETERPERMISSIONS, parameterPermissions)); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, isEncryptionRequired); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, rpcName); + assertTrue(TestValues.TRUE, Validator.validateHmiPermissions(TestValues.GENERAL_HMIPERMISSIONS, hmiPermissions)); + assertTrue(TestValues.TRUE, Validator.validateParameterPermissions(TestValues.GENERAL_PARAMETERPERMISSIONS, parameterPermissions)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, isEncryptionRequired); // Invalid/Null Tests PermissionItem msg = new PermissionItem(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getRpcName()); - assertNull(Test.NULL, msg.getHMIPermissions()); - assertNull(Test.NULL, msg.getParameterPermissions()); - assertNull(Test.NULL, msg.getRequireEncryption()); + assertNull(TestValues.NULL, msg.getRpcName()); + assertNull(TestValues.NULL, msg.getHMIPermissions()); + assertNull(TestValues.NULL, msg.getParameterPermissions()); + assertNull(TestValues.NULL, msg.getRequireEncryption()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(PermissionItem.KEY_RPC_NAME, Test.GENERAL_STRING); - reference.put(PermissionItem.KEY_HMI_PERMISSIONS, Test.JSON_HMIPERMISSIONS); - reference.put(PermissionItem.KEY_PARAMETER_PERMISSIONS, Test.JSON_PARAMETERPERMISSIONS); - reference.put(PermissionItem.KEY_REQUIRE_ENCRYPTION, Test.GENERAL_BOOLEAN); + reference.put(PermissionItem.KEY_RPC_NAME, TestValues.GENERAL_STRING); + reference.put(PermissionItem.KEY_HMI_PERMISSIONS, TestValues.JSON_HMIPERMISSIONS); + reference.put(PermissionItem.KEY_PARAMETER_PERMISSIONS, TestValues.JSON_PARAMETERPERMISSIONS); + reference.put(PermissionItem.KEY_REQUIRE_ENCRYPTION, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); if (key.equals(PermissionItem.KEY_HMI_PERMISSIONS)) { - assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key))); + assertTrue(TestValues.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key))); } else if (key.equals(PermissionItem.KEY_PARAMETER_PERMISSIONS)) { - assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key))); + assertTrue(TestValues.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key))); } else if (key.equals(PermissionItem.KEY_REQUIRE_ENCRYPTION)) { - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(reference, key), JsonUtils.readBooleanFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(reference, key), JsonUtils.readBooleanFromJsonObject(underTest, key)); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PhoneCapabilityTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PhoneCapabilityTests.java index 2614db0fd..97966d677 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PhoneCapabilityTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PhoneCapabilityTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.PhoneCapability; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,7 +23,7 @@ public class PhoneCapabilityTests extends TestCase{ public void setUp(){ msg = new PhoneCapability(); - msg.setDialNumberEnabled(Test.GENERAL_BOOLEAN); + msg.setDialNumberEnabled(TestValues.GENERAL_BOOLEAN); } /** @@ -34,31 +34,31 @@ public class PhoneCapabilityTests extends TestCase{ boolean dialNumberEnabled = msg.getDialNumberEnabled(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, dialNumberEnabled); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, dialNumberEnabled); // Invalid/Null Tests PhoneCapability msg = new PhoneCapability(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getDialNumberEnabled()); + assertNull(TestValues.NULL, msg.getDialNumberEnabled()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(PhoneCapability.KEY_DIALNUMBER_ENABLED, Test.GENERAL_BOOLEAN); + reference.put(PhoneCapability.KEY_DIALNUMBER_ENABLED, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PresetBankCapabilitiesTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PresetBankCapabilitiesTest.java index 256ef1383..0b8e160df 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PresetBankCapabilitiesTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/PresetBankCapabilitiesTest.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.PresetBankCapabilities; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,7 +23,7 @@ public class PresetBankCapabilitiesTest extends TestCase { public void setUp() { msg = new PresetBankCapabilities(); - msg.setOnScreenPresetsAvailable(Test.GENERAL_BOOLEAN); + msg.setOnScreenPresetsAvailable(TestValues.GENERAL_BOOLEAN); } /** @@ -34,31 +34,31 @@ public class PresetBankCapabilitiesTest extends TestCase { boolean presets = msg.onScreenPresetsAvailable(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, presets); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, presets); // Invalid/Null Tests PresetBankCapabilities msg = new PresetBankCapabilities(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.onScreenPresetsAvailable()); + assertNull(TestValues.NULL, msg.onScreenPresetsAvailable()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(PresetBankCapabilities.KEY_ON_SCREEN_PRESETS_AVAILABLE, Test.GENERAL_BOOLEAN); + reference.put(PresetBankCapabilities.KEY_ON_SCREEN_PRESETS_AVAILABLE, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RGBColorTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RGBColorTest.java index a9c0033a0..d2f0254f4 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RGBColorTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RGBColorTest.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.RGBColor; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -21,7 +21,7 @@ public class RGBColorTest extends TestCase { @Override public void setUp() { - msg = new RGBColor(Test.GENERAL_INT, Test.GENERAL_INT, Test.GENERAL_INT); + msg = new RGBColor(TestValues.GENERAL_INT, TestValues.GENERAL_INT, TestValues.GENERAL_INT); } /** @@ -34,37 +34,37 @@ public class RGBColorTest extends TestCase { Integer blue = msg.getBlue(); // Valid Tests - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, red); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, green); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, blue); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, red); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, green); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, blue); // Invalid/Null Tests RGBColor msg = new RGBColor(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertEquals(Test.MATCH, msg.getRed(), (Integer) 0); - assertEquals(Test.MATCH, msg.getGreen(), (Integer) 0); - assertEquals(Test.MATCH, msg.getBlue(), (Integer) 0); + assertEquals(TestValues.MATCH, msg.getRed(), (Integer) 0); + assertEquals(TestValues.MATCH, msg.getGreen(), (Integer) 0); + assertEquals(TestValues.MATCH, msg.getBlue(), (Integer) 0); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(RGBColor.KEY_RED, Test.GENERAL_INT); - reference.put(RGBColor.KEY_GREEN, Test.GENERAL_INT); - reference.put(RGBColor.KEY_BLUE, Test.GENERAL_INT); + reference.put(RGBColor.KEY_RED, TestValues.GENERAL_INT); + reference.put(RGBColor.KEY_GREEN, TestValues.GENERAL_INT); + reference.put(RGBColor.KEY_BLUE, TestValues.GENERAL_INT); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlCapabilitiesTests.java index a65a7deef..949a5f8b4 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlCapabilitiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlCapabilitiesTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.rpc.ModuleInfo; import com.smartdevicelink.proxy.rpc.RadioControlCapabilities; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -27,21 +27,21 @@ public class RadioControlCapabilitiesTests extends TestCase{ public void setUp(){ msg = new RadioControlCapabilities(); - msg.setModuleName(Test.GENERAL_STRING); - msg.setRadioEnableAvailable(Test.GENERAL_BOOLEAN); - msg.setRadioBandAvailable(Test.GENERAL_BOOLEAN); - msg.setRadioFrequencyAvailable(Test.GENERAL_BOOLEAN); - msg.setHdChannelAvailable(Test.GENERAL_BOOLEAN); - msg.setRdsDataAvailable(Test.GENERAL_BOOLEAN); - msg.setAvailableHDsAvailable(Test.GENERAL_BOOLEAN); - msg.setStateAvailable(Test.GENERAL_BOOLEAN); - msg.setSignalStrengthAvailable(Test.GENERAL_BOOLEAN); - msg.setSignalChangeThresholdAvailable(Test.GENERAL_BOOLEAN); - msg.setHdRadioEnableAvailable(Test.GENERAL_BOOLEAN); - msg.setSiriusXMRadioAvailable(Test.GENERAL_BOOLEAN); - msg.setSisDataAvailable(Test.GENERAL_BOOLEAN); - msg.setModuleInfo(Test.GENERAL_MODULE_INFO); - msg.setAvailableHdChannelsAvailable(Test.GENERAL_BOOLEAN); + msg.setModuleName(TestValues.GENERAL_STRING); + msg.setRadioEnableAvailable(TestValues.GENERAL_BOOLEAN); + msg.setRadioBandAvailable(TestValues.GENERAL_BOOLEAN); + msg.setRadioFrequencyAvailable(TestValues.GENERAL_BOOLEAN); + msg.setHdChannelAvailable(TestValues.GENERAL_BOOLEAN); + msg.setRdsDataAvailable(TestValues.GENERAL_BOOLEAN); + msg.setAvailableHDsAvailable(TestValues.GENERAL_BOOLEAN); + msg.setStateAvailable(TestValues.GENERAL_BOOLEAN); + msg.setSignalStrengthAvailable(TestValues.GENERAL_BOOLEAN); + msg.setSignalChangeThresholdAvailable(TestValues.GENERAL_BOOLEAN); + msg.setHdRadioEnableAvailable(TestValues.GENERAL_BOOLEAN); + msg.setSiriusXMRadioAvailable(TestValues.GENERAL_BOOLEAN); + msg.setSisDataAvailable(TestValues.GENERAL_BOOLEAN); + msg.setModuleInfo(TestValues.GENERAL_MODULE_INFO); + msg.setAvailableHdChannelsAvailable(TestValues.GENERAL_BOOLEAN); } /** @@ -67,65 +67,65 @@ public class RadioControlCapabilitiesTests extends TestCase{ // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, moduleName); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, radioEnableAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, radioBandAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, radioFrequencyAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, hdChannelAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, rdsDataAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, availableHDsAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, stateAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, signalStrengthAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, signalChangeThresholdAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, hdRadioEnableAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, siriusXMRadioAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, sisDataAvailable); - assertEquals(Test.MATCH, Test.GENERAL_MODULE_INFO, info); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, availableHdChannelsAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, moduleName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, radioEnableAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, radioBandAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, radioFrequencyAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, hdChannelAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, rdsDataAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, availableHDsAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, stateAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, signalStrengthAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, signalChangeThresholdAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, hdRadioEnableAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, siriusXMRadioAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, sisDataAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MODULE_INFO, info); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, availableHdChannelsAvailable); // Invalid/Null Tests RadioControlCapabilities msg = new RadioControlCapabilities(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getModuleName()); - assertNull(Test.NULL, msg.getRadioEnableAvailable()); - assertNull(Test.NULL, msg.getRadioBandAvailable()); - assertNull(Test.NULL, msg.getRadioFrequencyAvailable()); - assertNull(Test.NULL, msg.getHdChannelAvailable()); - assertNull(Test.NULL, msg.getRdsDataAvailable()); - assertNull(Test.NULL, msg.getAvailableHDsAvailable()); - assertNull(Test.NULL, msg.getStateAvailable()); - assertNull(Test.NULL, msg.getSignalStrengthAvailable()); - assertNull(Test.NULL, msg.getSignalChangeThresholdAvailable()); - assertNull(Test.NULL, msg.getHdRadioEnableAvailable()); - assertNull(Test.NULL, msg.getSiriusXMRadioAvailable()); - assertNull(Test.NULL, msg.getSisDataAvailable()); - assertNull(Test.NULL, msg.getModuleInfo()); - assertNull(Test.NULL, msg.getAvailableHdChannelsAvailable()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getModuleName()); + assertNull(TestValues.NULL, msg.getRadioEnableAvailable()); + assertNull(TestValues.NULL, msg.getRadioBandAvailable()); + assertNull(TestValues.NULL, msg.getRadioFrequencyAvailable()); + assertNull(TestValues.NULL, msg.getHdChannelAvailable()); + assertNull(TestValues.NULL, msg.getRdsDataAvailable()); + assertNull(TestValues.NULL, msg.getAvailableHDsAvailable()); + assertNull(TestValues.NULL, msg.getStateAvailable()); + assertNull(TestValues.NULL, msg.getSignalStrengthAvailable()); + assertNull(TestValues.NULL, msg.getSignalChangeThresholdAvailable()); + assertNull(TestValues.NULL, msg.getHdRadioEnableAvailable()); + assertNull(TestValues.NULL, msg.getSiriusXMRadioAvailable()); + assertNull(TestValues.NULL, msg.getSisDataAvailable()); + assertNull(TestValues.NULL, msg.getModuleInfo()); + assertNull(TestValues.NULL, msg.getAvailableHdChannelsAvailable()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(RadioControlCapabilities.KEY_MODULE_NAME, Test.GENERAL_STRING); - reference.put(RadioControlCapabilities.KEY_RADIO_ENABLE_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(RadioControlCapabilities.KEY_RADIO_BAND_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(RadioControlCapabilities.KEY_RADIO_FREQUENCY_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(RadioControlCapabilities.KEY_HD_CHANNEL_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(RadioControlCapabilities.KEY_RDS_DATA_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(RadioControlCapabilities.KEY_AVAILABLE_HDS_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(RadioControlCapabilities.KEY_STATE_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(RadioControlCapabilities.KEY_SIGNAL_STRENGTH_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(RadioControlCapabilities.KEY_SIGNAL_CHANGE_THRESHOLD_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(RadioControlCapabilities.KEY_HD_RADIO_ENABLE_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(RadioControlCapabilities.KEY_SIRIUS_XM_RADIO_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(RadioControlCapabilities.KEY_SIS_DATA_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(RadioControlCapabilities.KEY_MODULE_INFO, Test.JSON_MODULE_INFO); - reference.put(RadioControlCapabilities.KEY_AVAILABLE_HD_CHANNELS_AVAILABLE, Test.GENERAL_BOOLEAN); + reference.put(RadioControlCapabilities.KEY_MODULE_NAME, TestValues.GENERAL_STRING); + reference.put(RadioControlCapabilities.KEY_RADIO_ENABLE_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(RadioControlCapabilities.KEY_RADIO_BAND_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(RadioControlCapabilities.KEY_RADIO_FREQUENCY_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(RadioControlCapabilities.KEY_HD_CHANNEL_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(RadioControlCapabilities.KEY_RDS_DATA_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(RadioControlCapabilities.KEY_AVAILABLE_HDS_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(RadioControlCapabilities.KEY_STATE_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(RadioControlCapabilities.KEY_SIGNAL_STRENGTH_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(RadioControlCapabilities.KEY_SIGNAL_CHANGE_THRESHOLD_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(RadioControlCapabilities.KEY_HD_RADIO_ENABLE_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(RadioControlCapabilities.KEY_SIRIUS_XM_RADIO_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(RadioControlCapabilities.KEY_SIS_DATA_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(RadioControlCapabilities.KEY_MODULE_INFO, TestValues.JSON_MODULE_INFO); + reference.put(RadioControlCapabilities.KEY_AVAILABLE_HD_CHANNELS_AVAILABLE, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -135,14 +135,14 @@ public class RadioControlCapabilitiesTests extends TestCase{ JSONObject o2 = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> h1 = JsonRPCMarshaller.deserializeJSONObject(o1); Hashtable<String, Object> h2 = JsonRPCMarshaller.deserializeJSONObject(o2); - assertTrue(Test.TRUE, Validator.validateModuleInfo(new ModuleInfo(h1), new ModuleInfo(h2))); + assertTrue(TestValues.TRUE, Validator.validateModuleInfo(new ModuleInfo(h1), new ModuleInfo(h2))); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlDataTests.java index 6094b505a..a948492e3 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlDataTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.SisData; import com.smartdevicelink.proxy.rpc.enums.RadioBand; import com.smartdevicelink.proxy.rpc.enums.RadioState; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -31,19 +31,19 @@ public class RadioControlDataTests extends TestCase{ public void setUp(){ msg = new RadioControlData(); - msg.setFrequencyInteger(Test.GENERAL_INT); - msg.setFrequencyFraction(Test.GENERAL_INT); - msg.setBand(Test.GENERAL_RADIOBAND); - msg.setRdsData(Test.GENERAL_RDSDATA); - msg.setAvailableHDs(Test.GENERAL_INT); - msg.setHdChannel(Test.GENERAL_INT); - msg.setSignalStrength(Test.GENERAL_INT); - msg.setSignalChangeThreshold(Test.GENERAL_INT); - msg.setRadioEnable(Test.GENERAL_BOOLEAN); - msg.setState(Test.GENERAL_RADIOSTATE); - msg.setHdRadioEnable(Test.GENERAL_BOOLEAN); - msg.setSisData(Test.GENERAL_SISDATA); - msg.setAvailableHdChannels(Test.GENERAL_AVAILABLE_HD_CHANNELS_LIST); + msg.setFrequencyInteger(TestValues.GENERAL_INT); + msg.setFrequencyFraction(TestValues.GENERAL_INT); + msg.setBand(TestValues.GENERAL_RADIOBAND); + msg.setRdsData(TestValues.GENERAL_RDSDATA); + msg.setAvailableHDs(TestValues.GENERAL_INT); + msg.setHdChannel(TestValues.GENERAL_INT); + msg.setSignalStrength(TestValues.GENERAL_INT); + msg.setSignalChangeThreshold(TestValues.GENERAL_INT); + msg.setRadioEnable(TestValues.GENERAL_BOOLEAN); + msg.setState(TestValues.GENERAL_RADIOSTATE); + msg.setHdRadioEnable(TestValues.GENERAL_BOOLEAN); + msg.setSisData(TestValues.GENERAL_SISDATA); + msg.setAvailableHdChannels(TestValues.GENERAL_AVAILABLE_HD_CHANNELS_LIST); } /** @@ -66,59 +66,59 @@ public class RadioControlDataTests extends TestCase{ List<Integer> availableHdChannels = msg.getAvailableHdChannels(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, frequencyInteger); - assertEquals(Test.MATCH, Test.GENERAL_INT, frequencyFraction); - assertEquals(Test.MATCH, Test.GENERAL_RADIOBAND, band); - assertTrue(Test.TRUE, Validator.validateRdsData(Test.GENERAL_RDSDATA, rdsData)); - assertEquals(Test.MATCH, Test.GENERAL_INT, availableHDs); - assertEquals(Test.MATCH, Test.GENERAL_INT, hdChannel); - assertEquals(Test.MATCH, Test.GENERAL_INT, signalStrength); - assertEquals(Test.MATCH, Test.GENERAL_INT, signalChangeThreshold); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, radioEnable); - assertEquals(Test.MATCH, Test.GENERAL_RADIOSTATE, state); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, hdRadioEnable); - assertTrue(Test.TRUE, Validator.validateSisData(Test.GENERAL_SISDATA, sisData)); - assertEquals(Test.MATCH, Test.GENERAL_AVAILABLE_HD_CHANNELS_LIST, availableHdChannels); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, frequencyInteger); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, frequencyFraction); + assertEquals(TestValues.MATCH, TestValues.GENERAL_RADIOBAND, band); + assertTrue(TestValues.TRUE, Validator.validateRdsData(TestValues.GENERAL_RDSDATA, rdsData)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, availableHDs); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, hdChannel); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, signalStrength); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, signalChangeThreshold); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, radioEnable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_RADIOSTATE, state); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, hdRadioEnable); + assertTrue(TestValues.TRUE, Validator.validateSisData(TestValues.GENERAL_SISDATA, sisData)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_AVAILABLE_HD_CHANNELS_LIST, availableHdChannels); // Invalid/Null Tests RadioControlData msg = new RadioControlData(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getFrequencyInteger()); - assertNull(Test.NULL, msg.getFrequencyFraction()); - assertNull(Test.NULL, msg.getBand()); - assertNull(Test.NULL, msg.getRdsData()); - assertNull(Test.NULL, msg.getAvailableHDs()); - assertNull(Test.NULL, msg.getHdChannel()); - assertNull(Test.NULL, msg.getSignalStrength()); - assertNull(Test.NULL, msg.getSignalChangeThreshold()); - assertNull(Test.NULL, msg.getRadioEnable()); - assertNull(Test.NULL, msg.getState()); - assertNull(Test.NULL, msg.getHdRadioEnable()); - assertNull(Test.NULL, msg.getSisData()); - assertNull(Test.NULL, msg.getAvailableHdChannels()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getFrequencyInteger()); + assertNull(TestValues.NULL, msg.getFrequencyFraction()); + assertNull(TestValues.NULL, msg.getBand()); + assertNull(TestValues.NULL, msg.getRdsData()); + assertNull(TestValues.NULL, msg.getAvailableHDs()); + assertNull(TestValues.NULL, msg.getHdChannel()); + assertNull(TestValues.NULL, msg.getSignalStrength()); + assertNull(TestValues.NULL, msg.getSignalChangeThreshold()); + assertNull(TestValues.NULL, msg.getRadioEnable()); + assertNull(TestValues.NULL, msg.getState()); + assertNull(TestValues.NULL, msg.getHdRadioEnable()); + assertNull(TestValues.NULL, msg.getSisData()); + assertNull(TestValues.NULL, msg.getAvailableHdChannels()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(RadioControlData.KEY_FREQUENCY_INTEGER, Test.GENERAL_INT); - reference.put(RadioControlData.KEY_FREQUENCY_FRACTION, Test.GENERAL_INT); - reference.put(RadioControlData.KEY_BAND, Test.GENERAL_RADIOBAND); - reference.put(RadioControlData.KEY_RDS_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_RDSDATA.getStore())); - reference.put(RadioControlData.KEY_AVAILABLE_HDS, Test.GENERAL_INT); - reference.put(RadioControlData.KEY_HD_CHANNEL, Test.GENERAL_INT); - reference.put(RadioControlData.KEY_SIGNAL_STRENGTH, Test.GENERAL_INT); - reference.put(RadioControlData.KEY_SIGNAL_CHANGE_THRESHOLD, Test.GENERAL_INT); - reference.put(RadioControlData.KEY_RADIO_ENABLE, Test.GENERAL_BOOLEAN); - reference.put(RadioControlData.KEY_STATE, Test.GENERAL_RADIOSTATE); - reference.put(RadioControlData.KEY_HD_RADIO_ENABLE, Test.GENERAL_BOOLEAN); - reference.put(RadioControlData.KEY_SIS_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_SISDATA.getStore())); - reference.put(RadioControlData.KEY_AVAILABLE_HD_CHANNELS, Test.GENERAL_AVAILABLE_HD_CHANNELS_LIST); + reference.put(RadioControlData.KEY_FREQUENCY_INTEGER, TestValues.GENERAL_INT); + reference.put(RadioControlData.KEY_FREQUENCY_FRACTION, TestValues.GENERAL_INT); + reference.put(RadioControlData.KEY_BAND, TestValues.GENERAL_RADIOBAND); + reference.put(RadioControlData.KEY_RDS_DATA, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_RDSDATA.getStore())); + reference.put(RadioControlData.KEY_AVAILABLE_HDS, TestValues.GENERAL_INT); + reference.put(RadioControlData.KEY_HD_CHANNEL, TestValues.GENERAL_INT); + reference.put(RadioControlData.KEY_SIGNAL_STRENGTH, TestValues.GENERAL_INT); + reference.put(RadioControlData.KEY_SIGNAL_CHANGE_THRESHOLD, TestValues.GENERAL_INT); + reference.put(RadioControlData.KEY_RADIO_ENABLE, TestValues.GENERAL_BOOLEAN); + reference.put(RadioControlData.KEY_STATE, TestValues.GENERAL_RADIOSTATE); + reference.put(RadioControlData.KEY_HD_RADIO_ENABLE, TestValues.GENERAL_BOOLEAN); + reference.put(RadioControlData.KEY_SIS_DATA, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_SISDATA.getStore())); + reference.put(RadioControlData.KEY_AVAILABLE_HD_CHANNELS, TestValues.GENERAL_AVAILABLE_HD_CHANNELS_LIST); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -129,23 +129,23 @@ public class RadioControlDataTests extends TestCase{ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateRdsData(new RdsData(hashReference), new RdsData(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateRdsData(new RdsData(hashReference), new RdsData(hashTest))); } else if (key.equals(RadioControlData.KEY_SIS_DATA)) { JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key); JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateSisData(new SisData(hashReference), new SisData(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateSisData(new SisData(hashReference), new SisData(hashTest))); } else if(key.equals(RadioControlData.KEY_AVAILABLE_HD_CHANNELS)){ - List<Integer> list1 = Test.GENERAL_AVAILABLE_HD_CHANNELS_LIST; + List<Integer> list1 = TestValues.GENERAL_AVAILABLE_HD_CHANNELS_LIST; List<Integer> list2 = JsonUtils.readIntegerListFromJsonObject(underTest, key); - assertTrue(Test.TRUE, Validator.validateIntegerList(list1,list2)); + assertTrue(TestValues.TRUE, Validator.validateIntegerList(list1,list2)); } else{ - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RdsDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RdsDataTests.java index 7414304b0..fcdcda9ee 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RdsDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RdsDataTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.RdsData; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,14 +23,14 @@ public class RdsDataTests extends TestCase{ public void setUp(){ msg = new RdsData(); - msg.setProgramService(Test.GENERAL_STRING); - msg.setRadioText(Test.GENERAL_STRING); - msg.setClockText(Test.GENERAL_STRING); - msg.setProgramIdentification(Test.GENERAL_STRING); - msg.setRegion(Test.GENERAL_STRING); - msg.setTrafficProgram(Test.GENERAL_BOOLEAN); - msg.setTrafficAnnouncement(Test.GENERAL_BOOLEAN); - msg.setProgramType(Test.GENERAL_INT); + msg.setProgramService(TestValues.GENERAL_STRING); + msg.setRadioText(TestValues.GENERAL_STRING); + msg.setClockText(TestValues.GENERAL_STRING); + msg.setProgramIdentification(TestValues.GENERAL_STRING); + msg.setRegion(TestValues.GENERAL_STRING); + msg.setTrafficProgram(TestValues.GENERAL_BOOLEAN); + msg.setTrafficAnnouncement(TestValues.GENERAL_BOOLEAN); + msg.setProgramType(TestValues.GENERAL_INT); } /** @@ -48,54 +48,54 @@ public class RdsDataTests extends TestCase{ String reg = msg.getRegion(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, ps); - assertEquals(Test.MATCH, Test.GENERAL_STRING, rt); - assertEquals(Test.MATCH, Test.GENERAL_STRING, ct); - assertEquals(Test.MATCH, Test.GENERAL_STRING, pi); - assertEquals(Test.MATCH, Test.GENERAL_INT, pty); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, tp); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, ta); - assertEquals(Test.MATCH, Test.GENERAL_STRING, reg); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, ps); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, rt); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, ct); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, pi); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, pty); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, tp); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, ta); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, reg); // Invalid/Null Tests RdsData msg = new RdsData(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getProgramService()); - assertNull(Test.NULL, msg.getRadioText()); - assertNull(Test.NULL, msg.getClockText()); - assertNull(Test.NULL, msg.getProgramIdentification()); - assertNull(Test.NULL, msg.getRegion()); - assertNull(Test.NULL, msg.getTrafficProgram()); - assertNull(Test.NULL, msg.getTrafficAnnouncement()); - assertNull(Test.NULL, msg.getProgramType()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getProgramService()); + assertNull(TestValues.NULL, msg.getRadioText()); + assertNull(TestValues.NULL, msg.getClockText()); + assertNull(TestValues.NULL, msg.getProgramIdentification()); + assertNull(TestValues.NULL, msg.getRegion()); + assertNull(TestValues.NULL, msg.getTrafficProgram()); + assertNull(TestValues.NULL, msg.getTrafficAnnouncement()); + assertNull(TestValues.NULL, msg.getProgramType()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(RdsData.KEY_PS, Test.GENERAL_STRING); - reference.put(RdsData.KEY_RT, Test.GENERAL_STRING); - reference.put(RdsData.KEY_CT, Test.GENERAL_STRING); - reference.put(RdsData.KEY_PI, Test.GENERAL_STRING); - reference.put(RdsData.KEY_PTY, Test.GENERAL_INT); - reference.put(RdsData.KEY_TP, Test.GENERAL_BOOLEAN); - reference.put(RdsData.KEY_TA, Test.GENERAL_BOOLEAN); - reference.put(RdsData.KEY_REG, Test.GENERAL_STRING); + reference.put(RdsData.KEY_PS, TestValues.GENERAL_STRING); + reference.put(RdsData.KEY_RT, TestValues.GENERAL_STRING); + reference.put(RdsData.KEY_CT, TestValues.GENERAL_STRING); + reference.put(RdsData.KEY_PI, TestValues.GENERAL_STRING); + reference.put(RdsData.KEY_PTY, TestValues.GENERAL_INT); + reference.put(RdsData.KEY_TP, TestValues.GENERAL_BOOLEAN); + reference.put(RdsData.KEY_TA, TestValues.GENERAL_BOOLEAN); + reference.put(RdsData.KEY_REG, TestValues.GENERAL_STRING); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RectangleTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RectangleTests.java index 569a4db83..ec8bcad9c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RectangleTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RectangleTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.Rectangle; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,10 +23,10 @@ public class RectangleTests extends TestCase { public void setUp() { msg = new Rectangle(); - msg.setX(Test.GENERAL_FLOAT); - msg.setY(Test.GENERAL_FLOAT); - msg.setWidth(Test.GENERAL_FLOAT); - msg.setHeight(Test.GENERAL_FLOAT); + msg.setX(TestValues.GENERAL_FLOAT); + msg.setY(TestValues.GENERAL_FLOAT); + msg.setWidth(TestValues.GENERAL_FLOAT); + msg.setHeight(TestValues.GENERAL_FLOAT); } /** @@ -40,40 +40,40 @@ public class RectangleTests extends TestCase { Float height = msg.getHeight(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_FLOAT, x); - assertEquals(Test.MATCH, Test.GENERAL_FLOAT, y); - assertEquals(Test.MATCH, Test.GENERAL_FLOAT, width); - assertEquals(Test.MATCH, Test.GENERAL_FLOAT, height); + assertEquals(TestValues.MATCH, TestValues.GENERAL_FLOAT, x); + assertEquals(TestValues.MATCH, TestValues.GENERAL_FLOAT, y); + assertEquals(TestValues.MATCH, TestValues.GENERAL_FLOAT, width); + assertEquals(TestValues.MATCH, TestValues.GENERAL_FLOAT, height); // Invalid/Null Tests Rectangle msg = new Rectangle(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getX()); - assertNull(Test.NULL, msg.getY()); - assertNull(Test.NULL, msg.getWidth()); - assertNull(Test.NULL, msg.getHeight()); + assertNull(TestValues.NULL, msg.getX()); + assertNull(TestValues.NULL, msg.getY()); + assertNull(TestValues.NULL, msg.getWidth()); + assertNull(TestValues.NULL, msg.getHeight()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(Rectangle.KEY_X, (Test.GENERAL_FLOAT)); - reference.put(Rectangle.KEY_Y, (Test.GENERAL_FLOAT)); - reference.put(Rectangle.KEY_WIDTH, (Test.GENERAL_FLOAT)); - reference.put(Rectangle.KEY_HEIGHT, (Test.GENERAL_FLOAT)); + reference.put(Rectangle.KEY_X, (TestValues.GENERAL_FLOAT)); + reference.put(Rectangle.KEY_Y, (TestValues.GENERAL_FLOAT)); + reference.put(Rectangle.KEY_WIDTH, (TestValues.GENERAL_FLOAT)); + reference.put(Rectangle.KEY_HEIGHT, (TestValues.GENERAL_FLOAT)); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java index e6a2d2b9a..562335bc1 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java @@ -10,7 +10,7 @@ import com.smartdevicelink.proxy.rpc.RadioControlCapabilities; import com.smartdevicelink.proxy.rpc.RemoteControlCapabilities; import com.smartdevicelink.proxy.rpc.SeatControlCapabilities; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -35,13 +35,13 @@ public class RemoteControlCapabilitiesTests extends TestCase { @Override public void setUp() { msg = new RemoteControlCapabilities(); - msg.setButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST); - msg.setRadioControlCapabilities(Test.GENERAL_RADIOCONTROLCAPABILITIES_LIST); - msg.setClimateControlCapabilities(Test.GENERAL_CLIMATECONTROLCAPABILITIES_LIST); - msg.setSeatControlCapabilities(Test.GENERAL_SEATCONTROLCAPABILITIES_LIST); - msg.setAudioControlCapabilities(Test.GENERAL_AUDIOCONTROLCAPABILITIES_LIST); - msg.setHmiSettingsControlCapabilities(Test.GENERAL_HMISETTINGSCONTROLCAPABILITIES); - msg.setLightControlCapabilities(Test.GENERAL_LIGHTCONTROLCAPABILITIES); + msg.setButtonCapabilities(TestValues.GENERAL_BUTTONCAPABILITIES_LIST); + msg.setRadioControlCapabilities(TestValues.GENERAL_RADIOCONTROLCAPABILITIES_LIST); + msg.setClimateControlCapabilities(TestValues.GENERAL_CLIMATECONTROLCAPABILITIES_LIST); + msg.setSeatControlCapabilities(TestValues.GENERAL_SEATCONTROLCAPABILITIES_LIST); + msg.setAudioControlCapabilities(TestValues.GENERAL_AUDIOCONTROLCAPABILITIES_LIST); + msg.setHmiSettingsControlCapabilities(TestValues.GENERAL_HMISETTINGSCONTROLCAPABILITIES); + msg.setLightControlCapabilities(TestValues.GENERAL_LIGHTCONTROLCAPABILITIES); } /** @@ -58,46 +58,46 @@ public class RemoteControlCapabilitiesTests extends TestCase { LightControlCapabilities lightControlCapabilities = msg.getLightControlCapabilities(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_BUTTONCAPABILITIES_LIST.size(), buttonCapabilities.size()); - assertEquals(Test.MATCH, Test.GENERAL_RADIOCONTROLCAPABILITIES_LIST.size(), radioControlCapabilities.size()); - assertEquals(Test.MATCH, Test.GENERAL_CLIMATECONTROLCAPABILITIES_LIST.size(), climateControlCapabilities.size()); - assertEquals(Test.MATCH, Test.GENERAL_SEATCONTROLCAPABILITIES_LIST.size(), seatControlCapabilities.size()); - - assertTrue(Test.TRUE, Validator.validateButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST, buttonCapabilities)); - assertTrue(Test.TRUE, Validator.validateRadioControlCapabilities(Test.GENERAL_RADIOCONTROLCAPABILITIES_LIST, radioControlCapabilities)); - assertTrue(Test.TRUE, Validator.validateClimateControlCapabilities(Test.GENERAL_CLIMATECONTROLCAPABILITIES_LIST, climateControlCapabilities)); - assertTrue(Test.TRUE, Validator.validateSeatControlCapabilitiesList(Test.GENERAL_SEATCONTROLCAPABILITIES_LIST, seatControlCapabilities)); - assertTrue(Test.TRUE, Validator.validateAudioControlCapabilitiesList(Test.GENERAL_AUDIOCONTROLCAPABILITIES_LIST, audioControlCapabilities)); - assertTrue(Test.TRUE, Validator.validateHMISettingsControlCapabilities(Test.GENERAL_HMISETTINGSCONTROLCAPABILITIES, hmiSettingsControlCapabilities)); - assertTrue(Test.TRUE, Validator.validateLightControlCapabilities(Test.GENERAL_LIGHTCONTROLCAPABILITIES, lightControlCapabilities)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BUTTONCAPABILITIES_LIST.size(), buttonCapabilities.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_RADIOCONTROLCAPABILITIES_LIST.size(), radioControlCapabilities.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_CLIMATECONTROLCAPABILITIES_LIST.size(), climateControlCapabilities.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_SEATCONTROLCAPABILITIES_LIST.size(), seatControlCapabilities.size()); + + assertTrue(TestValues.TRUE, Validator.validateButtonCapabilities(TestValues.GENERAL_BUTTONCAPABILITIES_LIST, buttonCapabilities)); + assertTrue(TestValues.TRUE, Validator.validateRadioControlCapabilities(TestValues.GENERAL_RADIOCONTROLCAPABILITIES_LIST, radioControlCapabilities)); + assertTrue(TestValues.TRUE, Validator.validateClimateControlCapabilities(TestValues.GENERAL_CLIMATECONTROLCAPABILITIES_LIST, climateControlCapabilities)); + assertTrue(TestValues.TRUE, Validator.validateSeatControlCapabilitiesList(TestValues.GENERAL_SEATCONTROLCAPABILITIES_LIST, seatControlCapabilities)); + assertTrue(TestValues.TRUE, Validator.validateAudioControlCapabilitiesList(TestValues.GENERAL_AUDIOCONTROLCAPABILITIES_LIST, audioControlCapabilities)); + assertTrue(TestValues.TRUE, Validator.validateHMISettingsControlCapabilities(TestValues.GENERAL_HMISETTINGSCONTROLCAPABILITIES, hmiSettingsControlCapabilities)); + assertTrue(TestValues.TRUE, Validator.validateLightControlCapabilities(TestValues.GENERAL_LIGHTCONTROLCAPABILITIES, lightControlCapabilities)); // Invalid/Null Tests RemoteControlCapabilities msg = new RemoteControlCapabilities(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getButtonCapabilities()); - assertNull(Test.NULL, msg.getRadioControlCapabilities()); - assertNull(Test.NULL, msg.getClimateControlCapabilities()); - assertNull(Test.NULL, msg.getSeatControlCapabilities()); - assertNull(Test.NULL, msg.getAudioControlCapabilities()); - assertNull(Test.NULL, msg.getHmiSettingsControlCapabilities()); - assertNull(Test.NULL, msg.getLightControlCapabilities()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getButtonCapabilities()); + assertNull(TestValues.NULL, msg.getRadioControlCapabilities()); + assertNull(TestValues.NULL, msg.getClimateControlCapabilities()); + assertNull(TestValues.NULL, msg.getSeatControlCapabilities()); + assertNull(TestValues.NULL, msg.getAudioControlCapabilities()); + assertNull(TestValues.NULL, msg.getHmiSettingsControlCapabilities()); + assertNull(TestValues.NULL, msg.getLightControlCapabilities()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(RemoteControlCapabilities.KEY_BUTTON_CAPABILITIES, Test.JSON_BUTTONCAPABILITIES); - reference.put(RemoteControlCapabilities.KEY_RADIO_CONTROL_CAPABILITIES, Test.JSON_RADIOCONTROLCAPABILITIES); - reference.put(RemoteControlCapabilities.KEY_CLIMATE_CONTROL_CAPABILITIES, Test.JSON_CLIMATECONTROLCAPABILITIES); - reference.put(RemoteControlCapabilities.KEY_SEAT_CONTROL_CAPABILITIES, Test.GENERAL_SEATCONTROLCAPABILITIES_LIST); - reference.put(RemoteControlCapabilities.KEY_AUDIO_CONTROL_CAPABILITIES, Test.GENERAL_AUDIOCONTROLCAPABILITIES_LIST); - reference.put(RemoteControlCapabilities.KEY_HMI_SETTINGS_CONTROL_CAPABILITIES, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_HMISETTINGSCONTROLCAPABILITIES.getStore())); - reference.put(RemoteControlCapabilities.KEY_LIGHT_CONTROL_CAPABILITIES, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_LIGHTCONTROLCAPABILITIES.getStore())); + reference.put(RemoteControlCapabilities.KEY_BUTTON_CAPABILITIES, TestValues.JSON_BUTTONCAPABILITIES); + reference.put(RemoteControlCapabilities.KEY_RADIO_CONTROL_CAPABILITIES, TestValues.JSON_RADIOCONTROLCAPABILITIES); + reference.put(RemoteControlCapabilities.KEY_CLIMATE_CONTROL_CAPABILITIES, TestValues.JSON_CLIMATECONTROLCAPABILITIES); + reference.put(RemoteControlCapabilities.KEY_SEAT_CONTROL_CAPABILITIES, TestValues.GENERAL_SEATCONTROLCAPABILITIES_LIST); + reference.put(RemoteControlCapabilities.KEY_AUDIO_CONTROL_CAPABILITIES, TestValues.GENERAL_AUDIOCONTROLCAPABILITIES_LIST); + reference.put(RemoteControlCapabilities.KEY_HMI_SETTINGS_CONTROL_CAPABILITIES, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_HMISETTINGSCONTROLCAPABILITIES.getStore())); + reference.put(RemoteControlCapabilities.KEY_LIGHT_CONTROL_CAPABILITIES, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_LIGHTCONTROLCAPABILITIES.getStore())); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { @@ -106,7 +106,7 @@ public class RemoteControlCapabilitiesTests extends TestCase { if (key.equals(RemoteControlCapabilities.KEY_BUTTON_CAPABILITIES)) { JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key); JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); - assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length()); + assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length()); List<ButtonCapabilities> referenceList = new ArrayList<ButtonCapabilities>(); List<ButtonCapabilities> testList = new ArrayList<ButtonCapabilities>(); @@ -116,11 +116,11 @@ public class RemoteControlCapabilitiesTests extends TestCase { Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); testList.add(new ButtonCapabilities(hashTest)); } - assertTrue(Test.TRUE, Validator.validateButtonCapabilities(referenceList, testList)); + assertTrue(TestValues.TRUE, Validator.validateButtonCapabilities(referenceList, testList)); } else if (key.equals(RemoteControlCapabilities.KEY_RADIO_CONTROL_CAPABILITIES)) { JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key); JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); - assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length()); + assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length()); List<RadioControlCapabilities> referenceList = new ArrayList<RadioControlCapabilities>(); List<RadioControlCapabilities> testList = new ArrayList<RadioControlCapabilities>(); @@ -130,11 +130,11 @@ public class RemoteControlCapabilitiesTests extends TestCase { Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); testList.add(new RadioControlCapabilities(hashTest)); } - assertTrue(Test.TRUE, Validator.validateRadioControlCapabilities(referenceList, testList)); + assertTrue(TestValues.TRUE, Validator.validateRadioControlCapabilities(referenceList, testList)); } else if (key.equals(RemoteControlCapabilities.KEY_CLIMATE_CONTROL_CAPABILITIES)) { JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key); JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); - assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length()); + assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length()); List<ClimateControlCapabilities> referenceList = new ArrayList<ClimateControlCapabilities>(); List<ClimateControlCapabilities> testList = new ArrayList<ClimateControlCapabilities>(); @@ -144,7 +144,7 @@ public class RemoteControlCapabilitiesTests extends TestCase { Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); testList.add(new ClimateControlCapabilities(hashTest)); } - assertTrue(Test.TRUE, Validator.validateClimateControlCapabilities(referenceList, testList)); + assertTrue(TestValues.TRUE, Validator.validateClimateControlCapabilities(referenceList, testList)); } else if (key.equals(RemoteControlCapabilities.KEY_SEAT_CONTROL_CAPABILITIES)) { List<SeatControlCapabilities> sccReference = (List<SeatControlCapabilities>) JsonUtils.readObjectFromJsonObject(reference, key); JSONArray sccArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); @@ -164,17 +164,17 @@ public class RemoteControlCapabilitiesTests extends TestCase { JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateHMISettingsControlCapabilities(new HMISettingsControlCapabilities(hashReference), new HMISettingsControlCapabilities(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateHMISettingsControlCapabilities(new HMISettingsControlCapabilities(hashReference), new HMISettingsControlCapabilities(hashTest))); } else if (key.equals(RemoteControlCapabilities.KEY_LIGHT_CONTROL_CAPABILITIES)) { JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key); JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateLightControlCapabilities(new LightControlCapabilities(hashReference), new LightControlCapabilities(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateLightControlCapabilities(new LightControlCapabilities(hashReference), new LightControlCapabilities(hashTest))); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ScreenParamsTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ScreenParamsTest.java index 80a5e3258..e0e59a39e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ScreenParamsTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ScreenParamsTest.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.rpc.ImageResolution; import com.smartdevicelink.proxy.rpc.ScreenParams; import com.smartdevicelink.proxy.rpc.TouchEventCapabilities; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -27,8 +27,8 @@ public class ScreenParamsTest extends TestCase { public void setUp() { msg = new ScreenParams(); - msg.setImageResolution(Test.GENERAL_IMAGERESOLUTION); - msg.setTouchEventAvailable(Test.GENERAL_TOUCHEVENTCAPABILITIES); + msg.setImageResolution(TestValues.GENERAL_IMAGERESOLUTION); + msg.setTouchEventAvailable(TestValues.GENERAL_TOUCHEVENTCAPABILITIES); } /** @@ -40,26 +40,26 @@ public class ScreenParamsTest extends TestCase { TouchEventCapabilities touchEvent = msg.getTouchEventAvailable(); // Valid Tests - assertTrue(Test.TRUE, Validator.validateImageResolution(Test.GENERAL_IMAGERESOLUTION, imageRes)); - assertTrue(Test.TRUE, Validator.validateTouchEventCapabilities(Test.GENERAL_TOUCHEVENTCAPABILITIES, touchEvent)); + assertTrue(TestValues.TRUE, Validator.validateImageResolution(TestValues.GENERAL_IMAGERESOLUTION, imageRes)); + assertTrue(TestValues.TRUE, Validator.validateTouchEventCapabilities(TestValues.GENERAL_TOUCHEVENTCAPABILITIES, touchEvent)); // Invalid/Null Tests ScreenParams msg = new ScreenParams(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getImageResolution()); - assertNull(Test.NULL, msg.getTouchEventAvailable()); + assertNull(TestValues.NULL, msg.getImageResolution()); + assertNull(TestValues.NULL, msg.getTouchEventAvailable()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(ScreenParams.KEY_RESOLUTION, Test.JSON_IMAGERESOLUTION); - reference.put(ScreenParams.KEY_TOUCH_EVENT_AVAILABLE, Test.JSON_TOUCHEVENTCAPABILITIES); + reference.put(ScreenParams.KEY_RESOLUTION, TestValues.JSON_IMAGERESOLUTION); + reference.put(ScreenParams.KEY_TOUCH_EVENT_AVAILABLE, TestValues.JSON_TOUCHEVENTCAPABILITIES); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { @@ -69,22 +69,22 @@ public class ScreenParamsTest extends TestCase { JSONObject touchEventObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key); JSONObject touchEventObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key); - assertTrue(Test.TRUE, Validator.validateTouchEventCapabilities( + assertTrue(TestValues.TRUE, Validator.validateTouchEventCapabilities( new TouchEventCapabilities(JsonRPCMarshaller.deserializeJSONObject(touchEventObjReference)), new TouchEventCapabilities(JsonRPCMarshaller.deserializeJSONObject(touchEventObjTest)))); } else if (key.equals(ScreenParams.KEY_RESOLUTION)) { JSONObject resolutionObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key); JSONObject resolutionObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key); - assertTrue(Test.TRUE, Validator.validateImageResolution( + assertTrue(TestValues.TRUE, Validator.validateImageResolution( new ImageResolution(JsonRPCMarshaller.deserializeJSONObject(resolutionObjReference)), new ImageResolution(JsonRPCMarshaller.deserializeJSONObject(resolutionObjTest)))); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SdlMsgVersionTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SdlMsgVersionTest.java index a047cf01c..499db5c13 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SdlMsgVersionTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SdlMsgVersionTest.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.SdlMsgVersion; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,9 +23,9 @@ public class SdlMsgVersionTest extends TestCase { public void setUp() { msg = new SdlMsgVersion(); - msg.setMajorVersion(Test.GENERAL_INT); - msg.setMinorVersion(Test.GENERAL_INT); - msg.setPatchVersion(Test.GENERAL_INT); + msg.setMajorVersion(TestValues.GENERAL_INT); + msg.setMinorVersion(TestValues.GENERAL_INT); + msg.setPatchVersion(TestValues.GENERAL_INT); } /** @@ -38,37 +38,37 @@ public class SdlMsgVersionTest extends TestCase { Integer patch = msg.getPatchVersion(); // Valid Tests - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, major); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, minor); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, patch); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, major); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, minor); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, patch); // Invalid/Null Tests SdlMsgVersion msg = new SdlMsgVersion(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getMajorVersion()); - assertNull(Test.NULL, msg.getMinorVersion()); - assertNull(Test.NULL, msg.getPatchVersion()); + assertNull(TestValues.NULL, msg.getMajorVersion()); + assertNull(TestValues.NULL, msg.getMinorVersion()); + assertNull(TestValues.NULL, msg.getPatchVersion()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(SdlMsgVersion.KEY_MAJOR_VERSION, Test.GENERAL_INT); - reference.put(SdlMsgVersion.KEY_MINOR_VERSION, Test.GENERAL_INT); - reference.put(SdlMsgVersion.KEY_PATCH_VERSION, Test.GENERAL_INT); + reference.put(SdlMsgVersion.KEY_MAJOR_VERSION, TestValues.GENERAL_INT); + reference.put(SdlMsgVersion.KEY_MINOR_VERSION, TestValues.GENERAL_INT); + reference.put(SdlMsgVersion.KEY_PATCH_VERSION, TestValues.GENERAL_INT); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlCapabilitiesTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlCapabilitiesTest.java index d988fa991..38b0c3fff 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlCapabilitiesTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlCapabilitiesTest.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.SeatControlCapabilities; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -22,22 +22,22 @@ public class SeatControlCapabilitiesTest extends TestCase { @Override public void setUp() { msg = new SeatControlCapabilities(); - msg.setModuleName(Test.GENERAL_STRING); - msg.setHeatingEnabledAvailable(Test.GENERAL_BOOLEAN); - msg.setCoolingEnabledAvailable(Test.GENERAL_BOOLEAN); - msg.setHeatingLevelAvailable(Test.GENERAL_BOOLEAN); - msg.setCoolingLevelAvailable(Test.GENERAL_BOOLEAN); - msg.setHorizontalPositionAvailable(Test.GENERAL_BOOLEAN); - msg.setVerticalPositionAvailable(Test.GENERAL_BOOLEAN); - msg.setFrontVerticalPositionAvailable(Test.GENERAL_BOOLEAN); - msg.setBackVerticalPositionAvailable(Test.GENERAL_BOOLEAN); - msg.setBackTiltAngleAvailable(Test.GENERAL_BOOLEAN); - msg.setHeadSupportVerticalPositionAvailable(Test.GENERAL_BOOLEAN); - msg.setHeadSupportHorizontalPositionAvailable(Test.GENERAL_BOOLEAN); - msg.setMassageEnabledAvailable(Test.GENERAL_BOOLEAN); - msg.setMassageModeAvailable(Test.GENERAL_BOOLEAN); - msg.setMassageCushionFirmnessAvailable(Test.GENERAL_BOOLEAN); - msg.setMemoryAvailable(Test.GENERAL_BOOLEAN); + msg.setModuleName(TestValues.GENERAL_STRING); + msg.setHeatingEnabledAvailable(TestValues.GENERAL_BOOLEAN); + msg.setCoolingEnabledAvailable(TestValues.GENERAL_BOOLEAN); + msg.setHeatingLevelAvailable(TestValues.GENERAL_BOOLEAN); + msg.setCoolingLevelAvailable(TestValues.GENERAL_BOOLEAN); + msg.setHorizontalPositionAvailable(TestValues.GENERAL_BOOLEAN); + msg.setVerticalPositionAvailable(TestValues.GENERAL_BOOLEAN); + msg.setFrontVerticalPositionAvailable(TestValues.GENERAL_BOOLEAN); + msg.setBackVerticalPositionAvailable(TestValues.GENERAL_BOOLEAN); + msg.setBackTiltAngleAvailable(TestValues.GENERAL_BOOLEAN); + msg.setHeadSupportVerticalPositionAvailable(TestValues.GENERAL_BOOLEAN); + msg.setHeadSupportHorizontalPositionAvailable(TestValues.GENERAL_BOOLEAN); + msg.setMassageEnabledAvailable(TestValues.GENERAL_BOOLEAN); + msg.setMassageModeAvailable(TestValues.GENERAL_BOOLEAN); + msg.setMassageCushionFirmnessAvailable(TestValues.GENERAL_BOOLEAN); + msg.setMemoryAvailable(TestValues.GENERAL_BOOLEAN); } /** @@ -64,78 +64,78 @@ public class SeatControlCapabilitiesTest extends TestCase { Boolean memoryAvailable = msg.getMemoryAvailable(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, moduleName); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, heatingEnabledAvailable); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, coolingEnabledAvailable); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, heatingLevelAvailable); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, coolingLevelAvailable); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, horizontalPositionAvailable); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, verticalPositionAvailable); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, frontVerticalPositionAvailable); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, backVerticalPositionAvailable); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, backTiltAngleAvailable); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, headSupportHorizontalPositionAvailable); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, headSupportVerticalPositionAvailable); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, massageEnabledAvailable); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, massageModeAvailable); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, massageCushionFirmnessAvailable); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, memoryAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, moduleName); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, heatingEnabledAvailable); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, coolingEnabledAvailable); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, heatingLevelAvailable); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, coolingLevelAvailable); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, horizontalPositionAvailable); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, verticalPositionAvailable); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, frontVerticalPositionAvailable); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, backVerticalPositionAvailable); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, backTiltAngleAvailable); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, headSupportHorizontalPositionAvailable); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, headSupportVerticalPositionAvailable); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, massageEnabledAvailable); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, massageModeAvailable); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, massageCushionFirmnessAvailable); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, memoryAvailable); // Invalid/Null Tests SeatControlCapabilities msg = new SeatControlCapabilities(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getModuleName()); - assertNull(Test.NULL, msg.getHeatingEnabledAvailable()); - assertNull(Test.NULL, msg.getCoolingEnabledAvailable()); - assertNull(Test.NULL, msg.getHeatingLevelAvailable()); - assertNull(Test.NULL, msg.getCoolingLevelAvailable()); - assertNull(Test.NULL, msg.getHorizontalPositionAvailable()); - assertNull(Test.NULL, msg.getVerticalPositionAvailable()); - assertNull(Test.NULL, msg.getFrontVerticalPositionAvailable()); - assertNull(Test.NULL, msg.getBackVerticalPositionAvailable()); - assertNull(Test.NULL, msg.getBackTiltAngleAvailable()); - assertNull(Test.NULL, msg.getHeadSupportHorizontalPositionAvailable()); - assertNull(Test.NULL, msg.getHeadSupportVerticalPositionAvailable()); - assertNull(Test.NULL, msg.getMassageEnabledAvailable()); - assertNull(Test.NULL, msg.getMassageModeAvailable()); - assertNull(Test.NULL, msg.getMassageCushionFirmnessAvailable()); - assertNull(Test.NULL, msg.getMemoryAvailable()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getModuleName()); + assertNull(TestValues.NULL, msg.getHeatingEnabledAvailable()); + assertNull(TestValues.NULL, msg.getCoolingEnabledAvailable()); + assertNull(TestValues.NULL, msg.getHeatingLevelAvailable()); + assertNull(TestValues.NULL, msg.getCoolingLevelAvailable()); + assertNull(TestValues.NULL, msg.getHorizontalPositionAvailable()); + assertNull(TestValues.NULL, msg.getVerticalPositionAvailable()); + assertNull(TestValues.NULL, msg.getFrontVerticalPositionAvailable()); + assertNull(TestValues.NULL, msg.getBackVerticalPositionAvailable()); + assertNull(TestValues.NULL, msg.getBackTiltAngleAvailable()); + assertNull(TestValues.NULL, msg.getHeadSupportHorizontalPositionAvailable()); + assertNull(TestValues.NULL, msg.getHeadSupportVerticalPositionAvailable()); + assertNull(TestValues.NULL, msg.getMassageEnabledAvailable()); + assertNull(TestValues.NULL, msg.getMassageModeAvailable()); + assertNull(TestValues.NULL, msg.getMassageCushionFirmnessAvailable()); + assertNull(TestValues.NULL, msg.getMemoryAvailable()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(SeatControlCapabilities.KEY_MODULE_NAME, Test.GENERAL_STRING); - reference.put(SeatControlCapabilities.KEY_HEATING_ENABLED_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(SeatControlCapabilities.KEY_COOLING_ENABLED_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(SeatControlCapabilities.KEY_HEATING_LEVEL_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(SeatControlCapabilities.KEY_COOLING_LEVEL_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(SeatControlCapabilities.KEY_HORIZONTAL_POSITION_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(SeatControlCapabilities.KEY_VERTICAL_POSITION_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(SeatControlCapabilities.KEY_FRONT_VERTICAL_POSITION_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(SeatControlCapabilities.KEY_BACK_VERTICAL_POSITION_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(SeatControlCapabilities.KEY_BACK_TILT_ANGLE_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(SeatControlCapabilities.KEY_HEAD_SUPPORT_HORIZONTAL_POSITION_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(SeatControlCapabilities.KEY_HEAD_SUPPORT_VERTICAL_POSITION_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(SeatControlCapabilities.KEY_MASSAGE_ENABLED_AVAILABLE, Test.GENERAL_BOOLEAN); - - reference.put(SeatControlCapabilities.KEY_MASSAGE_MODE_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(SeatControlCapabilities.KEY_MASSAGE_CUSHION_FIRMNESS_AVAILABLE, Test.GENERAL_BOOLEAN); - - reference.put(SeatControlCapabilities.KEY_MEMORY_AVAILABLE, Test.GENERAL_BOOLEAN); + reference.put(SeatControlCapabilities.KEY_MODULE_NAME, TestValues.GENERAL_STRING); + reference.put(SeatControlCapabilities.KEY_HEATING_ENABLED_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(SeatControlCapabilities.KEY_COOLING_ENABLED_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(SeatControlCapabilities.KEY_HEATING_LEVEL_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(SeatControlCapabilities.KEY_COOLING_LEVEL_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(SeatControlCapabilities.KEY_HORIZONTAL_POSITION_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(SeatControlCapabilities.KEY_VERTICAL_POSITION_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(SeatControlCapabilities.KEY_FRONT_VERTICAL_POSITION_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(SeatControlCapabilities.KEY_BACK_VERTICAL_POSITION_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(SeatControlCapabilities.KEY_BACK_TILT_ANGLE_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(SeatControlCapabilities.KEY_HEAD_SUPPORT_HORIZONTAL_POSITION_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(SeatControlCapabilities.KEY_HEAD_SUPPORT_VERTICAL_POSITION_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(SeatControlCapabilities.KEY_MASSAGE_ENABLED_AVAILABLE, TestValues.GENERAL_BOOLEAN); + + reference.put(SeatControlCapabilities.KEY_MASSAGE_MODE_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(SeatControlCapabilities.KEY_MASSAGE_CUSHION_FIRMNESS_AVAILABLE, TestValues.GENERAL_BOOLEAN); + + reference.put(SeatControlCapabilities.KEY_MEMORY_AVAILABLE, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlDataTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlDataTest.java index 535e7cf3e..6ee549a4c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlDataTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlDataTest.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.SeatControlData; import com.smartdevicelink.proxy.rpc.SeatMemoryAction; import com.smartdevicelink.proxy.rpc.enums.SupportedSeat; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -31,22 +31,22 @@ public class SeatControlDataTest extends TestCase { @Override public void setUp() { msg = new SeatControlData(); - msg.setId(Test.GENERAL_SUPPORTEDSEAT); - msg.setHeatingEnabled(Test.GENERAL_BOOLEAN); - msg.setCoolingEnabled(Test.GENERAL_BOOLEAN); - msg.setHeatingLevel(Test.GENERAL_INT); - msg.setCoolingLevel(Test.GENERAL_INT); - msg.setHorizontalPosition(Test.GENERAL_INT); - msg.setVerticalPosition(Test.GENERAL_INT); - msg.setFrontVerticalPosition(Test.GENERAL_INT); - msg.setBackVerticalPosition(Test.GENERAL_INT); - msg.setBackTiltAngle(Test.GENERAL_INT); - msg.setHeadSupportVerticalPosition(Test.GENERAL_INT); - msg.setHeadSupportHorizontalPosition(Test.GENERAL_INT); - msg.setMassageEnabled(Test.GENERAL_BOOLEAN); - msg.setMassageMode(Test.GENERAL_MASSAGEMODEDATA_LIST); - msg.setMassageCushionFirmness(Test.GENERAL_MASSAGECUSHIONFIRMNESS_LIST); - msg.setMemory(Test.GENERAL_SEATMEMORYACTION); + msg.setId(TestValues.GENERAL_SUPPORTEDSEAT); + msg.setHeatingEnabled(TestValues.GENERAL_BOOLEAN); + msg.setCoolingEnabled(TestValues.GENERAL_BOOLEAN); + msg.setHeatingLevel(TestValues.GENERAL_INT); + msg.setCoolingLevel(TestValues.GENERAL_INT); + msg.setHorizontalPosition(TestValues.GENERAL_INT); + msg.setVerticalPosition(TestValues.GENERAL_INT); + msg.setFrontVerticalPosition(TestValues.GENERAL_INT); + msg.setBackVerticalPosition(TestValues.GENERAL_INT); + msg.setBackTiltAngle(TestValues.GENERAL_INT); + msg.setHeadSupportVerticalPosition(TestValues.GENERAL_INT); + msg.setHeadSupportHorizontalPosition(TestValues.GENERAL_INT); + msg.setMassageEnabled(TestValues.GENERAL_BOOLEAN); + msg.setMassageMode(TestValues.GENERAL_MASSAGEMODEDATA_LIST); + msg.setMassageCushionFirmness(TestValues.GENERAL_MASSAGECUSHIONFIRMNESS_LIST); + msg.setMemory(TestValues.GENERAL_SEATMEMORYACTION); } /** @@ -73,72 +73,72 @@ public class SeatControlDataTest extends TestCase { SeatMemoryAction memory = msg.getMemory(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_SUPPORTEDSEAT, id); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, heatingEnabled); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, coolingEnabled); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, heatingLevel); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, coolingLevel); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, horizontalPosition); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, verticalPosition); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, frontVerticalPosition); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, backVerticalPosition); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, backTiltAngle); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, headSupportHorizontalPosition); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, headSupportVerticalPosition); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, massageEnabled); - - assertTrue(Test.TRUE, Validator.validateMassageModeDataList(Test.GENERAL_MASSAGEMODEDATA_LIST, massageMode)); - assertTrue(Test.TRUE, Validator.validateMassageCushionFirmnessList(Test.GENERAL_MASSAGECUSHIONFIRMNESS_LIST, massageCushionFirmness)); - - assertTrue(Test.TRUE, Validator.validateSeatMemoryAction(Test.GENERAL_SEATMEMORYACTION, memory)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_SUPPORTEDSEAT, id); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, heatingEnabled); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, coolingEnabled); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, heatingLevel); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, coolingLevel); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, horizontalPosition); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, verticalPosition); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, frontVerticalPosition); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, backVerticalPosition); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, backTiltAngle); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, headSupportHorizontalPosition); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, headSupportVerticalPosition); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, massageEnabled); + + assertTrue(TestValues.TRUE, Validator.validateMassageModeDataList(TestValues.GENERAL_MASSAGEMODEDATA_LIST, massageMode)); + assertTrue(TestValues.TRUE, Validator.validateMassageCushionFirmnessList(TestValues.GENERAL_MASSAGECUSHIONFIRMNESS_LIST, massageCushionFirmness)); + + assertTrue(TestValues.TRUE, Validator.validateSeatMemoryAction(TestValues.GENERAL_SEATMEMORYACTION, memory)); // Invalid/Null Tests SeatControlData msg = new SeatControlData(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getId()); - assertNull(Test.NULL, msg.getHeatingEnabled()); - assertNull(Test.NULL, msg.getCoolingEnabled()); - assertNull(Test.NULL, msg.getHeatingLevel()); - assertNull(Test.NULL, msg.getCoolingLevel()); - assertNull(Test.NULL, msg.getHorizontalPosition()); - assertNull(Test.NULL, msg.getVerticalPosition()); - assertNull(Test.NULL, msg.getFrontVerticalPosition()); - assertNull(Test.NULL, msg.getBackVerticalPosition()); - assertNull(Test.NULL, msg.getBackTiltAngle()); - assertNull(Test.NULL, msg.getHeadSupportHorizontalPosition()); - assertNull(Test.NULL, msg.getHeadSupportVerticalPosition()); - assertNull(Test.NULL, msg.getMassageEnabled()); - assertNull(Test.NULL, msg.getMassageMode()); - assertNull(Test.NULL, msg.getMassageCushionFirmness()); - assertNull(Test.NULL, msg.getMemory()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getId()); + assertNull(TestValues.NULL, msg.getHeatingEnabled()); + assertNull(TestValues.NULL, msg.getCoolingEnabled()); + assertNull(TestValues.NULL, msg.getHeatingLevel()); + assertNull(TestValues.NULL, msg.getCoolingLevel()); + assertNull(TestValues.NULL, msg.getHorizontalPosition()); + assertNull(TestValues.NULL, msg.getVerticalPosition()); + assertNull(TestValues.NULL, msg.getFrontVerticalPosition()); + assertNull(TestValues.NULL, msg.getBackVerticalPosition()); + assertNull(TestValues.NULL, msg.getBackTiltAngle()); + assertNull(TestValues.NULL, msg.getHeadSupportHorizontalPosition()); + assertNull(TestValues.NULL, msg.getHeadSupportVerticalPosition()); + assertNull(TestValues.NULL, msg.getMassageEnabled()); + assertNull(TestValues.NULL, msg.getMassageMode()); + assertNull(TestValues.NULL, msg.getMassageCushionFirmness()); + assertNull(TestValues.NULL, msg.getMemory()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(SeatControlData.KEY_ID, Test.GENERAL_SUPPORTEDSEAT); - reference.put(SeatControlData.KEY_HEATING_ENABLED, Test.GENERAL_BOOLEAN); - reference.put(SeatControlData.KEY_COOLING_ENABLED, Test.GENERAL_BOOLEAN); - reference.put(SeatControlData.KEY_HEATING_LEVEL, Test.GENERAL_INT); - reference.put(SeatControlData.KEY_COOLING_LEVEL, Test.GENERAL_INT); - reference.put(SeatControlData.KEY_HORIZONTAL_POSITION, Test.GENERAL_INT); - reference.put(SeatControlData.KEY_VERTICAL_POSITION, Test.GENERAL_INT); - reference.put(SeatControlData.KEY_FRONT_VERTICAL_POSITION, Test.GENERAL_INT); - reference.put(SeatControlData.KEY_BACK_VERTICAL_POSITION, Test.GENERAL_INT); - reference.put(SeatControlData.KEY_BACK_TILT_ANGLE, Test.GENERAL_INT); - reference.put(SeatControlData.KEY_HEAD_SUPPORT_HORIZONTAL_POSITION, Test.GENERAL_INT); - reference.put(SeatControlData.KEY_HEAD_SUPPORT_VERTICAL_POSITION, Test.GENERAL_INT); - reference.put(SeatControlData.KEY_MASSAGE_ENABLED, Test.GENERAL_BOOLEAN); - - reference.put(SeatControlData.KEY_MASSAGE_MODE, Test.GENERAL_MASSAGEMODEDATA_LIST); - reference.put(SeatControlData.KEY_MASSAGE_CUSHION_FIRMNESS, Test.GENERAL_MASSAGECUSHIONFIRMNESS_LIST); - - reference.put(SeatControlData.KEY_MEMORY, Test.GENERAL_SEATMEMORYACTION); + reference.put(SeatControlData.KEY_ID, TestValues.GENERAL_SUPPORTEDSEAT); + reference.put(SeatControlData.KEY_HEATING_ENABLED, TestValues.GENERAL_BOOLEAN); + reference.put(SeatControlData.KEY_COOLING_ENABLED, TestValues.GENERAL_BOOLEAN); + reference.put(SeatControlData.KEY_HEATING_LEVEL, TestValues.GENERAL_INT); + reference.put(SeatControlData.KEY_COOLING_LEVEL, TestValues.GENERAL_INT); + reference.put(SeatControlData.KEY_HORIZONTAL_POSITION, TestValues.GENERAL_INT); + reference.put(SeatControlData.KEY_VERTICAL_POSITION, TestValues.GENERAL_INT); + reference.put(SeatControlData.KEY_FRONT_VERTICAL_POSITION, TestValues.GENERAL_INT); + reference.put(SeatControlData.KEY_BACK_VERTICAL_POSITION, TestValues.GENERAL_INT); + reference.put(SeatControlData.KEY_BACK_TILT_ANGLE, TestValues.GENERAL_INT); + reference.put(SeatControlData.KEY_HEAD_SUPPORT_HORIZONTAL_POSITION, TestValues.GENERAL_INT); + reference.put(SeatControlData.KEY_HEAD_SUPPORT_VERTICAL_POSITION, TestValues.GENERAL_INT); + reference.put(SeatControlData.KEY_MASSAGE_ENABLED, TestValues.GENERAL_BOOLEAN); + + reference.put(SeatControlData.KEY_MASSAGE_MODE, TestValues.GENERAL_MASSAGEMODEDATA_LIST); + reference.put(SeatControlData.KEY_MASSAGE_CUSHION_FIRMNESS, TestValues.GENERAL_MASSAGECUSHIONFIRMNESS_LIST); + + reference.put(SeatControlData.KEY_MEMORY, TestValues.GENERAL_SEATMEMORYACTION); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { @@ -163,11 +163,11 @@ public class SeatControlDataTest extends TestCase { Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(JsonUtils.readJsonObjectFromJsonObject(underTest, key)); assertTrue(Validator.validateSeatMemoryAction(mReference, new SeatMemoryAction(hashTest))); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatLocationCapabilityTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatLocationCapabilityTests.java index 847564adb..df99fd9cc 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatLocationCapabilityTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatLocationCapabilityTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.rpc.SeatLocation; import com.smartdevicelink.proxy.rpc.SeatLocationCapability; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -25,10 +25,10 @@ public class SeatLocationCapabilityTests extends TestCase { @Override public void setUp() { msg = new SeatLocationCapability(); - msg.setCols(Test.GENERAL_INT); - msg.setRows(Test.GENERAL_INT); - msg.setLevels(Test.GENERAL_INT); - msg.setSeats(Test.GENERAL_SEAT_LIST); + msg.setCols(TestValues.GENERAL_INT); + msg.setRows(TestValues.GENERAL_INT); + msg.setLevels(TestValues.GENERAL_INT); + msg.setSeats(TestValues.GENERAL_SEAT_LIST); } public void testRpcValues() { @@ -38,29 +38,29 @@ public class SeatLocationCapabilityTests extends TestCase { List<SeatLocation> seats = msg.getSeatLocations(); //valid tests - assertEquals(Test.MATCH, row, Test.GENERAL_INT); - assertEquals(Test.MATCH, col, Test.GENERAL_INT); - assertEquals(Test.MATCH, level, Test.GENERAL_INT); - assertEquals(Test.MATCH, seats.size(), Test.GENERAL_SEAT_LIST.size()); - for (int i = 0; i < Test.GENERAL_SEAT_LIST.size(); i++) { - assertTrue(Test.TRUE, Validator.validateGrid(Test.GENERAL_SEAT_LIST.get(i).getGrid(), seats.get(i).getGrid())); + assertEquals(TestValues.MATCH, row, TestValues.GENERAL_INT); + assertEquals(TestValues.MATCH, col, TestValues.GENERAL_INT); + assertEquals(TestValues.MATCH, level, TestValues.GENERAL_INT); + assertEquals(TestValues.MATCH, seats.size(), TestValues.GENERAL_SEAT_LIST.size()); + for (int i = 0; i < TestValues.GENERAL_SEAT_LIST.size(); i++) { + assertTrue(TestValues.TRUE, Validator.validateGrid(TestValues.GENERAL_SEAT_LIST.get(i).getGrid(), seats.get(i).getGrid())); } //null tests SeatLocationCapability msg = new SeatLocationCapability(); - assertNull(Test.NULL, msg.getCols()); - assertNull(Test.NULL, msg.getRows()); - assertNull(Test.NULL, msg.getLevels()); - assertNull(Test.NULL, msg.getSeatLocations()); + assertNull(TestValues.NULL, msg.getCols()); + assertNull(TestValues.NULL, msg.getRows()); + assertNull(TestValues.NULL, msg.getLevels()); + assertNull(TestValues.NULL, msg.getSeatLocations()); } public void testJson() { JSONObject original = new JSONObject(); try { - original.put(SeatLocationCapability.KEY_COLS, Test.GENERAL_INT); - original.put(SeatLocationCapability.KEY_ROWS, Test.GENERAL_INT); - original.put(SeatLocationCapability.KEY_LEVELS, Test.GENERAL_INT); - original.put(SeatLocationCapability.KEY_SEATS, Test.JSON_SEAT_LOCATIONS); + original.put(SeatLocationCapability.KEY_COLS, TestValues.GENERAL_INT); + original.put(SeatLocationCapability.KEY_ROWS, TestValues.GENERAL_INT); + original.put(SeatLocationCapability.KEY_LEVELS, TestValues.GENERAL_INT); + original.put(SeatLocationCapability.KEY_SEATS, TestValues.JSON_SEAT_LOCATIONS); JSONObject serialized = msg.serializeJSON(); assertEquals(serialized.length(), original.length()); @@ -72,28 +72,28 @@ public class SeatLocationCapabilityTests extends TestCase { if (key.equals(SeatLocationCapability.KEY_COLS)) { int i1 = new SeatLocationCapability(JsonRPCMarshaller.deserializeJSONObject(original)).getCols(); int i2 = new SeatLocationCapability(JsonRPCMarshaller.deserializeJSONObject(serialized)).getCols(); - assertEquals(Test.MATCH, i1, i2); + assertEquals(TestValues.MATCH, i1, i2); } else if (key.equals(SeatLocationCapability.KEY_ROWS)) { int i1 = new SeatLocationCapability(JsonRPCMarshaller.deserializeJSONObject(original)).getRows(); int i2 = new SeatLocationCapability(JsonRPCMarshaller.deserializeJSONObject(serialized)).getRows(); - assertEquals(Test.MATCH, i1, i2); + assertEquals(TestValues.MATCH, i1, i2); } else if (key.equals(SeatLocationCapability.KEY_LEVELS)) { int i1 = new SeatLocationCapability(JsonRPCMarshaller.deserializeJSONObject(original)).getLevels(); int i2 = new SeatLocationCapability(JsonRPCMarshaller.deserializeJSONObject(serialized)).getLevels(); - assertEquals(Test.MATCH, i1, i2); + assertEquals(TestValues.MATCH, i1, i2); } else if (key.equals(SeatLocationCapability.KEY_SEATS)) { JSONArray arr1 = JsonUtils.readJsonArrayFromJsonObject(original, key); JSONArray arr2 = JsonUtils.readJsonArrayFromJsonObject(serialized, key); - assertEquals(Test.MATCH, arr1.length(), arr2.length()); - for (int i = 0; i < Test.GENERAL_SEAT_LIST.size(); i++) { + assertEquals(TestValues.MATCH, arr1.length(), arr2.length()); + for (int i = 0; i < TestValues.GENERAL_SEAT_LIST.size(); i++) { Hashtable<String, Object> h1 = JsonRPCMarshaller.deserializeJSONObject(arr1.getJSONObject(i)); Hashtable<String, Object> h2 = JsonRPCMarshaller.deserializeJSONObject(arr2.getJSONObject(i)); - assertTrue(Test.MATCH, Validator.validateSeatLocation(new SeatLocation(h1), new SeatLocation(h2))); + assertTrue(TestValues.MATCH, Validator.validateSeatLocation(new SeatLocation(h1), new SeatLocation(h2))); } } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatLocationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatLocationTests.java index 6a102fc66..cf954b702 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatLocationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatLocationTests.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.rpc.Grid; import com.smartdevicelink.proxy.rpc.SeatLocation; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -18,31 +18,31 @@ public class SeatLocationTests extends TestCase { @Override public void setUp() { msg = new SeatLocation(); - msg.setGrid(Test.GENERAL_GRID); + msg.setGrid(TestValues.GENERAL_GRID); } public void testRpcValues() { Grid grid = msg.getGrid(); //valid test - assertTrue(Validator.validateGrid(Test.GENERAL_GRID, grid)); + assertTrue(Validator.validateGrid(TestValues.GENERAL_GRID, grid)); //null test SeatLocation msg = new SeatLocation(); - assertNull(Test.NULL, msg.getGrid()); + assertNull(TestValues.NULL, msg.getGrid()); } public void testJson() { JSONObject original = new JSONObject(); try { - original.put(SeatLocation.KEY_GRID, Test.GENERAL_GRID); + original.put(SeatLocation.KEY_GRID, TestValues.GENERAL_GRID); JSONObject serialized = msg.serializeJSON(); assertEquals(serialized.length(), original.length()); - assertTrue(Test.TRUE, Validator.validateSeatLocation(new SeatLocation(JsonRPCMarshaller.deserializeJSONObject(original)), + assertTrue(TestValues.TRUE, Validator.validateSeatLocation(new SeatLocation(JsonRPCMarshaller.deserializeJSONObject(original)), new SeatLocation(JsonRPCMarshaller.deserializeJSONObject(serialized)))); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatMemoryActionTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatMemoryActionTest.java index a8c17cee3..c6ca217f3 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatMemoryActionTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatMemoryActionTest.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.SeatMemoryAction; import com.smartdevicelink.proxy.rpc.enums.SeatMemoryActionType; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -24,9 +24,9 @@ public class SeatMemoryActionTest extends TestCase { public void setUp() { msg = new SeatMemoryAction(); - msg.setId(Test.GENERAL_INT); - msg.setLabel(Test.GENERAL_STRING); - msg.setAction(Test.GENERAL_SEATMEMORYACTIONTYPE); + msg.setId(TestValues.GENERAL_INT); + msg.setLabel(TestValues.GENERAL_STRING); + msg.setAction(TestValues.GENERAL_SEATMEMORYACTIONTYPE); } /** @@ -39,37 +39,37 @@ public class SeatMemoryActionTest extends TestCase { SeatMemoryActionType action = msg.getAction(); // Valid Tests - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, id); - assertEquals(Test.MATCH, Test.GENERAL_STRING, label); - assertEquals(Test.MATCH, Test.GENERAL_SEATMEMORYACTIONTYPE, action); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, id); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, label); + assertEquals(TestValues.MATCH, TestValues.GENERAL_SEATMEMORYACTIONTYPE, action); // Invalid/Null Tests SeatMemoryAction msg = new SeatMemoryAction(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getId()); - assertNull(Test.NULL, msg.getLabel()); - assertNull(Test.NULL, msg.getAction()); + assertNull(TestValues.NULL, msg.getId()); + assertNull(TestValues.NULL, msg.getLabel()); + assertNull(TestValues.NULL, msg.getAction()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(SeatMemoryAction.KEY_ID, Test.GENERAL_INT); - reference.put(SeatMemoryAction.KEY_LABEL, Test.GENERAL_STRING); - reference.put(SeatMemoryAction.KEY_ACTION, Test.GENERAL_SEATMEMORYACTIONTYPE); + reference.put(SeatMemoryAction.KEY_ID, TestValues.GENERAL_INT); + reference.put(SeatMemoryAction.KEY_LABEL, TestValues.GENERAL_STRING); + reference.put(SeatMemoryAction.KEY_ACTION, TestValues.GENERAL_SEATMEMORYACTIONTYPE); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SingleTireStatusTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SingleTireStatusTest.java index 15e83ad11..14f9890f2 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SingleTireStatusTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SingleTireStatusTest.java @@ -4,7 +4,7 @@ import com.smartdevicelink.proxy.rpc.SingleTireStatus; import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus; import com.smartdevicelink.proxy.rpc.enums.TPMS; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -25,9 +25,9 @@ public class SingleTireStatusTest extends TestCase { public void setUp() { msg = new SingleTireStatus(); - msg.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS); - msg.setTPMS(Test.GENERAL_TPMS); - msg.setPressure(Test.GENERAL_FLOAT); + msg.setStatus(TestValues.GENERAL_COMPONENTVOLUMESTATUS); + msg.setTPMS(TestValues.GENERAL_TPMS); + msg.setPressure(TestValues.GENERAL_FLOAT); } /** @@ -40,37 +40,37 @@ public class SingleTireStatusTest extends TestCase { Float pressure = msg.getPressure(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, status); - assertEquals(Test.MATCH, Test.GENERAL_TPMS, tpms); - assertEquals(Test.MATCH, Test.GENERAL_FLOAT, pressure); + assertEquals(TestValues.MATCH, TestValues.GENERAL_COMPONENTVOLUMESTATUS, status); + assertEquals(TestValues.MATCH, TestValues.GENERAL_TPMS, tpms); + assertEquals(TestValues.MATCH, TestValues.GENERAL_FLOAT, pressure); // Invalid/Null Tests SingleTireStatus msg = new SingleTireStatus(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getStatus()); - assertNull(Test.NULL, msg.getTPMS()); - assertNull(Test.NULL, msg.getPressure()); + assertNull(TestValues.NULL, msg.getStatus()); + assertNull(TestValues.NULL, msg.getTPMS()); + assertNull(TestValues.NULL, msg.getPressure()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS); - reference.put(SingleTireStatus.KEY_TPMS, Test.GENERAL_TPMS); - reference.put(SingleTireStatus.KEY_PRESSURE, Test.GENERAL_FLOAT); + reference.put(SingleTireStatus.KEY_STATUS, TestValues.GENERAL_COMPONENTVOLUMESTATUS); + reference.put(SingleTireStatus.KEY_TPMS, TestValues.GENERAL_TPMS); + reference.put(SingleTireStatus.KEY_PRESSURE, TestValues.GENERAL_FLOAT); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SisDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SisDataTests.java index 51e38f8d1..e3bd7c92e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SisDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SisDataTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.rpc.GPSData; import com.smartdevicelink.proxy.rpc.SisData; import com.smartdevicelink.proxy.rpc.StationIDNumber; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.VehicleDataHelper; @@ -29,11 +29,11 @@ public class SisDataTests extends TestCase { public void setUp() { msg = new SisData(); - msg.setStationShortName(Test.GENERAL_STRING); - msg.setStationIDNumber(Test.GENERAL_STATIONIDNUMBER); - msg.setStationLongName(Test.GENERAL_STRING); + msg.setStationShortName(TestValues.GENERAL_STRING); + msg.setStationIDNumber(TestValues.GENERAL_STATIONIDNUMBER); + msg.setStationLongName(TestValues.GENERAL_STRING); msg.setStationLocation(VehicleDataHelper.GPS); - msg.setStationMessage(Test.GENERAL_STRING); + msg.setStationMessage(TestValues.GENERAL_STRING); } /** @@ -48,35 +48,35 @@ public class SisDataTests extends TestCase { String stationMessage = msg.getStationMessage(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, stationShortName); - assertEquals(Test.MATCH, Test.GENERAL_STATIONIDNUMBER, stationIDNumber); - assertEquals(Test.MATCH, Test.GENERAL_STRING, stationLongName); - assertEquals(Test.MATCH, VehicleDataHelper.GPS, stationLocation); - assertEquals(Test.MATCH, Test.GENERAL_STRING, stationMessage); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, stationShortName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STATIONIDNUMBER, stationIDNumber); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, stationLongName); + assertEquals(TestValues.MATCH, VehicleDataHelper.GPS, stationLocation); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, stationMessage); // Invalid/Null Tests SisData msg = new SisData(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getStationShortName()); - assertNull(Test.NULL, msg.getStationIDNumber()); - assertNull(Test.NULL, msg.getStationLongName()); - assertNull(Test.NULL, msg.getStationLocation()); - assertNull(Test.NULL, msg.getStationMessage()); + assertNull(TestValues.NULL, msg.getStationShortName()); + assertNull(TestValues.NULL, msg.getStationIDNumber()); + assertNull(TestValues.NULL, msg.getStationLongName()); + assertNull(TestValues.NULL, msg.getStationLocation()); + assertNull(TestValues.NULL, msg.getStationMessage()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(SisData.KEY_STATION_SHORT_NAME, Test.GENERAL_STRING); - reference.put(SisData.KEY_STATION_ID_NUMBER, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_STATIONIDNUMBER.getStore())); - reference.put(SisData.KEY_STATION_LONG_NAME, Test.GENERAL_STRING); + reference.put(SisData.KEY_STATION_SHORT_NAME, TestValues.GENERAL_STRING); + reference.put(SisData.KEY_STATION_ID_NUMBER, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_STATIONIDNUMBER.getStore())); + reference.put(SisData.KEY_STATION_LONG_NAME, TestValues.GENERAL_STRING); reference.put(SisData.KEY_STATION_LOCATION, JsonRPCMarshaller.serializeHashtable(VehicleDataHelper.GPS.getStore())); - reference.put(SisData.KEY_STATION_MESSAGE, Test.GENERAL_STRING); + reference.put(SisData.KEY_STATION_MESSAGE, TestValues.GENERAL_STRING); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { @@ -87,19 +87,19 @@ public class SisDataTests extends TestCase { JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateStationIDNumber(new StationIDNumber(hashReference), new StationIDNumber(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateStationIDNumber(new StationIDNumber(hashReference), new StationIDNumber(hashTest))); } else if (key.equals(SisData.KEY_STATION_LOCATION)) { JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key); JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateGpsData(new GPSData(hashReference), new GPSData(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateGpsData(new GPSData(hashReference), new GPSData(hashTest))); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonCapabilitiesTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonCapabilitiesTest.java index b422ce627..1846d1022 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonCapabilitiesTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonCapabilitiesTest.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,11 +23,11 @@ public class SoftButtonCapabilitiesTest extends TestCase { public void setUp() { msg = new SoftButtonCapabilities(); - msg.setImageSupported(Test.GENERAL_BOOLEAN); - msg.setShortPressAvailable(Test.GENERAL_BOOLEAN); - msg.setLongPressAvailable(Test.GENERAL_BOOLEAN); - msg.setUpDownAvailable(Test.GENERAL_BOOLEAN); - msg.setTextSupported(Test.GENERAL_BOOLEAN); + msg.setImageSupported(TestValues.GENERAL_BOOLEAN); + msg.setShortPressAvailable(TestValues.GENERAL_BOOLEAN); + msg.setLongPressAvailable(TestValues.GENERAL_BOOLEAN); + msg.setUpDownAvailable(TestValues.GENERAL_BOOLEAN); + msg.setTextSupported(TestValues.GENERAL_BOOLEAN); } /** @@ -42,43 +42,43 @@ public class SoftButtonCapabilitiesTest extends TestCase { Boolean textSupported = msg.getTextSupported(); // Valid Tests - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, imageSupp); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, updown); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, longPress); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, shortPress); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, textSupported); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, imageSupp); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, updown); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, longPress); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, shortPress); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, textSupported); // Invalid/Null Tests SoftButtonCapabilities msg = new SoftButtonCapabilities(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getImageSupported()); - assertNull(Test.NULL, msg.getLongPressAvailable()); - assertNull(Test.NULL, msg.getShortPressAvailable()); - assertNull(Test.NULL, msg.getUpDownAvailable()); - assertNull(Test.NULL, msg.getTextSupported()); + assertNull(TestValues.NULL, msg.getImageSupported()); + assertNull(TestValues.NULL, msg.getLongPressAvailable()); + assertNull(TestValues.NULL, msg.getShortPressAvailable()); + assertNull(TestValues.NULL, msg.getUpDownAvailable()); + assertNull(TestValues.NULL, msg.getTextSupported()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(SoftButtonCapabilities.KEY_IMAGE_SUPPORTED, Test.GENERAL_BOOLEAN); - reference.put(SoftButtonCapabilities.KEY_UP_DOWN_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(SoftButtonCapabilities.KEY_LONG_PRESS_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(SoftButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(SoftButtonCapabilities.KEY_TEXT_SUPPORTED, Test.GENERAL_BOOLEAN); + reference.put(SoftButtonCapabilities.KEY_IMAGE_SUPPORTED, TestValues.GENERAL_BOOLEAN); + reference.put(SoftButtonCapabilities.KEY_UP_DOWN_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(SoftButtonCapabilities.KEY_LONG_PRESS_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(SoftButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(SoftButtonCapabilities.KEY_TEXT_SUPPORTED, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonTest.java index 5d12e1286..5d3d09d73 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SoftButtonTest.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.rpc.SoftButton; import com.smartdevicelink.proxy.rpc.enums.SoftButtonType; import com.smartdevicelink.proxy.rpc.enums.SystemAction; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -29,12 +29,12 @@ public class SoftButtonTest extends TestCase { public void setUp() { msg = new SoftButton(); - msg.setType(Test.GENERAL_SOFTBUTTONTYPE); - msg.setText(Test.GENERAL_STRING); - msg.setSystemAction(Test.GENERAL_SYSTEMACTION); - msg.setImage(Test.GENERAL_IMAGE); - msg.setIsHighlighted(Test.GENERAL_BOOLEAN); - msg.setSoftButtonID(Test.GENERAL_INT); + msg.setType(TestValues.GENERAL_SOFTBUTTONTYPE); + msg.setText(TestValues.GENERAL_STRING); + msg.setSystemAction(TestValues.GENERAL_SYSTEMACTION); + msg.setImage(TestValues.GENERAL_IMAGE); + msg.setIsHighlighted(TestValues.GENERAL_BOOLEAN); + msg.setSoftButtonID(TestValues.GENERAL_INT); } /** @@ -50,38 +50,38 @@ public class SoftButtonTest extends TestCase { Integer id = msg.getSoftButtonID(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_SOFTBUTTONTYPE, type); - assertEquals(Test.MATCH, Test.GENERAL_STRING, text); - assertEquals(Test.MATCH, Test.GENERAL_SYSTEMACTION, sysAction); - assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, image)); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, isHighlighted); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, id); + assertEquals(TestValues.MATCH, TestValues.GENERAL_SOFTBUTTONTYPE, type); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, text); + assertEquals(TestValues.MATCH, TestValues.GENERAL_SYSTEMACTION, sysAction); + assertTrue(TestValues.TRUE, Validator.validateImage(TestValues.GENERAL_IMAGE, image)); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, isHighlighted); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, id); // Invalid/Null Tests SoftButton msg = new SoftButton(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getSoftButtonID()); - assertNull(Test.NULL, msg.getImage()); - assertNull(Test.NULL, msg.getIsHighlighted()); - assertNull(Test.NULL, msg.getSystemAction()); - assertNull(Test.NULL, msg.getText()); - assertNull(Test.NULL, msg.getType()); + assertNull(TestValues.NULL, msg.getSoftButtonID()); + assertNull(TestValues.NULL, msg.getImage()); + assertNull(TestValues.NULL, msg.getIsHighlighted()); + assertNull(TestValues.NULL, msg.getSystemAction()); + assertNull(TestValues.NULL, msg.getText()); + assertNull(TestValues.NULL, msg.getType()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(SoftButton.KEY_SOFT_BUTTON_ID, Test.GENERAL_INT); - reference.put(SoftButton.KEY_TYPE, Test.GENERAL_SOFTBUTTONTYPE); - reference.put(SoftButton.KEY_TEXT, Test.GENERAL_STRING); - reference.put(SoftButton.KEY_IMAGE, Test.JSON_IMAGE); - reference.put(SoftButton.KEY_SYSTEM_ACTION, Test.GENERAL_SYSTEMACTION); - reference.put(SoftButton.KEY_IS_HIGHLIGHTED, Test.GENERAL_BOOLEAN); + reference.put(SoftButton.KEY_SOFT_BUTTON_ID, TestValues.GENERAL_INT); + reference.put(SoftButton.KEY_TYPE, TestValues.GENERAL_SOFTBUTTONTYPE); + reference.put(SoftButton.KEY_TEXT, TestValues.GENERAL_STRING); + reference.put(SoftButton.KEY_IMAGE, TestValues.JSON_IMAGE); + reference.put(SoftButton.KEY_SYSTEM_ACTION, TestValues.GENERAL_SYSTEMACTION); + reference.put(SoftButton.KEY_IS_HIGHLIGHTED, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { @@ -92,13 +92,13 @@ public class SoftButtonTest extends TestCase { JSONObject underTestArray = JsonUtils.readJsonObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray); Hashtable<String, Object> hashTest= JsonRPCMarshaller.deserializeJSONObject(underTestArray); - assertTrue(Test.TRUE, Validator.validateImage(new Image(hashReference), new Image(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateImage(new Image(hashReference), new Image(hashTest))); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StartTimeTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StartTimeTest.java index 5d698398f..54752d5ef 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StartTimeTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StartTimeTest.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.StartTime; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,9 +23,9 @@ public class StartTimeTest extends TestCase { public void setUp() { msg = new StartTime(); - msg.setHours(Test.GENERAL_INT); - msg.setMinutes(Test.GENERAL_INT); - msg.setSeconds(Test.GENERAL_INT); + msg.setHours(TestValues.GENERAL_INT); + msg.setMinutes(TestValues.GENERAL_INT); + msg.setSeconds(TestValues.GENERAL_INT); } /** @@ -38,42 +38,42 @@ public class StartTimeTest extends TestCase { Integer seconds = msg.getSeconds(); // Valid Tests - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, hours); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, minutes); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, seconds); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, hours); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, minutes); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, seconds); // TimeInterval constructor test StartTime startTime = new StartTime(7000); - assertEquals(Test.MATCH, (Integer) 1, startTime.getHours()); - assertEquals(Test.MATCH, (Integer) 56, startTime.getMinutes()); - assertEquals(Test.MATCH, (Integer) 40, startTime.getSeconds()); + assertEquals(TestValues.MATCH, (Integer) 1, startTime.getHours()); + assertEquals(TestValues.MATCH, (Integer) 56, startTime.getMinutes()); + assertEquals(TestValues.MATCH, (Integer) 40, startTime.getSeconds()); // Invalid/Null Tests StartTime msg = new StartTime(); - assertNotNull(Test.NOT_NULL, msg); - assertNull(Test.NULL, msg.getHours()); - assertNull(Test.NULL, msg.getMinutes()); - assertNull(Test.NULL, msg.getSeconds()); + assertNotNull(TestValues.NOT_NULL, msg); + assertNull(TestValues.NULL, msg.getHours()); + assertNull(TestValues.NULL, msg.getMinutes()); + assertNull(TestValues.NULL, msg.getSeconds()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(StartTime.KEY_HOURS, Test.GENERAL_INT); - reference.put(StartTime.KEY_MINUTES, Test.GENERAL_INT); - reference.put(StartTime.KEY_SECONDS, Test.GENERAL_INT); + reference.put(StartTime.KEY_HOURS, TestValues.GENERAL_INT); + reference.put(StartTime.KEY_MINUTES, TestValues.GENERAL_INT); + reference.put(StartTime.KEY_SECONDS, TestValues.GENERAL_INT); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StationIDNumberTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StationIDNumberTests.java index e7e61f8fd..0e3ee88cb 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StationIDNumberTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StationIDNumberTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.StationIDNumber; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,8 +23,8 @@ public class StationIDNumberTests extends TestCase { public void setUp() { msg = new StationIDNumber(); - msg.setCountryCode(Test.GENERAL_INT); - msg.setFccFacilityId(Test.GENERAL_INT); + msg.setCountryCode(TestValues.GENERAL_INT); + msg.setFccFacilityId(TestValues.GENERAL_INT); } /** @@ -37,15 +37,15 @@ public class StationIDNumberTests extends TestCase { int fccFacilityId = msg.getFccFacilityId(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, countryCode); - assertEquals(Test.MATCH, Test.GENERAL_INT, fccFacilityId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, countryCode); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, fccFacilityId); // Invalid/Null Tests StationIDNumber msg = new StationIDNumber(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getCountryCode()); - assertNull(Test.NULL, msg.getFccFacilityId()); + assertNull(TestValues.NULL, msg.getCountryCode()); + assertNull(TestValues.NULL, msg.getFccFacilityId()); } public void testJson() { @@ -53,21 +53,21 @@ public class StationIDNumberTests extends TestCase { try { - reference.put(StationIDNumber.KEY_COUNTRY_CODE, Test.GENERAL_INT); - reference.put(StationIDNumber.KEY_FCC_FACILITY_ID, Test.GENERAL_INT); + reference.put(StationIDNumber.KEY_COUNTRY_CODE, TestValues.GENERAL_INT); + reference.put(StationIDNumber.KEY_FCC_FACILITY_ID, TestValues.GENERAL_INT); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SystemCapabilityTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SystemCapabilityTests.java index 203f72060..0a02b6543 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SystemCapabilityTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SystemCapabilityTests.java @@ -11,7 +11,7 @@ import com.smartdevicelink.proxy.rpc.RemoteControlCapabilities; import com.smartdevicelink.proxy.rpc.SystemCapability; import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -36,12 +36,12 @@ public class SystemCapabilityTests extends TestCase { public void setUp() { msg = new SystemCapability(); - msg.setSystemCapabilityType(Test.GENERAL_SYSTEMCAPABILITYTYPE); - msg.setCapabilityForType(SystemCapabilityType.NAVIGATION, Test.GENERAL_NAVIGATIONCAPABILITY); - msg.setCapabilityForType(SystemCapabilityType.PHONE_CALL, Test.GENERAL_PHONECAPABILITY); - msg.setCapabilityForType(SystemCapabilityType.REMOTE_CONTROL, Test.GENERAL_REMOTECONTROLCAPABILITIES); - msg.setCapabilityForType(SystemCapabilityType.APP_SERVICES, Test.GENERAL_APP_SERVICE_CAPABILITIES); - msg.setCapabilityForType(SystemCapabilityType.DISPLAYS, Test.GENERAL_DISPLAYCAPABILITY_LIST); + msg.setSystemCapabilityType(TestValues.GENERAL_SYSTEMCAPABILITYTYPE); + msg.setCapabilityForType(SystemCapabilityType.NAVIGATION, TestValues.GENERAL_NAVIGATIONCAPABILITY); + msg.setCapabilityForType(SystemCapabilityType.PHONE_CALL, TestValues.GENERAL_PHONECAPABILITY); + msg.setCapabilityForType(SystemCapabilityType.REMOTE_CONTROL, TestValues.GENERAL_REMOTECONTROLCAPABILITIES); + msg.setCapabilityForType(SystemCapabilityType.APP_SERVICES, TestValues.GENERAL_APP_SERVICE_CAPABILITIES); + msg.setCapabilityForType(SystemCapabilityType.DISPLAYS, TestValues.GENERAL_DISPLAYCAPABILITY_LIST); } /** @@ -57,41 +57,41 @@ public class SystemCapabilityTests extends TestCase { List<DisplayCapability> displayCapabilities = (List<DisplayCapability>) msg.getCapabilityForType(SystemCapabilityType.DISPLAYS); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_SYSTEMCAPABILITYTYPE, testType); - assertTrue(Test.TRUE, Validator.validateNavigationCapability(Test.GENERAL_NAVIGATIONCAPABILITY, testNavigationCapability)); - assertTrue(Test.TRUE, Validator.validatePhoneCapability(Test.GENERAL_PHONECAPABILITY, testPhoneCapability)); - assertTrue(Test.TRUE, Validator.validateRemoteControlCapabilities(Test.GENERAL_REMOTECONTROLCAPABILITIES, testRemoteControlCapabilities)); - assertTrue(Test.TRUE, Validator.validateAppServiceCapabilities(Test.GENERAL_APP_SERVICE_CAPABILITIES, testAppServicesCapabilities)); - - for(int i = 0; i < Test.GENERAL_DISPLAYCAPABILITY_LIST.size(); i++){ - assertTrue(Test.TRUE, Validator.validateDisplayCapability(Test.GENERAL_DISPLAYCAPABILITY_LIST.get(i), displayCapabilities.get(i))); + assertEquals(TestValues.MATCH, TestValues.GENERAL_SYSTEMCAPABILITYTYPE, testType); + assertTrue(TestValues.TRUE, Validator.validateNavigationCapability(TestValues.GENERAL_NAVIGATIONCAPABILITY, testNavigationCapability)); + assertTrue(TestValues.TRUE, Validator.validatePhoneCapability(TestValues.GENERAL_PHONECAPABILITY, testPhoneCapability)); + assertTrue(TestValues.TRUE, Validator.validateRemoteControlCapabilities(TestValues.GENERAL_REMOTECONTROLCAPABILITIES, testRemoteControlCapabilities)); + assertTrue(TestValues.TRUE, Validator.validateAppServiceCapabilities(TestValues.GENERAL_APP_SERVICE_CAPABILITIES, testAppServicesCapabilities)); + + for(int i = 0; i < TestValues.GENERAL_DISPLAYCAPABILITY_LIST.size(); i++){ + assertTrue(TestValues.TRUE, Validator.validateDisplayCapability(TestValues.GENERAL_DISPLAYCAPABILITY_LIST.get(i), displayCapabilities.get(i))); } // Invalid/Null Tests SystemCapability msg = new SystemCapability(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getSystemCapabilityType()); - assertNull(Test.NULL, msg.getCapabilityForType(SystemCapabilityType.NAVIGATION)); - assertNull(Test.NULL, msg.getCapabilityForType(SystemCapabilityType.PHONE_CALL)); - assertNull(Test.NULL, msg.getCapabilityForType(SystemCapabilityType.REMOTE_CONTROL)); - assertNull(Test.NULL, msg.getCapabilityForType(SystemCapabilityType.APP_SERVICES)); - assertNull(Test.NULL, msg.getCapabilityForType(SystemCapabilityType.DISPLAYS)); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getSystemCapabilityType()); + assertNull(TestValues.NULL, msg.getCapabilityForType(SystemCapabilityType.NAVIGATION)); + assertNull(TestValues.NULL, msg.getCapabilityForType(SystemCapabilityType.PHONE_CALL)); + assertNull(TestValues.NULL, msg.getCapabilityForType(SystemCapabilityType.REMOTE_CONTROL)); + assertNull(TestValues.NULL, msg.getCapabilityForType(SystemCapabilityType.APP_SERVICES)); + assertNull(TestValues.NULL, msg.getCapabilityForType(SystemCapabilityType.DISPLAYS)); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(SystemCapability.KEY_SYSTEM_CAPABILITY_TYPE, Test.GENERAL_SYSTEMCAPABILITYTYPE); - reference.put(SystemCapability.KEY_NAVIGATION_CAPABILITY, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_NAVIGATIONCAPABILITY.getStore())); - reference.put(SystemCapability.KEY_PHONE_CAPABILITY, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_PHONECAPABILITY.getStore())); - reference.put(SystemCapability.KEY_REMOTE_CONTROL_CAPABILITY, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_REMOTECONTROLCAPABILITIES.getStore())); - reference.put(SystemCapability.KEY_APP_SERVICES_CAPABILITIES, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_APP_SERVICE_CAPABILITIES.getStore())); - reference.put(SystemCapability.KEY_DISPLAY_CAPABILITIES, Test.JSON_DISPLAYCAPABILITY_LIST); + reference.put(SystemCapability.KEY_SYSTEM_CAPABILITY_TYPE, TestValues.GENERAL_SYSTEMCAPABILITYTYPE); + reference.put(SystemCapability.KEY_NAVIGATION_CAPABILITY, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_NAVIGATIONCAPABILITY.getStore())); + reference.put(SystemCapability.KEY_PHONE_CAPABILITY, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_PHONECAPABILITY.getStore())); + reference.put(SystemCapability.KEY_REMOTE_CONTROL_CAPABILITY, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_REMOTECONTROLCAPABILITIES.getStore())); + reference.put(SystemCapability.KEY_APP_SERVICES_CAPABILITIES, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_APP_SERVICE_CAPABILITIES.getStore())); + reference.put(SystemCapability.KEY_DISPLAY_CAPABILITIES, TestValues.JSON_DISPLAYCAPABILITY_LIST); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { @@ -102,19 +102,19 @@ public class SystemCapabilityTests extends TestCase { JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateNavigationCapability( new NavigationCapability(hashReference), new NavigationCapability(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateNavigationCapability( new NavigationCapability(hashReference), new NavigationCapability(hashTest))); } else if(key.equals(SystemCapability.KEY_PHONE_CAPABILITY)){ JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key); JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validatePhoneCapability( new PhoneCapability(hashReference), new PhoneCapability(hashTest))); + assertTrue(TestValues.TRUE, Validator.validatePhoneCapability( new PhoneCapability(hashReference), new PhoneCapability(hashTest))); } else if(key.equals(SystemCapability.KEY_REMOTE_CONTROL_CAPABILITY)){ JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key); JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateRemoteControlCapabilities( new RemoteControlCapabilities(hashReference), new RemoteControlCapabilities(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateRemoteControlCapabilities( new RemoteControlCapabilities(hashReference), new RemoteControlCapabilities(hashTest))); } else if(key.equals(SystemCapability.KEY_APP_SERVICES_CAPABILITIES)){ JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key); JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); @@ -122,23 +122,23 @@ public class SystemCapabilityTests extends TestCase { Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); Log.i("TEST REF", hashReference.toString()); Log.i("TEST TEST", hashTest.toString()); - assertTrue(Test.TRUE, Validator.validateAppServiceCapabilities( new AppServicesCapabilities(hashReference), new AppServicesCapabilities(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateAppServiceCapabilities( new AppServicesCapabilities(hashReference), new AppServicesCapabilities(hashTest))); } else if(key.equals(SystemCapability.KEY_DISPLAY_CAPABILITIES)){ JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key); JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); - assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length()); + assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length()); for(int i = 0; i < referenceArray.length(); i++){ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i)); Hashtable<String, Object> hashTest= JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); - assertTrue(Test.TRUE, Validator.validateDisplayCapability(new DisplayCapability(hashReference), new DisplayCapability(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateDisplayCapability(new DisplayCapability(hashReference), new DisplayCapability(hashTest))); } } else{ - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TTSChunkTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TTSChunkTest.java index 4a34d297a..8a30b1c21 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TTSChunkTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TTSChunkTest.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.TTSChunk; import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -20,8 +20,8 @@ public class TTSChunkTest extends TestCase { public void setUp() { msg = new TTSChunk(); - msg.setText(Test.GENERAL_STRING); - msg.setType(Test.GENERAL_SPEECHCAPABILITIES); + msg.setText(TestValues.GENERAL_STRING); + msg.setType(TestValues.GENERAL_SPEECHCAPABILITIES); } /** @@ -33,34 +33,34 @@ public class TTSChunkTest extends TestCase { SpeechCapabilities speechType = msg.getType(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, text); - assertEquals(Test.MATCH, Test.GENERAL_SPEECHCAPABILITIES, speechType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, text); + assertEquals(TestValues.MATCH, TestValues.GENERAL_SPEECHCAPABILITIES, speechType); // Invalid/Null Tests TTSChunk msg = new TTSChunk(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getText()); - assertNull(Test.NULL, msg.getType()); + assertNull(TestValues.NULL, msg.getText()); + assertNull(TestValues.NULL, msg.getType()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(TTSChunk.KEY_TEXT, Test.GENERAL_STRING); - reference.put(TTSChunk.KEY_TYPE, Test.GENERAL_SPEECHCAPABILITIES); + reference.put(TTSChunk.KEY_TEXT, TestValues.GENERAL_STRING); + reference.put(TTSChunk.KEY_TYPE, TestValues.GENERAL_SPEECHCAPABILITIES); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemperatureTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemperatureTests.java index 090f5a235..353862a18 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemperatureTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemperatureTests.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.Temperature; import com.smartdevicelink.proxy.rpc.enums.TemperatureUnit; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -24,8 +24,8 @@ public class TemperatureTests extends TestCase{ public void setUp(){ msg = new Temperature(); - msg.setUnit(Test.GENERAL_TEMPERATUREUNIT); - msg.setValue(Test.GENERAL_FLOAT); + msg.setUnit(TestValues.GENERAL_TEMPERATUREUNIT); + msg.setValue(TestValues.GENERAL_FLOAT); } /** @@ -37,36 +37,36 @@ public class TemperatureTests extends TestCase{ float value = msg.getValue(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_FLOAT, value); - assertEquals(Test.MATCH, Test.GENERAL_TEMPERATUREUNIT, unit); + assertEquals(TestValues.MATCH, TestValues.GENERAL_FLOAT, value); + assertEquals(TestValues.MATCH, TestValues.GENERAL_TEMPERATUREUNIT, unit); // Invalid/Null Tests Temperature msg = new Temperature(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getUnit()); - assertNull(Test.NULL, msg.getValue()); + assertNull(TestValues.NULL, msg.getUnit()); + assertNull(TestValues.NULL, msg.getValue()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(Temperature.KEY_VALUE, (Float) Test.GENERAL_FLOAT); - reference.put(Temperature.KEY_UNIT, Test.GENERAL_TEMPERATUREUNIT); + reference.put(Temperature.KEY_VALUE, (Float) TestValues.GENERAL_FLOAT); + reference.put(Temperature.KEY_UNIT, TestValues.GENERAL_TEMPERATUREUNIT); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemplateColorSchemeTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemplateColorSchemeTest.java index 85666a8b6..22ef586d2 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemplateColorSchemeTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemplateColorSchemeTest.java @@ -4,7 +4,7 @@ import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.rpc.RGBColor; import com.smartdevicelink.proxy.rpc.TemplateColorScheme; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -25,9 +25,9 @@ public class TemplateColorSchemeTest extends TestCase { @Override public void setUp() { msg = new TemplateColorScheme(); - msg.setPrimaryColor(Test.GENERAL_RGBCOLOR); - msg.setSecondaryColor(Test.GENERAL_RGBCOLOR); - msg.setBackgroundColor(Test.GENERAL_RGBCOLOR); + msg.setPrimaryColor(TestValues.GENERAL_RGBCOLOR); + msg.setSecondaryColor(TestValues.GENERAL_RGBCOLOR); + msg.setBackgroundColor(TestValues.GENERAL_RGBCOLOR); } /** @@ -40,29 +40,29 @@ public class TemplateColorSchemeTest extends TestCase { RGBColor backgroundColor = msg.getBackgroundColor(); // Valid Tests - assertTrue(Test.TRUE, Validator.validateRGBColor(Test.GENERAL_RGBCOLOR, primaryColor)); - assertTrue(Test.TRUE, Validator.validateRGBColor(Test.GENERAL_RGBCOLOR, secondaryColor)); - assertTrue(Test.TRUE, Validator.validateRGBColor(Test.GENERAL_RGBCOLOR, backgroundColor)); + assertTrue(TestValues.TRUE, Validator.validateRGBColor(TestValues.GENERAL_RGBCOLOR, primaryColor)); + assertTrue(TestValues.TRUE, Validator.validateRGBColor(TestValues.GENERAL_RGBCOLOR, secondaryColor)); + assertTrue(TestValues.TRUE, Validator.validateRGBColor(TestValues.GENERAL_RGBCOLOR, backgroundColor)); // Invalid/Null Tests TemplateColorScheme msg = new TemplateColorScheme(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getPrimaryColor()); - assertNull(Test.NULL, msg.getSecondaryColor()); - assertNull(Test.NULL, msg.getBackgroundColor()); + assertNull(TestValues.NULL, msg.getPrimaryColor()); + assertNull(TestValues.NULL, msg.getSecondaryColor()); + assertNull(TestValues.NULL, msg.getBackgroundColor()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(TemplateColorScheme.KEY_PRIMARY_COLOR, Test.JSON_RGBCOLOR); - reference.put(TemplateColorScheme.KEY_SECONDARY_COLOR, Test.JSON_RGBCOLOR); - reference.put(TemplateColorScheme.KEY_BACKGROUND_COLOR, Test.JSON_RGBCOLOR); + reference.put(TemplateColorScheme.KEY_PRIMARY_COLOR, TestValues.JSON_RGBCOLOR); + reference.put(TemplateColorScheme.KEY_SECONDARY_COLOR, TestValues.JSON_RGBCOLOR); + reference.put(TemplateColorScheme.KEY_BACKGROUND_COLOR, TestValues.JSON_RGBCOLOR); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { @@ -71,10 +71,10 @@ public class TemplateColorSchemeTest extends TestCase { RGBColor referenceColor = new RGBColor(JsonRPCMarshaller.deserializeJSONObject(referenceColorObj)); JSONObject underTestColorObj = JsonUtils.readJsonObjectFromJsonObject(underTest, key); RGBColor underTestColor = new RGBColor(JsonRPCMarshaller.deserializeJSONObject(underTestColorObj)); - assertTrue(Test.TRUE, Validator.validateRGBColor(referenceColor, underTestColor)); + assertTrue(TestValues.TRUE, Validator.validateRGBColor(referenceColor, underTestColor)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemplateConfigurationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemplateConfigurationTests.java index 4fc3744be..d01bb92fd 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemplateConfigurationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TemplateConfigurationTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.rpc.TemplateColorScheme; import com.smartdevicelink.proxy.rpc.TemplateConfiguration; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -27,9 +27,9 @@ public class TemplateConfigurationTests extends TestCase { public void setUp(){ msg = new TemplateConfiguration(); - msg.setTemplate(Test.GENERAL_STRING); - msg.setDayColorScheme(Test.GENERAL_DAYCOLORSCHEME); - msg.setNightColorScheme(Test.GENERAL_NIGHTCOLORSCHEME); + msg.setTemplate(TestValues.GENERAL_STRING); + msg.setDayColorScheme(TestValues.GENERAL_DAYCOLORSCHEME); + msg.setNightColorScheme(TestValues.GENERAL_NIGHTCOLORSCHEME); } @@ -43,29 +43,29 @@ public class TemplateConfigurationTests extends TestCase { TemplateColorScheme testNightColorScheme = msg.getNightColorScheme(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, testTemplate); - assertEquals(Test.MATCH, Test.GENERAL_DAYCOLORSCHEME, testDayColorScheme); - assertEquals(Test.MATCH, Test.GENERAL_NIGHTCOLORSCHEME, testNightColorScheme); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testTemplate); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DAYCOLORSCHEME, testDayColorScheme); + assertEquals(TestValues.MATCH, TestValues.GENERAL_NIGHTCOLORSCHEME, testNightColorScheme); // Invalid/Null Tests TemplateConfiguration msg = new TemplateConfiguration(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getTemplate()); - assertNull(Test.NULL, msg.getDayColorScheme()); - assertNull(Test.NULL, msg.getNightColorScheme()); + assertNull(TestValues.NULL, msg.getTemplate()); + assertNull(TestValues.NULL, msg.getDayColorScheme()); + assertNull(TestValues.NULL, msg.getNightColorScheme()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(TemplateConfiguration.KEY_TEMPLATE, Test.GENERAL_STRING); - reference.put(TemplateConfiguration.KEY_DAY_COLOR_SCHEME, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_DAYCOLORSCHEME.getStore())); - reference.put(TemplateConfiguration.KEY_NIGHT_COLOR_SCHEME, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_NIGHTCOLORSCHEME.getStore())); + reference.put(TemplateConfiguration.KEY_TEMPLATE, TestValues.GENERAL_STRING); + reference.put(TemplateConfiguration.KEY_DAY_COLOR_SCHEME, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_DAYCOLORSCHEME.getStore())); + reference.put(TemplateConfiguration.KEY_NIGHT_COLOR_SCHEME, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_NIGHTCOLORSCHEME.getStore())); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -76,19 +76,19 @@ public class TemplateConfigurationTests extends TestCase { JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(new TemplateColorScheme(hashReference), new TemplateColorScheme(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateTemplateColorScheme(new TemplateColorScheme(hashReference), new TemplateColorScheme(hashTest))); } else if (key.equals(TemplateConfiguration.KEY_NIGHT_COLOR_SCHEME)) { JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key); JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(new TemplateColorScheme(hashReference), new TemplateColorScheme(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateTemplateColorScheme(new TemplateColorScheme(hashReference), new TemplateColorScheme(hashTest))); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TextFieldTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TextFieldTest.java index 8a06abd5d..9db332b77 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TextFieldTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TextFieldTest.java @@ -4,7 +4,7 @@ import com.smartdevicelink.proxy.rpc.TextField; import com.smartdevicelink.proxy.rpc.enums.CharacterSet; import com.smartdevicelink.proxy.rpc.enums.TextFieldName; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -25,10 +25,10 @@ public class TextFieldTest extends TestCase { public void setUp() { msg = new TextField(); - msg.setName(Test.GENERAL_TEXTFIELDNAME); - msg.setCharacterSet(Test.GENERAL_CHARACTERSET); - msg.setWidth(Test.GENERAL_INT); - msg.setRows(Test.GENERAL_INT); + msg.setName(TestValues.GENERAL_TEXTFIELDNAME); + msg.setCharacterSet(TestValues.GENERAL_CHARACTERSET); + msg.setWidth(TestValues.GENERAL_INT); + msg.setRows(TestValues.GENERAL_INT); } /** @@ -42,40 +42,40 @@ public class TextFieldTest extends TestCase { Integer rows = msg.getRows(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_TEXTFIELDNAME, name); - assertEquals(Test.MATCH, Test.GENERAL_CHARACTERSET, charSet); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, width); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, rows); + assertEquals(TestValues.MATCH, TestValues.GENERAL_TEXTFIELDNAME, name); + assertEquals(TestValues.MATCH, TestValues.GENERAL_CHARACTERSET, charSet); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, width); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, rows); // Invalid/Null Tests TextField msg = new TextField(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getName()); - assertNull(Test.NULL, msg.getWidth()); - assertNull(Test.NULL, msg.getRows()); - assertNull(Test.NULL, msg.getCharacterSet()); + assertNull(TestValues.NULL, msg.getName()); + assertNull(TestValues.NULL, msg.getWidth()); + assertNull(TestValues.NULL, msg.getRows()); + assertNull(TestValues.NULL, msg.getCharacterSet()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(TextField.KEY_CHARACTER_SET, Test.GENERAL_CHARACTERSET); - reference.put(TextField.KEY_WIDTH, Test.GENERAL_INT); - reference.put(TextField.KEY_ROWS, Test.GENERAL_INT); - reference.put(TextField.KEY_NAME, Test.GENERAL_TEXTFIELDNAME); + reference.put(TextField.KEY_CHARACTER_SET, TestValues.GENERAL_CHARACTERSET); + reference.put(TextField.KEY_WIDTH, TestValues.GENERAL_INT); + reference.put(TextField.KEY_ROWS, TestValues.GENERAL_INT); + reference.put(TextField.KEY_NAME, TestValues.GENERAL_TEXTFIELDNAME); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TireStatusTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TireStatusTest.java index 3def0a8eb..59d289546 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TireStatusTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TireStatusTest.java @@ -4,7 +4,7 @@ import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.rpc.SingleTireStatus; import com.smartdevicelink.proxy.rpc.TireStatus; import com.smartdevicelink.proxy.rpc.enums.WarningLightStatus; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -23,24 +23,24 @@ public class TireStatusTest extends TestCase { @Override public void setUp() { msg = new TireStatus(); - msg.setPressureTellTale(Test.GENERAL_WARNINGLIGHTSTATUS); + msg.setPressureTellTale(TestValues.GENERAL_WARNINGLIGHTSTATUS); SingleTireStatus tireLeftFront = new SingleTireStatus(); - tireLeftFront.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS); + tireLeftFront.setStatus(TestValues.GENERAL_COMPONENTVOLUMESTATUS); msg.setLeftFront(tireLeftFront); SingleTireStatus tireRightFront = new SingleTireStatus(); - tireRightFront.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS); + tireRightFront.setStatus(TestValues.GENERAL_COMPONENTVOLUMESTATUS); msg.setRightFront(tireRightFront); SingleTireStatus tireLeftRear = new SingleTireStatus(); - tireLeftRear.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS); + tireLeftRear.setStatus(TestValues.GENERAL_COMPONENTVOLUMESTATUS); msg.setLeftRear(tireLeftRear); SingleTireStatus tireRightRear = new SingleTireStatus(); - tireRightRear.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS); + tireRightRear.setStatus(TestValues.GENERAL_COMPONENTVOLUMESTATUS); msg.setRightRear(tireRightRear); SingleTireStatus tireInnerLeftRear = new SingleTireStatus(); - tireInnerLeftRear.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS); + tireInnerLeftRear.setStatus(TestValues.GENERAL_COMPONENTVOLUMESTATUS); msg.setInnerLeftRear(tireInnerLeftRear); SingleTireStatus tireInnerRightRear = new SingleTireStatus(); - tireInnerRightRear.setStatus(Test.GENERAL_COMPONENTVOLUMESTATUS); + tireInnerRightRear.setStatus(TestValues.GENERAL_COMPONENTVOLUMESTATUS); msg.setInnerRightRear(tireInnerRightRear); } @@ -58,51 +58,51 @@ public class TireStatusTest extends TestCase { SingleTireStatus innerRightRear = msg.getInnerRightRear(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_WARNINGLIGHTSTATUS, pressure); - assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, leftFront.getStatus()); - assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, rightFront.getStatus()); - assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, leftRear.getStatus()); - assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, rightRear.getStatus()); - assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, innerLeftRear.getStatus()); - assertEquals(Test.MATCH, Test.GENERAL_COMPONENTVOLUMESTATUS, innerRightRear.getStatus()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_WARNINGLIGHTSTATUS, pressure); + assertEquals(TestValues.MATCH, TestValues.GENERAL_COMPONENTVOLUMESTATUS, leftFront.getStatus()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_COMPONENTVOLUMESTATUS, rightFront.getStatus()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_COMPONENTVOLUMESTATUS, leftRear.getStatus()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_COMPONENTVOLUMESTATUS, rightRear.getStatus()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_COMPONENTVOLUMESTATUS, innerLeftRear.getStatus()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_COMPONENTVOLUMESTATUS, innerRightRear.getStatus()); // Invalid/Null Tests TireStatus msg = new TireStatus(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(TireStatus.KEY_PRESSURE_TELL_TALE, Test.GENERAL_WARNINGLIGHTSTATUS); + reference.put(TireStatus.KEY_PRESSURE_TELL_TALE, TestValues.GENERAL_WARNINGLIGHTSTATUS); JSONObject tireLeftFront = new JSONObject(); - tireLeftFront.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS); + tireLeftFront.put(SingleTireStatus.KEY_STATUS, TestValues.GENERAL_COMPONENTVOLUMESTATUS); reference.put(TireStatus.KEY_LEFT_FRONT, tireLeftFront); JSONObject tireRightFront = new JSONObject(); - tireRightFront.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS); + tireRightFront.put(SingleTireStatus.KEY_STATUS, TestValues.GENERAL_COMPONENTVOLUMESTATUS); reference.put(TireStatus.KEY_RIGHT_FRONT, tireRightFront); JSONObject tireLeftRear = new JSONObject(); - tireLeftRear.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS); + tireLeftRear.put(SingleTireStatus.KEY_STATUS, TestValues.GENERAL_COMPONENTVOLUMESTATUS); reference.put(TireStatus.KEY_LEFT_REAR, tireLeftRear); JSONObject tireRightRear = new JSONObject(); - tireRightRear.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS); + tireRightRear.put(SingleTireStatus.KEY_STATUS, TestValues.GENERAL_COMPONENTVOLUMESTATUS); reference.put(TireStatus.KEY_RIGHT_REAR, tireRightRear); JSONObject tireInnerLeftRear = new JSONObject(); - tireInnerLeftRear.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS); + tireInnerLeftRear.put(SingleTireStatus.KEY_STATUS, TestValues.GENERAL_COMPONENTVOLUMESTATUS); reference.put(TireStatus.KEY_INNER_LEFT_REAR, tireInnerLeftRear); JSONObject tireInnerRightRear = new JSONObject(); - tireInnerRightRear.put(SingleTireStatus.KEY_STATUS, Test.GENERAL_COMPONENTVOLUMESTATUS); + tireInnerRightRear.put(SingleTireStatus.KEY_STATUS, TestValues.GENERAL_COMPONENTVOLUMESTATUS); reference.put(TireStatus.KEY_INNER_RIGHT_REAR, tireInnerRightRear); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); - assertTrue(Test.TRUE, Validator.validateTireStatus( + assertTrue(TestValues.TRUE, Validator.validateTireStatus( new TireStatus(JsonRPCMarshaller.deserializeJSONObject(reference)), new TireStatus(JsonRPCMarshaller.deserializeJSONObject(underTest)))); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchCoordTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchCoordTest.java index 7ce2f176f..cc7c0f40a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchCoordTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchCoordTest.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.TouchCoord; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,8 +23,8 @@ public class TouchCoordTest extends TestCase { public void setUp() { msg = new TouchCoord(); - msg.setX(Test.GENERAL_INT); - msg.setY(Test.GENERAL_INT); + msg.setX(TestValues.GENERAL_INT); + msg.setY(TestValues.GENERAL_INT); } /** @@ -36,34 +36,34 @@ public class TouchCoordTest extends TestCase { Integer y = msg.getY(); // Valid Tests - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, x); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, y); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, x); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, y); // Invalid/Null Tests TouchCoord msg = new TouchCoord(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getX()); - assertNull(Test.NULL, msg.getY()); + assertNull(TestValues.NULL, msg.getX()); + assertNull(TestValues.NULL, msg.getY()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(TouchCoord.KEY_X, Test.GENERAL_INT); - reference.put(TouchCoord.KEY_Y, Test.GENERAL_INT); + reference.put(TouchCoord.KEY_X, TestValues.GENERAL_INT); + reference.put(TouchCoord.KEY_Y, TestValues.GENERAL_INT); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventCapabilitiesTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventCapabilitiesTest.java index 27e90e337..6c07edae5 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventCapabilitiesTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventCapabilitiesTest.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.TouchEventCapabilities; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,9 +23,9 @@ public class TouchEventCapabilitiesTest extends TestCase { public void setUp() { msg = new TouchEventCapabilities(); - msg.setPressAvailable(Test.GENERAL_BOOLEAN); - msg.setDoublePressAvailable(Test.GENERAL_BOOLEAN); - msg.setMultiTouchAvailable(Test.GENERAL_BOOLEAN); + msg.setPressAvailable(TestValues.GENERAL_BOOLEAN); + msg.setDoublePressAvailable(TestValues.GENERAL_BOOLEAN); + msg.setMultiTouchAvailable(TestValues.GENERAL_BOOLEAN); } /** @@ -38,37 +38,37 @@ public class TouchEventCapabilitiesTest extends TestCase { Boolean doublePress = msg.getDoublePressAvailable(); // Valid Tests - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, press); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, multiTouch); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, doublePress); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, press); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, multiTouch); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, doublePress); // Invalid/Null Tests TouchEventCapabilities msg = new TouchEventCapabilities(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getPressAvailable()); - assertNull(Test.NULL, msg.getMultiTouchAvailable()); - assertNull(Test.NULL, msg.getDoublePressAvailable()); + assertNull(TestValues.NULL, msg.getPressAvailable()); + assertNull(TestValues.NULL, msg.getMultiTouchAvailable()); + assertNull(TestValues.NULL, msg.getDoublePressAvailable()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(TouchEventCapabilities.KEY_PRESS_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(TouchEventCapabilities.KEY_MULTI_TOUCH_AVAILABLE, Test.GENERAL_BOOLEAN); - reference.put(TouchEventCapabilities.KEY_DOUBLE_PRESS_AVAILABLE, Test.GENERAL_BOOLEAN); + reference.put(TouchEventCapabilities.KEY_PRESS_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(TouchEventCapabilities.KEY_MULTI_TOUCH_AVAILABLE, TestValues.GENERAL_BOOLEAN); + reference.put(TouchEventCapabilities.KEY_DOUBLE_PRESS_AVAILABLE, TestValues.GENERAL_BOOLEAN); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventTest.java index 24a10d68e..204fc4b4a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TouchEventTest.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.TouchCoord; import com.smartdevicelink.proxy.rpc.TouchEvent; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -25,9 +25,9 @@ public class TouchEventTest extends TestCase { @Override public void setUp() { msg = new TouchEvent(); - msg.setId(Test.GENERAL_INT); - msg.setTs(Test.GENERAL_LONG_LIST); - msg.setC(Test.GENERAL_TOUCHCOORD_LIST); + msg.setId(TestValues.GENERAL_INT); + msg.setTs(TestValues.GENERAL_LONG_LIST); + msg.setC(TestValues.GENERAL_TOUCHCOORD_LIST); } /** @@ -40,50 +40,50 @@ public class TouchEventTest extends TestCase { List<TouchCoord> coordTest = msg.getC(); // Valid Tests - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, id); - assertTrue(Test.TRUE, Validator.validateLongList(Test.GENERAL_LONG_LIST, timestamp)); - assertEquals(Test.MATCH, Test.GENERAL_TOUCHCOORD_LIST.size(), coordTest.size()); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, id); + assertTrue(TestValues.TRUE, Validator.validateLongList(TestValues.GENERAL_LONG_LIST, timestamp)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_TOUCHCOORD_LIST.size(), coordTest.size()); - for (int index = 0; index < Test.GENERAL_TOUCHCOORD_LIST.size(); index++) { - assertTrue(Test.TRUE, Validator.validateTouchCoord(Test.GENERAL_TOUCHCOORD_LIST.get(index), coordTest.get(index))); + for (int index = 0; index < TestValues.GENERAL_TOUCHCOORD_LIST.size(); index++) { + assertTrue(TestValues.TRUE, Validator.validateTouchCoord(TestValues.GENERAL_TOUCHCOORD_LIST.get(index), coordTest.get(index))); } // Invalid/Null Tests TouchEvent msg = new TouchEvent(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getId()); - assertNull(Test.NULL, msg.getTs()); - assertNull(Test.NULL, msg.getC()); + assertNull(TestValues.NULL, msg.getId()); + assertNull(TestValues.NULL, msg.getTs()); + assertNull(TestValues.NULL, msg.getC()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(TouchEvent.KEY_ID, Test.GENERAL_INT); - reference.put(TouchEvent.KEY_TS, JsonUtils.createJsonArray(Test.GENERAL_LONG_LIST)); - reference.put(TouchEvent.KEY_C, Test.JSON_TOUCHCOORDS); + reference.put(TouchEvent.KEY_ID, TestValues.GENERAL_INT); + reference.put(TouchEvent.KEY_TS, JsonUtils.createJsonArray(TestValues.GENERAL_LONG_LIST)); + reference.put(TouchEvent.KEY_C, TestValues.JSON_TOUCHCOORDS); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); if (key.equals(TouchEvent.KEY_C)) { - assertTrue(Test.TRUE, JsonUtils.readIntegerFromJsonObject(reference, key) == JsonUtils.readIntegerFromJsonObject(underTest, key)); + assertTrue(TestValues.TRUE, JsonUtils.readIntegerFromJsonObject(reference, key) == JsonUtils.readIntegerFromJsonObject(underTest, key)); } else if (key.equals(TouchEvent.KEY_TS)) { List<Long> tsListReference = JsonUtils.readLongListFromJsonObject(reference, key); List<Long> tsListTest = JsonUtils.readLongListFromJsonObject(underTest, key); - assertTrue(Test.TRUE, tsListReference.containsAll(tsListTest) && tsListTest.containsAll(tsListReference)); + assertTrue(TestValues.TRUE, tsListReference.containsAll(tsListTest) && tsListTest.containsAll(tsListReference)); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TurnTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TurnTests.java index dba742b71..6b4b71988 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TurnTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/TurnTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.Image; import com.smartdevicelink.proxy.rpc.Turn; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -17,10 +17,10 @@ public class TurnTests extends TestCase { @Override public void setUp(){ msg = new Turn(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - msg.setTurnIcon(Test.GENERAL_IMAGE); - msg.setNavigationText(Test.GENERAL_STRING); + msg.setTurnIcon(TestValues.GENERAL_IMAGE); + msg.setNavigationText(TestValues.GENERAL_STRING); } /** @@ -32,25 +32,25 @@ public class TurnTests extends TestCase { String text = msg.getNavigationText(); // Valid Tests - assertTrue(Test.MATCH, Validator.validateImage(Test.GENERAL_IMAGE, icon)); - assertEquals(Test.MATCH, Test.GENERAL_STRING, text); + assertTrue(TestValues.MATCH, Validator.validateImage(TestValues.GENERAL_IMAGE, icon)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, text); // Invalid/Null Tests Turn msg = new Turn(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getNavigationText()); - assertNull(Test.NULL, msg.getTurnIcon()); + assertNull(TestValues.NULL, msg.getNavigationText()); + assertNull(TestValues.NULL, msg.getTurnIcon()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(Turn.KEY_NAVIGATION_TEXT, Test.GENERAL_STRING); - reference.put(Turn.KEY_TURN_IMAGE, Test.JSON_IMAGE); + reference.put(Turn.KEY_NAVIGATION_TEXT, TestValues.GENERAL_STRING); + reference.put(Turn.KEY_TURN_IMAGE, TestValues.JSON_IMAGE); } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleDataResultTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleDataResultTest.java index dd84c8181..c3b9034f0 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleDataResultTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleDataResultTest.java @@ -4,7 +4,7 @@ import com.smartdevicelink.proxy.rpc.VehicleDataResult; import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode; import com.smartdevicelink.proxy.rpc.enums.VehicleDataType; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -21,9 +21,9 @@ public class VehicleDataResultTest extends TestCase { public void setUp() { msg = new VehicleDataResult(); - msg.setDataType(Test.GENERAL_VEHICLEDATATYPE); - msg.setResultCode(Test.GENERAL_VEHICLEDATARESULTCODE); - msg.setOEMCustomVehicleDataType(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); + msg.setDataType(TestValues.GENERAL_VEHICLEDATATYPE); + msg.setResultCode(TestValues.GENERAL_VEHICLEDATARESULTCODE); + msg.setOEMCustomVehicleDataType(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); } /** @@ -36,39 +36,39 @@ public class VehicleDataResultTest extends TestCase { String oemCustomDataType = msg.getOEMCustomVehicleDataType(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_VEHICLEDATARESULTCODE, result); - assertEquals(Test.MATCH, Test.GENERAL_VEHICLEDATATYPE, type); - assertEquals(Test.MATCH, Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, oemCustomDataType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHICLEDATARESULTCODE, result); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VEHICLEDATATYPE, type); + assertEquals(TestValues.MATCH, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, oemCustomDataType); // Invalid/Null Tests VehicleDataResult msg = new VehicleDataResult(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getDataType()); - assertNull(Test.NULL, msg.getResultCode()); - assertNull(Test.NULL, msg.getOEMCustomVehicleDataType()); + assertNull(TestValues.NULL, msg.getDataType()); + assertNull(TestValues.NULL, msg.getResultCode()); + assertNull(TestValues.NULL, msg.getOEMCustomVehicleDataType()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(VehicleDataResult.KEY_RESULT_CODE, Test.GENERAL_VEHICLEDATARESULTCODE); - reference.put(VehicleDataResult.KEY_DATA_TYPE, Test.GENERAL_VEHICLEDATATYPE); - reference.put(VehicleDataResult.KEY_OEM_CUSTOM_DATA_TYPE, Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); + reference.put(VehicleDataResult.KEY_RESULT_CODE, TestValues.GENERAL_VEHICLEDATARESULTCODE); + reference.put(VehicleDataResult.KEY_DATA_TYPE, TestValues.GENERAL_VEHICLEDATATYPE); + reference.put(VehicleDataResult.KEY_OEM_CUSTOM_DATA_TYPE, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleTypeTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleTypeTest.java index 24d85152a..1b0d5730e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleTypeTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VehicleTypeTest.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.VehicleType; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -19,10 +19,10 @@ public class VehicleTypeTest extends TestCase { public void setUp() { msg = new VehicleType(); - msg.setModel(Test.GENERAL_STRING); - msg.setMake(Test.GENERAL_STRING); - msg.setTrim(Test.GENERAL_STRING); - msg.setModelYear(Test.GENERAL_STRING); + msg.setModel(TestValues.GENERAL_STRING); + msg.setMake(TestValues.GENERAL_STRING); + msg.setTrim(TestValues.GENERAL_STRING); + msg.setModelYear(TestValues.GENERAL_STRING); } /** @@ -36,40 +36,40 @@ public class VehicleTypeTest extends TestCase { String model = msg.getModel(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, year); - assertEquals(Test.MATCH, Test.GENERAL_STRING, model); - assertEquals(Test.MATCH, Test.GENERAL_STRING, make); - assertEquals(Test.MATCH, Test.GENERAL_STRING, trim); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, year); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, model); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, make); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, trim); // Invalid/Null Tests VehicleType msg = new VehicleType(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getModel()); - assertNull(Test.NULL, msg.getMake()); - assertNull(Test.NULL, msg.getModelYear()); - assertNull(Test.NULL, msg.getTrim()); + assertNull(TestValues.NULL, msg.getModel()); + assertNull(TestValues.NULL, msg.getMake()); + assertNull(TestValues.NULL, msg.getModelYear()); + assertNull(TestValues.NULL, msg.getTrim()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(VehicleType.KEY_MODEL, Test.GENERAL_STRING); - reference.put(VehicleType.KEY_MAKE, Test.GENERAL_STRING); - reference.put(VehicleType.KEY_MODEL_YEAR, Test.GENERAL_STRING); - reference.put(VehicleType.KEY_TRIM, Test.GENERAL_STRING); + reference.put(VehicleType.KEY_MODEL, TestValues.GENERAL_STRING); + reference.put(VehicleType.KEY_MAKE, TestValues.GENERAL_STRING); + reference.put(VehicleType.KEY_MODEL_YEAR, TestValues.GENERAL_STRING); + reference.put(VehicleType.KEY_TRIM, TestValues.GENERAL_STRING); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingCapabilityTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingCapabilityTests.java index 808429d2f..0fb0288e2 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingCapabilityTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingCapabilityTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.rpc.ImageResolution; import com.smartdevicelink.proxy.rpc.VideoStreamingCapability; import com.smartdevicelink.proxy.rpc.VideoStreamingFormat; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -26,13 +26,13 @@ public class VideoStreamingCapabilityTests extends TestCase { @Override public void setUp() { msg = new VideoStreamingCapability(); - msg.setSupportedFormats(Test.GENERAL_VIDEOSTREAMINGFORMAT_LIST); - msg.setPreferredResolution(Test.GENERAL_IMAGERESOLUTION); - msg.setMaxBitrate(Test.GENERAL_INT); - msg.setIsHapticSpatialDataSupported(Test.GENERAL_BOOLEAN); - msg.setDiagonalScreenSize(Test.GENERAL_DOUBLE); - msg.setPixelPerInch(Test.GENERAL_DOUBLE); - msg.setScale(Test.GENERAL_DOUBLE); + msg.setSupportedFormats(TestValues.GENERAL_VIDEOSTREAMINGFORMAT_LIST); + msg.setPreferredResolution(TestValues.GENERAL_IMAGERESOLUTION); + msg.setMaxBitrate(TestValues.GENERAL_INT); + msg.setIsHapticSpatialDataSupported(TestValues.GENERAL_BOOLEAN); + msg.setDiagonalScreenSize(TestValues.GENERAL_DOUBLE); + msg.setPixelPerInch(TestValues.GENERAL_DOUBLE); + msg.setScale(TestValues.GENERAL_DOUBLE); } /** @@ -49,48 +49,48 @@ public class VideoStreamingCapabilityTests extends TestCase { Double scale = msg.getScale(); // Valid Tests - assertEquals(Test.MATCH, (List<VideoStreamingFormat>) Test.GENERAL_VIDEOSTREAMINGFORMAT_LIST, format); - assertEquals(Test.MATCH, (ImageResolution) Test.GENERAL_IMAGERESOLUTION, res); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, maxBitrate); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, isHapticSpatialDataSupported); - assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, diagonalScreenSize); - assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, pixelPerInch); - assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, scale); + assertEquals(TestValues.MATCH, (List<VideoStreamingFormat>) TestValues.GENERAL_VIDEOSTREAMINGFORMAT_LIST, format); + assertEquals(TestValues.MATCH, (ImageResolution) TestValues.GENERAL_IMAGERESOLUTION, res); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, maxBitrate); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, isHapticSpatialDataSupported); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DOUBLE, diagonalScreenSize); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DOUBLE, pixelPerInch); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DOUBLE, scale); // Invalid/Null Tests VideoStreamingCapability msg = new VideoStreamingCapability(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getMaxBitrate()); - assertNull(Test.NULL, msg.getPreferredResolution()); - assertNull(Test.NULL, msg.getSupportedFormats()); - assertNull(Test.NULL, msg.getIsHapticSpatialDataSupported()); - assertNull(Test.NULL, msg.getDiagonalScreenSize()); - assertNull(Test.NULL, msg.getPixelPerInch()); - assertNull(Test.NULL, msg.getScale()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getMaxBitrate()); + assertNull(TestValues.NULL, msg.getPreferredResolution()); + assertNull(TestValues.NULL, msg.getSupportedFormats()); + assertNull(TestValues.NULL, msg.getIsHapticSpatialDataSupported()); + assertNull(TestValues.NULL, msg.getDiagonalScreenSize()); + assertNull(TestValues.NULL, msg.getPixelPerInch()); + assertNull(TestValues.NULL, msg.getScale()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(VideoStreamingCapability.KEY_MAX_BITRATE, Test.GENERAL_INT); - reference.put(VideoStreamingCapability.KEY_PREFERRED_RESOLUTION, Test.GENERAL_IMAGERESOLUTION); - reference.put(VideoStreamingCapability.KEY_SUPPORTED_FORMATS, Test.GENERAL_VIDEOSTREAMINGFORMAT_LIST); - reference.put(VideoStreamingCapability.KEY_HAPTIC_SPATIAL_DATA_SUPPORTED, Test.GENERAL_BOOLEAN); - reference.put(VideoStreamingCapability.KEY_DIAGONAL_SCREEN_SIZE, Test.GENERAL_DOUBLE); - reference.put(VideoStreamingCapability.KEY_PIXEL_PER_INCH, Test.GENERAL_DOUBLE); - reference.put(VideoStreamingCapability.KEY_SCALE, Test.GENERAL_DOUBLE); + reference.put(VideoStreamingCapability.KEY_MAX_BITRATE, TestValues.GENERAL_INT); + reference.put(VideoStreamingCapability.KEY_PREFERRED_RESOLUTION, TestValues.GENERAL_IMAGERESOLUTION); + reference.put(VideoStreamingCapability.KEY_SUPPORTED_FORMATS, TestValues.GENERAL_VIDEOSTREAMINGFORMAT_LIST); + reference.put(VideoStreamingCapability.KEY_HAPTIC_SPATIAL_DATA_SUPPORTED, TestValues.GENERAL_BOOLEAN); + reference.put(VideoStreamingCapability.KEY_DIAGONAL_SCREEN_SIZE, TestValues.GENERAL_DOUBLE); + reference.put(VideoStreamingCapability.KEY_PIXEL_PER_INCH, TestValues.GENERAL_DOUBLE); + reference.put(VideoStreamingCapability.KEY_SCALE, TestValues.GENERAL_DOUBLE); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); if (key.equals(VideoStreamingCapability.KEY_MAX_BITRATE) || key.equals(VideoStreamingCapability.KEY_HAPTIC_SPATIAL_DATA_SUPPORTED)) { - assertTrue(Test.TRUE, JsonUtils.readIntegerFromJsonObject(reference, key) == JsonUtils.readIntegerFromJsonObject(underTest, key)); + assertTrue(TestValues.TRUE, JsonUtils.readIntegerFromJsonObject(reference, key) == JsonUtils.readIntegerFromJsonObject(underTest, key)); } else if (key.equals(VideoStreamingCapability.KEY_PREFERRED_RESOLUTION)) { ImageResolution irReference = (ImageResolution) JsonUtils.readObjectFromJsonObject(reference, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(JsonUtils.readJsonObjectFromJsonObject(underTest, key)); @@ -108,7 +108,7 @@ public class VideoStreamingCapabilityTests extends TestCase { } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingFormatTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingFormatTests.java index 431b3bfc6..935751483 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingFormatTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VideoStreamingFormatTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.proxy.rpc.VideoStreamingFormat; import com.smartdevicelink.proxy.rpc.enums.VideoStreamingCodec; import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -20,8 +20,8 @@ public class VideoStreamingFormatTests extends TestCase { @Override public void setUp() { msg = new VideoStreamingFormat(); - msg.setProtocol(Test.GENERAL_VIDEOSTREAMINGPROTOCOL); - msg.setCodec(Test.GENERAL_VIDEOSTREAMINGCODEC); + msg.setProtocol(TestValues.GENERAL_VIDEOSTREAMINGPROTOCOL); + msg.setCodec(TestValues.GENERAL_VIDEOSTREAMINGCODEC); } /** @@ -33,35 +33,35 @@ public class VideoStreamingFormatTests extends TestCase { VideoStreamingCodec codec = msg.getCodec(); // Valid Tests - assertEquals(Test.MATCH, (VideoStreamingProtocol) Test.GENERAL_VIDEOSTREAMINGPROTOCOL, protocol); - assertEquals(Test.MATCH, (VideoStreamingCodec) Test.GENERAL_VIDEOSTREAMINGCODEC, codec); + assertEquals(TestValues.MATCH, (VideoStreamingProtocol) TestValues.GENERAL_VIDEOSTREAMINGPROTOCOL, protocol); + assertEquals(TestValues.MATCH, (VideoStreamingCodec) TestValues.GENERAL_VIDEOSTREAMINGCODEC, codec); // Invalid/Null Tests VideoStreamingFormat msg = new VideoStreamingFormat(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getProtocol()); - assertNull(Test.NULL, msg.getCodec()); + assertNull(TestValues.NULL, msg.getProtocol()); + assertNull(TestValues.NULL, msg.getCodec()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(VideoStreamingFormat.KEY_PROTOCOL, Test.GENERAL_VIDEOSTREAMINGPROTOCOL); - reference.put(VideoStreamingFormat.KEY_CODEC, Test.GENERAL_VIDEOSTREAMINGCODEC); + reference.put(VideoStreamingFormat.KEY_PROTOCOL, TestValues.GENERAL_VIDEOSTREAMINGPROTOCOL); + reference.put(VideoStreamingFormat.KEY_CODEC, TestValues.GENERAL_VIDEOSTREAMINGCODEC); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VrHelpItemTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VrHelpItemTest.java index 405e2bf84..a60615042 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VrHelpItemTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/VrHelpItemTest.java @@ -4,7 +4,7 @@ import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.rpc.Image; import com.smartdevicelink.proxy.rpc.VrHelpItem; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -23,9 +23,9 @@ public class VrHelpItemTest extends TestCase { public void setUp() { msg = new VrHelpItem(); - msg.setText(Test.GENERAL_STRING); - msg.setImage(Test.GENERAL_IMAGE); - msg.setPosition(Test.GENERAL_INT); + msg.setText(TestValues.GENERAL_STRING); + msg.setImage(TestValues.GENERAL_IMAGE); + msg.setPosition(TestValues.GENERAL_INT); } @@ -39,29 +39,29 @@ public class VrHelpItemTest extends TestCase { Integer position = msg.getPosition(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, text); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, position); - assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, image)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, text); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, position); + assertTrue(TestValues.TRUE, Validator.validateImage(TestValues.GENERAL_IMAGE, image)); // Invalid/Null Tests VrHelpItem msg = new VrHelpItem(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getImage()); - assertNull(Test.NULL, msg.getText()); - assertNull(Test.NULL, msg.getPosition()); + assertNull(TestValues.NULL, msg.getImage()); + assertNull(TestValues.NULL, msg.getText()); + assertNull(TestValues.NULL, msg.getPosition()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(VrHelpItem.KEY_IMAGE, Test.JSON_IMAGE); - reference.put(VrHelpItem.KEY_TEXT, Test.GENERAL_STRING); - reference.put(VrHelpItem.KEY_POSITION, Test.GENERAL_INT); + reference.put(VrHelpItem.KEY_IMAGE, TestValues.JSON_IMAGE); + reference.put(VrHelpItem.KEY_TEXT, TestValues.GENERAL_STRING); + reference.put(VrHelpItem.KEY_POSITION, TestValues.GENERAL_INT); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { @@ -73,13 +73,13 @@ public class VrHelpItemTest extends TestCase { Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateImage(new Image(hashReference), new Image(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateImage(new Image(hashReference), new Image(hashTest))); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherAlertTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherAlertTests.java index 4a8ade572..f3537a29b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherAlertTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherAlertTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.rpc.DateTime; import com.smartdevicelink.proxy.rpc.WeatherAlert; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -29,12 +29,12 @@ public class WeatherAlertTests extends TestCase { public void setUp(){ msg = new WeatherAlert(); - msg.setExpires(Test.GENERAL_DATETIME); - msg.setTimeIssued(Test.GENERAL_DATETIME); - msg.setRegions(Test.GENERAL_STRING_LIST); - msg.setSeverity(Test.GENERAL_STRING); - msg.setSummary(Test.GENERAL_STRING); - msg.setTitle(Test.GENERAL_STRING); + msg.setExpires(TestValues.GENERAL_DATETIME); + msg.setTimeIssued(TestValues.GENERAL_DATETIME); + msg.setRegions(TestValues.GENERAL_STRING_LIST); + msg.setSeverity(TestValues.GENERAL_STRING); + msg.setSummary(TestValues.GENERAL_STRING); + msg.setTitle(TestValues.GENERAL_STRING); } /** @@ -50,44 +50,44 @@ public class WeatherAlertTests extends TestCase { String title = msg.getTitle(); // Valid Tests - assertEquals(Test.MATCH, expires, Test.GENERAL_DATETIME); - assertEquals(Test.MATCH, issued, Test.GENERAL_DATETIME); - assertEquals(Test.MATCH, regions, Test.GENERAL_STRING_LIST); - assertEquals(Test.MATCH, severity, Test.GENERAL_STRING); - assertEquals(Test.MATCH, summary, Test.GENERAL_STRING); - assertEquals(Test.MATCH, title, Test.GENERAL_STRING); + assertEquals(TestValues.MATCH, expires, TestValues.GENERAL_DATETIME); + assertEquals(TestValues.MATCH, issued, TestValues.GENERAL_DATETIME); + assertEquals(TestValues.MATCH, regions, TestValues.GENERAL_STRING_LIST); + assertEquals(TestValues.MATCH, severity, TestValues.GENERAL_STRING); + assertEquals(TestValues.MATCH, summary, TestValues.GENERAL_STRING); + assertEquals(TestValues.MATCH, title, TestValues.GENERAL_STRING); // Invalid/Null Tests WeatherAlert msg = new WeatherAlert(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getExpires()); - assertNull(Test.NULL, msg.getTimeIssued()); - assertNull(Test.NULL, msg.getRegions()); - assertNull(Test.NULL, msg.getSeverity()); - assertNull(Test.NULL, msg.getSummary()); - assertNull(Test.NULL, msg.getTitle()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getExpires()); + assertNull(TestValues.NULL, msg.getTimeIssued()); + assertNull(TestValues.NULL, msg.getRegions()); + assertNull(TestValues.NULL, msg.getSeverity()); + assertNull(TestValues.NULL, msg.getSummary()); + assertNull(TestValues.NULL, msg.getTitle()); } public void testRequiredParamsConstructor(){ - msg = new WeatherAlert(Test.GENERAL_STRING_LIST); + msg = new WeatherAlert(TestValues.GENERAL_STRING_LIST); List<String> regions = msg.getRegions(); - assertEquals(Test.MATCH, regions, Test.GENERAL_STRING_LIST); + assertEquals(TestValues.MATCH, regions, TestValues.GENERAL_STRING_LIST); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(WeatherAlert.KEY_EXPIRES, Test.GENERAL_DATETIME); - reference.put(WeatherAlert.KEY_TIME_ISSUED, Test.GENERAL_DATETIME); - reference.put(WeatherAlert.KEY_REGIONS, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST)); - reference.put(WeatherAlert.KEY_SEVERITY, Test.GENERAL_STRING); - reference.put(WeatherAlert.KEY_SUMMARY, Test.GENERAL_STRING); - reference.put(WeatherAlert.KEY_TITLE, Test.GENERAL_STRING); + reference.put(WeatherAlert.KEY_EXPIRES, TestValues.GENERAL_DATETIME); + reference.put(WeatherAlert.KEY_TIME_ISSUED, TestValues.GENERAL_DATETIME); + reference.put(WeatherAlert.KEY_REGIONS, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); + reference.put(WeatherAlert.KEY_SEVERITY, TestValues.GENERAL_STRING); + reference.put(WeatherAlert.KEY_SUMMARY, TestValues.GENERAL_STRING); + reference.put(WeatherAlert.KEY_TITLE, TestValues.GENERAL_STRING); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()) { @@ -95,18 +95,18 @@ public class WeatherAlertTests extends TestCase { if (key.equals(WeatherAlert.KEY_EXPIRES)||key.equals(WeatherAlert.KEY_TIME_ISSUED)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateDateTime(Test.GENERAL_DATETIME, new DateTime(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateDateTime(TestValues.GENERAL_DATETIME, new DateTime(hashTest))); } else if (key.equals(WeatherAlert.KEY_REGIONS)){ JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key); JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); - assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length()); - assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key))); + assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length()); + assertTrue(TestValues.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key))); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherDataTests.java index 04522acfb..cbebce592 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherDataTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.rpc.Image; import com.smartdevicelink.proxy.rpc.Temperature; import com.smartdevicelink.proxy.rpc.WeatherData; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -29,28 +29,28 @@ public class WeatherDataTests extends TestCase { public void setUp(){ msg = new WeatherData(); - msg.setCurrentTemperature(Test.GENERAL_TEMPERATURE); - msg.setTemperatureHigh(Test.GENERAL_TEMPERATURE); - msg.setTemperatureLow(Test.GENERAL_TEMPERATURE); - msg.setApparentTemperature(Test.GENERAL_TEMPERATURE); - msg.setApparentTemperatureHigh(Test.GENERAL_TEMPERATURE); - msg.setApparentTemperatureLow(Test.GENERAL_TEMPERATURE); - msg.setWeatherSummary(Test.GENERAL_STRING); - msg.setTime(Test.GENERAL_DATETIME); - msg.setHumidity(Test.GENERAL_FLOAT); - msg.setCloudCover(Test.GENERAL_FLOAT); - msg.setMoonPhase(Test.GENERAL_FLOAT); - msg.setWindBearing(Test.GENERAL_INTEGER); - msg.setWindGust(Test.GENERAL_FLOAT); - msg.setWindSpeed(Test.GENERAL_FLOAT); - msg.setNearestStormBearing(Test.GENERAL_INTEGER); - msg.setNearestStormDistance(Test.GENERAL_INTEGER); - msg.setPrecipAccumulation(Test.GENERAL_FLOAT); - msg.setPrecipIntensity(Test.GENERAL_FLOAT); - msg.setPrecipProbability(Test.GENERAL_FLOAT); - msg.setPrecipType(Test.GENERAL_STRING); - msg.setVisibility(Test.GENERAL_FLOAT); - msg.setWeatherIcon(Test.GENERAL_IMAGE); + msg.setCurrentTemperature(TestValues.GENERAL_TEMPERATURE); + msg.setTemperatureHigh(TestValues.GENERAL_TEMPERATURE); + msg.setTemperatureLow(TestValues.GENERAL_TEMPERATURE); + msg.setApparentTemperature(TestValues.GENERAL_TEMPERATURE); + msg.setApparentTemperatureHigh(TestValues.GENERAL_TEMPERATURE); + msg.setApparentTemperatureLow(TestValues.GENERAL_TEMPERATURE); + msg.setWeatherSummary(TestValues.GENERAL_STRING); + msg.setTime(TestValues.GENERAL_DATETIME); + msg.setHumidity(TestValues.GENERAL_FLOAT); + msg.setCloudCover(TestValues.GENERAL_FLOAT); + msg.setMoonPhase(TestValues.GENERAL_FLOAT); + msg.setWindBearing(TestValues.GENERAL_INTEGER); + msg.setWindGust(TestValues.GENERAL_FLOAT); + msg.setWindSpeed(TestValues.GENERAL_FLOAT); + msg.setNearestStormBearing(TestValues.GENERAL_INTEGER); + msg.setNearestStormDistance(TestValues.GENERAL_INTEGER); + msg.setPrecipAccumulation(TestValues.GENERAL_FLOAT); + msg.setPrecipIntensity(TestValues.GENERAL_FLOAT); + msg.setPrecipProbability(TestValues.GENERAL_FLOAT); + msg.setPrecipType(TestValues.GENERAL_STRING); + msg.setVisibility(TestValues.GENERAL_FLOAT); + msg.setWeatherIcon(TestValues.GENERAL_IMAGE); } /** @@ -81,85 +81,85 @@ public class WeatherDataTests extends TestCase { Image weatherIcon = msg.getWeatherIcon(); // Valid Tests - assertEquals(Test.MATCH, currentTemperature, Test.GENERAL_TEMPERATURE); - assertEquals(Test.MATCH, temperatureHigh, Test.GENERAL_TEMPERATURE); - assertEquals(Test.MATCH, temperatureLow, Test.GENERAL_TEMPERATURE); - assertEquals(Test.MATCH, apparentTemperature, Test.GENERAL_TEMPERATURE); - assertEquals(Test.MATCH, apparentTemperatureHigh, Test.GENERAL_TEMPERATURE); - assertEquals(Test.MATCH, weatherSummary, Test.GENERAL_STRING); - assertEquals(Test.MATCH, time, Test.GENERAL_DATETIME); - assertEquals(Test.MATCH, humidity, Test.GENERAL_FLOAT); - assertEquals(Test.MATCH, cloudCover, Test.GENERAL_FLOAT); - assertEquals(Test.MATCH, moonPhase, Test.GENERAL_FLOAT); - assertEquals(Test.MATCH, windBearing, Test.GENERAL_INTEGER); - assertEquals(Test.MATCH, windGust, Test.GENERAL_FLOAT); - assertEquals(Test.MATCH, windSpeed, Test.GENERAL_FLOAT); - assertEquals(Test.MATCH, nearestStormBearing, Test.GENERAL_INTEGER); - assertEquals(Test.MATCH, nearestStormDistance, Test.GENERAL_INTEGER); - assertEquals(Test.MATCH, precipAccumulation, Test.GENERAL_FLOAT); - assertEquals(Test.MATCH, precipIntensity, Test.GENERAL_FLOAT); - assertEquals(Test.MATCH, precipProbability, Test.GENERAL_FLOAT); - assertEquals(Test.MATCH, precipType, Test.GENERAL_STRING); - assertEquals(Test.MATCH, visibility, Test.GENERAL_FLOAT); - assertEquals(Test.MATCH, weatherIcon, Test.GENERAL_IMAGE); + assertEquals(TestValues.MATCH, currentTemperature, TestValues.GENERAL_TEMPERATURE); + assertEquals(TestValues.MATCH, temperatureHigh, TestValues.GENERAL_TEMPERATURE); + assertEquals(TestValues.MATCH, temperatureLow, TestValues.GENERAL_TEMPERATURE); + assertEquals(TestValues.MATCH, apparentTemperature, TestValues.GENERAL_TEMPERATURE); + assertEquals(TestValues.MATCH, apparentTemperatureHigh, TestValues.GENERAL_TEMPERATURE); + assertEquals(TestValues.MATCH, weatherSummary, TestValues.GENERAL_STRING); + assertEquals(TestValues.MATCH, time, TestValues.GENERAL_DATETIME); + assertEquals(TestValues.MATCH, humidity, TestValues.GENERAL_FLOAT); + assertEquals(TestValues.MATCH, cloudCover, TestValues.GENERAL_FLOAT); + assertEquals(TestValues.MATCH, moonPhase, TestValues.GENERAL_FLOAT); + assertEquals(TestValues.MATCH, windBearing, TestValues.GENERAL_INTEGER); + assertEquals(TestValues.MATCH, windGust, TestValues.GENERAL_FLOAT); + assertEquals(TestValues.MATCH, windSpeed, TestValues.GENERAL_FLOAT); + assertEquals(TestValues.MATCH, nearestStormBearing, TestValues.GENERAL_INTEGER); + assertEquals(TestValues.MATCH, nearestStormDistance, TestValues.GENERAL_INTEGER); + assertEquals(TestValues.MATCH, precipAccumulation, TestValues.GENERAL_FLOAT); + assertEquals(TestValues.MATCH, precipIntensity, TestValues.GENERAL_FLOAT); + assertEquals(TestValues.MATCH, precipProbability, TestValues.GENERAL_FLOAT); + assertEquals(TestValues.MATCH, precipType, TestValues.GENERAL_STRING); + assertEquals(TestValues.MATCH, visibility, TestValues.GENERAL_FLOAT); + assertEquals(TestValues.MATCH, weatherIcon, TestValues.GENERAL_IMAGE); // Invalid/Null Tests WeatherData msg = new WeatherData(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getCurrentTemperature()); - assertNull(Test.NULL, msg.getTemperatureHigh()); - assertNull(Test.NULL, msg.getTemperatureLow()); - assertNull(Test.NULL, msg.getApparentTemperature()); - assertNull(Test.NULL, msg.getApparentTemperatureHigh()); - assertNull(Test.NULL, msg.getApparentTemperatureLow()); - assertNull(Test.NULL, msg.getWeatherSummary()); - assertNull(Test.NULL, msg.getTime()); - assertNull(Test.NULL, msg.getHumidity()); - assertNull(Test.NULL, msg.getCloudCover()); - assertNull(Test.NULL, msg.getMoonPhase()); - assertNull(Test.NULL, msg.getWindBearing()); - assertNull(Test.NULL, msg.getWindGust()); - assertNull(Test.NULL, msg.getWindSpeed()); - assertNull(Test.NULL, msg.getNearestStormBearing()); - assertNull(Test.NULL, msg.getNearestStormDistance()); - assertNull(Test.NULL, msg.getPrecipAccumulation()); - assertNull(Test.NULL, msg.getPrecipIntensity()); - assertNull(Test.NULL, msg.getPrecipProbability()); - assertNull(Test.NULL, msg.getPrecipType()); - assertNull(Test.NULL, msg.getVisibility()); - assertNull(Test.NULL, msg.getWeatherIcon()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getCurrentTemperature()); + assertNull(TestValues.NULL, msg.getTemperatureHigh()); + assertNull(TestValues.NULL, msg.getTemperatureLow()); + assertNull(TestValues.NULL, msg.getApparentTemperature()); + assertNull(TestValues.NULL, msg.getApparentTemperatureHigh()); + assertNull(TestValues.NULL, msg.getApparentTemperatureLow()); + assertNull(TestValues.NULL, msg.getWeatherSummary()); + assertNull(TestValues.NULL, msg.getTime()); + assertNull(TestValues.NULL, msg.getHumidity()); + assertNull(TestValues.NULL, msg.getCloudCover()); + assertNull(TestValues.NULL, msg.getMoonPhase()); + assertNull(TestValues.NULL, msg.getWindBearing()); + assertNull(TestValues.NULL, msg.getWindGust()); + assertNull(TestValues.NULL, msg.getWindSpeed()); + assertNull(TestValues.NULL, msg.getNearestStormBearing()); + assertNull(TestValues.NULL, msg.getNearestStormDistance()); + assertNull(TestValues.NULL, msg.getPrecipAccumulation()); + assertNull(TestValues.NULL, msg.getPrecipIntensity()); + assertNull(TestValues.NULL, msg.getPrecipProbability()); + assertNull(TestValues.NULL, msg.getPrecipType()); + assertNull(TestValues.NULL, msg.getVisibility()); + assertNull(TestValues.NULL, msg.getWeatherIcon()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(WeatherData.KEY_CURRENT_TEMPERATURE, Test.GENERAL_TEMPERATURE); - reference.put(WeatherData.KEY_TEMPERATURE_HIGH, Test.GENERAL_TEMPERATURE); - reference.put(WeatherData.KEY_TEMPERATURE_LOW, Test.GENERAL_TEMPERATURE); - reference.put(WeatherData.KEY_APPARENT_TEMPERATURE, Test.GENERAL_TEMPERATURE); - reference.put(WeatherData.KEY_APPARENT_TEMPERATURE_HIGH, Test.GENERAL_TEMPERATURE); - reference.put(WeatherData.KEY_APPARENT_TEMPERATURE_LOW, Test.GENERAL_TEMPERATURE); - reference.put(WeatherData.KEY_WEATHER_SUMMARY, Test.GENERAL_STRING); - reference.put(WeatherData.KEY_TIME, Test.GENERAL_DATETIME); - reference.put(WeatherData.KEY_HUMIDITY, Test.GENERAL_FLOAT); - reference.put(WeatherData.KEY_CLOUD_COVER, Test.GENERAL_FLOAT); - reference.put(WeatherData.KEY_MOON_PHASE, Test.GENERAL_FLOAT); - reference.put(WeatherData.KEY_WIND_BEARING, Test.GENERAL_INTEGER); - reference.put(WeatherData.KEY_WIND_GUST, Test.GENERAL_FLOAT); - reference.put(WeatherData.KEY_WIND_SPEED, Test.GENERAL_FLOAT); - reference.put(WeatherData.KEY_NEAREST_STORM_BEARING, Test.GENERAL_INTEGER); - reference.put(WeatherData.KEY_NEAREST_STORM_DISTANCE, Test.GENERAL_INTEGER); - reference.put(WeatherData.KEY_PRECIP_ACCUMULATION, Test.GENERAL_FLOAT); - reference.put(WeatherData.KEY_PRECIP_INTENSITY, Test.GENERAL_FLOAT); - reference.put(WeatherData.KEY_PRECIP_PROBABILITY, Test.GENERAL_FLOAT); - reference.put(WeatherData.KEY_PRECIP_TYPE, Test.GENERAL_STRING); - reference.put(WeatherData.KEY_VISIBILITY, Test.GENERAL_FLOAT); - reference.put(WeatherData.KEY_WEATHER_ICON, Test.GENERAL_STRING); + reference.put(WeatherData.KEY_CURRENT_TEMPERATURE, TestValues.GENERAL_TEMPERATURE); + reference.put(WeatherData.KEY_TEMPERATURE_HIGH, TestValues.GENERAL_TEMPERATURE); + reference.put(WeatherData.KEY_TEMPERATURE_LOW, TestValues.GENERAL_TEMPERATURE); + reference.put(WeatherData.KEY_APPARENT_TEMPERATURE, TestValues.GENERAL_TEMPERATURE); + reference.put(WeatherData.KEY_APPARENT_TEMPERATURE_HIGH, TestValues.GENERAL_TEMPERATURE); + reference.put(WeatherData.KEY_APPARENT_TEMPERATURE_LOW, TestValues.GENERAL_TEMPERATURE); + reference.put(WeatherData.KEY_WEATHER_SUMMARY, TestValues.GENERAL_STRING); + reference.put(WeatherData.KEY_TIME, TestValues.GENERAL_DATETIME); + reference.put(WeatherData.KEY_HUMIDITY, TestValues.GENERAL_FLOAT); + reference.put(WeatherData.KEY_CLOUD_COVER, TestValues.GENERAL_FLOAT); + reference.put(WeatherData.KEY_MOON_PHASE, TestValues.GENERAL_FLOAT); + reference.put(WeatherData.KEY_WIND_BEARING, TestValues.GENERAL_INTEGER); + reference.put(WeatherData.KEY_WIND_GUST, TestValues.GENERAL_FLOAT); + reference.put(WeatherData.KEY_WIND_SPEED, TestValues.GENERAL_FLOAT); + reference.put(WeatherData.KEY_NEAREST_STORM_BEARING, TestValues.GENERAL_INTEGER); + reference.put(WeatherData.KEY_NEAREST_STORM_DISTANCE, TestValues.GENERAL_INTEGER); + reference.put(WeatherData.KEY_PRECIP_ACCUMULATION, TestValues.GENERAL_FLOAT); + reference.put(WeatherData.KEY_PRECIP_INTENSITY, TestValues.GENERAL_FLOAT); + reference.put(WeatherData.KEY_PRECIP_PROBABILITY, TestValues.GENERAL_FLOAT); + reference.put(WeatherData.KEY_PRECIP_TYPE, TestValues.GENERAL_STRING); + reference.put(WeatherData.KEY_VISIBILITY, TestValues.GENERAL_FLOAT); + reference.put(WeatherData.KEY_WEATHER_ICON, TestValues.GENERAL_STRING); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()) { @@ -169,21 +169,21 @@ public class WeatherDataTests extends TestCase { key.equals(WeatherData.KEY_APPARENT_TEMPERATURE_HIGH) || key.equals(WeatherData.KEY_APPARENT_TEMPERATURE_LOW)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateTemperature(Test.GENERAL_TEMPERATURE, new Temperature(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateTemperature(TestValues.GENERAL_TEMPERATURE, new Temperature(hashTest))); } else if (key.equals(WeatherData.KEY_TIME)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateDateTime(Test.GENERAL_DATETIME, new DateTime(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateDateTime(TestValues.GENERAL_DATETIME, new DateTime(hashTest))); } else if (key.equals(WeatherData.KEY_WEATHER_ICON)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, new Image(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateImage(TestValues.GENERAL_IMAGE, new Image(hashTest))); } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceDataTests.java index 09c976538..3e3e26d95 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceDataTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.WeatherAlert; import com.smartdevicelink.proxy.rpc.WeatherData; import com.smartdevicelink.proxy.rpc.WeatherServiceData; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -33,12 +33,12 @@ public class WeatherServiceDataTests extends TestCase { public void setUp(){ msg = new WeatherServiceData(); - msg.setLocation(Test.GENERAL_LOCATIONDETAILS); - msg.setCurrentForecast(Test.GENERAL_WEATHERDATA); - msg.setMinuteForecast(Test.GENERAL_WEATHERDATA_LIST); - msg.setHourlyForecast(Test.GENERAL_WEATHERDATA_LIST); - msg.setMultidayForecast(Test.GENERAL_WEATHERDATA_LIST); - msg.setAlerts(Test.GENERAL_WEATHERALERT_LIST); + msg.setLocation(TestValues.GENERAL_LOCATIONDETAILS); + msg.setCurrentForecast(TestValues.GENERAL_WEATHERDATA); + msg.setMinuteForecast(TestValues.GENERAL_WEATHERDATA_LIST); + msg.setHourlyForecast(TestValues.GENERAL_WEATHERDATA_LIST); + msg.setMultidayForecast(TestValues.GENERAL_WEATHERDATA_LIST); + msg.setAlerts(TestValues.GENERAL_WEATHERALERT_LIST); } /** @@ -54,44 +54,44 @@ public class WeatherServiceDataTests extends TestCase { List<WeatherAlert> alerts = msg.getAlerts(); // Valid Tests - assertEquals(Test.GENERAL_LOCATIONDETAILS, location); - assertEquals(Test.GENERAL_WEATHERDATA, currentForecast); - assertEquals(Test.GENERAL_WEATHERDATA_LIST, minuteForecast); - assertEquals(Test.GENERAL_WEATHERDATA_LIST, hourlyForecast); - assertEquals(Test.GENERAL_WEATHERDATA_LIST, multidayForecast); - assertEquals(Test.GENERAL_WEATHERALERT_LIST, alerts); + assertEquals(TestValues.GENERAL_LOCATIONDETAILS, location); + assertEquals(TestValues.GENERAL_WEATHERDATA, currentForecast); + assertEquals(TestValues.GENERAL_WEATHERDATA_LIST, minuteForecast); + assertEquals(TestValues.GENERAL_WEATHERDATA_LIST, hourlyForecast); + assertEquals(TestValues.GENERAL_WEATHERDATA_LIST, multidayForecast); + assertEquals(TestValues.GENERAL_WEATHERALERT_LIST, alerts); // Invalid/Null Tests WeatherServiceData msg = new WeatherServiceData(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getLocation()); - assertNull(Test.NULL, msg.getCurrentForecast()); - assertNull(Test.NULL, msg.getMinuteForecast()); - assertNull(Test.NULL, msg.getHourlyForecast()); - assertNull(Test.NULL, msg.getMultidayForecast()); - assertNull(Test.NULL, msg.getAlerts()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getLocation()); + assertNull(TestValues.NULL, msg.getCurrentForecast()); + assertNull(TestValues.NULL, msg.getMinuteForecast()); + assertNull(TestValues.NULL, msg.getHourlyForecast()); + assertNull(TestValues.NULL, msg.getMultidayForecast()); + assertNull(TestValues.NULL, msg.getAlerts()); } public void testRequiredParamsConstructor(){ - msg = new WeatherServiceData(Test.GENERAL_LOCATIONDETAILS); + msg = new WeatherServiceData(TestValues.GENERAL_LOCATIONDETAILS); LocationDetails location = msg.getLocation(); - assertEquals(Test.GENERAL_LOCATIONDETAILS, location); + assertEquals(TestValues.GENERAL_LOCATIONDETAILS, location); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(WeatherServiceData.KEY_LOCATION, Test.GENERAL_LOCATIONDETAILS); - reference.put(WeatherServiceData.KEY_CURRENT_FORECAST, Test.GENERAL_WEATHERDATA); - reference.put(WeatherServiceData.KEY_MINUTE_FORECAST, Test.GENERAL_WEATHERDATA_LIST); - reference.put(WeatherServiceData.KEY_HOURLY_FORECAST, Test.GENERAL_WEATHERDATA_LIST); - reference.put(WeatherServiceData.KEY_MULTIDAY_FORECAST, Test.GENERAL_WEATHERDATA_LIST); - reference.put(WeatherServiceData.KEY_ALERTS, Test.GENERAL_WEATHERALERT_LIST); + reference.put(WeatherServiceData.KEY_LOCATION, TestValues.GENERAL_LOCATIONDETAILS); + reference.put(WeatherServiceData.KEY_CURRENT_FORECAST, TestValues.GENERAL_WEATHERDATA); + reference.put(WeatherServiceData.KEY_MINUTE_FORECAST, TestValues.GENERAL_WEATHERDATA_LIST); + reference.put(WeatherServiceData.KEY_HOURLY_FORECAST, TestValues.GENERAL_WEATHERDATA_LIST); + reference.put(WeatherServiceData.KEY_MULTIDAY_FORECAST, TestValues.GENERAL_WEATHERDATA_LIST); + reference.put(WeatherServiceData.KEY_ALERTS, TestValues.GENERAL_WEATHERALERT_LIST); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -101,13 +101,13 @@ public class WeatherServiceDataTests extends TestCase { JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateLocationDetails( Test.GENERAL_LOCATIONDETAILS, new LocationDetails(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateLocationDetails( TestValues.GENERAL_LOCATIONDETAILS, new LocationDetails(hashTest))); } else if(key.equals(WeatherServiceData.KEY_CURRENT_FORECAST)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateWeatherData( Test.GENERAL_WEATHERDATA, new WeatherData(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateWeatherData( TestValues.GENERAL_WEATHERDATA, new WeatherData(hashTest))); } else if(key.equals(WeatherServiceData.KEY_MINUTE_FORECAST) || key.equals(WeatherServiceData.KEY_HOURLY_FORECAST) || key.equals(WeatherServiceData.KEY_MULTIDAY_FORECAST)){ @@ -120,7 +120,7 @@ public class WeatherServiceDataTests extends TestCase { } assertTrue("JSON value didn't match expected value for key \"" + key + "\".", - Validator.validateWeatherDataList(Test.GENERAL_WEATHERDATA_LIST, weatherDataUnderTestList)); + Validator.validateWeatherDataList(TestValues.GENERAL_WEATHERDATA_LIST, weatherDataUnderTestList)); } else if(key.equals(WeatherServiceData.KEY_ALERTS)){ @@ -132,11 +132,11 @@ public class WeatherServiceDataTests extends TestCase { } assertTrue("JSON value didn't match expected value for key \"" + key + "\".", - Validator.validateWeatherAlertList(Test.GENERAL_WEATHERALERT_LIST, weatherAlertUnderTestList)); + Validator.validateWeatherAlertList(TestValues.GENERAL_WEATHERALERT_LIST, weatherAlertUnderTestList)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceManifestTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceManifestTests.java index cbd65fae7..7a576569b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceManifestTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceManifestTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.WeatherServiceManifest; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -23,11 +23,11 @@ public class WeatherServiceManifestTests extends TestCase { public void setUp(){ msg = new WeatherServiceManifest(); - msg.setCurrentForecastSupported(Test.GENERAL_BOOLEAN); - msg.setMaxHourlyForecastAmount(Test.GENERAL_INT); - msg.setMaxMinutelyForecastAmount(Test.GENERAL_INT); - msg.setMaxMultidayForecastAmount(Test.GENERAL_INT); - msg.setWeatherForLocationSupported(Test.GENERAL_BOOLEAN); + msg.setCurrentForecastSupported(TestValues.GENERAL_BOOLEAN); + msg.setMaxHourlyForecastAmount(TestValues.GENERAL_INT); + msg.setMaxMinutelyForecastAmount(TestValues.GENERAL_INT); + msg.setMaxMultidayForecastAmount(TestValues.GENERAL_INT); + msg.setWeatherForLocationSupported(TestValues.GENERAL_BOOLEAN); } /** @@ -42,43 +42,43 @@ public class WeatherServiceManifestTests extends TestCase { Integer getMaxMultidayForecastAmt = msg.getMaxMultidayForecastAmount(); // Valid Tests - assertEquals(Test.GENERAL_BOOLEAN, currentForecastSupported); - assertEquals(Test.GENERAL_BOOLEAN, weatherForLocationSupported); - assertEquals(Test.MATCH, Test.GENERAL_INTEGER, getMaxHourlyForecastAmt); - assertEquals(Test.MATCH, Test.GENERAL_INTEGER, getMaxMinutelyForecastAmt); - assertEquals(Test.MATCH, Test.GENERAL_INTEGER, getMaxMultidayForecastAmt); + assertEquals(TestValues.GENERAL_BOOLEAN, currentForecastSupported); + assertEquals(TestValues.GENERAL_BOOLEAN, weatherForLocationSupported); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER, getMaxHourlyForecastAmt); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER, getMaxMinutelyForecastAmt); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER, getMaxMultidayForecastAmt); // Invalid/Null Tests WeatherServiceManifest msg = new WeatherServiceManifest(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getCurrentForecastSupported()); - assertNull(Test.NULL, msg.getWeatherForLocationSupported()); - assertNull(Test.NULL, msg.getMaxHourlyForecastAmount()); - assertNull(Test.NULL, msg.getMaxMinutelyForecastAmount()); - assertNull(Test.NULL, msg.getMaxMultidayForecastAmount()); + assertNull(TestValues.NULL, msg.getCurrentForecastSupported()); + assertNull(TestValues.NULL, msg.getWeatherForLocationSupported()); + assertNull(TestValues.NULL, msg.getMaxHourlyForecastAmount()); + assertNull(TestValues.NULL, msg.getMaxMinutelyForecastAmount()); + assertNull(TestValues.NULL, msg.getMaxMultidayForecastAmount()); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(WeatherServiceManifest.KEY_CURRENT_FORECAST_SUPPORTED, Test.GENERAL_BOOLEAN); - reference.put(WeatherServiceManifest.KEY_WEATHER_FOR_LOCATION_SUPPORTED, Test.GENERAL_BOOLEAN); - reference.put(WeatherServiceManifest.KEY_MAX_HOURLY_FORECAST_AMOUNT, Test.GENERAL_INTEGER); - reference.put(WeatherServiceManifest.KEY_MAX_MINUTELY_FORECAST_AMOUNT, Test.GENERAL_INTEGER); - reference.put(WeatherServiceManifest.KEY_MAX_MULTIDAY_FORECAST_AMOUNT, Test.GENERAL_INTEGER); + reference.put(WeatherServiceManifest.KEY_CURRENT_FORECAST_SUPPORTED, TestValues.GENERAL_BOOLEAN); + reference.put(WeatherServiceManifest.KEY_WEATHER_FOR_LOCATION_SUPPORTED, TestValues.GENERAL_BOOLEAN); + reference.put(WeatherServiceManifest.KEY_MAX_HOURLY_FORECAST_AMOUNT, TestValues.GENERAL_INTEGER); + reference.put(WeatherServiceManifest.KEY_MAX_MINUTELY_FORECAST_AMOUNT, TestValues.GENERAL_INTEGER); + reference.put(WeatherServiceManifest.KEY_MAX_MULTIDAY_FORECAST_AMOUNT, TestValues.GENERAL_INTEGER); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WindowCapabilityTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WindowCapabilityTests.java index 550231452..62f2e4337 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WindowCapabilityTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WindowCapabilityTests.java @@ -9,7 +9,7 @@ import com.smartdevicelink.proxy.rpc.WindowCapability; import com.smartdevicelink.proxy.rpc.enums.ImageType; import com.smartdevicelink.proxy.rpc.enums.MenuLayout; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -34,15 +34,15 @@ public class WindowCapabilityTests extends TestCase { @Override public void setUp() { msg = new WindowCapability(); - msg.setWindowID(Test.GENERAL_INT); - msg.setTextFields(Test.GENERAL_TEXTFIELD_LIST); - msg.setImageFields(Test.GENERAL_IMAGEFIELD_LIST); - msg.setImageTypeSupported(Test.GENERAL_IMAGE_TYPE_LIST); - msg.setTemplatesAvailable(Test.GENERAL_STRING_LIST); - msg.setNumCustomPresetsAvailable(Test.GENERAL_INT); - msg.setButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST); - msg.setSoftButtonCapabilities(Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST); - msg.setMenuLayoutsAvailable(Test.GENERAL_MENU_LAYOUT_LIST); + msg.setWindowID(TestValues.GENERAL_INT); + msg.setTextFields(TestValues.GENERAL_TEXTFIELD_LIST); + msg.setImageFields(TestValues.GENERAL_IMAGEFIELD_LIST); + msg.setImageTypeSupported(TestValues.GENERAL_IMAGE_TYPE_LIST); + msg.setTemplatesAvailable(TestValues.GENERAL_STRING_LIST); + msg.setNumCustomPresetsAvailable(TestValues.GENERAL_INT); + msg.setButtonCapabilities(TestValues.GENERAL_BUTTONCAPABILITIES_LIST); + msg.setSoftButtonCapabilities(TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST); + msg.setMenuLayoutsAvailable(TestValues.GENERAL_MENU_LAYOUT_LIST); } /** @@ -61,70 +61,70 @@ public class WindowCapabilityTests extends TestCase { List<MenuLayout> menuLayouts = msg.getMenuLayoutsAvailable(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, windowID); - assertEquals(Test.MATCH, Test.GENERAL_TEXTFIELD_LIST.size(), textFields.size()); - assertEquals(Test.MATCH, Test.GENERAL_IMAGEFIELD_LIST.size(), imageFields.size()); - assertEquals(Test.MATCH, Test.GENERAL_IMAGE_TYPE_LIST.size(), imageTypeSupported.size()); - assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), templatesAvailable.size()); - assertEquals(Test.MATCH, Test.GENERAL_INT, numCustomPresetsAvailable); - assertEquals(Test.MATCH, Test.GENERAL_BUTTONCAPABILITIES_LIST.size(), buttonCapabilities.size()); - assertEquals(Test.MATCH, Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST.size(), softButtonCapabilities.size()); - assertEquals(Test.MATCH, Test.GENERAL_MENU_LAYOUT_LIST.size(), menuLayouts.size()); - - for (int i = 0; i < Test.GENERAL_TEXTFIELD_LIST.size(); i++) { - assertTrue(Test.TRUE, Validator.validateTextFields(Test.GENERAL_TEXTFIELD_LIST.get(i), textFields.get(i))); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, windowID); + assertEquals(TestValues.MATCH, TestValues.GENERAL_TEXTFIELD_LIST.size(), textFields.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_IMAGEFIELD_LIST.size(), imageFields.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_IMAGE_TYPE_LIST.size(), imageTypeSupported.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING_LIST.size(), templatesAvailable.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, numCustomPresetsAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BUTTONCAPABILITIES_LIST.size(), buttonCapabilities.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST.size(), softButtonCapabilities.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MENU_LAYOUT_LIST.size(), menuLayouts.size()); + + for (int i = 0; i < TestValues.GENERAL_TEXTFIELD_LIST.size(); i++) { + assertTrue(TestValues.TRUE, Validator.validateTextFields(TestValues.GENERAL_TEXTFIELD_LIST.get(i), textFields.get(i))); } - for (int i = 0; i < Test.GENERAL_IMAGEFIELD_LIST.size(); i++) { - assertTrue(Test.TRUE, Validator.validateImageFields(Test.GENERAL_IMAGEFIELD_LIST.get(i), imageFields.get(i))); + for (int i = 0; i < TestValues.GENERAL_IMAGEFIELD_LIST.size(); i++) { + assertTrue(TestValues.TRUE, Validator.validateImageFields(TestValues.GENERAL_IMAGEFIELD_LIST.get(i), imageFields.get(i))); } - for (int i = 0; i < Test.GENERAL_IMAGE_TYPE_LIST.size(); i++) { - assertEquals(Test.MATCH, Test.GENERAL_IMAGE_TYPE_LIST.get(i), imageTypeSupported.get(i)); + for (int i = 0; i < TestValues.GENERAL_IMAGE_TYPE_LIST.size(); i++) { + assertEquals(TestValues.MATCH, TestValues.GENERAL_IMAGE_TYPE_LIST.get(i), imageTypeSupported.get(i)); } - for (int i = 0; i < Test.GENERAL_STRING_LIST.size(); i++) { - assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.get(i), templatesAvailable.get(i)); + for (int i = 0; i < TestValues.GENERAL_STRING_LIST.size(); i++) { + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING_LIST.get(i), templatesAvailable.get(i)); } - for(int i = 0; i < Test.GENERAL_MENU_LAYOUT_LIST.size(); i++){ - assertEquals(Test.MATCH, Test.GENERAL_MENU_LAYOUT_LIST.get(i), menuLayouts.get(i)); + for(int i = 0; i < TestValues.GENERAL_MENU_LAYOUT_LIST.size(); i++){ + assertEquals(TestValues.MATCH, TestValues.GENERAL_MENU_LAYOUT_LIST.get(i), menuLayouts.get(i)); } - assertTrue(Test.TRUE, Validator.validateButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST, buttonCapabilities)); - assertTrue(Test.TRUE, Validator.validateSoftButtonCapabilities(Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST, softButtonCapabilities)); + assertTrue(TestValues.TRUE, Validator.validateButtonCapabilities(TestValues.GENERAL_BUTTONCAPABILITIES_LIST, buttonCapabilities)); + assertTrue(TestValues.TRUE, Validator.validateSoftButtonCapabilities(TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST, softButtonCapabilities)); // Invalid/Null Tests WindowCapability msg = new WindowCapability(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getWindowID()); - assertNull(Test.NULL, msg.getTextFields()); - assertNull(Test.NULL, msg.getImageFields()); - assertNull(Test.NULL, msg.getImageTypeSupported()); - assertNull(Test.NULL, msg.getTemplatesAvailable()); - assertNull(Test.NULL, msg.getNumCustomPresetsAvailable()); - assertNull(Test.NULL, msg.getButtonCapabilities()); - assertNull(Test.NULL, msg.getSoftButtonCapabilities()); - assertNull(Test.NULL, msg.getMenuLayoutsAvailable()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getWindowID()); + assertNull(TestValues.NULL, msg.getTextFields()); + assertNull(TestValues.NULL, msg.getImageFields()); + assertNull(TestValues.NULL, msg.getImageTypeSupported()); + assertNull(TestValues.NULL, msg.getTemplatesAvailable()); + assertNull(TestValues.NULL, msg.getNumCustomPresetsAvailable()); + assertNull(TestValues.NULL, msg.getButtonCapabilities()); + assertNull(TestValues.NULL, msg.getSoftButtonCapabilities()); + assertNull(TestValues.NULL, msg.getMenuLayoutsAvailable()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(WindowCapability.KEY_WINDOW_ID, Test.GENERAL_INT); - reference.put(WindowCapability.KEY_TEXT_FIELDS, Test.JSON_TEXTFIELDS); - reference.put(WindowCapability.KEY_IMAGE_FIELDS, Test.JSON_IMAGEFIELDS); - reference.put(WindowCapability.KEY_IMAGE_TYPE_SUPPORTED, Test.JSON_IMAGE_TYPE_SUPPORTED); - reference.put(WindowCapability.KEY_TEMPLATES_AVAILABLE, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST)); - reference.put(WindowCapability.KEY_NUM_CUSTOM_PRESETS_AVAILABLE, Test.GENERAL_INT); - reference.put(WindowCapability.KEY_BUTTON_CAPABILITIES, Test.JSON_BUTTONCAPABILITIES); - reference.put(WindowCapability.KEY_SOFT_BUTTON_CAPABILITIES, Test.JSON_SOFTBUTTONCAPABILITIES); - reference.put(WindowCapability.KEY_MENU_LAYOUTS_AVAILABLE, JsonUtils.createJsonArray(Test.GENERAL_MENU_LAYOUT_LIST)); + reference.put(WindowCapability.KEY_WINDOW_ID, TestValues.GENERAL_INT); + reference.put(WindowCapability.KEY_TEXT_FIELDS, TestValues.JSON_TEXTFIELDS); + reference.put(WindowCapability.KEY_IMAGE_FIELDS, TestValues.JSON_IMAGEFIELDS); + reference.put(WindowCapability.KEY_IMAGE_TYPE_SUPPORTED, TestValues.JSON_IMAGE_TYPE_SUPPORTED); + reference.put(WindowCapability.KEY_TEMPLATES_AVAILABLE, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); + reference.put(WindowCapability.KEY_NUM_CUSTOM_PRESETS_AVAILABLE, TestValues.GENERAL_INT); + reference.put(WindowCapability.KEY_BUTTON_CAPABILITIES, TestValues.JSON_BUTTONCAPABILITIES); + reference.put(WindowCapability.KEY_SOFT_BUTTON_CAPABILITIES, TestValues.JSON_SOFTBUTTONCAPABILITIES); + reference.put(WindowCapability.KEY_MENU_LAYOUTS_AVAILABLE, JsonUtils.createJsonArray(TestValues.GENERAL_MENU_LAYOUT_LIST)); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { @@ -133,32 +133,32 @@ public class WindowCapabilityTests extends TestCase { if (key.equals(WindowCapability.KEY_IMAGE_FIELDS)) { JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key); JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); - assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length()); + assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length()); for (int i = 0; i < referenceArray.length(); i++) { Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i)); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); - assertTrue(Test.TRUE, Validator.validateImageFields(new ImageField(hashReference), new ImageField(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateImageFields(new ImageField(hashReference), new ImageField(hashTest))); } } else if (key.equals(WindowCapability.KEY_TEXT_FIELDS)) { JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key); JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); - assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length()); + assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length()); for (int i = 0; i < referenceArray.length(); i++) { Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i)); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); - assertTrue(Test.TRUE, Validator.validateTextFields(new TextField(hashReference), new TextField(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateTextFields(new TextField(hashReference), new TextField(hashTest))); } } else if (key.equals(WindowCapability.KEY_TEMPLATES_AVAILABLE)) { JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key); JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); - assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length()); - assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key))); + assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length()); + assertTrue(TestValues.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key))); } else if (key.equals(WindowCapability.KEY_BUTTON_CAPABILITIES)) { JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key); JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); - assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length()); + assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length()); List<ButtonCapabilities> referenceList = new ArrayList<ButtonCapabilities>(); List<ButtonCapabilities> testList = new ArrayList<ButtonCapabilities>(); @@ -168,11 +168,11 @@ public class WindowCapabilityTests extends TestCase { Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); testList.add(new ButtonCapabilities(hashTest)); } - assertTrue(Test.TRUE, Validator.validateButtonCapabilities(referenceList, testList)); + assertTrue(TestValues.TRUE, Validator.validateButtonCapabilities(referenceList, testList)); } else if (key.equals(WindowCapability.KEY_SOFT_BUTTON_CAPABILITIES)) { JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key); JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); - assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length()); + assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length()); List<SoftButtonCapabilities> referenceList = new ArrayList<SoftButtonCapabilities>(); List<SoftButtonCapabilities> testList = new ArrayList<SoftButtonCapabilities>(); @@ -182,21 +182,21 @@ public class WindowCapabilityTests extends TestCase { Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); testList.add(new SoftButtonCapabilities(hashTest)); } - assertTrue(Test.TRUE, Validator.validateSoftButtonCapabilities(referenceList, testList)); + assertTrue(TestValues.TRUE, Validator.validateSoftButtonCapabilities(referenceList, testList)); } else if (key.equals(WindowCapability.KEY_IMAGE_TYPE_SUPPORTED) || (key.equals(WindowCapability.KEY_MENU_LAYOUTS_AVAILABLE))) { List<String> referenceList = JsonUtils.readStringListFromJsonObject(reference, key); List<String> underTestList = JsonUtils.readStringListFromJsonObject(underTest, key); - assertEquals(Test.MATCH, referenceList.size(), underTestList.size()); + assertEquals(TestValues.MATCH, referenceList.size(), underTestList.size()); for (int i = 0; i < referenceList.size(); i++) { - assertEquals(Test.MATCH, referenceList.get(i), underTestList.get(i)); + assertEquals(TestValues.MATCH, referenceList.get(i), underTestList.get(i)); } } else { - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WindowTypeCapabilitiesTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WindowTypeCapabilitiesTest.java index 84d57ba52..cb91bb4c1 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WindowTypeCapabilitiesTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WindowTypeCapabilitiesTest.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.proxy.rpc.WindowTypeCapabilities; import com.smartdevicelink.proxy.rpc.enums.WindowType; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -20,8 +20,8 @@ public class WindowTypeCapabilitiesTest extends TestCase { public void setUp() { msg = new WindowTypeCapabilities(); - msg.setMaximumNumberOfWindows(Test.GENERAL_INT); - msg.setType(Test.GENERAL_WINDOWTYPE); + msg.setMaximumNumberOfWindows(TestValues.GENERAL_INT); + msg.setType(TestValues.GENERAL_WINDOWTYPE); } /** @@ -33,34 +33,34 @@ public class WindowTypeCapabilitiesTest extends TestCase { WindowType type = msg.getType(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, maximumNumberOfWindows); - assertEquals(Test.MATCH, Test.GENERAL_WINDOWTYPE, type); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, maximumNumberOfWindows); + assertEquals(TestValues.MATCH, TestValues.GENERAL_WINDOWTYPE, type); // Invalid/Null Tests WindowTypeCapabilities msg = new WindowTypeCapabilities(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); - assertNull(Test.NULL, msg.getMaximumNumberOfWindows()); - assertNull(Test.NULL, msg.getType()); + assertNull(TestValues.NULL, msg.getMaximumNumberOfWindows()); + assertNull(TestValues.NULL, msg.getType()); } public void testJson() { JSONObject reference = new JSONObject(); try { - reference.put(WindowTypeCapabilities.KEY_MAXIMUM_NUMBER_OF_WINDOWS, Test.GENERAL_INT); - reference.put(WindowTypeCapabilities.KEY_TYPE, Test.GENERAL_WINDOWTYPE); + reference.put(WindowTypeCapabilities.KEY_MAXIMUM_NUMBER_OF_WINDOWS, TestValues.GENERAL_INT); + reference.put(WindowTypeCapabilities.KEY_TYPE, TestValues.GENERAL_WINDOWTYPE); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RequestTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RequestTypeTests.java index d721e9b58..54c40d69f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RequestTypeTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/RequestTypeTests.java @@ -1,7 +1,7 @@ package com.smartdevicelink.test.rpc.enums; import com.smartdevicelink.proxy.rpc.enums.RequestType; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -71,21 +71,21 @@ public class RequestTypeTests extends TestCase { assertNotNull("PROPRIETARY returned null", enumProprietary); assertNotNull("ICON_URL returned null", enumIconURL); - assertNotNull(Test.NOT_NULL, enumQueryApps); - assertNotNull(Test.NOT_NULL, enumLaunchApp); - assertNotNull(Test.NOT_NULL, enumLockScreen); - assertNotNull(Test.NOT_NULL, enumTrafficMessage); - assertNotNull(Test.NOT_NULL, enumDriverProfile); - assertNotNull(Test.NOT_NULL, enumVoiceSearch); - assertNotNull(Test.NOT_NULL, enumNavigation); - assertNotNull(Test.NOT_NULL, enumPhone); - assertNotNull(Test.NOT_NULL, enumClimate); - assertNotNull(Test.NOT_NULL, enumSettings); - assertNotNull(Test.NOT_NULL, enumDiagnostics); - assertNotNull(Test.NOT_NULL, enumEmergency); - assertNotNull(Test.NOT_NULL, enumMedia); - assertNotNull(Test.NOT_NULL, enumFota); - assertNotNull(Test.NOT_NULL, enumIconURL); + assertNotNull(TestValues.NOT_NULL, enumQueryApps); + assertNotNull(TestValues.NOT_NULL, enumLaunchApp); + assertNotNull(TestValues.NOT_NULL, enumLockScreen); + assertNotNull(TestValues.NOT_NULL, enumTrafficMessage); + assertNotNull(TestValues.NOT_NULL, enumDriverProfile); + assertNotNull(TestValues.NOT_NULL, enumVoiceSearch); + assertNotNull(TestValues.NOT_NULL, enumNavigation); + assertNotNull(TestValues.NOT_NULL, enumPhone); + assertNotNull(TestValues.NOT_NULL, enumClimate); + assertNotNull(TestValues.NOT_NULL, enumSettings); + assertNotNull(TestValues.NOT_NULL, enumDiagnostics); + assertNotNull(TestValues.NOT_NULL, enumEmergency); + assertNotNull(TestValues.NOT_NULL, enumMedia); + assertNotNull(TestValues.NOT_NULL, enumFota); + assertNotNull(TestValues.NOT_NULL, enumIconURL); } /** diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SdlDisconnectedReasonTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SdlDisconnectedReasonTests.java index d264b2563..d4c22354e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SdlDisconnectedReasonTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SdlDisconnectedReasonTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.enums; import com.smartdevicelink.proxy.rpc.enums.AppInterfaceUnregisteredReason; import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -159,18 +159,18 @@ public class SdlDisconnectedReasonTests extends TestCase { * {@link com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason#convertAppInterfaceunregisteredReason(AppInterfaceUnregisteredReason)} */ public void testConvertMethod () { - assertEquals(Test.MATCH, SdlDisconnectedReason.DEFAULT, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.APP_UNAUTHORIZED)); - assertEquals(Test.MATCH, SdlDisconnectedReason.BLUETOOTH_OFF, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.BLUETOOTH_OFF)); - assertEquals(Test.MATCH, SdlDisconnectedReason.DRIVER_DISTRACTION_VIOLATION, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.DRIVER_DISTRACTION_VIOLATION)); - assertEquals(Test.MATCH, SdlDisconnectedReason.FACTORY_DEFAULTS, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.FACTORY_DEFAULTS)); - assertEquals(Test.MATCH, SdlDisconnectedReason.IGNITION_OFF, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.IGNITION_OFF)); - assertEquals(Test.MATCH, SdlDisconnectedReason.LANGUAGE_CHANGE, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.LANGUAGE_CHANGE)); - assertEquals(Test.MATCH, SdlDisconnectedReason.MASTER_RESET, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.MASTER_RESET)); - assertEquals(Test.MATCH, SdlDisconnectedReason.REQUEST_WHILE_IN_NONE_HMI_LEVEL, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.REQUEST_WHILE_IN_NONE_HMI_LEVEL)); - assertEquals(Test.MATCH, SdlDisconnectedReason.TOO_MANY_REQUESTS, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.TOO_MANY_REQUESTS)); - assertEquals(Test.MATCH, SdlDisconnectedReason.USB_DISCONNECTED, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.USB_DISCONNECTED)); - assertEquals(Test.MATCH, SdlDisconnectedReason.USER_EXIT, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.USER_EXIT)); - assertNull(Test.MATCH, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(null)); + assertEquals(TestValues.MATCH, SdlDisconnectedReason.DEFAULT, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.APP_UNAUTHORIZED)); + assertEquals(TestValues.MATCH, SdlDisconnectedReason.BLUETOOTH_OFF, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.BLUETOOTH_OFF)); + assertEquals(TestValues.MATCH, SdlDisconnectedReason.DRIVER_DISTRACTION_VIOLATION, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.DRIVER_DISTRACTION_VIOLATION)); + assertEquals(TestValues.MATCH, SdlDisconnectedReason.FACTORY_DEFAULTS, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.FACTORY_DEFAULTS)); + assertEquals(TestValues.MATCH, SdlDisconnectedReason.IGNITION_OFF, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.IGNITION_OFF)); + assertEquals(TestValues.MATCH, SdlDisconnectedReason.LANGUAGE_CHANGE, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.LANGUAGE_CHANGE)); + assertEquals(TestValues.MATCH, SdlDisconnectedReason.MASTER_RESET, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.MASTER_RESET)); + assertEquals(TestValues.MATCH, SdlDisconnectedReason.REQUEST_WHILE_IN_NONE_HMI_LEVEL, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.REQUEST_WHILE_IN_NONE_HMI_LEVEL)); + assertEquals(TestValues.MATCH, SdlDisconnectedReason.TOO_MANY_REQUESTS, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.TOO_MANY_REQUESTS)); + assertEquals(TestValues.MATCH, SdlDisconnectedReason.USB_DISCONNECTED, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.USB_DISCONNECTED)); + assertEquals(TestValues.MATCH, SdlDisconnectedReason.USER_EXIT, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason.USER_EXIT)); + assertNull(TestValues.MATCH, SdlDisconnectedReason.convertAppInterfaceUnregisteredReason(null)); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextFieldNameTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextFieldNameTests.java index 33baa6835..cb55330eb 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextFieldNameTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextFieldNameTests.java @@ -1,7 +1,7 @@ package com.smartdevicelink.test.rpc.enums; import com.smartdevicelink.proxy.rpc.enums.TextFieldName; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -105,10 +105,10 @@ public class TextFieldNameTests extends TestCase { assertNotNull("templateTitle returned null", templateTitle); - assertNotNull(Test.NOT_NULL, enumLocName); - assertNotNull(Test.NOT_NULL, enumLocDesc); - assertNotNull(Test.NOT_NULL, enumAddLines); - assertNotNull(Test.NOT_NULL, enumPhone); + assertNotNull(TestValues.NOT_NULL, enumLocName); + assertNotNull(TestValues.NOT_NULL, enumLocDesc); + assertNotNull(TestValues.NOT_NULL, enumAddLines); + assertNotNull(TestValues.NOT_NULL, enumPhone); } /** diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppInterfaceUnregisteredTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppInterfaceUnregisteredTests.java index c5f9bebdb..f75b79b83 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppInterfaceUnregisteredTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppInterfaceUnregisteredTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.OnAppInterfaceUnregistered; import com.smartdevicelink.proxy.rpc.enums.AppInterfaceUnregisteredReason; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONException; import org.json.JSONObject; @@ -20,7 +20,7 @@ public class OnAppInterfaceUnregisteredTests extends BaseRpcTests{ protected RPCMessage createMessage(){ OnAppInterfaceUnregistered msg = new OnAppInterfaceUnregistered(); - msg.setReason(Test.GENERAL_APPINTERFACEUNREGISTEREDREASON); + msg.setReason(TestValues.GENERAL_APPINTERFACEUNREGISTEREDREASON); return msg; } @@ -40,9 +40,9 @@ public class OnAppInterfaceUnregisteredTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(OnAppInterfaceUnregistered.KEY_REASON, Test.GENERAL_APPINTERFACEUNREGISTEREDREASON); + result.put(OnAppInterfaceUnregistered.KEY_REASON, TestValues.GENERAL_APPINTERFACEUNREGISTEREDREASON); } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -56,13 +56,13 @@ public class OnAppInterfaceUnregisteredTests extends BaseRpcTests{ AppInterfaceUnregisteredReason reason = ( (OnAppInterfaceUnregistered) msg ).getReason(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_APPINTERFACEUNREGISTEREDREASON, reason); + assertEquals(TestValues.MATCH, TestValues.GENERAL_APPINTERFACEUNREGISTEREDREASON, reason); // Invalid/Null tests OnAppInterfaceUnregistered msg = new OnAppInterfaceUnregistered(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getReason()); + assertNull(TestValues.NULL, msg.getReason()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppServiceDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppServiceDataTests.java index 8a04d4b6a..ec2125b77 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppServiceDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAppServiceDataTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.AppServiceData; import com.smartdevicelink.proxy.rpc.OnAppServiceData; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONException; import org.json.JSONObject; @@ -20,7 +20,7 @@ public class OnAppServiceDataTests extends BaseRpcTests { protected RPCMessage createMessage(){ OnAppServiceData msg = new OnAppServiceData(); - msg.setServiceData(Test.GENERAL_APPSERVICEDATA); + msg.setServiceData(TestValues.GENERAL_APPSERVICEDATA); return msg; } @@ -40,9 +40,9 @@ public class OnAppServiceDataTests extends BaseRpcTests { JSONObject result = new JSONObject(); try{ - result.put(OnAppServiceData.KEY_SERVICE_DATA, Test.GENERAL_APPSERVICEDATA.serializeJSON()); + result.put(OnAppServiceData.KEY_SERVICE_DATA, TestValues.GENERAL_APPSERVICEDATA.serializeJSON()); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -56,18 +56,18 @@ public class OnAppServiceDataTests extends BaseRpcTests { AppServiceData cmdId = ( (OnAppServiceData) msg ).getServiceData(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_APPSERVICEDATA, cmdId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_APPSERVICEDATA, cmdId); // Invalid/Null Tests OnAppServiceData msg = new OnAppServiceData(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getServiceData()); + assertNull(TestValues.NULL, msg.getServiceData()); // test constructor with param - msg = new OnAppServiceData(Test.GENERAL_APPSERVICEDATA); + msg = new OnAppServiceData(TestValues.GENERAL_APPSERVICEDATA); AppServiceData serviceData = msg.getServiceData(); - assertEquals(serviceData, Test.GENERAL_APPSERVICEDATA); + assertEquals(serviceData, TestValues.GENERAL_APPSERVICEDATA); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAudioPassThruTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAudioPassThruTests.java index 1c6efbef5..f5b9117ef 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAudioPassThruTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnAudioPassThruTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.OnAudioPassThru; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONObject; @@ -40,7 +40,7 @@ public class OnAudioPassThruTests extends BaseRpcTests{ public void testRpcValues () { // Invalid/Null Tests OnAudioPassThru msg = new OnAudioPassThru(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonEventTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonEventTests.java index 2bf73753e..41e2030bc 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonEventTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonEventTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.rpc.OnButtonEvent; import com.smartdevicelink.proxy.rpc.enums.ButtonEventMode; import com.smartdevicelink.proxy.rpc.enums.ButtonName; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONException; import org.json.JSONObject; @@ -21,9 +21,9 @@ public class OnButtonEventTests extends BaseRpcTests{ protected RPCMessage createMessage(){ OnButtonEvent msg = new OnButtonEvent(); - msg.setButtonEventMode(Test.GENERAL_BUTTONEVENTMODE); - msg.setButtonName(Test.GENERAL_BUTTONNAME); - msg.setCustomButtonID(Test.GENERAL_INT); + msg.setButtonEventMode(TestValues.GENERAL_BUTTONEVENTMODE); + msg.setButtonName(TestValues.GENERAL_BUTTONNAME); + msg.setCustomButtonID(TestValues.GENERAL_INT); return msg; } @@ -43,11 +43,11 @@ public class OnButtonEventTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(OnButtonEvent.KEY_BUTTON_EVENT_MODE, Test.GENERAL_BUTTONEVENTMODE); - result.put(OnButtonEvent.KEY_BUTTON_NAME, Test.GENERAL_BUTTONNAME); - result.put(OnButtonEvent.KEY_CUSTOM_BUTTON_ID, Test.GENERAL_INT); + result.put(OnButtonEvent.KEY_BUTTON_EVENT_MODE, TestValues.GENERAL_BUTTONEVENTMODE); + result.put(OnButtonEvent.KEY_BUTTON_NAME, TestValues.GENERAL_BUTTONNAME); + result.put(OnButtonEvent.KEY_CUSTOM_BUTTON_ID, TestValues.GENERAL_INT); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -63,17 +63,17 @@ public class OnButtonEventTests extends BaseRpcTests{ ButtonName name = ( (OnButtonEvent) msg ).getButtonName(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, cmdId); - assertEquals(Test.MATCH, Test.GENERAL_BUTTONEVENTMODE, mode); - assertEquals(Test.MATCH, Test.GENERAL_BUTTONNAME, name); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, cmdId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BUTTONEVENTMODE, mode); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BUTTONNAME, name); // Invalid/Null Tests OnButtonEvent msg = new OnButtonEvent(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getButtonEventMode()); - assertNull(Test.NULL, msg.getButtonName()); - assertNull(Test.NULL, msg.getCustomButtonID()); + assertNull(TestValues.NULL, msg.getButtonEventMode()); + assertNull(TestValues.NULL, msg.getButtonName()); + assertNull(TestValues.NULL, msg.getCustomButtonID()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonPressTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonPressTests.java index dcc300253..a4583616b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonPressTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnButtonPressTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.rpc.OnButtonPress; import com.smartdevicelink.proxy.rpc.enums.ButtonName; import com.smartdevicelink.proxy.rpc.enums.ButtonPressMode; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONException; import org.json.JSONObject; @@ -21,9 +21,9 @@ public class OnButtonPressTests extends BaseRpcTests{ protected RPCMessage createMessage(){ OnButtonPress msg = new OnButtonPress(); - msg.setButtonName(Test.GENERAL_BUTTONNAME); - msg.setButtonPressMode(Test.GENERAL_BUTTONPRESSMODE); - msg.setCustomButtonID(Test.GENERAL_INT); + msg.setButtonName(TestValues.GENERAL_BUTTONNAME); + msg.setButtonPressMode(TestValues.GENERAL_BUTTONPRESSMODE); + msg.setCustomButtonID(TestValues.GENERAL_INT); return msg; } @@ -43,11 +43,11 @@ public class OnButtonPressTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(OnButtonPress.KEY_CUSTOM_BUTTON_ID, Test.GENERAL_INT); - result.put(OnButtonPress.KEY_BUTTON_NAME, Test.GENERAL_BUTTONNAME); - result.put(OnButtonPress.KEY_BUTTON_PRESS_MODE, Test.GENERAL_BUTTONPRESSMODE); + result.put(OnButtonPress.KEY_CUSTOM_BUTTON_ID, TestValues.GENERAL_INT); + result.put(OnButtonPress.KEY_BUTTON_NAME, TestValues.GENERAL_BUTTONNAME); + result.put(OnButtonPress.KEY_BUTTON_PRESS_MODE, TestValues.GENERAL_BUTTONPRESSMODE); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -63,17 +63,17 @@ public class OnButtonPressTests extends BaseRpcTests{ ButtonPressMode buttonPressMode = ( (OnButtonPress) msg ).getButtonPressMode(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, customName); - assertEquals(Test.MATCH, Test.GENERAL_BUTTONNAME, buttonName); - assertEquals(Test.MATCH, Test.GENERAL_BUTTONPRESSMODE, buttonPressMode); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, customName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BUTTONNAME, buttonName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BUTTONPRESSMODE, buttonPressMode); // Invalid/Null Tests OnButtonPress msg = new OnButtonPress(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getCustomButtonID()); - assertNull(Test.NULL, msg.getButtonName()); - assertNull(Test.NULL, msg.getButtonPressMode()); + assertNull(TestValues.NULL, msg.getCustomButtonID()); + assertNull(TestValues.NULL, msg.getButtonName()); + assertNull(TestValues.NULL, msg.getButtonPressMode()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnCommandTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnCommandTests.java index 737435ec6..7f72cf219 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnCommandTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnCommandTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.OnCommand; import com.smartdevicelink.proxy.rpc.enums.TriggerSource; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONException; import org.json.JSONObject; @@ -20,8 +20,8 @@ public class OnCommandTests extends BaseRpcTests{ protected RPCMessage createMessage(){ OnCommand msg = new OnCommand(); - msg.setCmdID(Test.GENERAL_INT); - msg.setTriggerSource(Test.GENERAL_TRIGGERSOURCE); + msg.setCmdID(TestValues.GENERAL_INT); + msg.setTriggerSource(TestValues.GENERAL_TRIGGERSOURCE); return msg; } @@ -41,10 +41,10 @@ public class OnCommandTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(OnCommand.KEY_CMD_ID, Test.GENERAL_INT); - result.put(OnCommand.KEY_TRIGGER_SOURCE, Test.GENERAL_TRIGGERSOURCE); + result.put(OnCommand.KEY_CMD_ID, TestValues.GENERAL_INT); + result.put(OnCommand.KEY_TRIGGER_SOURCE, TestValues.GENERAL_TRIGGERSOURCE); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -59,15 +59,15 @@ public class OnCommandTests extends BaseRpcTests{ TriggerSource triggerSource = ( (OnCommand) msg ).getTriggerSource(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, cmdId); - assertEquals(Test.MATCH, Test.GENERAL_TRIGGERSOURCE, triggerSource); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, cmdId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_TRIGGERSOURCE, triggerSource); // Invalid/Null Tests OnCommand msg = new OnCommand(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getTriggerSource()); - assertNull(Test.NULL, msg.getCmdID()); + assertNull(TestValues.NULL, msg.getTriggerSource()); + assertNull(TestValues.NULL, msg.getCmdID()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnDriverDistractionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnDriverDistractionTests.java index c334c7e82..bf0581cd0 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnDriverDistractionTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnDriverDistractionTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.OnDriverDistraction; import com.smartdevicelink.proxy.rpc.enums.DriverDistractionState; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONException; import org.json.JSONObject; @@ -44,7 +44,7 @@ public class OnDriverDistractionTests extends BaseRpcTests{ try{ result.put(OnDriverDistraction.KEY_STATE, STATUS); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -58,13 +58,13 @@ public class OnDriverDistractionTests extends BaseRpcTests{ DriverDistractionState cmdId = ( (OnDriverDistraction) msg ).getState(); // Valid Tests - assertEquals(Test.MATCH, STATUS, cmdId); + assertEquals(TestValues.MATCH, STATUS, cmdId); // Invalid/Null Tests OnDriverDistraction msg = new OnDriverDistraction(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getState()); + assertNull(TestValues.NULL, msg.getState()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnErrorTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnErrorTests.java index a907c8942..bcd3563f6 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnErrorTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnErrorTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.notifications; import com.smartdevicelink.proxy.callbacks.InternalProxyMessage; import com.smartdevicelink.proxy.callbacks.OnError; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -20,18 +20,18 @@ public class OnErrorTests extends TestCase { public void testValues () { // Valid Tests OnError testOnError = new OnError(); - assertEquals(Test.MATCH, InternalProxyMessage.OnProxyError, testOnError.getFunctionName()); + assertEquals(TestValues.MATCH, InternalProxyMessage.OnProxyError, testOnError.getFunctionName()); Exception testE = new Exception(); - testOnError = new OnError(Test.GENERAL_STRING, testE); - assertEquals(Test.MATCH, InternalProxyMessage.OnProxyError, testOnError.getFunctionName()); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testOnError.getInfo()); - assertEquals(Test.MATCH, testE, testOnError.getException()); + testOnError = new OnError(TestValues.GENERAL_STRING, testE); + assertEquals(TestValues.MATCH, InternalProxyMessage.OnProxyError, testOnError.getFunctionName()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testOnError.getInfo()); + assertEquals(TestValues.MATCH, testE, testOnError.getException()); // Invalid/Null Tests testOnError = new OnError(null, null); - assertEquals(Test.MATCH, InternalProxyMessage.OnProxyError, testOnError.getFunctionName()); - assertNull(Test.NULL, testOnError.getInfo()); - assertNull(Test.NULL, testOnError.getException()); + assertEquals(TestValues.MATCH, InternalProxyMessage.OnProxyError, testOnError.getFunctionName()); + assertNull(TestValues.NULL, testOnError.getInfo()); + assertNull(TestValues.NULL, testOnError.getException()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHMIStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHMIStatusTests.java index 56c41b213..70c9a728a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHMIStatusTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHMIStatusTests.java @@ -8,7 +8,7 @@ import com.smartdevicelink.proxy.rpc.enums.HMILevel; import com.smartdevicelink.proxy.rpc.enums.SystemContext; import com.smartdevicelink.proxy.rpc.enums.VideoStreamingState; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.util.Version; import org.json.JSONException; @@ -24,12 +24,12 @@ public class OnHMIStatusTests extends BaseRpcTests{ protected RPCMessage createMessage(){ OnHMIStatus msg = new OnHMIStatus(); - msg.setAudioStreamingState(Test.GENERAL_AUDIOSTREAMINGSTATE); - msg.setVideoStreamingState(Test.GENERAL_VIDEOSTREAMINGSTATE); - msg.setFirstRun(Test.GENERAL_BOOLEAN); - msg.setHmiLevel(Test.GENERAL_HMILEVEL); - msg.setSystemContext(Test.GENERAL_SYSTEMCONTEXT); - msg.setWindowID(Test.GENERAL_INT); + msg.setAudioStreamingState(TestValues.GENERAL_AUDIOSTREAMINGSTATE); + msg.setVideoStreamingState(TestValues.GENERAL_VIDEOSTREAMINGSTATE); + msg.setFirstRun(TestValues.GENERAL_BOOLEAN); + msg.setHmiLevel(TestValues.GENERAL_HMILEVEL); + msg.setSystemContext(TestValues.GENERAL_SYSTEMCONTEXT); + msg.setWindowID(TestValues.GENERAL_INT); return msg; } @@ -49,13 +49,13 @@ public class OnHMIStatusTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(OnHMIStatus.KEY_AUDIO_STREAMING_STATE, Test.GENERAL_AUDIOSTREAMINGSTATE); - result.put(OnHMIStatus.KEY_VIDEO_STREAMING_STATE, Test.GENERAL_VIDEOSTREAMINGSTATE); - result.put(OnHMIStatus.KEY_HMI_LEVEL, Test.GENERAL_HMILEVEL); - result.put(OnHMIStatus.KEY_SYSTEM_CONTEXT, Test.GENERAL_SYSTEMCONTEXT); - result.put(OnHMIStatus.KEY_WINDOW_ID, Test.GENERAL_INT); + result.put(OnHMIStatus.KEY_AUDIO_STREAMING_STATE, TestValues.GENERAL_AUDIOSTREAMINGSTATE); + result.put(OnHMIStatus.KEY_VIDEO_STREAMING_STATE, TestValues.GENERAL_VIDEOSTREAMINGSTATE); + result.put(OnHMIStatus.KEY_HMI_LEVEL, TestValues.GENERAL_HMILEVEL); + result.put(OnHMIStatus.KEY_SYSTEM_CONTEXT, TestValues.GENERAL_SYSTEMCONTEXT); + result.put(OnHMIStatus.KEY_WINDOW_ID, TestValues.GENERAL_INT); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -73,24 +73,24 @@ public class OnHMIStatusTests extends BaseRpcTests{ int testWindowID = ( (OnHMIStatus) msg ).getWindowID(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_AUDIOSTREAMINGSTATE, audioStreamingState); - assertEquals(Test.MATCH, Test.GENERAL_VIDEOSTREAMINGSTATE, videoStreamingState); - assertEquals(Test.MATCH, Test.GENERAL_HMILEVEL, hmiLevel); - assertEquals(Test.MATCH, Test.GENERAL_SYSTEMCONTEXT, context); - assertEquals(Test.MATCH, Test.GENERAL_INT, testWindowID); + assertEquals(TestValues.MATCH, TestValues.GENERAL_AUDIOSTREAMINGSTATE, audioStreamingState); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VIDEOSTREAMINGSTATE, videoStreamingState); + assertEquals(TestValues.MATCH, TestValues.GENERAL_HMILEVEL, hmiLevel); + assertEquals(TestValues.MATCH, TestValues.GENERAL_SYSTEMCONTEXT, context); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, testWindowID); // Invalid/Null Tests OnHMIStatus msg = new OnHMIStatus(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getAudioStreamingState()); + assertNull(TestValues.NULL, msg.getAudioStreamingState()); - assertNull(Test.NULL, msg.getVideoStreamingState()); + assertNull(TestValues.NULL, msg.getVideoStreamingState()); msg.format(new Version(4,5,0),true); - assertEquals(Test.MATCH, VideoStreamingState.STREAMABLE, msg.getVideoStreamingState()); - assertNull(Test.NULL, msg.getHmiLevel()); - assertNull(Test.NULL, msg.getSystemContext()); - assertNull(Test.NULL, msg.getWindowID()); + assertEquals(TestValues.MATCH, VideoStreamingState.STREAMABLE, msg.getVideoStreamingState()); + assertNull(TestValues.NULL, msg.getHmiLevel()); + assertNull(TestValues.NULL, msg.getSystemContext()); + assertNull(TestValues.NULL, msg.getWindowID()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHashChangeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHashChangeTests.java index cfc439a89..50b866314 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHashChangeTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHashChangeTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.OnHashChange; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONException; import org.json.JSONObject; @@ -43,7 +43,7 @@ public class OnHashChangeTests extends BaseRpcTests{ try{ result.put(OnHashChange.KEY_HASH_ID, HASH_ID); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -57,13 +57,13 @@ public class OnHashChangeTests extends BaseRpcTests{ String hashId = ( (OnHashChange) msg ).getHashID(); // Valid Tests - assertEquals(Test.MATCH, HASH_ID, hashId); + assertEquals(TestValues.MATCH, HASH_ID, hashId); // Invalid/Null Tests OnHashChange msg = new OnHashChange(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getHashID()); + assertNull(TestValues.NULL, msg.getHashID()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnInteriorVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnInteriorVehicleDataTests.java index 4fded53fe..ba20dbae0 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnInteriorVehicleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnInteriorVehicleDataTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.ModuleData; import com.smartdevicelink.proxy.rpc.OnInteriorVehicleData; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import org.json.JSONException; @@ -21,7 +21,7 @@ public class OnInteriorVehicleDataTests extends BaseRpcTests{ @Override protected RPCMessage createMessage(){ OnInteriorVehicleData msg = new OnInteriorVehicleData(); - msg.setModuleData(Test.GENERAL_MODULEDATA); + msg.setModuleData(TestValues.GENERAL_MODULEDATA); return msg; } @@ -41,9 +41,9 @@ public class OnInteriorVehicleDataTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(OnInteriorVehicleData.KEY_MODULE_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_MODULEDATA.getStore())); + result.put(OnInteriorVehicleData.KEY_MODULE_DATA, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_MODULEDATA.getStore())); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -57,13 +57,13 @@ public class OnInteriorVehicleDataTests extends BaseRpcTests{ ModuleData moduleData = ( (OnInteriorVehicleData) msg ).getModuleData(); // Valid Tests - assertTrue(Test.TRUE, Validator.validateModuleData(Test.GENERAL_MODULEDATA, moduleData)); + assertTrue(TestValues.TRUE, Validator.validateModuleData(TestValues.GENERAL_MODULEDATA, moduleData)); // Invalid/Null Tests OnInteriorVehicleData msg = new OnInteriorVehicleData(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getModuleData()); + assertNull(TestValues.NULL, msg.getModuleData()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnKeyboardInputTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnKeyboardInputTests.java index 4f541a84a..92e2a30cf 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnKeyboardInputTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnKeyboardInputTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.OnKeyboardInput; import com.smartdevicelink.proxy.rpc.enums.KeyboardEvent; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONException; import org.json.JSONObject; @@ -20,8 +20,8 @@ public class OnKeyboardInputTests extends BaseRpcTests{ protected RPCMessage createMessage(){ OnKeyboardInput msg = new OnKeyboardInput(); - msg.setData(Test.GENERAL_STRING); - msg.setEvent(Test.GENERAL_KEYBOARDEVENT); + msg.setData(TestValues.GENERAL_STRING); + msg.setEvent(TestValues.GENERAL_KEYBOARDEVENT); return msg; } @@ -41,10 +41,10 @@ public class OnKeyboardInputTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(OnKeyboardInput.KEY_DATA, Test.GENERAL_STRING); - result.put(OnKeyboardInput.KEY_EVENT, Test.GENERAL_KEYBOARDEVENT); + result.put(OnKeyboardInput.KEY_DATA, TestValues.GENERAL_STRING); + result.put(OnKeyboardInput.KEY_EVENT, TestValues.GENERAL_KEYBOARDEVENT); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -59,15 +59,15 @@ public class OnKeyboardInputTests extends BaseRpcTests{ String data = ( (OnKeyboardInput) msg ).getData(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_KEYBOARDEVENT, event); - assertEquals(Test.MATCH, Test.GENERAL_STRING, data); + assertEquals(TestValues.MATCH, TestValues.GENERAL_KEYBOARDEVENT, event); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, data); // Invalid/Null Tests OnKeyboardInput msg = new OnKeyboardInput(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getData()); - assertNull(Test.NULL, msg.getEvent()); + assertNull(TestValues.NULL, msg.getData()); + assertNull(TestValues.NULL, msg.getEvent()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLanguageChangeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLanguageChangeTests.java index 884851f4c..0f3ffae76 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLanguageChangeTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLanguageChangeTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.OnLanguageChange; import com.smartdevicelink.proxy.rpc.enums.Language; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONException; import org.json.JSONObject; @@ -20,8 +20,8 @@ public class OnLanguageChangeTests extends BaseRpcTests{ protected RPCMessage createMessage(){ OnLanguageChange msg = new OnLanguageChange(); - msg.setLanguage(Test.GENERAL_LANGUAGE); - msg.setHmiDisplayLanguage(Test.GENERAL_LANGUAGE); + msg.setLanguage(TestValues.GENERAL_LANGUAGE); + msg.setHmiDisplayLanguage(TestValues.GENERAL_LANGUAGE); return msg; } @@ -41,10 +41,10 @@ public class OnLanguageChangeTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(OnLanguageChange.KEY_LANGUAGE, Test.GENERAL_LANGUAGE); - result.put(OnLanguageChange.KEY_HMI_DISPLAY_LANGUAGE, Test.GENERAL_LANGUAGE); + result.put(OnLanguageChange.KEY_LANGUAGE, TestValues.GENERAL_LANGUAGE); + result.put(OnLanguageChange.KEY_HMI_DISPLAY_LANGUAGE, TestValues.GENERAL_LANGUAGE); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -59,15 +59,15 @@ public class OnLanguageChangeTests extends BaseRpcTests{ Language hmiLang = ( (OnLanguageChange) msg ).getHmiDisplayLanguage(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, lang); - assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, hmiLang); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LANGUAGE, lang); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LANGUAGE, hmiLang); // Invalid/Null Tests OnLanguageChange msg = new OnLanguageChange(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getLanguage()); - assertNull(Test.NULL, msg.getHmiDisplayLanguage()); + assertNull(TestValues.NULL, msg.getLanguage()); + assertNull(TestValues.NULL, msg.getHmiDisplayLanguage()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLockScreenStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLockScreenStatusTests.java index 0326cda53..a8afc88cc 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLockScreenStatusTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnLockScreenStatusTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.OnLockScreenStatus; import com.smartdevicelink.proxy.rpc.enums.HMILevel; import com.smartdevicelink.proxy.rpc.enums.LockScreenStatus; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONException; import org.json.JSONObject; @@ -22,10 +22,10 @@ public class OnLockScreenStatusTests extends BaseRpcTests{ protected RPCMessage createMessage(){ OnLockScreenStatus msg = new OnLockScreenStatus(); - msg.setDriverDistractionStatus(Test.GENERAL_BOOLEAN); - msg.setHMILevel(Test.GENERAL_HMILEVEL); - msg.setShowLockScreen(Test.GENERAL_LOCKSCREENSTATUS); - msg.setUserSelected(Test.GENERAL_BOOLEAN); + msg.setDriverDistractionStatus(TestValues.GENERAL_BOOLEAN); + msg.setHMILevel(TestValues.GENERAL_HMILEVEL); + msg.setShowLockScreen(TestValues.GENERAL_LOCKSCREENSTATUS); + msg.setUserSelected(TestValues.GENERAL_BOOLEAN); return msg; } @@ -45,12 +45,12 @@ public class OnLockScreenStatusTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(OnLockScreenStatus.KEY_DRIVER_DISTRACTION, Test.GENERAL_BOOLEAN); - result.put(OnHMIStatus.KEY_HMI_LEVEL, Test.GENERAL_HMILEVEL); - result.put(OnLockScreenStatus.KEY_SHOW_LOCK_SCREEN, Test.GENERAL_LOCKSCREENSTATUS); - result.put(OnLockScreenStatus.KEY_USER_SELECTED, Test.GENERAL_BOOLEAN); + result.put(OnLockScreenStatus.KEY_DRIVER_DISTRACTION, TestValues.GENERAL_BOOLEAN); + result.put(OnHMIStatus.KEY_HMI_LEVEL, TestValues.GENERAL_HMILEVEL); + result.put(OnLockScreenStatus.KEY_SHOW_LOCK_SCREEN, TestValues.GENERAL_LOCKSCREENSTATUS); + result.put(OnLockScreenStatus.KEY_USER_SELECTED, TestValues.GENERAL_BOOLEAN); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -67,19 +67,19 @@ public class OnLockScreenStatusTests extends BaseRpcTests{ boolean userSelected = ( (OnLockScreenStatus) msg ).getUserSelected(); // Valid Tests - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, status); - assertEquals(Test.MATCH, Test.GENERAL_HMILEVEL, hmiLevel); - assertEquals(Test.MATCH, Test.GENERAL_LOCKSCREENSTATUS, lockScreen); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, userSelected); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, status); + assertEquals(TestValues.MATCH, TestValues.GENERAL_HMILEVEL, hmiLevel); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LOCKSCREENSTATUS, lockScreen); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, userSelected); // Invalid/Null Tests OnLockScreenStatus msg = new OnLockScreenStatus(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getDriverDistractionStatus()); - assertNull(Test.NULL, msg.getHMILevel()); - assertNull(Test.NULL, msg.getShowLockScreen()); - assertNull(Test.NULL, msg.getUserSelected()); + assertNull(TestValues.NULL, msg.getDriverDistractionStatus()); + assertNull(TestValues.NULL, msg.getHMILevel()); + assertNull(TestValues.NULL, msg.getShowLockScreen()); + assertNull(TestValues.NULL, msg.getUserSelected()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnPermissionsChangeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnPermissionsChangeTests.java index 5064753c6..10c1313f7 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnPermissionsChangeTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnPermissionsChangeTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.OnPermissionsChange; import com.smartdevicelink.proxy.rpc.PermissionItem; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import org.json.JSONException; @@ -23,8 +23,8 @@ public class OnPermissionsChangeTests extends BaseRpcTests{ protected RPCMessage createMessage(){ OnPermissionsChange msg = new OnPermissionsChange(); - msg.setPermissionItem(Test.GENERAL_PERMISSIONITEM_LIST); - msg.setRequireEncryption(Test.GENERAL_BOOLEAN); + msg.setPermissionItem(TestValues.GENERAL_PERMISSIONITEM_LIST); + msg.setRequireEncryption(TestValues.GENERAL_BOOLEAN); return msg; } @@ -44,10 +44,10 @@ public class OnPermissionsChangeTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(OnPermissionsChange.KEY_PERMISSION_ITEM, Test.JSON_PERMISSIONITEMS); - result.put(OnPermissionsChange.KEY_REQUIRE_ENCRYPTION, Test.GENERAL_BOOLEAN); + result.put(OnPermissionsChange.KEY_PERMISSION_ITEM, TestValues.JSON_PERMISSIONITEMS); + result.put(OnPermissionsChange.KEY_REQUIRE_ENCRYPTION, TestValues.GENERAL_BOOLEAN); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -61,18 +61,18 @@ public class OnPermissionsChangeTests extends BaseRpcTests{ List<PermissionItem> data = ( (OnPermissionsChange) msg ).getPermissionItem(); boolean isRequired = ((OnPermissionsChange)msg).getRequireEncryption(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_PERMISSIONITEM_LIST.size(), data.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_PERMISSIONITEM_LIST.size(), data.size()); for(int i=0; i<data.size(); i++){ - assertTrue(Test.TRUE, Validator.validatePermissionItem(Test.GENERAL_PERMISSIONITEM_LIST.get(i), data.get(i))); + assertTrue(TestValues.TRUE, Validator.validatePermissionItem(TestValues.GENERAL_PERMISSIONITEM_LIST.get(i), data.get(i))); } - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, isRequired); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, isRequired); // Invalid/Null Tests OnPermissionsChange msg = new OnPermissionsChange(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getRequireEncryption()); + assertNull(TestValues.NULL, msg.getRequireEncryption()); - assertNull(Test.NULL, msg.getPermissionItem()); + assertNull(TestValues.NULL, msg.getPermissionItem()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyClosedTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyClosedTests.java index defede878..efa954b24 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyClosedTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyClosedTests.java @@ -3,7 +3,7 @@ package com.smartdevicelink.test.rpc.notifications; import com.smartdevicelink.proxy.callbacks.InternalProxyMessage; import com.smartdevicelink.proxy.callbacks.OnProxyClosed; import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -21,21 +21,21 @@ public class OnProxyClosedTests extends TestCase { public void testValues () { // Valid Tests OnProxyClosed testOnProxyClosed = new OnProxyClosed(); - assertEquals(Test.MATCH, InternalProxyMessage.OnProxyClosed, testOnProxyClosed.getFunctionName()); + assertEquals(TestValues.MATCH, InternalProxyMessage.OnProxyClosed, testOnProxyClosed.getFunctionName()); Exception testE = new Exception(); SdlDisconnectedReason testReason = SdlDisconnectedReason.DEFAULT; - testOnProxyClosed = new OnProxyClosed(Test.GENERAL_STRING, testE, testReason); - assertEquals(Test.MATCH, InternalProxyMessage.OnProxyClosed, testOnProxyClosed.getFunctionName()); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testOnProxyClosed.getInfo()); - assertEquals(Test.MATCH, testE, testOnProxyClosed.getException()); - assertEquals(Test.MATCH, testReason, testOnProxyClosed.getReason()); + testOnProxyClosed = new OnProxyClosed(TestValues.GENERAL_STRING, testE, testReason); + assertEquals(TestValues.MATCH, InternalProxyMessage.OnProxyClosed, testOnProxyClosed.getFunctionName()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testOnProxyClosed.getInfo()); + assertEquals(TestValues.MATCH, testE, testOnProxyClosed.getException()); + assertEquals(TestValues.MATCH, testReason, testOnProxyClosed.getReason()); // Invalid/Null Tests testOnProxyClosed = new OnProxyClosed(null, null, null); - assertEquals(Test.MATCH, InternalProxyMessage.OnProxyClosed, testOnProxyClosed.getFunctionName()); - assertNull(Test.NULL, testOnProxyClosed.getInfo()); - assertNull(Test.NULL, testOnProxyClosed.getException()); - assertNull(Test.NULL, testOnProxyClosed.getReason()); + assertEquals(TestValues.MATCH, InternalProxyMessage.OnProxyClosed, testOnProxyClosed.getFunctionName()); + assertNull(TestValues.NULL, testOnProxyClosed.getInfo()); + assertNull(TestValues.NULL, testOnProxyClosed.getException()); + assertNull(TestValues.NULL, testOnProxyClosed.getReason()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyOpenedTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyOpenedTests.java index 312d5abd1..6daef5687 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyOpenedTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyOpenedTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.rpc.notifications; import com.smartdevicelink.proxy.callbacks.InternalProxyMessage; import com.smartdevicelink.proxy.callbacks.OnProxyOpened; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import junit.framework.TestCase; @@ -20,7 +20,7 @@ public class OnProxyOpenedTests extends TestCase { */ public void testMethods () { OnProxyOpened testOnProxyOpened = new OnProxyOpened(); - assertNotNull(Test.NOT_NULL, testOnProxyOpened); - assertEquals(Test.MATCH, InternalProxyMessage.OnProxyOpened, testOnProxyOpened.getFunctionName()); + assertNotNull(TestValues.NOT_NULL, testOnProxyOpened); + assertEquals(TestValues.MATCH, InternalProxyMessage.OnProxyOpened, testOnProxyOpened.getFunctionName()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnRCStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnRCStatusTests.java index a6d4d63fd..319b6373c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnRCStatusTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnRCStatusTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.ModuleData; import com.smartdevicelink.proxy.rpc.OnRCStatus; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONArray; import org.json.JSONException; @@ -20,15 +20,15 @@ public class OnRCStatusTests extends BaseRpcTests { protected RPCMessage createMessage() { OnRCStatus msg = new OnRCStatus(); - List<ModuleData> listAllocatedModules = Test.GENERAL_MODULEDATA_LIST; + List<ModuleData> listAllocatedModules = TestValues.GENERAL_MODULEDATA_LIST; msg.setAllocatedModules(listAllocatedModules); List<ModuleData> listFreeModules = new ArrayList<>(); - listFreeModules.add(Test.GENERAL_MODULEDATA); + listFreeModules.add(TestValues.GENERAL_MODULEDATA); msg.setFreeModules(listFreeModules); - msg.setAllowed(Test.GENERAL_BOOLEAN); + msg.setAllowed(TestValues.GENERAL_BOOLEAN); return msg; } @@ -49,8 +49,8 @@ public class OnRCStatusTests extends BaseRpcTests { JSONArray jsonArrayAllocatedModules = new JSONArray(); JSONArray jsonArrayFreeModules = new JSONArray(); try { - jsonArrayAllocatedModules.put(JsonRPCMarshaller.serializeHashtable(Test.GENERAL_MODULEDATA.getStore())); - jsonArrayFreeModules.put(JsonRPCMarshaller.serializeHashtable(Test.GENERAL_MODULEDATA.getStore())); + jsonArrayAllocatedModules.put(JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_MODULEDATA.getStore())); + jsonArrayFreeModules.put(JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_MODULEDATA.getStore())); } catch (JSONException e) { e.printStackTrace(); } @@ -58,7 +58,7 @@ public class OnRCStatusTests extends BaseRpcTests { try { result.put(OnRCStatus.KEY_ALLOCATED_MODULES, jsonArrayAllocatedModules); result.put(OnRCStatus.KEY_FREE_MODULES, jsonArrayFreeModules); - result.put(OnRCStatus.KEY_ALLOWED, Test.GENERAL_BOOLEAN); + result.put(OnRCStatus.KEY_ALLOWED, TestValues.GENERAL_BOOLEAN); } catch (JSONException e) { e.printStackTrace(); } @@ -76,17 +76,17 @@ public class OnRCStatusTests extends BaseRpcTests { Boolean allowed = ((OnRCStatus) msg).getAllowed(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_MODULEDATA, listAllocatedModules.get(0)); - assertEquals(Test.MATCH, Test.GENERAL_MODULEDATA, listFreeModules.get(0)); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, allowed); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MODULEDATA, listAllocatedModules.get(0)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MODULEDATA, listFreeModules.get(0)); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, allowed); // Invalid/Null Tests OnRCStatus msg = new OnRCStatus(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getAllocatedModules()); - assertNull(Test.NULL, msg.getFreeModules()); - assertNull(Test.NULL, msg.getAllowed()); + assertNull(TestValues.NULL, msg.getAllocatedModules()); + assertNull(TestValues.NULL, msg.getFreeModules()); + assertNull(TestValues.NULL, msg.getAllowed()); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSdlChoiceChosenTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSdlChoiceChosenTests.java index 7146ca0cf..af0a2aba1 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSdlChoiceChosenTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSdlChoiceChosenTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.rpc.OnSdlChoiceChosen; import com.smartdevicelink.proxy.rpc.OnSdlChoiceChosen.SdlChoice; import com.smartdevicelink.proxy.rpc.enums.TriggerSource; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import org.json.JSONException; @@ -23,9 +23,9 @@ public class OnSdlChoiceChosenTests extends BaseRpcTests{ @Override protected RPCMessage createMessage(){ OnSdlChoiceChosen msg = new OnSdlChoiceChosen(); - sdlChoice = msg.new SdlChoice(Test.GENERAL_CHOICE); + sdlChoice = msg.new SdlChoice(TestValues.GENERAL_CHOICE); - msg.setTriggerSource(Test.GENERAL_TRIGGERSOURCE); + msg.setTriggerSource(TestValues.GENERAL_TRIGGERSOURCE); msg.setSdlChoice(sdlChoice); return msg; @@ -46,10 +46,10 @@ public class OnSdlChoiceChosenTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(OnSdlChoiceChosen.KEY_TRIGGER_SOURCE, Test.GENERAL_TRIGGERSOURCE); + result.put(OnSdlChoiceChosen.KEY_TRIGGER_SOURCE, TestValues.GENERAL_TRIGGERSOURCE); result.put(OnSdlChoiceChosen.KEY_SDL_CHOICE, sdlChoice); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -64,15 +64,15 @@ public class OnSdlChoiceChosenTests extends BaseRpcTests{ TriggerSource source = ( (OnSdlChoiceChosen) msg ).getTriggerSource(); // Valid Tests - assertTrue(Test.MATCH, Validator.validateChoice(Test.GENERAL_CHOICE, data.getChoice())); - assertEquals(Test.MATCH, Test.GENERAL_TRIGGERSOURCE, source); + assertTrue(TestValues.MATCH, Validator.validateChoice(TestValues.GENERAL_CHOICE, data.getChoice())); + assertEquals(TestValues.MATCH, TestValues.GENERAL_TRIGGERSOURCE, source); // Invalid/Null Tests OnSdlChoiceChosen msg = new OnSdlChoiceChosen(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getTriggerSource()); - assertNull(Test.NULL, msg.getSdlChoice()); + assertNull(TestValues.NULL, msg.getTriggerSource()); + assertNull(TestValues.NULL, msg.getSdlChoice()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnStreamRPCTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnStreamRPCTests.java index 58db7d8eb..5e5a4d3b0 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnStreamRPCTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnStreamRPCTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.OnStreamRPC; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONException; import org.json.JSONObject; @@ -18,9 +18,9 @@ public class OnStreamRPCTests extends BaseRpcTests { protected RPCMessage createMessage(){ OnStreamRPC msg = new OnStreamRPC(); - msg.setBytesComplete(Test.GENERAL_LONG); - msg.setFileName(Test.GENERAL_STRING); - msg.setFileSize(Test.GENERAL_LONG); + msg.setBytesComplete(TestValues.GENERAL_LONG); + msg.setFileName(TestValues.GENERAL_STRING); + msg.setFileSize(TestValues.GENERAL_LONG); return msg; } @@ -40,11 +40,11 @@ public class OnStreamRPCTests extends BaseRpcTests { JSONObject result = new JSONObject(); try{ - result.put(OnStreamRPC.KEY_BYTESCOMPLETE, Test.GENERAL_LONG); - result.put(OnStreamRPC.KEY_FILENAME, Test.GENERAL_STRING); - result.put(OnStreamRPC.KEY_FILESIZE, Test.GENERAL_LONG); + result.put(OnStreamRPC.KEY_BYTESCOMPLETE, TestValues.GENERAL_LONG); + result.put(OnStreamRPC.KEY_FILENAME, TestValues.GENERAL_STRING); + result.put(OnStreamRPC.KEY_FILESIZE, TestValues.GENERAL_LONG); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -60,17 +60,17 @@ public class OnStreamRPCTests extends BaseRpcTests { Long fileSize = ((OnStreamRPC) msg).getFileSize(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_LONG, bytes); - assertEquals(Test.MATCH, Test.GENERAL_STRING, fileName); - assertEquals(Test.MATCH, Test.GENERAL_LONG, fileSize); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LONG, bytes); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, fileName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LONG, fileSize); // Invalid/Null Tests OnStreamRPC msg = new OnStreamRPC(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getBytesComplete()); - assertNull(Test.NULL, msg.getFileName()); - assertNull(Test.NULL, msg.getFileSize()); + assertNull(TestValues.NULL, msg.getBytesComplete()); + assertNull(TestValues.NULL, msg.getFileName()); + assertNull(TestValues.NULL, msg.getFileSize()); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemCapabilityUpdatedTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemCapabilityUpdatedTests.java index ca0fa5f02..b9e12bb35 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemCapabilityUpdatedTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemCapabilityUpdatedTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.OnSystemCapabilityUpdated; import com.smartdevicelink.proxy.rpc.SystemCapability; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONException; import org.json.JSONObject; @@ -20,7 +20,7 @@ public class OnSystemCapabilityUpdatedTests extends BaseRpcTests { protected RPCMessage createMessage(){ OnSystemCapabilityUpdated msg = new OnSystemCapabilityUpdated(); - msg.setSystemCapability(Test.GENERAL_SYSTEMCAPABILITY); + msg.setSystemCapability(TestValues.GENERAL_SYSTEMCAPABILITY); return msg; } @@ -40,9 +40,9 @@ public class OnSystemCapabilityUpdatedTests extends BaseRpcTests { JSONObject result = new JSONObject(); try{ - result.put(OnSystemCapabilityUpdated.KEY_SYSTEM_CAPABILITY, Test.GENERAL_SYSTEMCAPABILITY.serializeJSON()); + result.put(OnSystemCapabilityUpdated.KEY_SYSTEM_CAPABILITY, TestValues.GENERAL_SYSTEMCAPABILITY.serializeJSON()); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -56,18 +56,18 @@ public class OnSystemCapabilityUpdatedTests extends BaseRpcTests { SystemCapability cmdId = ( (OnSystemCapabilityUpdated) msg ).getSystemCapability(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_SYSTEMCAPABILITY, cmdId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_SYSTEMCAPABILITY, cmdId); // Invalid/Null Tests OnSystemCapabilityUpdated msg = new OnSystemCapabilityUpdated(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getSystemCapability()); + assertNull(TestValues.NULL, msg.getSystemCapability()); // test constructor with param - msg = new OnSystemCapabilityUpdated(Test.GENERAL_SYSTEMCAPABILITY); + msg = new OnSystemCapabilityUpdated(TestValues.GENERAL_SYSTEMCAPABILITY); SystemCapability systemCapability = msg.getSystemCapability(); - assertEquals(systemCapability, Test.GENERAL_SYSTEMCAPABILITY); + assertEquals(systemCapability, TestValues.GENERAL_SYSTEMCAPABILITY); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemRequestTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemRequestTests.java index d4490dd15..0815f3c01 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemRequestTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnSystemRequestTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.OnSystemRequest; import com.smartdevicelink.proxy.rpc.enums.FileType; import com.smartdevicelink.proxy.rpc.enums.RequestType; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import org.json.JSONException; @@ -23,13 +23,13 @@ public class OnSystemRequestTests extends BaseRpcTests{ protected RPCMessage createMessage(){ OnSystemRequest msg = new OnSystemRequest(); - msg.setFileType(Test.GENERAL_FILETYPE); - msg.setLength(Test.GENERAL_LONG); - msg.setOffset(Test.GENERAL_LONG); - msg.setRequestType(Test.GENERAL_REQUESTTYPE); - msg.setRequestSubType(Test.GENERAL_STRING); - msg.setTimeout(Test.GENERAL_INT); - msg.setUrl(Test.GENERAL_STRING); + msg.setFileType(TestValues.GENERAL_FILETYPE); + msg.setLength(TestValues.GENERAL_LONG); + msg.setOffset(TestValues.GENERAL_LONG); + msg.setRequestType(TestValues.GENERAL_REQUESTTYPE); + msg.setRequestSubType(TestValues.GENERAL_STRING); + msg.setTimeout(TestValues.GENERAL_INT); + msg.setUrl(TestValues.GENERAL_STRING); return msg; } @@ -49,15 +49,15 @@ public class OnSystemRequestTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(OnSystemRequest.KEY_FILE_TYPE, Test.GENERAL_FILETYPE); - result.put(OnSystemRequest.KEY_LENGTH, Test.GENERAL_LONG); - result.put(OnSystemRequest.KEY_TIMEOUT, Test.GENERAL_INT); - result.put(OnSystemRequest.KEY_OFFSET, Test.GENERAL_LONG); - result.put(OnSystemRequest.KEY_URL, Test.GENERAL_STRING); - result.put(OnSystemRequest.KEY_REQUEST_TYPE, Test.GENERAL_REQUESTTYPE); - result.put(OnSystemRequest.KEY_REQUEST_SUB_TYPE, Test.GENERAL_STRING); + result.put(OnSystemRequest.KEY_FILE_TYPE, TestValues.GENERAL_FILETYPE); + result.put(OnSystemRequest.KEY_LENGTH, TestValues.GENERAL_LONG); + result.put(OnSystemRequest.KEY_TIMEOUT, TestValues.GENERAL_INT); + result.put(OnSystemRequest.KEY_OFFSET, TestValues.GENERAL_LONG); + result.put(OnSystemRequest.KEY_URL, TestValues.GENERAL_STRING); + result.put(OnSystemRequest.KEY_REQUEST_TYPE, TestValues.GENERAL_REQUESTTYPE); + result.put(OnSystemRequest.KEY_REQUEST_SUB_TYPE, TestValues.GENERAL_STRING); } catch(JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -78,28 +78,28 @@ public class OnSystemRequestTests extends BaseRpcTests{ // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_FILETYPE, fileType); - assertEquals(Test.MATCH, Test.GENERAL_LONG, length); - assertEquals(Test.MATCH, Test.GENERAL_INT, timeout); - assertEquals(Test.MATCH, Test.GENERAL_LONG, offset); - assertEquals(Test.MATCH, Test.GENERAL_STRING, url); - assertEquals(Test.MATCH, Test.GENERAL_REQUESTTYPE, requestType); - assertEquals(Test.MATCH, Test.GENERAL_STRING, requestSubType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_FILETYPE, fileType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LONG, length); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, timeout); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LONG, offset); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, url); + assertEquals(TestValues.MATCH, TestValues.GENERAL_REQUESTTYPE, requestType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, requestSubType); // Test Body OnSystemRequest osr = (OnSystemRequest) msg; String body = osr.getBody(); - assertNull(Test.NULL, body); + assertNull(TestValues.NULL, body); String testBody = "123ABC"; osr.setBody(testBody); String readBody = osr.getBody(); - assertEquals(Test.MATCH, testBody, readBody); + assertEquals(TestValues.MATCH, testBody, readBody); // Test Headers Headers headers = osr.getHeader(); - assertNull(Test.NULL, headers); + assertNull(TestValues.NULL, headers); Headers testHeaders = new Headers(); testHeaders.setCharset("ASCII"); @@ -115,19 +115,19 @@ public class OnSystemRequestTests extends BaseRpcTests{ osr.setHeaders(testHeaders); Headers readHeaders = osr.getHeader(); - assertTrue(Test.TRUE, Validator.validateHeaders(testHeaders, readHeaders)); + assertTrue(TestValues.TRUE, Validator.validateHeaders(testHeaders, readHeaders)); // Invalid/Null Tests OnSystemRequest msg = new OnSystemRequest(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getFileType()); - assertNull(Test.NULL, msg.getLength()); - assertNull(Test.NULL, msg.getOffset()); - assertNull(Test.NULL, msg.getTimeout()); - assertNull(Test.NULL, msg.getUrl()); - assertNull(Test.NULL, msg.getRequestType()); - assertNull(Test.NULL, msg.getRequestSubType()); + assertNull(TestValues.NULL, msg.getFileType()); + assertNull(TestValues.NULL, msg.getLength()); + assertNull(TestValues.NULL, msg.getOffset()); + assertNull(TestValues.NULL, msg.getTimeout()); + assertNull(TestValues.NULL, msg.getUrl()); + assertNull(TestValues.NULL, msg.getRequestType()); + assertNull(TestValues.NULL, msg.getRequestSubType()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTBTClientStateTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTBTClientStateTests.java index 3b8b8fa3f..e9e7a14e3 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTBTClientStateTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTBTClientStateTests.java @@ -5,7 +5,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.OnTBTClientState; import com.smartdevicelink.proxy.rpc.enums.TBTState; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONException; import org.json.JSONObject; @@ -20,7 +20,7 @@ public class OnTBTClientStateTests extends BaseRpcTests{ protected RPCMessage createMessage(){ OnTBTClientState msg = new OnTBTClientState(); - msg.setState(Test.GENERAL_TBTSTATE); + msg.setState(TestValues.GENERAL_TBTSTATE); return msg; } @@ -40,9 +40,9 @@ public class OnTBTClientStateTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(OnTBTClientState.KEY_STATE, Test.GENERAL_TBTSTATE); + result.put(OnTBTClientState.KEY_STATE, TestValues.GENERAL_TBTSTATE); } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -56,13 +56,13 @@ public class OnTBTClientStateTests extends BaseRpcTests{ TBTState data = ( (OnTBTClientState) msg ).getState(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_TBTSTATE, data); + assertEquals(TestValues.MATCH, TestValues.GENERAL_TBTSTATE, data); // Invalid/Null Tests OnTBTClientState msg = new OnTBTClientState(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getState()); + assertNull(TestValues.NULL, msg.getState()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTouchEventTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTouchEventTests.java index a978d12e7..70506eeea 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTouchEventTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnTouchEventTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.rpc.OnTouchEvent; import com.smartdevicelink.proxy.rpc.TouchEvent; import com.smartdevicelink.proxy.rpc.enums.TouchType; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import org.json.JSONException; @@ -23,8 +23,8 @@ public class OnTouchEventTests extends BaseRpcTests{ @Override protected RPCMessage createMessage(){ OnTouchEvent msg = new OnTouchEvent(); - msg.setType(Test.GENERAL_TOUCHTYPE); - msg.setEvent(Test.GENERAL_TOUCHEVENT_LIST); + msg.setType(TestValues.GENERAL_TOUCHTYPE); + msg.setEvent(TestValues.GENERAL_TOUCHEVENT_LIST); return msg; } @@ -44,10 +44,10 @@ public class OnTouchEventTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(OnTouchEvent.KEY_TYPE,Test.GENERAL_TOUCHTYPE); - result.put(OnTouchEvent.KEY_EVENT, Test.JSON_TOUCHEVENTS); + result.put(OnTouchEvent.KEY_TYPE, TestValues.GENERAL_TOUCHTYPE); + result.put(OnTouchEvent.KEY_EVENT, TestValues.JSON_TOUCHEVENTS); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -62,20 +62,20 @@ public class OnTouchEventTests extends BaseRpcTests{ List<TouchEvent> event = ( (OnTouchEvent) msg ).getEvent(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_TOUCHTYPE, type); - assertEquals(Test.MATCH, Test.GENERAL_TOUCHEVENT_LIST.size(), event.size()); - for(int i=0; i< Test.GENERAL_TOUCHEVENT_LIST.size(); i++){ - TouchEvent referenceEvent = Test.GENERAL_TOUCHEVENT_LIST.get(i); + assertEquals(TestValues.MATCH, TestValues.GENERAL_TOUCHTYPE, type); + assertEquals(TestValues.MATCH, TestValues.GENERAL_TOUCHEVENT_LIST.size(), event.size()); + for(int i = 0; i< TestValues.GENERAL_TOUCHEVENT_LIST.size(); i++){ + TouchEvent referenceEvent = TestValues.GENERAL_TOUCHEVENT_LIST.get(i); TouchEvent dataEvent = event.get(i); - assertTrue(Test.TRUE, Validator.validateTouchEvent(referenceEvent, dataEvent)); + assertTrue(TestValues.TRUE, Validator.validateTouchEvent(referenceEvent, dataEvent)); } // Invalid/Null Tests OnTouchEvent msg = new OnTouchEvent(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getType()); - assertNull(Test.NULL, msg.getEvent()); + assertNull(TestValues.NULL, msg.getType()); + assertNull(TestValues.NULL, msg.getEvent()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java index e366e832f..daae07db4 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java @@ -25,7 +25,7 @@ import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus; import com.smartdevicelink.proxy.rpc.enums.WiperStatus; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.VehicleDataHelper; @@ -92,9 +92,9 @@ public class OnVehicleDataTests extends BaseRpcTests{ result.put(OnVehicleData.KEY_FUEL_RANGE, VehicleDataHelper.JSON_FUEL_RANGE); result.put(OnVehicleData.KEY_TURN_SIGNAL, VehicleDataHelper.TURN_SIGNAL); result.put(OnVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS); - result.put(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE); + result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE); } catch(JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -134,75 +134,75 @@ public class OnVehicleDataTests extends BaseRpcTests{ List<FuelRange> fuelRangeList = ( (OnVehicleData) msg).getFuelRange(); TurnSignal turnSignal = ( (OnVehicleData) msg).getTurnSignal(); ElectronicParkBrakeStatus electronicParkBrakeStatus = ( (OnVehicleData) msg).getElectronicParkBrakeStatus(); - Object oemCustomVehicleData = ( (OnVehicleData) msg).getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); + Object oemCustomVehicleData = ( (OnVehicleData) msg).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); // Valid Tests - assertEquals(Test.MATCH, VehicleDataHelper.SPEED, speed); - assertEquals(Test.MATCH, VehicleDataHelper.RPM, rpm); - assertEquals(Test.MATCH, VehicleDataHelper.EXTERNAL_TEMPERATURE, external); - assertEquals(Test.MATCH, VehicleDataHelper.FUEL_LEVEL, fuelLevel); - assertEquals(Test.MATCH, VehicleDataHelper.VIN, vin); - assertEquals(Test.MATCH, VehicleDataHelper.PRNDL_FINAL, prndl); - assertTrue(Test.MATCH, Validator.validateTireStatus(VehicleDataHelper.TIRE_PRESSURE, pressure)); - assertEquals(Test.MATCH, VehicleDataHelper.ENGINE_TORQUE, torque); - assertEquals(Test.MATCH, VehicleDataHelper.ENGINE_OIL_LIFE, engineOilLife); - assertEquals(Test.MATCH, VehicleDataHelper.ODOMETER, odometer); - assertTrue(Test.MATCH, Validator.validateGpsData(VehicleDataHelper.GPS, gps)); - assertEquals(Test.MATCH, VehicleDataHelper.FUEL_LEVEL_STATE, state); - assertEquals(Test.MATCH, VehicleDataHelper.INSTANT_FUEL_CONSUMPTION, consumption); - assertTrue(Test.TRUE, Validator.validateBeltStatus(VehicleDataHelper.BELT_STATUS, belt)); - assertTrue(Test.TRUE, Validator.validateBodyInformation(VehicleDataHelper.BODY_INFORMATION, body)); - assertTrue(Test.TRUE, Validator.validateDeviceStatus(VehicleDataHelper.DEVICE_STATUS, device)); - assertEquals(Test.MATCH, VehicleDataHelper.DRIVER_BRAKING, brake); - assertEquals(Test.MATCH, VehicleDataHelper.WIPER_STATUS, wiper); - assertTrue(Test.TRUE, Validator.validateHeadLampStatus(VehicleDataHelper.HEAD_LAMP_STATUS, lamp)); - assertEquals(Test.MATCH, VehicleDataHelper.ACC_PEDAL_POSITION, pedal); - assertEquals(Test.MATCH, VehicleDataHelper.STEERING_WHEEL_ANGLE, wheel); - assertTrue(Test.TRUE, Validator.validateECallInfo(VehicleDataHelper.E_CALL_INFO, ecall)); - assertTrue(Test.TRUE, Validator.validateAirbagStatus(VehicleDataHelper.AIRBAG_STATUS, airbag)); - assertTrue(Test.TRUE, Validator.validateEmergencyEvent(VehicleDataHelper.EMERGENCY_EVENT, event)); - assertTrue(Test.TRUE, Validator.validateClusterModeStatus(VehicleDataHelper.CLUSTER_MODE_STATUS, cluster)); - assertTrue(Test.TRUE, Validator.validateMyKey(VehicleDataHelper.MY_KEY, key)); - assertTrue(Test.TRUE, Validator.validateFuelRange(VehicleDataHelper.FUEL_RANGE_LIST, fuelRangeList)); - assertEquals(Test.MATCH, VehicleDataHelper.TURN_SIGNAL, turnSignal); - assertEquals(Test.MATCH, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus); - assertEquals(Test.MATCH, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE, oemCustomVehicleData); + assertEquals(TestValues.MATCH, VehicleDataHelper.SPEED, speed); + assertEquals(TestValues.MATCH, VehicleDataHelper.RPM, rpm); + assertEquals(TestValues.MATCH, VehicleDataHelper.EXTERNAL_TEMPERATURE, external); + assertEquals(TestValues.MATCH, VehicleDataHelper.FUEL_LEVEL, fuelLevel); + assertEquals(TestValues.MATCH, VehicleDataHelper.VIN, vin); + assertEquals(TestValues.MATCH, VehicleDataHelper.PRNDL_FINAL, prndl); + assertTrue(TestValues.MATCH, Validator.validateTireStatus(VehicleDataHelper.TIRE_PRESSURE, pressure)); + assertEquals(TestValues.MATCH, VehicleDataHelper.ENGINE_TORQUE, torque); + assertEquals(TestValues.MATCH, VehicleDataHelper.ENGINE_OIL_LIFE, engineOilLife); + assertEquals(TestValues.MATCH, VehicleDataHelper.ODOMETER, odometer); + assertTrue(TestValues.MATCH, Validator.validateGpsData(VehicleDataHelper.GPS, gps)); + assertEquals(TestValues.MATCH, VehicleDataHelper.FUEL_LEVEL_STATE, state); + assertEquals(TestValues.MATCH, VehicleDataHelper.INSTANT_FUEL_CONSUMPTION, consumption); + assertTrue(TestValues.TRUE, Validator.validateBeltStatus(VehicleDataHelper.BELT_STATUS, belt)); + assertTrue(TestValues.TRUE, Validator.validateBodyInformation(VehicleDataHelper.BODY_INFORMATION, body)); + assertTrue(TestValues.TRUE, Validator.validateDeviceStatus(VehicleDataHelper.DEVICE_STATUS, device)); + assertEquals(TestValues.MATCH, VehicleDataHelper.DRIVER_BRAKING, brake); + assertEquals(TestValues.MATCH, VehicleDataHelper.WIPER_STATUS, wiper); + assertTrue(TestValues.TRUE, Validator.validateHeadLampStatus(VehicleDataHelper.HEAD_LAMP_STATUS, lamp)); + assertEquals(TestValues.MATCH, VehicleDataHelper.ACC_PEDAL_POSITION, pedal); + assertEquals(TestValues.MATCH, VehicleDataHelper.STEERING_WHEEL_ANGLE, wheel); + assertTrue(TestValues.TRUE, Validator.validateECallInfo(VehicleDataHelper.E_CALL_INFO, ecall)); + assertTrue(TestValues.TRUE, Validator.validateAirbagStatus(VehicleDataHelper.AIRBAG_STATUS, airbag)); + assertTrue(TestValues.TRUE, Validator.validateEmergencyEvent(VehicleDataHelper.EMERGENCY_EVENT, event)); + assertTrue(TestValues.TRUE, Validator.validateClusterModeStatus(VehicleDataHelper.CLUSTER_MODE_STATUS, cluster)); + assertTrue(TestValues.TRUE, Validator.validateMyKey(VehicleDataHelper.MY_KEY, key)); + assertTrue(TestValues.TRUE, Validator.validateFuelRange(VehicleDataHelper.FUEL_RANGE_LIST, fuelRangeList)); + assertEquals(TestValues.MATCH, VehicleDataHelper.TURN_SIGNAL, turnSignal); + assertEquals(TestValues.MATCH, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus); + assertEquals(TestValues.MATCH, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE, oemCustomVehicleData); // Invalid/Null Tests OnVehicleData msg = new OnVehicleData(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getSpeed()); - assertNull(Test.NULL, msg.getRpm()); - assertNull(Test.NULL, msg.getExternalTemperature()); - assertNull(Test.NULL, msg.getFuelLevel()); - assertNull(Test.NULL, msg.getVin()); - assertNull(Test.NULL, msg.getPrndl()); - assertNull(Test.NULL, msg.getTirePressure()); - assertNull(Test.NULL, msg.getEngineTorque()); - assertNull(Test.NULL, msg.getEngineOilLife()); - assertNull(Test.NULL, msg.getOdometer()); - assertNull(Test.NULL, msg.getGps()); - assertNull(Test.NULL, msg.getFuelLevelState()); - assertNull(Test.NULL, msg.getInstantFuelConsumption()); - assertNull(Test.NULL, msg.getBeltStatus()); - assertNull(Test.NULL, msg.getBodyInformation()); - assertNull(Test.NULL, msg.getDeviceStatus()); - assertNull(Test.NULL, msg.getDriverBraking()); - assertNull(Test.NULL, msg.getWiperStatus()); - assertNull(Test.NULL, msg.getHeadLampStatus()); - assertNull(Test.NULL, msg.getAccPedalPosition()); - assertNull(Test.NULL, msg.getSteeringWheelAngle()); - assertNull(Test.NULL, msg.getECallInfo()); - assertNull(Test.NULL, msg.getAirbagStatus()); - assertNull(Test.NULL, msg.getEmergencyEvent()); - assertNull(Test.NULL, msg.getClusterModeStatus()); - assertNull(Test.NULL, msg.getMyKey()); - assertNull(Test.NULL, msg.getFuelRange()); - assertNull(Test.NULL, msg.getTurnSignal()); - assertNull(Test.NULL, msg.getElectronicParkBrakeStatus()); - assertNull(Test.NULL, msg.getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); + assertNull(TestValues.NULL, msg.getSpeed()); + assertNull(TestValues.NULL, msg.getRpm()); + assertNull(TestValues.NULL, msg.getExternalTemperature()); + assertNull(TestValues.NULL, msg.getFuelLevel()); + assertNull(TestValues.NULL, msg.getVin()); + assertNull(TestValues.NULL, msg.getPrndl()); + assertNull(TestValues.NULL, msg.getTirePressure()); + assertNull(TestValues.NULL, msg.getEngineTorque()); + assertNull(TestValues.NULL, msg.getEngineOilLife()); + assertNull(TestValues.NULL, msg.getOdometer()); + assertNull(TestValues.NULL, msg.getGps()); + assertNull(TestValues.NULL, msg.getFuelLevelState()); + assertNull(TestValues.NULL, msg.getInstantFuelConsumption()); + assertNull(TestValues.NULL, msg.getBeltStatus()); + assertNull(TestValues.NULL, msg.getBodyInformation()); + assertNull(TestValues.NULL, msg.getDeviceStatus()); + assertNull(TestValues.NULL, msg.getDriverBraking()); + assertNull(TestValues.NULL, msg.getWiperStatus()); + assertNull(TestValues.NULL, msg.getHeadLampStatus()); + assertNull(TestValues.NULL, msg.getAccPedalPosition()); + assertNull(TestValues.NULL, msg.getSteeringWheelAngle()); + assertNull(TestValues.NULL, msg.getECallInfo()); + assertNull(TestValues.NULL, msg.getAirbagStatus()); + assertNull(TestValues.NULL, msg.getEmergencyEvent()); + assertNull(TestValues.NULL, msg.getClusterModeStatus()); + assertNull(TestValues.NULL, msg.getMyKey()); + assertNull(TestValues.NULL, msg.getFuelRange()); + assertNull(TestValues.NULL, msg.getTurnSignal()); + assertNull(TestValues.NULL, msg.getElectronicParkBrakeStatus()); + assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } public void testJson() { @@ -377,13 +377,13 @@ public class OnVehicleDataTests extends BaseRpcTests{ reference.put(OnVehicleData.KEY_FUEL_RANGE, fuelRangeArrayObj); reference.put(OnVehicleData.KEY_TURN_SIGNAL, VehicleDataHelper.TURN_SIGNAL); reference.put(OnVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS); - reference.put(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE); + reference.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE); JSONObject underTest = msg.serializeJSON(); //go inside underTest and only return the JSONObject inside the parameters key inside the notification key underTest = underTest.getJSONObject("notification").getJSONObject("parameters"); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); @@ -394,7 +394,7 @@ public class OnVehicleDataTests extends BaseRpcTests{ JSONObject tirePressureReference = JsonUtils.readJsonObjectFromJsonObject(reference, key); JSONObject tirePressureTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key); - assertTrue(Test.TRUE, Validator.validateTireStatus( + assertTrue(TestValues.TRUE, Validator.validateTireStatus( new TireStatus(JsonRPCMarshaller.deserializeJSONObject(tirePressureReference)), new TireStatus(JsonRPCMarshaller.deserializeJSONObject(tirePressureTest)))); @@ -402,49 +402,49 @@ public class OnVehicleDataTests extends BaseRpcTests{ JSONObject GPSObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key); JSONObject GPSObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key); - assertTrue(Test.TRUE, Validator.validateGpsData( + assertTrue(TestValues.TRUE, Validator.validateGpsData( new GPSData(JsonRPCMarshaller.deserializeJSONObject(GPSObjReference)), new GPSData(JsonRPCMarshaller.deserializeJSONObject(GPSObjTest)))); } else if (key.equals(OnVehicleData.KEY_BELT_STATUS)) { JSONObject beltObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key); JSONObject beltObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key); - assertTrue(Test.TRUE, Validator.validateBeltStatus( + assertTrue(TestValues.TRUE, Validator.validateBeltStatus( new BeltStatus(JsonRPCMarshaller.deserializeJSONObject(beltObjReference)), new BeltStatus(JsonRPCMarshaller.deserializeJSONObject(beltObjTest)))); } else if (key.equals(OnVehicleData.KEY_BODY_INFORMATION)) { JSONObject bodyInfoObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key); JSONObject bodyInfoObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key); - assertTrue(Test.TRUE, Validator.validateBodyInformation( + assertTrue(TestValues.TRUE, Validator.validateBodyInformation( new BodyInformation(JsonRPCMarshaller.deserializeJSONObject(bodyInfoObjReference)), new BodyInformation(JsonRPCMarshaller.deserializeJSONObject(bodyInfoObjTest)))); } else if (key.equals(OnVehicleData.KEY_DEVICE_STATUS)) { JSONObject deviceObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key); JSONObject deviceObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key); - assertTrue(Test.TRUE, Validator.validateDeviceStatus( + assertTrue(TestValues.TRUE, Validator.validateDeviceStatus( new DeviceStatus(JsonRPCMarshaller.deserializeJSONObject(deviceObjReference)), new DeviceStatus(JsonRPCMarshaller.deserializeJSONObject(deviceObjTest)))); } else if (key.equals(OnVehicleData.KEY_HEAD_LAMP_STATUS)) { JSONObject headLampObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key); JSONObject headLampObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key); - assertTrue(Test.TRUE, Validator.validateHeadLampStatus( + assertTrue(TestValues.TRUE, Validator.validateHeadLampStatus( new HeadLampStatus(JsonRPCMarshaller.deserializeJSONObject(headLampObjReference)), new HeadLampStatus(JsonRPCMarshaller.deserializeJSONObject(headLampObjTest)))); } else if (key.equals(OnVehicleData.KEY_E_CALL_INFO)) { JSONObject callInfoObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key); JSONObject callInfoObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key); - assertTrue(Test.TRUE, Validator.validateECallInfo( + assertTrue(TestValues.TRUE, Validator.validateECallInfo( new ECallInfo(JsonRPCMarshaller.deserializeJSONObject(callInfoObjReference)), new ECallInfo(JsonRPCMarshaller.deserializeJSONObject(callInfoObjTest)))); } else if (key.equals(OnVehicleData.KEY_AIRBAG_STATUS)) { JSONObject airbagObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key); JSONObject airbagObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key); - assertTrue(Test.TRUE, Validator.validateAirbagStatus( + assertTrue(TestValues.TRUE, Validator.validateAirbagStatus( new AirbagStatus(JsonRPCMarshaller.deserializeJSONObject(airbagObjReference)), new AirbagStatus(JsonRPCMarshaller.deserializeJSONObject(airbagObjTest)))); } @@ -452,7 +452,7 @@ public class OnVehicleDataTests extends BaseRpcTests{ JSONObject emergencyObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key); JSONObject emergencyObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key); - assertTrue(Test.TRUE, Validator.validateEmergencyEvent( + assertTrue(TestValues.TRUE, Validator.validateEmergencyEvent( new EmergencyEvent(JsonRPCMarshaller.deserializeJSONObject(emergencyObjReference)), new EmergencyEvent(JsonRPCMarshaller.deserializeJSONObject(emergencyObjTest)))); } @@ -460,7 +460,7 @@ public class OnVehicleDataTests extends BaseRpcTests{ JSONObject clusterModeObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key); JSONObject clusterModeObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key); - assertTrue(Test.TRUE, Validator.validateClusterModeStatus( + assertTrue(TestValues.TRUE, Validator.validateClusterModeStatus( new ClusterModeStatus(JsonRPCMarshaller.deserializeJSONObject(clusterModeObjReference)), new ClusterModeStatus(JsonRPCMarshaller.deserializeJSONObject(clusterModeObjTest)))); } @@ -468,7 +468,7 @@ public class OnVehicleDataTests extends BaseRpcTests{ JSONObject myKeyObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key); JSONObject myKeyObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key); - assertTrue(Test.TRUE, Validator.validateMyKey( + assertTrue(TestValues.TRUE, Validator.validateMyKey( new MyKey(JsonRPCMarshaller.deserializeJSONObject(myKeyObjReference)), new MyKey(JsonRPCMarshaller.deserializeJSONObject(myKeyObjTest)))); } @@ -490,16 +490,16 @@ public class OnVehicleDataTests extends BaseRpcTests{ fuelRangeUnderTestList.add(fuelRange); } - assertTrue(Test.TRUE, Validator.validateFuelRange( + assertTrue(TestValues.TRUE, Validator.validateFuelRange( fuelRangeRefereceList, fuelRangeUnderTestList)); } else { - assertEquals(Test.TRUE, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + assertEquals(TestValues.TRUE, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); } } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnWayPointChangeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnWayPointChangeTests.java index dcc02dafd..9d1382ed8 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnWayPointChangeTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnWayPointChangeTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.GetWayPointsResponse; import com.smartdevicelink.proxy.rpc.LocationDetails; import com.smartdevicelink.proxy.rpc.OnWayPointChange; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONArray; import org.json.JSONException; @@ -26,8 +26,8 @@ public class OnWayPointChangeTests extends BaseRpcTests { OnWayPointChange msg = new OnWayPointChange(); List<LocationDetails> list = new ArrayList<>(); - list.add(Test.GENERAL_LOCATIONDETAILS); - list.add(Test.GENERAL_LOCATIONDETAILS); + list.add(TestValues.GENERAL_LOCATIONDETAILS); + list.add(TestValues.GENERAL_LOCATIONDETAILS); msg.setWayPoints(list); @@ -50,8 +50,8 @@ public class OnWayPointChangeTests extends BaseRpcTests { JSONArray jsonArray = new JSONArray(); try { - jsonArray.put(JsonRPCMarshaller.serializeHashtable(Test.GENERAL_LOCATIONDETAILS.getStore())); - jsonArray.put(JsonRPCMarshaller.serializeHashtable(Test.GENERAL_LOCATIONDETAILS.getStore())); + jsonArray.put(JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_LOCATIONDETAILS.getStore())); + jsonArray.put(JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_LOCATIONDETAILS.getStore())); } catch (JSONException e) { e.printStackTrace(); } @@ -73,14 +73,14 @@ public class OnWayPointChangeTests extends BaseRpcTests { List<LocationDetails> list = ((OnWayPointChange) msg).getWayPoints(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_LOCATIONDETAILS, list.get(0)); - assertEquals(Test.MATCH, Test.GENERAL_LOCATIONDETAILS, list.get(1)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LOCATIONDETAILS, list.get(0)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LOCATIONDETAILS, list.get(1)); // Invalid/Null Tests OnWayPointChange msg = new OnWayPointChange(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getWayPoints()); + assertNull(TestValues.NULL, msg.getWayPoints()); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java index aa7967c2a..d8115510f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java @@ -8,7 +8,7 @@ import com.smartdevicelink.proxy.rpc.Image; import com.smartdevicelink.proxy.rpc.MenuParams; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -28,10 +28,10 @@ public class AddCommandTests extends BaseRpcTests{ protected RPCMessage createMessage(){ AddCommand msg = new AddCommand(); - msg.setCmdIcon(Test.GENERAL_IMAGE); - msg.setMenuParams(Test.GENERAL_MENUPARAMS); - msg.setVrCommands(Test.GENERAL_STRING_LIST); - msg.setCmdID(Test.GENERAL_INT); + msg.setCmdIcon(TestValues.GENERAL_IMAGE); + msg.setMenuParams(TestValues.GENERAL_MENUPARAMS); + msg.setVrCommands(TestValues.GENERAL_STRING_LIST); + msg.setCmdID(TestValues.GENERAL_INT); return msg; } @@ -51,12 +51,12 @@ public class AddCommandTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(AddCommand.KEY_CMD_ICON, Test.JSON_IMAGE); - result.put(AddCommand.KEY_MENU_PARAMS, Test.JSON_MENUPARAMS); - result.put(AddCommand.KEY_VR_COMMANDS, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST)); - result.put(AddCommand.KEY_CMD_ID, Test.GENERAL_INT); + result.put(AddCommand.KEY_CMD_ICON, TestValues.JSON_IMAGE); + result.put(AddCommand.KEY_MENU_PARAMS, TestValues.JSON_MENUPARAMS); + result.put(AddCommand.KEY_VR_COMMANDS, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); + result.put(AddCommand.KEY_CMD_ID, TestValues.GENERAL_INT); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -73,26 +73,26 @@ public class AddCommandTests extends BaseRpcTests{ List<String> testVrCommands = ( (AddCommand) msg ).getVrCommands(); // Valid Tests - assertNotNull(Test.NOT_NULL, testMenuParams); - assertNotNull(Test.NOT_NULL, testImage); - assertNotNull(Test.NOT_NULL, testVrCommands); + assertNotNull(TestValues.NOT_NULL, testMenuParams); + assertNotNull(TestValues.NOT_NULL, testImage); + assertNotNull(TestValues.NOT_NULL, testVrCommands); - assertEquals(Test.MATCH, Test.GENERAL_INT, testCmdId); - assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), testVrCommands.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, testCmdId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING_LIST.size(), testVrCommands.size()); - assertTrue(Test.TRUE, Validator.validateMenuParams(Test.GENERAL_MENUPARAMS, testMenuParams)); - assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, testImage)); - assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, testVrCommands)); + assertTrue(TestValues.TRUE, Validator.validateMenuParams(TestValues.GENERAL_MENUPARAMS, testMenuParams)); + assertTrue(TestValues.TRUE, Validator.validateImage(TestValues.GENERAL_IMAGE, testImage)); + assertTrue(TestValues.TRUE, Validator.validateStringList(TestValues.GENERAL_STRING_LIST, testVrCommands)); // Invalid/Null Tests AddCommand msg = new AddCommand(); - assertNotNull(Test.NULL, msg); + assertNotNull(TestValues.NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getCmdIcon()); - assertNull(Test.NULL, msg.getCmdID()); - assertNull(Test.NULL, msg.getMenuParams()); - assertNull(Test.NULL, msg.getVrCommands()); + assertNull(TestValues.NULL, msg.getCmdIcon()); + assertNull(TestValues.NULL, msg.getCmdID()); + assertNull(TestValues.NULL, msg.getMenuParams()); + assertNull(TestValues.NULL, msg.getVrCommands()); } /** @@ -100,35 +100,35 @@ public class AddCommandTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); AddCommand cmd = new AddCommand(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); List<String> vrCommandsList = JsonUtils.readStringListFromJsonObject(parameters, AddCommand.KEY_VR_COMMANDS); List<String> testCommandsList = cmd.getVrCommands(); - assertEquals(Test.MATCH, vrCommandsList.size(), testCommandsList.size()); - assertTrue(Test.TRUE, Validator.validateStringList(vrCommandsList, testCommandsList)); + assertEquals(TestValues.MATCH, vrCommandsList.size(), testCommandsList.size()); + assertTrue(TestValues.TRUE, Validator.validateStringList(vrCommandsList, testCommandsList)); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, AddCommand.KEY_CMD_ID), cmd.getCmdID()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, AddCommand.KEY_CMD_ID), cmd.getCmdID()); JSONObject menuParams = JsonUtils.readJsonObjectFromJsonObject(parameters, AddCommand.KEY_MENU_PARAMS); MenuParams referenceMenuParams = new MenuParams(JsonRPCMarshaller.deserializeJSONObject(menuParams)); - assertTrue(Test.TRUE, Validator.validateMenuParams(referenceMenuParams, cmd.getMenuParams())); + assertTrue(TestValues.TRUE, Validator.validateMenuParams(referenceMenuParams, cmd.getMenuParams())); JSONObject cmdIcon = JsonUtils.readJsonObjectFromJsonObject(parameters, AddCommand.KEY_CMD_ICON); Image referenceCmdIcon = new Image(JsonRPCMarshaller.deserializeJSONObject(cmdIcon)); - assertTrue(Test.TRUE, Validator.validateImage(referenceCmdIcon, cmd.getCmdIcon())); + assertTrue(TestValues.TRUE, Validator.validateImage(referenceCmdIcon, cmd.getCmdIcon())); } catch (JSONException e) { e.printStackTrace(); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java index 2ea3d2079..d936a3fe5 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java @@ -8,7 +8,7 @@ import com.smartdevicelink.proxy.rpc.Image; import com.smartdevicelink.proxy.rpc.enums.MenuLayout; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -27,11 +27,11 @@ public class AddSubmenuTests extends BaseRpcTests{ protected RPCMessage createMessage(){ AddSubMenu msg = new AddSubMenu(); - msg.setMenuID(Test.GENERAL_INT); - msg.setMenuName(Test.GENERAL_STRING); - msg.setPosition(Test.GENERAL_INT); - msg.setMenuIcon(Test.GENERAL_IMAGE); - msg.setMenuLayout(Test.GENERAL_MENU_LAYOUT); + msg.setMenuID(TestValues.GENERAL_INT); + msg.setMenuName(TestValues.GENERAL_STRING); + msg.setPosition(TestValues.GENERAL_INT); + msg.setMenuIcon(TestValues.GENERAL_IMAGE); + msg.setMenuLayout(TestValues.GENERAL_MENU_LAYOUT); return msg; } @@ -51,13 +51,13 @@ public class AddSubmenuTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(AddSubMenu.KEY_MENU_ID, Test.GENERAL_INT); - result.put(AddSubMenu.KEY_MENU_NAME, Test.GENERAL_STRING); - result.put(AddSubMenu.KEY_POSITION, Test.GENERAL_INT); - result.put(AddSubMenu.KEY_MENU_ICON, Test.JSON_IMAGE); - result.put(AddSubMenu.KEY_MENU_LAYOUT, Test.GENERAL_MENU_LAYOUT); + result.put(AddSubMenu.KEY_MENU_ID, TestValues.GENERAL_INT); + result.put(AddSubMenu.KEY_MENU_NAME, TestValues.GENERAL_STRING); + result.put(AddSubMenu.KEY_POSITION, TestValues.GENERAL_INT); + result.put(AddSubMenu.KEY_MENU_ICON, TestValues.JSON_IMAGE); + result.put(AddSubMenu.KEY_MENU_LAYOUT, TestValues.GENERAL_MENU_LAYOUT); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -75,11 +75,11 @@ public class AddSubmenuTests extends BaseRpcTests{ MenuLayout testMenuLayout = ( (AddSubMenu) msg ).getMenuLayout(); // Valid Tests - assertEquals("Menu ID didn't match input menu ID.", Test.GENERAL_INT, testMenuId); - assertEquals("Menu name didn't match input menu name.", Test.GENERAL_STRING, testMenuName); - assertEquals("Position didn't match input position.", Test.GENERAL_INT, testPosition); - assertTrue("Menu icon didn't match input icon.", Validator.validateImage(Test.GENERAL_IMAGE, testMenuIcon)); - assertEquals("Menu layout didn't match input menu layout.", Test.GENERAL_MENU_LAYOUT, testMenuLayout); + assertEquals("Menu ID didn't match input menu ID.", TestValues.GENERAL_INT, testMenuId); + assertEquals("Menu name didn't match input menu name.", TestValues.GENERAL_STRING, testMenuName); + assertEquals("Position didn't match input position.", TestValues.GENERAL_INT, testPosition); + assertTrue("Menu icon didn't match input icon.", Validator.validateImage(TestValues.GENERAL_IMAGE, testMenuIcon)); + assertEquals("Menu layout didn't match input menu layout.", TestValues.GENERAL_MENU_LAYOUT, testMenuLayout); // Invalid/Null Tests @@ -87,11 +87,11 @@ public class AddSubmenuTests extends BaseRpcTests{ assertNotNull("Null object creation failed.", msg); testNullBase(msg); - assertNull(Test.NULL, msg.getMenuID()); - assertNull(Test.NULL, msg.getMenuName()); - assertNull(Test.NULL, msg.getPosition()); - assertNull(Test.NULL, msg.getMenuIcon()); - assertNull(Test.NULL, msg.getMenuLayout()); + assertNull(TestValues.NULL, msg.getMenuID()); + assertNull(TestValues.NULL, msg.getMenuName()); + assertNull(TestValues.NULL, msg.getPosition()); + assertNull(TestValues.NULL, msg.getMenuIcon()); + assertNull(TestValues.NULL, msg.getMenuLayout()); } /** @@ -99,31 +99,31 @@ public class AddSubmenuTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); AddSubMenu cmd = new AddSubMenu(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, AddSubMenu.KEY_MENU_ID), cmd.getMenuID()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, AddSubMenu.KEY_POSITION), cmd.getPosition()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, AddSubMenu.KEY_MENU_NAME), cmd.getMenuName()); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, AddSubMenu.KEY_MENU_LAYOUT), cmd.getMenuLayout()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, AddSubMenu.KEY_MENU_ID), cmd.getMenuID()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, AddSubMenu.KEY_POSITION), cmd.getPosition()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, AddSubMenu.KEY_MENU_NAME), cmd.getMenuName()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, AddSubMenu.KEY_MENU_LAYOUT), cmd.getMenuLayout()); JSONObject menuIcon = JsonUtils.readJsonObjectFromJsonObject(parameters, AddSubMenu.KEY_MENU_ICON); Image referenceMenuIcon = new Image(JsonRPCMarshaller.deserializeJSONObject(menuIcon)); - assertTrue(Test.TRUE, Validator.validateImage(referenceMenuIcon, cmd.getMenuIcon())); + assertTrue(TestValues.TRUE, Validator.validateImage(referenceMenuIcon, cmd.getMenuIcon())); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertManeuverTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertManeuverTests.java index 6cbe23fd1..656356140 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertManeuverTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertManeuverTests.java @@ -8,7 +8,7 @@ import com.smartdevicelink.proxy.rpc.SoftButton; import com.smartdevicelink.proxy.rpc.TTSChunk; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -30,8 +30,8 @@ public class AlertManeuverTests extends BaseRpcTests { protected RPCMessage createMessage() { AlertManeuver msg = new AlertManeuver(); - msg.setTtsChunks(Test.GENERAL_TTSCHUNK_LIST); - msg.setSoftButtons(Test.GENERAL_SOFTBUTTON_LIST); + msg.setTtsChunks(TestValues.GENERAL_TTSCHUNK_LIST); + msg.setSoftButtons(TestValues.GENERAL_SOFTBUTTON_LIST); return msg; } @@ -51,10 +51,10 @@ public class AlertManeuverTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(AlertManeuver.KEY_TTS_CHUNKS, Test.JSON_TTSCHUNKS); - result.put(AlertManeuver.KEY_SOFT_BUTTONS, Test.JSON_SOFTBUTTONS); + result.put(AlertManeuver.KEY_TTS_CHUNKS, TestValues.JSON_TTSCHUNKS); + result.put(AlertManeuver.KEY_SOFT_BUTTONS, TestValues.JSON_SOFTBUTTONS); } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -69,16 +69,16 @@ public class AlertManeuverTests extends BaseRpcTests { List<SoftButton> testSoftButtons = ( (AlertManeuver) msg ).getSoftButtons(); // Valid Tests - assertTrue(Test.TRUE, Validator.validateSoftButtons(Test.GENERAL_SOFTBUTTON_LIST, testSoftButtons)); - assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testTtsChunks)); + assertTrue(TestValues.TRUE, Validator.validateSoftButtons(TestValues.GENERAL_SOFTBUTTON_LIST, testSoftButtons)); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(TestValues.GENERAL_TTSCHUNK_LIST, testTtsChunks)); // Invalid/Null Tests AlertManeuver msg = new AlertManeuver(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getTtsChunks()); - assertNull(Test.NULL, msg.getSoftButtons()); + assertNull(TestValues.NULL, msg.getTtsChunks()); + assertNull(TestValues.NULL, msg.getSoftButtons()); } /** @@ -86,18 +86,18 @@ public class AlertManeuverTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); AlertManeuver cmd = new AlertManeuver(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); JSONArray ttsChunkArray = JsonUtils.readJsonArrayFromJsonObject(parameters, AlertManeuver.KEY_TTS_CHUNKS); @@ -107,7 +107,7 @@ public class AlertManeuverTests extends BaseRpcTests { TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)ttsChunkArray.get(index))); ttsChunkList.add(chunk); } - assertTrue(Test.TRUE, Validator.validateTtsChunks(ttsChunkList, cmd.getTtsChunks())); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(ttsChunkList, cmd.getTtsChunks())); JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, AlertManeuver.KEY_SOFT_BUTTONS); List<SoftButton> softButtonList = new ArrayList<SoftButton>(); @@ -115,9 +115,9 @@ public class AlertManeuverTests extends BaseRpcTests { SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject((JSONObject)softButtonArray.get(index))); softButtonList.add(chunk); } - assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons())); + assertTrue(TestValues.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons())); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertTests.java index 8bd229d4d..3db87cb5a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertTests.java @@ -9,7 +9,7 @@ import com.smartdevicelink.proxy.rpc.SoftButton; import com.smartdevicelink.proxy.rpc.TTSChunk; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -31,16 +31,16 @@ public class AlertTests extends BaseRpcTests{ protected RPCMessage createMessage(){ Alert msg = new Alert(); - msg.setDuration(Test.GENERAL_INT); - msg.setAlertText1(Test.GENERAL_STRING); - msg.setAlertText2(Test.GENERAL_STRING); - msg.setAlertText3(Test.GENERAL_STRING); - msg.setPlayTone(Test.GENERAL_BOOLEAN); - msg.setProgressIndicator(Test.GENERAL_BOOLEAN); - msg.setTtsChunks(Test.GENERAL_TTSCHUNK_LIST); - msg.setSoftButtons(Test.GENERAL_SOFTBUTTON_LIST); - msg.setCancelID(Test.GENERAL_INTEGER); - msg.setAlertIcon(Test.GENERAL_IMAGE); + msg.setDuration(TestValues.GENERAL_INT); + msg.setAlertText1(TestValues.GENERAL_STRING); + msg.setAlertText2(TestValues.GENERAL_STRING); + msg.setAlertText3(TestValues.GENERAL_STRING); + msg.setPlayTone(TestValues.GENERAL_BOOLEAN); + msg.setProgressIndicator(TestValues.GENERAL_BOOLEAN); + msg.setTtsChunks(TestValues.GENERAL_TTSCHUNK_LIST); + msg.setSoftButtons(TestValues.GENERAL_SOFTBUTTON_LIST); + msg.setCancelID(TestValues.GENERAL_INTEGER); + msg.setAlertIcon(TestValues.GENERAL_IMAGE); return msg; } @@ -60,18 +60,18 @@ public class AlertTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(Alert.KEY_DURATION, Test.GENERAL_INT); - result.put(Alert.KEY_ALERT_TEXT_1, Test.GENERAL_STRING); - result.put(Alert.KEY_ALERT_TEXT_2, Test.GENERAL_STRING); - result.put(Alert.KEY_ALERT_TEXT_3, Test.GENERAL_STRING); - result.put(Alert.KEY_PLAY_TONE, Test.GENERAL_BOOLEAN); - result.put(Alert.KEY_PROGRESS_INDICATOR, Test.GENERAL_BOOLEAN); - result.put(Alert.KEY_TTS_CHUNKS, Test.JSON_TTSCHUNKS); - result.put(Alert.KEY_SOFT_BUTTONS, Test.JSON_SOFTBUTTONS); - result.put(Alert.KEY_CANCEL_ID, Test.GENERAL_INTEGER); - result.put(Alert.KEY_ALERT_ICON, Test.JSON_IMAGE); + result.put(Alert.KEY_DURATION, TestValues.GENERAL_INT); + result.put(Alert.KEY_ALERT_TEXT_1, TestValues.GENERAL_STRING); + result.put(Alert.KEY_ALERT_TEXT_2, TestValues.GENERAL_STRING); + result.put(Alert.KEY_ALERT_TEXT_3, TestValues.GENERAL_STRING); + result.put(Alert.KEY_PLAY_TONE, TestValues.GENERAL_BOOLEAN); + result.put(Alert.KEY_PROGRESS_INDICATOR, TestValues.GENERAL_BOOLEAN); + result.put(Alert.KEY_TTS_CHUNKS, TestValues.JSON_TTSCHUNKS); + result.put(Alert.KEY_SOFT_BUTTONS, TestValues.JSON_SOFTBUTTONS); + result.put(Alert.KEY_CANCEL_ID, TestValues.GENERAL_INTEGER); + result.put(Alert.KEY_ALERT_ICON, TestValues.JSON_IMAGE); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -94,32 +94,32 @@ public class AlertTests extends BaseRpcTests{ Image alertIcon = ( (Alert) msg ).getAlertIcon(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, testDuration); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testAlertText1); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testAlertText2); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testAlertText3); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testPlayTone); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testProgressIndicator); - assertTrue(Test.TRUE, Validator.validateSoftButtons(Test.GENERAL_SOFTBUTTON_LIST, testSoftButtons)); - assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testTtsChunks)); - assertEquals(Test.MATCH, Test.GENERAL_INTEGER, testCancelID); - assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, alertIcon)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, testDuration); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testAlertText1); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testAlertText2); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testAlertText3); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, testPlayTone); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, testProgressIndicator); + assertTrue(TestValues.TRUE, Validator.validateSoftButtons(TestValues.GENERAL_SOFTBUTTON_LIST, testSoftButtons)); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(TestValues.GENERAL_TTSCHUNK_LIST, testTtsChunks)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER, testCancelID); + assertTrue(TestValues.TRUE, Validator.validateImage(TestValues.GENERAL_IMAGE, alertIcon)); // Invalid/Null Tests Alert msg = new Alert(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getAlertText1()); - assertNull(Test.NULL, msg.getAlertText2()); - assertNull(Test.NULL, msg.getAlertText3()); - assertNull(Test.NULL, msg.getDuration()); - assertNull(Test.NULL, msg.getPlayTone()); - assertNull(Test.NULL, msg.getProgressIndicator()); - assertNull(Test.NULL, msg.getTtsChunks()); - assertNull(Test.NULL, msg.getSoftButtons()); - assertNull(Test.NULL, msg.getCancelID()); - assertNull(Test.NULL, msg.getAlertIcon()); + assertNull(TestValues.NULL, msg.getAlertText1()); + assertNull(TestValues.NULL, msg.getAlertText2()); + assertNull(TestValues.NULL, msg.getAlertText3()); + assertNull(TestValues.NULL, msg.getDuration()); + assertNull(TestValues.NULL, msg.getPlayTone()); + assertNull(TestValues.NULL, msg.getProgressIndicator()); + assertNull(TestValues.NULL, msg.getTtsChunks()); + assertNull(TestValues.NULL, msg.getSoftButtons()); + assertNull(TestValues.NULL, msg.getCancelID()); + assertNull(TestValues.NULL, msg.getAlertIcon()); } /** @@ -127,26 +127,26 @@ public class AlertTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); Alert cmd = new Alert(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, Alert.KEY_PLAY_TONE), cmd.getPlayTone()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Alert.KEY_DURATION), cmd.getDuration()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Alert.KEY_ALERT_TEXT_1), cmd.getAlertText1()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Alert.KEY_ALERT_TEXT_2), cmd.getAlertText2()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Alert.KEY_ALERT_TEXT_3), cmd.getAlertText3()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, Alert.KEY_PROGRESS_INDICATOR), cmd.getProgressIndicator()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Alert.KEY_CANCEL_ID), cmd.getCancelID()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, Alert.KEY_PLAY_TONE), cmd.getPlayTone()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Alert.KEY_DURATION), cmd.getDuration()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, Alert.KEY_ALERT_TEXT_1), cmd.getAlertText1()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, Alert.KEY_ALERT_TEXT_2), cmd.getAlertText2()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, Alert.KEY_ALERT_TEXT_3), cmd.getAlertText3()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, Alert.KEY_PROGRESS_INDICATOR), cmd.getProgressIndicator()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Alert.KEY_CANCEL_ID), cmd.getCancelID()); JSONArray ttsChunkArray = JsonUtils.readJsonArrayFromJsonObject(parameters, Alert.KEY_TTS_CHUNKS); List<TTSChunk> ttsChunkList = new ArrayList<TTSChunk>(); @@ -154,7 +154,7 @@ public class AlertTests extends BaseRpcTests{ TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)ttsChunkArray.get(index)) ); ttsChunkList.add(chunk); } - assertTrue(Test.TRUE, Validator.validateTtsChunks(ttsChunkList, cmd.getTtsChunks())); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(ttsChunkList, cmd.getTtsChunks())); JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, Alert.KEY_SOFT_BUTTONS); List<SoftButton> softButtonList = new ArrayList<SoftButton>(); @@ -162,13 +162,13 @@ public class AlertTests extends BaseRpcTests{ SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonArray.get(index)) ); softButtonList.add(chunk); } - assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons())); + assertTrue(TestValues.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons())); JSONObject alertIcon = JsonUtils.readJsonObjectFromJsonObject(parameters, Alert.KEY_ALERT_ICON); Image referenceAlertIcon = new Image(JsonRPCMarshaller.deserializeJSONObject(alertIcon)); - assertTrue(Test.TRUE, Validator.validateImage(referenceAlertIcon, cmd.getAlertIcon())); + assertTrue(TestValues.TRUE, Validator.validateImage(referenceAlertIcon, cmd.getAlertIcon())); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ButtonPressTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ButtonPressTests.java index 6f90585d4..7f51fd0ab 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ButtonPressTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ButtonPressTests.java @@ -9,7 +9,7 @@ import com.smartdevicelink.proxy.rpc.enums.ButtonPressMode; import com.smartdevicelink.proxy.rpc.enums.ModuleType; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -27,10 +27,10 @@ public class ButtonPressTests extends BaseRpcTests { protected RPCMessage createMessage(){ ButtonPress msg = new ButtonPress(); - msg.setModuleType(Test.GENERAL_MODULETYPE); - msg.setButtonPressMode(Test.GENERAL_BUTTONPRESSMODE); - msg.setButtonName(Test.GENERAL_BUTTONNAME); - msg.setModuleId(Test.GENERAL_STRING); + msg.setModuleType(TestValues.GENERAL_MODULETYPE); + msg.setButtonPressMode(TestValues.GENERAL_BUTTONPRESSMODE); + msg.setButtonName(TestValues.GENERAL_BUTTONNAME); + msg.setModuleId(TestValues.GENERAL_STRING); return msg; } @@ -50,12 +50,12 @@ public class ButtonPressTests extends BaseRpcTests { JSONObject result = new JSONObject(); try{ - result.put(ButtonPress.KEY_MODULE_TYPE, Test.GENERAL_MODULETYPE); - result.put(ButtonPress.KEY_BUTTON_NAME, Test.GENERAL_BUTTONNAME); - result.put(ButtonPress.KEY_BUTTON_PRESS_MODE, Test.GENERAL_BUTTONPRESSMODE); - result.put(ButtonPress.KEY_MODULE_ID, Test.GENERAL_STRING); + result.put(ButtonPress.KEY_MODULE_TYPE, TestValues.GENERAL_MODULETYPE); + result.put(ButtonPress.KEY_BUTTON_NAME, TestValues.GENERAL_BUTTONNAME); + result.put(ButtonPress.KEY_BUTTON_PRESS_MODE, TestValues.GENERAL_BUTTONPRESSMODE); + result.put(ButtonPress.KEY_MODULE_ID, TestValues.GENERAL_STRING); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -72,20 +72,20 @@ public class ButtonPressTests extends BaseRpcTests { String testButtonId = ((ButtonPress) msg).getModuleId(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_MODULETYPE, testModuleType); - assertEquals(Test.MATCH, Test.GENERAL_BUTTONNAME, testButtonName); - assertEquals(Test.MATCH, Test.GENERAL_BUTTONPRESSMODE, testButtonPressMode); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testButtonId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MODULETYPE, testModuleType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BUTTONNAME, testButtonName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BUTTONPRESSMODE, testButtonPressMode); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testButtonId); // Invalid/Null Tests ButtonPress msg = new ButtonPress(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getModuleType()); - assertNull(Test.NULL, msg.getButtonName()); - assertNull(Test.NULL, msg.getButtonPressMode()); - assertNull(Test.NULL, msg.getModuleId()); + assertNull(TestValues.NULL, msg.getModuleType()); + assertNull(TestValues.NULL, msg.getButtonName()); + assertNull(TestValues.NULL, msg.getButtonPressMode()); + assertNull(TestValues.NULL, msg.getModuleId()); } /** @@ -93,27 +93,27 @@ public class ButtonPressTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ButtonPress cmd = new ButtonPress(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, ButtonPress.KEY_MODULE_TYPE).toString(), cmd.getModuleType().toString()); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, ButtonPress.KEY_BUTTON_NAME).toString(), cmd.getButtonName().toString()); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, ButtonPress.KEY_BUTTON_PRESS_MODE).toString(), cmd.getButtonPressMode().toString()); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, ButtonPress.KEY_MODULE_ID), cmd.getModuleId()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, ButtonPress.KEY_MODULE_TYPE).toString(), cmd.getModuleType().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, ButtonPress.KEY_BUTTON_NAME).toString(), cmd.getButtonName().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, ButtonPress.KEY_BUTTON_PRESS_MODE).toString(), cmd.getButtonPressMode().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, ButtonPress.KEY_MODULE_ID), cmd.getModuleId()); }catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CancelInteractionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CancelInteractionTests.java index 8735bea9c..dea479494 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CancelInteractionTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CancelInteractionTests.java @@ -40,7 +40,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.CancelInteraction; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -57,8 +57,8 @@ public class CancelInteractionTests extends BaseRpcTests { @Override protected RPCMessage createMessage() { CancelInteraction msg = new CancelInteraction(); - msg.setInteractionFunctionID(Test.GENERAL_INTEGER); - msg.setCancelID(Test.GENERAL_INTEGER); + msg.setInteractionFunctionID(TestValues.GENERAL_INTEGER); + msg.setCancelID(TestValues.GENERAL_INTEGER); return msg; } @@ -77,10 +77,10 @@ public class CancelInteractionTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(CancelInteraction.KEY_FUNCTION_ID, Test.GENERAL_INTEGER); - result.put(CancelInteraction.KEY_CANCEL_ID, Test.GENERAL_INTEGER); + result.put(CancelInteraction.KEY_FUNCTION_ID, TestValues.GENERAL_INTEGER); + result.put(CancelInteraction.KEY_CANCEL_ID, TestValues.GENERAL_INTEGER); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -95,16 +95,16 @@ public class CancelInteractionTests extends BaseRpcTests { Integer testCancelID = ((CancelInteraction) msg).getCancelID(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INTEGER, testFunctionID); - assertEquals(Test.MATCH, Test.GENERAL_INTEGER, testCancelID); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER, testFunctionID); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER, testCancelID); // Invalid/Null Tests CancelInteraction msg = new CancelInteraction(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getInteractionFunctionID()); - assertNull(Test.NULL, msg.getCancelID()); + assertNull(TestValues.NULL, msg.getInteractionFunctionID()); + assertNull(TestValues.NULL, msg.getCancelID()); } /** @@ -112,24 +112,24 @@ public class CancelInteractionTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); CancelInteraction cmd = new CancelInteraction(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, CancelInteraction.KEY_FUNCTION_ID), cmd.getInteractionFunctionID()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, CancelInteraction.KEY_CANCEL_ID), cmd.getCancelID()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, CancelInteraction.KEY_FUNCTION_ID), cmd.getInteractionFunctionID()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, CancelInteraction.KEY_CANCEL_ID), cmd.getCancelID()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ChangeRegistrationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ChangeRegistrationTests.java index 9eda2e182..8404f3b47 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ChangeRegistrationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ChangeRegistrationTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.ChangeRegistration; import com.smartdevicelink.proxy.rpc.enums.Language; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -25,8 +25,8 @@ public class ChangeRegistrationTests extends BaseRpcTests{ protected RPCMessage createMessage(){ ChangeRegistration msg = new ChangeRegistration(); - msg.setLanguage(Test.GENERAL_LANGUAGE); - msg.setHmiDisplayLanguage(Test.GENERAL_LANGUAGE); + msg.setLanguage(TestValues.GENERAL_LANGUAGE); + msg.setHmiDisplayLanguage(TestValues.GENERAL_LANGUAGE); return msg; } @@ -46,10 +46,10 @@ public class ChangeRegistrationTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(ChangeRegistration.KEY_LANGUAGE, Test.GENERAL_LANGUAGE); - result.put(ChangeRegistration.KEY_HMI_DISPLAY_LANGUAGE, Test.GENERAL_LANGUAGE); + result.put(ChangeRegistration.KEY_LANGUAGE, TestValues.GENERAL_LANGUAGE); + result.put(ChangeRegistration.KEY_HMI_DISPLAY_LANGUAGE, TestValues.GENERAL_LANGUAGE); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -64,16 +64,16 @@ public class ChangeRegistrationTests extends BaseRpcTests{ Language testHmiLanguage = ( (ChangeRegistration) msg ).getHmiDisplayLanguage(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, testLanguage); - assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, testHmiLanguage); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LANGUAGE, testLanguage); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LANGUAGE, testHmiLanguage); // Invalid/Null Tests ChangeRegistration msg = new ChangeRegistration(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getLanguage()); - assertNull(Test.NULL, msg.getHmiDisplayLanguage()); + assertNull(TestValues.NULL, msg.getLanguage()); + assertNull(TestValues.NULL, msg.getHmiDisplayLanguage()); } /** @@ -81,24 +81,24 @@ public class ChangeRegistrationTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ChangeRegistration cmd = new ChangeRegistration(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ChangeRegistration.KEY_LANGUAGE), cmd.getLanguage().toString()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ChangeRegistration.KEY_HMI_DISPLAY_LANGUAGE), cmd.getHmiDisplayLanguage().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, ChangeRegistration.KEY_LANGUAGE), cmd.getLanguage().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, ChangeRegistration.KEY_HMI_DISPLAY_LANGUAGE), cmd.getHmiDisplayLanguage().toString()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CloseApplicationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CloseApplicationTests.java index 9d8debf20..19ba24ba0 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CloseApplicationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CloseApplicationTests.java @@ -40,7 +40,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.CloseApplication; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -80,7 +80,7 @@ public class CloseApplicationTests extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests CloseApplication msg = new CloseApplication(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -89,21 +89,21 @@ public class CloseApplicationTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); CloseApplication cmd = new CloseApplication(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateInteractionChoiceSetTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateInteractionChoiceSetTests.java index 5969c53fc..b36d5c823 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateInteractionChoiceSetTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateInteractionChoiceSetTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.Choice; import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSet; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -28,8 +28,8 @@ public class CreateInteractionChoiceSetTests extends BaseRpcTests{ protected RPCMessage createMessage(){ CreateInteractionChoiceSet msg = new CreateInteractionChoiceSet(); - msg.setInteractionChoiceSetID(Test.GENERAL_INT); - msg.setChoiceSet(Test.GENERAL_CHOICE_LIST); + msg.setInteractionChoiceSetID(TestValues.GENERAL_INT); + msg.setChoiceSet(TestValues.GENERAL_CHOICE_LIST); return msg; } @@ -49,10 +49,10 @@ public class CreateInteractionChoiceSetTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(CreateInteractionChoiceSet.KEY_INTERACTION_CHOICE_SET_ID, Test.GENERAL_INT); - result.put(CreateInteractionChoiceSet.KEY_CHOICE_SET, Test.JSON_CHOICES); + result.put(CreateInteractionChoiceSet.KEY_INTERACTION_CHOICE_SET_ID, TestValues.GENERAL_INT); + result.put(CreateInteractionChoiceSet.KEY_CHOICE_SET, TestValues.JSON_CHOICES); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -67,19 +67,19 @@ public class CreateInteractionChoiceSetTests extends BaseRpcTests{ List<Choice> testChoices = ( (CreateInteractionChoiceSet) msg ).getChoiceSet(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, testCmdId); - assertEquals(Test.MATCH, Test.GENERAL_CHOICE_LIST.size(), testChoices.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, testCmdId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_CHOICE_LIST.size(), testChoices.size()); for(int i = 0; i < testChoices.size(); i++){ - assertTrue(Test.TRUE, Validator.validateChoice(Test.GENERAL_CHOICE_LIST.get(i), testChoices.get(i))); + assertTrue(TestValues.TRUE, Validator.validateChoice(TestValues.GENERAL_CHOICE_LIST.get(i), testChoices.get(i))); } // Invalid/Null Tests CreateInteractionChoiceSet msg = new CreateInteractionChoiceSet(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getChoiceSet()); - assertNull(Test.NULL, msg.getInteractionChoiceSetID()); + assertNull(TestValues.NULL, msg.getChoiceSet()); + assertNull(TestValues.NULL, msg.getInteractionChoiceSetID()); } /** @@ -87,29 +87,29 @@ public class CreateInteractionChoiceSetTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); CreateInteractionChoiceSet cmd = new CreateInteractionChoiceSet(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, CreateInteractionChoiceSet.KEY_INTERACTION_CHOICE_SET_ID), cmd.getInteractionChoiceSetID()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, CreateInteractionChoiceSet.KEY_INTERACTION_CHOICE_SET_ID), cmd.getInteractionChoiceSetID()); JSONArray choiceSetArray = JsonUtils.readJsonArrayFromJsonObject(parameters, CreateInteractionChoiceSet.KEY_CHOICE_SET); for (int index = 0; index < choiceSetArray.length(); index++) { Choice chunk = new Choice(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)choiceSetArray.get(index)) ); - assertTrue(Test.TRUE, Validator.validateChoice(chunk, cmd.getChoiceSet().get(index)) ); + assertTrue(TestValues.TRUE, Validator.validateChoice(chunk, cmd.getChoiceSet().get(index)) ); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateWindowTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateWindowTests.java index cb039a7d3..f0aaf1bcd 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateWindowTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateWindowTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.CreateWindow; import com.smartdevicelink.proxy.rpc.enums.WindowType; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -25,11 +25,11 @@ public class CreateWindowTests extends BaseRpcTests { protected RPCMessage createMessage() { CreateWindow msg = new CreateWindow(); - msg.setWindowID(Test.GENERAL_INT); - msg.setWindowName(Test.GENERAL_STRING); - msg.setType(Test.GENERAL_WINDOWTYPE); - msg.setAssociatedServiceType(Test.GENERAL_STRING); - msg.setDuplicateUpdatesFromWindowID(Test.GENERAL_INT); + msg.setWindowID(TestValues.GENERAL_INT); + msg.setWindowName(TestValues.GENERAL_STRING); + msg.setType(TestValues.GENERAL_WINDOWTYPE); + msg.setAssociatedServiceType(TestValues.GENERAL_STRING); + msg.setDuplicateUpdatesFromWindowID(TestValues.GENERAL_INT); return msg; } @@ -49,13 +49,13 @@ public class CreateWindowTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(CreateWindow.KEY_WINDOW_ID, Test.GENERAL_INT); - result.put(CreateWindow.KEY_WINDOW_NAME, Test.GENERAL_STRING); - result.put(CreateWindow.KEY_TYPE, Test.GENERAL_WINDOWTYPE); - result.put(CreateWindow.KEY_ASSOCIATED_SERVICE_TYPE, Test.GENERAL_STRING); - result.put(CreateWindow.KEY_DUPLICATE_UPDATES_FROM_WINDOW_ID, Test.GENERAL_INT); + result.put(CreateWindow.KEY_WINDOW_ID, TestValues.GENERAL_INT); + result.put(CreateWindow.KEY_WINDOW_NAME, TestValues.GENERAL_STRING); + result.put(CreateWindow.KEY_TYPE, TestValues.GENERAL_WINDOWTYPE); + result.put(CreateWindow.KEY_ASSOCIATED_SERVICE_TYPE, TestValues.GENERAL_STRING); + result.put(CreateWindow.KEY_DUPLICATE_UPDATES_FROM_WINDOW_ID, TestValues.GENERAL_INT); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -73,22 +73,22 @@ public class CreateWindowTests extends BaseRpcTests { int testDuplicateUpdatesFromWindowID = ((CreateWindow) msg).getDuplicateUpdatesFromWindowID(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, testWindowID); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testWindowName); - assertEquals(Test.MATCH, Test.GENERAL_WINDOWTYPE, testType); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testAssociatedServiceType); - assertEquals(Test.MATCH, Test.GENERAL_INT, testDuplicateUpdatesFromWindowID); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, testWindowID); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testWindowName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_WINDOWTYPE, testType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testAssociatedServiceType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, testDuplicateUpdatesFromWindowID); // Invalid/Null Tests CreateWindow msg = new CreateWindow(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getWindowID()); - assertNull(Test.NULL, msg.getWindowName()); - assertNull(Test.NULL, msg.getType()); - assertNull(Test.NULL, msg.getAssociatedServiceType()); - assertNull(Test.NULL, msg.getDuplicateUpdatesFromWindowID()); + assertNull(TestValues.NULL, msg.getWindowID()); + assertNull(TestValues.NULL, msg.getWindowName()); + assertNull(TestValues.NULL, msg.getType()); + assertNull(TestValues.NULL, msg.getAssociatedServiceType()); + assertNull(TestValues.NULL, msg.getDuplicateUpdatesFromWindowID()); } /** @@ -96,27 +96,27 @@ public class CreateWindowTests extends BaseRpcTests { */ public void testJsonConstructor() { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); CreateWindow cmd = new CreateWindow(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, CreateWindow.KEY_WINDOW_ID), cmd.getWindowID()); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, CreateWindow.KEY_WINDOW_NAME).toString(), cmd.getWindowName().toString()); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, CreateWindow.KEY_TYPE).toString(), cmd.getType().toString()); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, CreateWindow.KEY_ASSOCIATED_SERVICE_TYPE).toString(), cmd.getAssociatedServiceType().toString()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, CreateWindow.KEY_DUPLICATE_UPDATES_FROM_WINDOW_ID), cmd.getDuplicateUpdatesFromWindowID()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, CreateWindow.KEY_WINDOW_ID), cmd.getWindowID()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, CreateWindow.KEY_WINDOW_NAME).toString(), cmd.getWindowName().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, CreateWindow.KEY_TYPE).toString(), cmd.getType().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, CreateWindow.KEY_ASSOCIATED_SERVICE_TYPE).toString(), cmd.getAssociatedServiceType().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, CreateWindow.KEY_DUPLICATE_UPDATES_FROM_WINDOW_ID), cmd.getDuplicateUpdatesFromWindowID()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteCommandTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteCommandTests.java index 8b3bff42c..ae901cede 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteCommandTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteCommandTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.DeleteCommand; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -24,7 +24,7 @@ public class DeleteCommandTests extends BaseRpcTests{ protected RPCMessage createMessage(){ DeleteCommand msg = new DeleteCommand(); - msg.setCmdID(Test.GENERAL_INT); + msg.setCmdID(TestValues.GENERAL_INT); return msg; } @@ -44,9 +44,9 @@ public class DeleteCommandTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(DeleteCommand.KEY_CMD_ID, Test.GENERAL_INT); + result.put(DeleteCommand.KEY_CMD_ID, TestValues.GENERAL_INT); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -60,14 +60,14 @@ public class DeleteCommandTests extends BaseRpcTests{ int cmdId = ( (DeleteCommand) msg ).getCmdID(); // Valid Tests - assertEquals("Command ID didn't match input command ID.", Test.GENERAL_INT, cmdId); + assertEquals("Command ID didn't match input command ID.", TestValues.GENERAL_INT, cmdId); // Invalid/Null Tests DeleteCommand msg = new DeleteCommand(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.MATCH, msg.getCmdID()); + assertNull(TestValues.MATCH, msg.getCmdID()); } /** @@ -75,24 +75,24 @@ public class DeleteCommandTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.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); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DeleteCommand.KEY_CMD_ID), cmd.getCmdID()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteFileTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteFileTests.java index c86a1c134..cf1dec131 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteFileTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteFileTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.DeleteFile; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -24,7 +24,7 @@ public class DeleteFileTests extends BaseRpcTests{ protected RPCMessage createMessage(){ DeleteFile msg = new DeleteFile(); - msg.setSdlFileName(Test.GENERAL_STRING); + msg.setSdlFileName(TestValues.GENERAL_STRING); return msg; } @@ -44,9 +44,9 @@ public class DeleteFileTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(DeleteFile.KEY_SDL_FILE_NAME, Test.GENERAL_STRING); + result.put(DeleteFile.KEY_SDL_FILE_NAME, TestValues.GENERAL_STRING); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -60,14 +60,14 @@ public class DeleteFileTests extends BaseRpcTests{ String testFilename = ( (DeleteFile) msg ).getSdlFileName(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, testFilename); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testFilename); // Invalid/Null Tests DeleteFile msg = new DeleteFile(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getSdlFileName()); + assertNull(TestValues.NULL, msg.getSdlFileName()); } /** @@ -75,23 +75,23 @@ public class DeleteFileTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); DeleteFile cmd = new DeleteFile(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, DeleteFile.KEY_SDL_FILE_NAME), cmd.getSdlFileName()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, DeleteFile.KEY_SDL_FILE_NAME), cmd.getSdlFileName()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteInteractionChoiceSetTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteInteractionChoiceSetTests.java index b30aa1567..47f9b1b1a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteInteractionChoiceSetTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteInteractionChoiceSetTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSet; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -24,7 +24,7 @@ public class DeleteInteractionChoiceSetTests extends BaseRpcTests{ protected RPCMessage createMessage(){ DeleteInteractionChoiceSet msg = new DeleteInteractionChoiceSet(); - msg.setInteractionChoiceSetID(Test.GENERAL_INT); + msg.setInteractionChoiceSetID(TestValues.GENERAL_INT); return msg; } @@ -44,9 +44,9 @@ public class DeleteInteractionChoiceSetTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(DeleteInteractionChoiceSet.KEY_INTERACTION_CHOICE_SET_ID, Test.GENERAL_INT); + result.put(DeleteInteractionChoiceSet.KEY_INTERACTION_CHOICE_SET_ID, TestValues.GENERAL_INT); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -60,14 +60,14 @@ public class DeleteInteractionChoiceSetTests extends BaseRpcTests{ int testChoiceSetId = ( (DeleteInteractionChoiceSet) msg ).getInteractionChoiceSetID(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, testChoiceSetId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, testChoiceSetId); // Invalid/Null Tests DeleteInteractionChoiceSet msg = new DeleteInteractionChoiceSet(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getInteractionChoiceSetID()); + assertNull(TestValues.NULL, msg.getInteractionChoiceSetID()); } /** @@ -75,23 +75,23 @@ public class DeleteInteractionChoiceSetTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); DeleteInteractionChoiceSet cmd = new DeleteInteractionChoiceSet(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DeleteInteractionChoiceSet.KEY_INTERACTION_CHOICE_SET_ID), cmd.getInteractionChoiceSetID()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DeleteInteractionChoiceSet.KEY_INTERACTION_CHOICE_SET_ID), cmd.getInteractionChoiceSetID()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteSubMenuTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteSubMenuTests.java index 4ed760099..f6929a4cd 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteSubMenuTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteSubMenuTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.DeleteSubMenu; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -24,7 +24,7 @@ public class DeleteSubMenuTests extends BaseRpcTests{ protected RPCMessage createMessage(){ DeleteSubMenu msg = new DeleteSubMenu(); - msg.setMenuID(Test.GENERAL_INT); + msg.setMenuID(TestValues.GENERAL_INT); return msg; } @@ -44,9 +44,9 @@ public class DeleteSubMenuTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(DeleteSubMenu.KEY_MENU_ID, Test.GENERAL_INT); + result.put(DeleteSubMenu.KEY_MENU_ID, TestValues.GENERAL_INT); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -60,14 +60,14 @@ public class DeleteSubMenuTests extends BaseRpcTests{ int testMenuId = ( (DeleteSubMenu) msg ).getMenuID(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, testMenuId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, testMenuId); // Invalid/Null Tests DeleteSubMenu msg = new DeleteSubMenu(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getMenuID()); + assertNull(TestValues.NULL, msg.getMenuID()); } /** @@ -75,23 +75,23 @@ public class DeleteSubMenuTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); DeleteSubMenu cmd = new DeleteSubMenu(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DeleteSubMenu.KEY_MENU_ID), cmd.getMenuID()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DeleteSubMenu.KEY_MENU_ID), cmd.getMenuID()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteWindowTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteWindowTests.java index 48080615f..378496ca9 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteWindowTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteWindowTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.DeleteWindow; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -24,7 +24,7 @@ public class DeleteWindowTests extends BaseRpcTests { protected RPCMessage createMessage() { DeleteWindow msg = new DeleteWindow(); - msg.setWindowID(Test.GENERAL_INT); + msg.setWindowID(TestValues.GENERAL_INT); return msg; } @@ -44,9 +44,9 @@ public class DeleteWindowTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(DeleteWindow.KEY_WINDOW_ID, Test.GENERAL_INT); + result.put(DeleteWindow.KEY_WINDOW_ID, TestValues.GENERAL_INT); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -60,14 +60,14 @@ public class DeleteWindowTests extends BaseRpcTests { int testWindowID = ((DeleteWindow) msg).getWindowID(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, testWindowID); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, testWindowID); // Invalid/Null Tests DeleteWindow msg = new DeleteWindow(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getWindowID()); + assertNull(TestValues.NULL, msg.getWindowID()); } /** @@ -75,23 +75,23 @@ public class DeleteWindowTests extends BaseRpcTests { */ public void testJsonConstructor() { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); DeleteWindow cmd = new DeleteWindow(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DeleteWindow.KEY_WINDOW_ID), cmd.getWindowID()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DeleteWindow.KEY_WINDOW_ID), cmd.getWindowID()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DiagnosticMessageTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DiagnosticMessageTests.java index 7b050347d..8063f08a3 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DiagnosticMessageTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DiagnosticMessageTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.DiagnosticMessage; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -26,9 +26,9 @@ public class DiagnosticMessageTests extends BaseRpcTests{ protected RPCMessage createMessage(){ DiagnosticMessage msg = new DiagnosticMessage(); - msg.setMessageLength(Test.GENERAL_INT); - msg.setTargetID(Test.GENERAL_INT); - msg.setMessageData(Test.GENERAL_INTEGER_LIST); + msg.setMessageLength(TestValues.GENERAL_INT); + msg.setTargetID(TestValues.GENERAL_INT); + msg.setMessageData(TestValues.GENERAL_INTEGER_LIST); return msg; } @@ -48,11 +48,11 @@ public class DiagnosticMessageTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(DiagnosticMessage.KEY_TARGET_ID, Test.GENERAL_INT); - result.put(DiagnosticMessage.KEY_MESSAGE_LENGTH, Test.GENERAL_INT); - result.put(DiagnosticMessage.KEY_MESSAGE_DATA, JsonUtils.createJsonArray(Test.GENERAL_INTEGER_LIST)); + result.put(DiagnosticMessage.KEY_TARGET_ID, TestValues.GENERAL_INT); + result.put(DiagnosticMessage.KEY_MESSAGE_LENGTH, TestValues.GENERAL_INT); + result.put(DiagnosticMessage.KEY_MESSAGE_DATA, JsonUtils.createJsonArray(TestValues.GENERAL_INTEGER_LIST)); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -68,22 +68,22 @@ public class DiagnosticMessageTests extends BaseRpcTests{ List<Integer> testMessageData = ( (DiagnosticMessage) msg ).getMessageData(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, testTargetId); - assertEquals(Test.MATCH, Test.GENERAL_INT, testMessageLength); - assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST.size(), testMessageData.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, testTargetId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, testMessageLength); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER_LIST.size(), testMessageData.size()); for(int i = 0; i < testMessageData.size(); i++){ - assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST.get(i), testMessageData.get(i)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER_LIST.get(i), testMessageData.get(i)); } // Invalid/Null Tests DiagnosticMessage msg = new DiagnosticMessage(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getTargetID()); - assertNull(Test.NULL, msg.getMessageLength()); - assertNull(Test.NULL, msg.getMessageData()); + assertNull(TestValues.NULL, msg.getTargetID()); + assertNull(TestValues.NULL, msg.getMessageLength()); + assertNull(TestValues.NULL, msg.getMessageData()); } /** @@ -91,29 +91,29 @@ public class DiagnosticMessageTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); DiagnosticMessage cmd = new DiagnosticMessage(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DiagnosticMessage.KEY_TARGET_ID), cmd.getTargetID()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DiagnosticMessage.KEY_MESSAGE_LENGTH), cmd.getMessageLength()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DiagnosticMessage.KEY_TARGET_ID), cmd.getTargetID()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DiagnosticMessage.KEY_MESSAGE_LENGTH), cmd.getMessageLength()); List<Integer> messageDataList = JsonUtils.readIntegerListFromJsonObject(parameters, DiagnosticMessage.KEY_MESSAGE_DATA); List<Integer> testDataList = cmd.getMessageData(); - assertEquals(Test.MATCH, messageDataList.size(), testDataList.size()); - assertTrue(Test.TRUE, Validator.validateIntegerList(messageDataList, testDataList)); + assertEquals(TestValues.MATCH, messageDataList.size(), testDataList.size()); + assertTrue(TestValues.TRUE, Validator.validateIntegerList(messageDataList, testDataList)); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DialNumberTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DialNumberTests.java index 40a8d432f..f845ec6a4 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DialNumberTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DialNumberTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.DialNumber; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -48,7 +48,7 @@ public class DialNumberTests extends BaseRpcTests { try{ result.put(DialNumber.KEY_NUMBER, TEST_NUMBER); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -62,13 +62,13 @@ public class DialNumberTests extends BaseRpcTests { String testNumber = ((DialNumber) msg).getNumber(); // Valid Tests - assertEquals(Test.MATCH, TEST_NUMBER, testNumber); + assertEquals(TestValues.MATCH, TEST_NUMBER, testNumber); // Invalid/Null Tests DialNumber msg = new DialNumber(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getNumber()); + assertNull(TestValues.NULL, msg.getNumber()); } /** @@ -76,22 +76,22 @@ public class DialNumberTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); DialNumber cmd = new DialNumber(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, DialNumber.KEY_NUMBER), cmd.getNumber()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, DialNumber.KEY_NUMBER), cmd.getNumber()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/EndAudioPassThruTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/EndAudioPassThruTests.java index 0ab5ebe66..83c5e7fe7 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/EndAudioPassThruTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/EndAudioPassThruTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.EndAudioPassThru; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class EndAudioPassThruTests extends BaseRpcTests{ public void testRpcValues () { // Invalid/Null Tests EndAudioPassThru msg = new EndAudioPassThru(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,20 +55,20 @@ public class EndAudioPassThruTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); EndAudioPassThru cmd = new EndAudioPassThru(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetAppServiceDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetAppServiceDataTests.java index abda43557..d75bf818c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetAppServiceDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetAppServiceDataTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.GetAppServiceData; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -19,8 +19,8 @@ public class GetAppServiceDataTests extends BaseRpcTests { @Override protected RPCMessage createMessage() { GetAppServiceData msg = new GetAppServiceData(); - msg.setServiceType(Test.GENERAL_STRING); - msg.setSubscribe(Test.GENERAL_BOOLEAN); + msg.setServiceType(TestValues.GENERAL_STRING); + msg.setSubscribe(TestValues.GENERAL_BOOLEAN); return msg; } @@ -39,10 +39,10 @@ public class GetAppServiceDataTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(GetAppServiceData.KEY_SERVICE_TYPE, Test.GENERAL_STRING); - result.put(GetAppServiceData.KEY_SUBSCRIBE, Test.GENERAL_BOOLEAN); + result.put(GetAppServiceData.KEY_SERVICE_TYPE, TestValues.GENERAL_STRING); + result.put(GetAppServiceData.KEY_SUBSCRIBE, TestValues.GENERAL_BOOLEAN); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; } @@ -56,12 +56,12 @@ public class GetAppServiceDataTests extends BaseRpcTests { boolean subscribe = ( (GetAppServiceData) msg ).getSubscribe(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, serviceType); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, subscribe); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, serviceType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, subscribe); // Invalid/Null Tests GetAppServiceData msg = new GetAppServiceData(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); assertNull(msg.getServiceType()); @@ -73,10 +73,10 @@ public class GetAppServiceDataTests extends BaseRpcTests { */ public void testRequiredParamsConstructor () { - GetAppServiceData msg = new GetAppServiceData(Test.GENERAL_STRING); - assertNotNull(Test.NOT_NULL, msg); + GetAppServiceData msg = new GetAppServiceData(TestValues.GENERAL_STRING); + assertNotNull(TestValues.NOT_NULL, msg); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, msg.getServiceType()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, msg.getServiceType()); } /** @@ -84,22 +84,22 @@ public class GetAppServiceDataTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); GetAppServiceData cmd = new GetAppServiceData(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetAppServiceData.KEY_SUBSCRIBE), cmd.getSubscribe()); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetAppServiceData.KEY_SERVICE_TYPE).toString(), cmd.getServiceType().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetAppServiceData.KEY_SUBSCRIBE), cmd.getSubscribe()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetAppServiceData.KEY_SERVICE_TYPE).toString(), cmd.getServiceType().toString()); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetCloudAppPropertiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetCloudAppPropertiesTests.java index d31c33caa..d100d0672 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetCloudAppPropertiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetCloudAppPropertiesTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.GetCloudAppProperties; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONException; import org.json.JSONObject; @@ -15,7 +15,7 @@ public class GetCloudAppPropertiesTests extends BaseRpcTests { protected RPCMessage createMessage(){ GetCloudAppProperties msg = new GetCloudAppProperties(); - msg.setAppID(Test.GENERAL_STRING); + msg.setAppID(TestValues.GENERAL_STRING); return msg; } @@ -35,9 +35,9 @@ public class GetCloudAppPropertiesTests extends BaseRpcTests { JSONObject result = new JSONObject(); try{ - result.put(GetCloudAppProperties.KEY_APP_ID, Test.GENERAL_STRING); + result.put(GetCloudAppProperties.KEY_APP_ID, TestValues.GENERAL_STRING); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetDTCsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetDTCsTests.java index 5b298a93b..89ccf6359 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetDTCsTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetDTCsTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.GetDTCs; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -24,8 +24,8 @@ public class GetDTCsTests extends BaseRpcTests{ protected RPCMessage createMessage(){ GetDTCs msg = new GetDTCs(); - msg.setEcuName(Test.GENERAL_INT); - msg.setDtcMask(Test.GENERAL_INT); + msg.setEcuName(TestValues.GENERAL_INT); + msg.setDtcMask(TestValues.GENERAL_INT); return msg; } @@ -45,10 +45,10 @@ public class GetDTCsTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(GetDTCs.KEY_ECU_NAME, Test.GENERAL_INT); - result.put(GetDTCs.KEY_DTC_MASK, Test.GENERAL_INT); + result.put(GetDTCs.KEY_ECU_NAME, TestValues.GENERAL_INT); + result.put(GetDTCs.KEY_DTC_MASK, TestValues.GENERAL_INT); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -63,16 +63,16 @@ public class GetDTCsTests extends BaseRpcTests{ int testEcuName = ( (GetDTCs) msg ).getEcuName(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, testDtcMask); - assertEquals(Test.MATCH, Test.GENERAL_INT, testEcuName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, testDtcMask); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, testEcuName); // Invalid/Null Tests GetDTCs msg = new GetDTCs(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getEcuName()); - assertNull(Test.NULL, msg.getDtcMask()); + assertNull(TestValues.NULL, msg.getEcuName()); + assertNull(TestValues.NULL, msg.getDtcMask()); } /** @@ -80,26 +80,26 @@ public class GetDTCsTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); GetDTCs cmd = new GetDTCs(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetDTCs.KEY_DTC_MASK), cmd.getDtcMask()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetDTCs.KEY_ECU_NAME), cmd.getEcuName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetDTCs.KEY_DTC_MASK), cmd.getDtcMask()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetDTCs.KEY_ECU_NAME), cmd.getEcuName()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetFileTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetFileTests.java index 48214373d..59ff1f516 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetFileTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetFileTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.GetFile; import com.smartdevicelink.proxy.rpc.enums.FileType; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -22,11 +22,11 @@ public class GetFileTests extends BaseRpcTests { protected RPCMessage createMessage() { GetFile msg = new GetFile(); - msg.setFileName(Test.GENERAL_STRING); - msg.setAppServiceId(Test.GENERAL_STRING); - msg.setFileType(Test.GENERAL_FILETYPE); - msg.setOffset(Test.GENERAL_INT); - msg.setLength(Test.GENERAL_INT); + msg.setFileName(TestValues.GENERAL_STRING); + msg.setAppServiceId(TestValues.GENERAL_STRING); + msg.setFileType(TestValues.GENERAL_FILETYPE); + msg.setOffset(TestValues.GENERAL_INT); + msg.setLength(TestValues.GENERAL_INT); return msg; } @@ -46,13 +46,13 @@ public class GetFileTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(GetFile.KEY_FILE_NAME, Test.GENERAL_STRING); - result.put(GetFile.KEY_APP_SERVICE_ID, Test.GENERAL_STRING); - result.put(GetFile.KEY_FILE_TYPE, Test.GENERAL_FILETYPE); - result.put(GetFile.KEY_OFFSET, Test.GENERAL_INTEGER); - result.put(GetFile.KEY_LENGTH, Test.GENERAL_INTEGER); + result.put(GetFile.KEY_FILE_NAME, TestValues.GENERAL_STRING); + result.put(GetFile.KEY_APP_SERVICE_ID, TestValues.GENERAL_STRING); + result.put(GetFile.KEY_FILE_TYPE, TestValues.GENERAL_FILETYPE); + result.put(GetFile.KEY_OFFSET, TestValues.GENERAL_INTEGER); + result.put(GetFile.KEY_LENGTH, TestValues.GENERAL_INTEGER); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -70,22 +70,22 @@ public class GetFileTests extends BaseRpcTests { Integer length = ( (GetFile) msg ).getLength(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, fileName); - assertEquals(Test.MATCH, Test.GENERAL_STRING, appServiceId); - assertEquals(Test.MATCH, Test.GENERAL_FILETYPE, fileType); - assertEquals(Test.MATCH, Test.GENERAL_INTEGER, offset); - assertEquals(Test.MATCH, Test.GENERAL_INTEGER, length); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, fileName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, appServiceId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_FILETYPE, fileType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER, offset); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER, length); // Invalid/Null Tests GetFile msg = new GetFile(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getFileName()); - assertNull(Test.NULL, msg.getAppServiceId()); - assertNull(Test.NULL, msg.getFileType()); - assertNull(Test.NULL, msg.getOffset()); - assertNull(Test.NULL, msg.getLength()); + assertNull(TestValues.NULL, msg.getFileName()); + assertNull(TestValues.NULL, msg.getAppServiceId()); + assertNull(TestValues.NULL, msg.getFileType()); + assertNull(TestValues.NULL, msg.getOffset()); + assertNull(TestValues.NULL, msg.getLength()); } /** @@ -93,10 +93,10 @@ public class GetFileTests extends BaseRpcTests { */ public void testRequiredParamsConstructor () { - GetFile msg = new GetFile(Test.GENERAL_STRING); - assertNotNull(Test.NOT_NULL, msg); + GetFile msg = new GetFile(TestValues.GENERAL_STRING); + assertNotNull(TestValues.NOT_NULL, msg); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, msg.getFileName()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, msg.getFileName()); } /** @@ -104,26 +104,26 @@ public class GetFileTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); GetFile cmd = new GetFile(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetFile.KEY_APP_SERVICE_ID), cmd.getAppServiceId()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetFile.KEY_FILE_NAME), cmd.getFileName()); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetFile.KEY_FILE_TYPE).toString(), cmd.getFileType().toString()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetFile.KEY_LENGTH), cmd.getLength()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetFile.KEY_OFFSET), cmd.getOffset()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetFile.KEY_APP_SERVICE_ID), cmd.getAppServiceId()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetFile.KEY_FILE_NAME), cmd.getFileName()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetFile.KEY_FILE_TYPE).toString(), cmd.getFileType().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetFile.KEY_LENGTH), cmd.getLength()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetFile.KEY_OFFSET), cmd.getOffset()); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataConsentTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataConsentTests.java index 15a902a84..5d40d255d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataConsentTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataConsentTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.GetInteriorVehicleDataConsent; import com.smartdevicelink.proxy.rpc.enums.ModuleType; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -21,8 +21,8 @@ public class GetInteriorVehicleDataConsentTests extends BaseRpcTests { @Override protected RPCMessage createMessage() { GetInteriorVehicleDataConsent msg = new GetInteriorVehicleDataConsent(); - msg.setModuleType(Test.GENERAL_MODULETYPE); - msg.setModuleIds(Test.GENERAL_STRING_LIST); + msg.setModuleType(TestValues.GENERAL_MODULETYPE); + msg.setModuleIds(TestValues.GENERAL_STRING_LIST); return msg; } @@ -30,10 +30,10 @@ public class GetInteriorVehicleDataConsentTests extends BaseRpcTests { protected JSONObject getExpectedParameters(int sdlVersion) { JSONObject result = new JSONObject(); try { - result.put(GetInteriorVehicleDataConsent.KEY_MODULE_TYPE, Test.GENERAL_MODULETYPE); - result.put(GetInteriorVehicleDataConsent.KEY_MODULE_ID, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST)); + result.put(GetInteriorVehicleDataConsent.KEY_MODULE_TYPE, TestValues.GENERAL_MODULETYPE); + result.put(GetInteriorVehicleDataConsent.KEY_MODULE_ID, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; } @@ -53,40 +53,40 @@ public class GetInteriorVehicleDataConsentTests extends BaseRpcTests { List<String> ids = ((GetInteriorVehicleDataConsent) msg).getModuleIds(); //valid tests - assertEquals(Test.MATCH, Test.GENERAL_MODULETYPE, type); - assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST, ids); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MODULETYPE, type); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING_LIST, ids); //null tests GetInteriorVehicleDataConsent msg = new GetInteriorVehicleDataConsent(); - assertNull(Test.NULL, msg.getModuleType()); - assertNull(Test.NULL, msg.getModuleIds()); + assertNull(TestValues.NULL, msg.getModuleType()); + assertNull(TestValues.NULL, msg.getModuleIds()); //test require param constructor - GetInteriorVehicleDataConsent msg2 = new GetInteriorVehicleDataConsent(Test.GENERAL_MODULETYPE, Test.GENERAL_STRING_LIST); - assertEquals(Test.MATCH, Test.GENERAL_MODULETYPE, msg2.getModuleType()); - assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST, msg2.getModuleIds()); + GetInteriorVehicleDataConsent msg2 = new GetInteriorVehicleDataConsent(TestValues.GENERAL_MODULETYPE, TestValues.GENERAL_STRING_LIST); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MODULETYPE, msg2.getModuleType()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING_LIST, msg2.getModuleIds()); } public void testJsonConstructor() { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); GetInteriorVehicleDataConsent cmd = new GetInteriorVehicleDataConsent(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.NOT_NULL, 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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetInteriorVehicleDataConsent.KEY_MODULE_TYPE).toString(), cmd.getModuleType().toString()); - assertEquals(Test.MATCH, JsonUtils.readStringListFromJsonObject(parameters, GetInteriorVehicleDataConsent.KEY_MODULE_ID), cmd.getModuleIds()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetInteriorVehicleDataConsent.KEY_MODULE_TYPE).toString(), cmd.getModuleType().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readStringListFromJsonObject(parameters, GetInteriorVehicleDataConsent.KEY_MODULE_ID), cmd.getModuleIds()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataTests.java index dd175ae6f..c0c92e867 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.GetInteriorVehicleData; import com.smartdevicelink.proxy.rpc.enums.ModuleType; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -25,9 +25,9 @@ public class GetInteriorVehicleDataTests extends BaseRpcTests { protected RPCMessage createMessage(){ GetInteriorVehicleData msg = new GetInteriorVehicleData(); - msg.setModuleType(Test.GENERAL_MODULETYPE); - msg.setSubscribe(Test.GENERAL_BOOLEAN); - msg.setModuleId(Test.GENERAL_STRING); + msg.setModuleType(TestValues.GENERAL_MODULETYPE); + msg.setSubscribe(TestValues.GENERAL_BOOLEAN); + msg.setModuleId(TestValues.GENERAL_STRING); return msg; } @@ -47,11 +47,11 @@ public class GetInteriorVehicleDataTests extends BaseRpcTests { JSONObject result = new JSONObject(); try{ - result.put(GetInteriorVehicleData.KEY_MODULE_TYPE, Test.GENERAL_MODULETYPE); - result.put(GetInteriorVehicleData.KEY_SUBSCRIBE, Test.GENERAL_BOOLEAN); - result.put(GetInteriorVehicleData.KEY_MODULE_ID, Test.GENERAL_STRING); + result.put(GetInteriorVehicleData.KEY_MODULE_TYPE, TestValues.GENERAL_MODULETYPE); + result.put(GetInteriorVehicleData.KEY_SUBSCRIBE, TestValues.GENERAL_BOOLEAN); + result.put(GetInteriorVehicleData.KEY_MODULE_ID, TestValues.GENERAL_STRING); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -67,18 +67,18 @@ public class GetInteriorVehicleDataTests extends BaseRpcTests { String testModuleId = ((GetInteriorVehicleData) msg).getModuleId(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_MODULETYPE, testModuleType); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testSubscribed); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testModuleId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MODULETYPE, testModuleType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, testSubscribed); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testModuleId); // Invalid/Null Tests GetInteriorVehicleData msg = new GetInteriorVehicleData(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getModuleType()); - assertNull(Test.NULL, msg.getSubscribe()); - assertNull(Test.NULL, msg.getModuleId()); + assertNull(TestValues.NULL, msg.getModuleType()); + assertNull(TestValues.NULL, msg.getSubscribe()); + assertNull(TestValues.NULL, msg.getModuleId()); } /** @@ -86,26 +86,26 @@ public class GetInteriorVehicleDataTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); GetInteriorVehicleData cmd = new GetInteriorVehicleData(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetInteriorVehicleData.KEY_MODULE_TYPE).toString(), cmd.getModuleType().toString()); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetInteriorVehicleData.KEY_SUBSCRIBE), cmd.getSubscribe()); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetInteriorVehicleData.KEY_MODULE_ID), cmd.getModuleId()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetInteriorVehicleData.KEY_MODULE_TYPE).toString(), cmd.getModuleType().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetInteriorVehicleData.KEY_SUBSCRIBE), cmd.getSubscribe()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetInteriorVehicleData.KEY_MODULE_ID), cmd.getModuleId()); }catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetSystemCapabilityTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetSystemCapabilityTests.java index 290a291d1..87269b70f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetSystemCapabilityTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetSystemCapabilityTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.GetSystemCapability; import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -21,8 +21,8 @@ public class GetSystemCapabilityTests extends BaseRpcTests { protected RPCMessage createMessage(){ GetSystemCapability msg = new GetSystemCapability(); - msg.setSystemCapabilityType(Test.GENERAL_SYSTEMCAPABILITYTYPE); - msg.setSubscribe(Test.GENERAL_BOOLEAN); + msg.setSystemCapabilityType(TestValues.GENERAL_SYSTEMCAPABILITYTYPE); + msg.setSubscribe(TestValues.GENERAL_BOOLEAN); return msg; } @@ -42,10 +42,10 @@ public class GetSystemCapabilityTests extends BaseRpcTests { JSONObject result = new JSONObject(); try{ - result.put(GetSystemCapability.KEY_SYSTEM_CAPABILITY_TYPE, Test.GENERAL_SYSTEMCAPABILITYTYPE); - result.put(GetSystemCapability.KEY_SUBSCRIBE, Test.GENERAL_BOOLEAN); + result.put(GetSystemCapability.KEY_SYSTEM_CAPABILITY_TYPE, TestValues.GENERAL_SYSTEMCAPABILITYTYPE); + result.put(GetSystemCapability.KEY_SUBSCRIBE, TestValues.GENERAL_BOOLEAN); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -60,16 +60,16 @@ public class GetSystemCapabilityTests extends BaseRpcTests { boolean testSubscribe = ( (GetSystemCapability) msg ).getSubscribe(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_SYSTEMCAPABILITYTYPE, testType); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testSubscribe); + assertEquals(TestValues.MATCH, TestValues.GENERAL_SYSTEMCAPABILITYTYPE, testType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, testSubscribe); // Invalid/Null Tests GetSystemCapability msg = new GetSystemCapability(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getSystemCapabilityType()); - assertNull(Test.NULL, msg.getSubscribe()); + assertNull(TestValues.NULL, msg.getSystemCapabilityType()); + assertNull(TestValues.NULL, msg.getSubscribe()); } /** @@ -77,25 +77,25 @@ public class GetSystemCapabilityTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); GetSystemCapability cmd = new GetSystemCapability(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetSystemCapability.KEY_SYSTEM_CAPABILITY_TYPE).toString(), cmd.getSystemCapabilityType().toString()); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetSystemCapability.KEY_SUBSCRIBE), cmd.getSubscribe()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetSystemCapability.KEY_SYSTEM_CAPABILITY_TYPE).toString(), cmd.getSystemCapabilityType().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetSystemCapability.KEY_SUBSCRIBE), cmd.getSubscribe()); }catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java index 99577fb46..dbd5e30bc 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.GetVehicleData; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -24,36 +24,36 @@ public class GetVehicleDataTests extends BaseRpcTests { protected RPCMessage createMessage(){ GetVehicleData msg = new GetVehicleData(); - msg.setSpeed(Test.GENERAL_BOOLEAN); - msg.setRpm(Test.GENERAL_BOOLEAN); - msg.setExternalTemperature(Test.GENERAL_BOOLEAN); - msg.setFuelLevel(Test.GENERAL_BOOLEAN); - msg.setPrndl(Test.GENERAL_BOOLEAN); - msg.setTirePressure(Test.GENERAL_BOOLEAN); - msg.setEngineTorque(Test.GENERAL_BOOLEAN); - msg.setEngineOilLife(Test.GENERAL_BOOLEAN); - msg.setOdometer(Test.GENERAL_BOOLEAN); - msg.setGps(Test.GENERAL_BOOLEAN); - msg.setFuelLevelState(Test.GENERAL_BOOLEAN); - msg.setInstantFuelConsumption(Test.GENERAL_BOOLEAN); - msg.setVin(Test.GENERAL_BOOLEAN); - msg.setBeltStatus(Test.GENERAL_BOOLEAN); - msg.setBodyInformation(Test.GENERAL_BOOLEAN); - msg.setDeviceStatus(Test.GENERAL_BOOLEAN); - msg.setDriverBraking(Test.GENERAL_BOOLEAN); - msg.setWiperStatus(Test.GENERAL_BOOLEAN); - msg.setHeadLampStatus(Test.GENERAL_BOOLEAN); - msg.setAccPedalPosition(Test.GENERAL_BOOLEAN); - msg.setSteeringWheelAngle(Test.GENERAL_BOOLEAN); - msg.setECallInfo(Test.GENERAL_BOOLEAN); - msg.setAirbagStatus(Test.GENERAL_BOOLEAN); - msg.setEmergencyEvent(Test.GENERAL_BOOLEAN); - msg.setClusterModeStatus(Test.GENERAL_BOOLEAN); - msg.setMyKey(Test.GENERAL_BOOLEAN); - msg.setFuelRange(Test.GENERAL_BOOLEAN); - msg.setTurnSignal(Test.GENERAL_BOOLEAN); - msg.setElectronicParkBrakeStatus(Test.GENERAL_BOOLEAN); - msg.setOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, Test.GENERAL_BOOLEAN); + msg.setSpeed(TestValues.GENERAL_BOOLEAN); + msg.setRpm(TestValues.GENERAL_BOOLEAN); + msg.setExternalTemperature(TestValues.GENERAL_BOOLEAN); + msg.setFuelLevel(TestValues.GENERAL_BOOLEAN); + msg.setPrndl(TestValues.GENERAL_BOOLEAN); + msg.setTirePressure(TestValues.GENERAL_BOOLEAN); + msg.setEngineTorque(TestValues.GENERAL_BOOLEAN); + msg.setEngineOilLife(TestValues.GENERAL_BOOLEAN); + msg.setOdometer(TestValues.GENERAL_BOOLEAN); + msg.setGps(TestValues.GENERAL_BOOLEAN); + msg.setFuelLevelState(TestValues.GENERAL_BOOLEAN); + msg.setInstantFuelConsumption(TestValues.GENERAL_BOOLEAN); + msg.setVin(TestValues.GENERAL_BOOLEAN); + msg.setBeltStatus(TestValues.GENERAL_BOOLEAN); + msg.setBodyInformation(TestValues.GENERAL_BOOLEAN); + msg.setDeviceStatus(TestValues.GENERAL_BOOLEAN); + msg.setDriverBraking(TestValues.GENERAL_BOOLEAN); + msg.setWiperStatus(TestValues.GENERAL_BOOLEAN); + msg.setHeadLampStatus(TestValues.GENERAL_BOOLEAN); + msg.setAccPedalPosition(TestValues.GENERAL_BOOLEAN); + msg.setSteeringWheelAngle(TestValues.GENERAL_BOOLEAN); + msg.setECallInfo(TestValues.GENERAL_BOOLEAN); + msg.setAirbagStatus(TestValues.GENERAL_BOOLEAN); + msg.setEmergencyEvent(TestValues.GENERAL_BOOLEAN); + msg.setClusterModeStatus(TestValues.GENERAL_BOOLEAN); + msg.setMyKey(TestValues.GENERAL_BOOLEAN); + msg.setFuelRange(TestValues.GENERAL_BOOLEAN); + msg.setTurnSignal(TestValues.GENERAL_BOOLEAN); + msg.setElectronicParkBrakeStatus(TestValues.GENERAL_BOOLEAN); + msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN); return msg; } @@ -73,38 +73,38 @@ public class GetVehicleDataTests extends BaseRpcTests { JSONObject result = new JSONObject(); try{ - result.put(GetVehicleData.KEY_SPEED, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_RPM, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_EXTERNAL_TEMPERATURE, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_FUEL_LEVEL, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_PRNDL, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_TIRE_PRESSURE, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_ENGINE_TORQUE, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_ENGINE_OIL_LIFE, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_ODOMETER, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_GPS, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_FUEL_LEVEL_STATE, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_INSTANT_FUEL_CONSUMPTION, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_VIN, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_BELT_STATUS, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_BODY_INFORMATION, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_DEVICE_STATUS, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_DRIVER_BRAKING, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_WIPER_STATUS, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_HEAD_LAMP_STATUS, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_ACC_PEDAL_POSITION, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_STEERING_WHEEL_ANGLE, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_E_CALL_INFO, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_AIRBAG_STATUS, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_EMERGENCY_EVENT, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_CLUSTER_MODE_STATUS, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_MY_KEY, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_FUEL_RANGE, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_TURN_SIGNAL, Test.GENERAL_BOOLEAN); - result.put(GetVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, Test.GENERAL_BOOLEAN); - result.put(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, Test.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_SPEED, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_RPM, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_EXTERNAL_TEMPERATURE, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_FUEL_LEVEL, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_PRNDL, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_TIRE_PRESSURE, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_ENGINE_TORQUE, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_ENGINE_OIL_LIFE, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_ODOMETER, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_GPS, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_FUEL_LEVEL_STATE, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_INSTANT_FUEL_CONSUMPTION, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_VIN, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_BELT_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_BODY_INFORMATION, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_DEVICE_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_DRIVER_BRAKING, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_WIPER_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_HEAD_LAMP_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_ACC_PEDAL_POSITION, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_STEERING_WHEEL_ANGLE, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_E_CALL_INFO, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_AIRBAG_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_EMERGENCY_EVENT, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_CLUSTER_MODE_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_MY_KEY, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_FUEL_RANGE, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_TURN_SIGNAL, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -115,73 +115,73 @@ public class GetVehicleDataTests extends BaseRpcTests { */ public void testRpcValues () { // Valid Tests - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getSpeed()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getRpm()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getExternalTemperature()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getFuelLevel()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getPrndl()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getTirePressure()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getEngineTorque()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getEngineOilLife()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getOdometer()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getGps()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getFuelLevelState()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getInstantFuelConsumption()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getVin()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getBeltStatus()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getBodyInformation()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getVin()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getDeviceStatus()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getDriverBraking()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getWiperStatus()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getHeadLampStatus()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getAccPedalPosition()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getSteeringWheelAngle()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getECallInfo()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getAirbagStatus()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getEmergencyEvent()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getClusterModeStatus()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getMyKey()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getFuelRange()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getTurnSignal()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getElectronicParkBrakeStatus()); - assertTrue(Test.TRUE, ( (GetVehicleData) msg ).getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getSpeed()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getRpm()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getExternalTemperature()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getFuelLevel()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getPrndl()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getTirePressure()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getEngineTorque()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getEngineOilLife()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getOdometer()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getGps()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getFuelLevelState()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getInstantFuelConsumption()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getVin()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getBeltStatus()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getBodyInformation()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getVin()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getDeviceStatus()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getDriverBraking()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getWiperStatus()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getHeadLampStatus()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getAccPedalPosition()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getSteeringWheelAngle()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getECallInfo()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getAirbagStatus()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getEmergencyEvent()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getClusterModeStatus()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getMyKey()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getFuelRange()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getTurnSignal()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getElectronicParkBrakeStatus()); + assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); // Invalid/Null Tests GetVehicleData msg = new GetVehicleData(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getAccPedalPosition()); - assertNull(Test.NULL, msg.getAirbagStatus()); - assertNull(Test.NULL, msg.getBeltStatus()); - assertNull(Test.NULL, msg.getDriverBraking()); - assertNull(Test.NULL, msg.getFuelLevel()); - assertNull(Test.NULL, msg.getTirePressure()); - assertNull(Test.NULL, msg.getWiperStatus()); - assertNull(Test.NULL, msg.getGps()); - assertNull(Test.NULL, msg.getSpeed()); - assertNull(Test.NULL, msg.getRpm()); - assertNull(Test.NULL, msg.getFuelLevelState()); - assertNull(Test.NULL, msg.getInstantFuelConsumption()); - assertNull(Test.NULL, msg.getExternalTemperature()); - assertNull(Test.NULL, msg.getVin()); - assertNull(Test.NULL, msg.getPrndl()); - assertNull(Test.NULL, msg.getOdometer()); - assertNull(Test.NULL, msg.getBodyInformation()); - assertNull(Test.NULL, msg.getDeviceStatus()); - assertNull(Test.NULL, msg.getHeadLampStatus()); - assertNull(Test.NULL, msg.getEngineTorque()); - assertNull(Test.NULL, msg.getEngineOilLife()); - assertNull(Test.NULL, msg.getSteeringWheelAngle()); - assertNull(Test.NULL, msg.getECallInfo()); - assertNull(Test.NULL, msg.getEmergencyEvent()); - assertNull(Test.NULL, msg.getClusterModeStatus()); - assertNull(Test.NULL, msg.getMyKey()); - assertNull(Test.NULL, msg.getFuelRange()); - assertNull(Test.NULL, msg.getTurnSignal()); - assertNull(Test.NULL, msg.getElectronicParkBrakeStatus()); - assertNull(Test.NULL, msg.getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); + assertNull(TestValues.NULL, msg.getAccPedalPosition()); + assertNull(TestValues.NULL, msg.getAirbagStatus()); + assertNull(TestValues.NULL, msg.getBeltStatus()); + assertNull(TestValues.NULL, msg.getDriverBraking()); + assertNull(TestValues.NULL, msg.getFuelLevel()); + assertNull(TestValues.NULL, msg.getTirePressure()); + assertNull(TestValues.NULL, msg.getWiperStatus()); + assertNull(TestValues.NULL, msg.getGps()); + assertNull(TestValues.NULL, msg.getSpeed()); + assertNull(TestValues.NULL, msg.getRpm()); + assertNull(TestValues.NULL, msg.getFuelLevelState()); + assertNull(TestValues.NULL, msg.getInstantFuelConsumption()); + assertNull(TestValues.NULL, msg.getExternalTemperature()); + assertNull(TestValues.NULL, msg.getVin()); + assertNull(TestValues.NULL, msg.getPrndl()); + assertNull(TestValues.NULL, msg.getOdometer()); + assertNull(TestValues.NULL, msg.getBodyInformation()); + assertNull(TestValues.NULL, msg.getDeviceStatus()); + assertNull(TestValues.NULL, msg.getHeadLampStatus()); + assertNull(TestValues.NULL, msg.getEngineTorque()); + assertNull(TestValues.NULL, msg.getEngineOilLife()); + assertNull(TestValues.NULL, msg.getSteeringWheelAngle()); + assertNull(TestValues.NULL, msg.getECallInfo()); + assertNull(TestValues.NULL, msg.getEmergencyEvent()); + assertNull(TestValues.NULL, msg.getClusterModeStatus()); + assertNull(TestValues.NULL, msg.getMyKey()); + assertNull(TestValues.NULL, msg.getFuelRange()); + assertNull(TestValues.NULL, msg.getTurnSignal()); + assertNull(TestValues.NULL, msg.getElectronicParkBrakeStatus()); + assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } /** @@ -189,52 +189,52 @@ public class GetVehicleDataTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); GetVehicleData cmd = new GetVehicleData(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.NOT_NULL, body); // Test everything in the json body. assertEquals("Command name doesn't match input name", JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); assertEquals("Correlation ID doesn't match input ID", JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_SPEED), cmd.getSpeed()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_RPM), cmd.getRpm()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_EXTERNAL_TEMPERATURE), cmd.getExternalTemperature()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_FUEL_LEVEL), cmd.getFuelLevel()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_VIN), cmd.getVin()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_PRNDL), cmd.getPrndl()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_TIRE_PRESSURE), cmd.getTirePressure()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ENGINE_TORQUE), cmd.getEngineTorque()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ENGINE_OIL_LIFE), cmd.getEngineOilLife()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ODOMETER), cmd.getOdometer()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_GPS), cmd.getGps()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_FUEL_LEVEL_STATE), cmd.getFuelLevelState()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_INSTANT_FUEL_CONSUMPTION), cmd.getInstantFuelConsumption()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_BELT_STATUS), cmd.getBeltStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_BODY_INFORMATION), cmd.getBodyInformation()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_DEVICE_STATUS), cmd.getDeviceStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_DRIVER_BRAKING), cmd.getDriverBraking()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_WIPER_STATUS), cmd.getWiperStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_HEAD_LAMP_STATUS), cmd.getHeadLampStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ACC_PEDAL_POSITION), cmd.getAccPedalPosition()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_STEERING_WHEEL_ANGLE), cmd.getSteeringWheelAngle()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_E_CALL_INFO), cmd.getECallInfo()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_AIRBAG_STATUS), cmd.getAirbagStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_EMERGENCY_EVENT), cmd.getEmergencyEvent()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_CLUSTER_MODE_STATUS), cmd.getClusterModeStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_MY_KEY), cmd.getMyKey()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_FUEL_RANGE), cmd.getFuelRange()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_TURN_SIGNAL), cmd.getTurnSignal()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_SPEED), cmd.getSpeed()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_RPM), cmd.getRpm()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_EXTERNAL_TEMPERATURE), cmd.getExternalTemperature()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_FUEL_LEVEL), cmd.getFuelLevel()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_VIN), cmd.getVin()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_PRNDL), cmd.getPrndl()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_TIRE_PRESSURE), cmd.getTirePressure()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ENGINE_TORQUE), cmd.getEngineTorque()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ENGINE_OIL_LIFE), cmd.getEngineOilLife()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ODOMETER), cmd.getOdometer()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_GPS), cmd.getGps()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_FUEL_LEVEL_STATE), cmd.getFuelLevelState()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_INSTANT_FUEL_CONSUMPTION), cmd.getInstantFuelConsumption()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_BELT_STATUS), cmd.getBeltStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_BODY_INFORMATION), cmd.getBodyInformation()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_DEVICE_STATUS), cmd.getDeviceStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_DRIVER_BRAKING), cmd.getDriverBraking()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_WIPER_STATUS), cmd.getWiperStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_HEAD_LAMP_STATUS), cmd.getHeadLampStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ACC_PEDAL_POSITION), cmd.getAccPedalPosition()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_STEERING_WHEEL_ANGLE), cmd.getSteeringWheelAngle()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_E_CALL_INFO), cmd.getECallInfo()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_AIRBAG_STATUS), cmd.getAirbagStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_EMERGENCY_EVENT), cmd.getEmergencyEvent()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_CLUSTER_MODE_STATUS), cmd.getClusterModeStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_MY_KEY), cmd.getMyKey()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_FUEL_RANGE), cmd.getFuelRange()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_TURN_SIGNAL), cmd.getTurnSignal()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetWayPointsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetWayPointsTests.java index bf0531685..68a7a8caf 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetWayPointsTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetWayPointsTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.GetWayPoints; import com.smartdevicelink.proxy.rpc.enums.WayPointType; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class GetWayPointsTests extends BaseRpcTests { try{ result.put(GetWayPoints.KEY_WAY_POINT_TYPE, WayPointType.DESTINATION); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -60,14 +60,14 @@ public class GetWayPointsTests extends BaseRpcTests { WayPointType testType = ( (GetWayPoints) msg ).getWayPointType(); // Valid Tests - assertEquals(Test.MATCH, WayPointType.DESTINATION, testType); + assertEquals(TestValues.MATCH, WayPointType.DESTINATION, testType); // Invalid/Null Tests GetWayPoints msg = new GetWayPoints(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getWayPointType()); + assertNull(TestValues.NULL, msg.getWayPointType()); } /** @@ -75,22 +75,22 @@ public class GetWayPointsTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); GetWayPoints cmd = new GetWayPoints(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, WayPointType.valueForString(JsonUtils.readStringFromJsonObject(parameters, GetWayPoints.KEY_WAY_POINT_TYPE)), cmd.getWayPointType()); + assertEquals(TestValues.MATCH, WayPointType.valueForString(JsonUtils.readStringFromJsonObject(parameters, GetWayPoints.KEY_WAY_POINT_TYPE)), cmd.getWayPointType()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ListFilesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ListFilesTests.java index 2fd8db4ea..dfca109a3 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ListFilesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ListFilesTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.ListFiles; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class ListFilesTests extends BaseRpcTests{ public void testRpcValues () { // Invalid/Null Tests ListFiles msg = new ListFiles(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,20 +55,20 @@ public class ListFilesTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ListFiles cmd = new ListFiles(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAppServiceInteractionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAppServiceInteractionTests.java index 5e5c4ffbd..3d9281c3f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAppServiceInteractionTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAppServiceInteractionTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.PerformAppServiceInteraction; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -21,10 +21,10 @@ public class PerformAppServiceInteractionTests extends BaseRpcTests { protected RPCMessage createMessage() { PerformAppServiceInteraction msg = new PerformAppServiceInteraction(); - msg.setServiceUri(Test.GENERAL_STRING); - msg.setServiceID(Test.GENERAL_STRING); - msg.setOriginApp(Test.GENERAL_STRING); - msg.setRequestServiceActive(Test.GENERAL_BOOLEAN); + msg.setServiceUri(TestValues.GENERAL_STRING); + msg.setServiceID(TestValues.GENERAL_STRING); + msg.setOriginApp(TestValues.GENERAL_STRING); + msg.setRequestServiceActive(TestValues.GENERAL_BOOLEAN); return msg; } @@ -44,12 +44,12 @@ public class PerformAppServiceInteractionTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(PerformAppServiceInteraction.KEY_SERVICE_URI, Test.GENERAL_STRING); - result.put(PerformAppServiceInteraction.KEY_SERVICE_ID, Test.GENERAL_STRING); - result.put(PerformAppServiceInteraction.KEY_ORIGIN_APP, Test.GENERAL_STRING); - result.put(PerformAppServiceInteraction.KEY_REQUEST_SERVICE_ACTIVE, Test.GENERAL_BOOLEAN); + result.put(PerformAppServiceInteraction.KEY_SERVICE_URI, TestValues.GENERAL_STRING); + result.put(PerformAppServiceInteraction.KEY_SERVICE_ID, TestValues.GENERAL_STRING); + result.put(PerformAppServiceInteraction.KEY_ORIGIN_APP, TestValues.GENERAL_STRING); + result.put(PerformAppServiceInteraction.KEY_REQUEST_SERVICE_ACTIVE, TestValues.GENERAL_BOOLEAN); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -66,20 +66,20 @@ public class PerformAppServiceInteractionTests extends BaseRpcTests { boolean requestServiceActive = ( (PerformAppServiceInteraction) msg ).getRequestServiceActive(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, serviceUri); - assertEquals(Test.MATCH, Test.GENERAL_STRING, appServiceId); - assertEquals(Test.MATCH, Test.GENERAL_STRING, originApp); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, requestServiceActive); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, serviceUri); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, appServiceId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, originApp); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, requestServiceActive); // Invalid/Null Tests PerformAppServiceInteraction msg = new PerformAppServiceInteraction(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getServiceUri()); - assertNull(Test.NULL, msg.getServiceID()); - assertNull(Test.NULL, msg.getOriginApp()); - assertNull(Test.NULL, msg.getRequestServiceActive()); + assertNull(TestValues.NULL, msg.getServiceUri()); + assertNull(TestValues.NULL, msg.getServiceID()); + assertNull(TestValues.NULL, msg.getOriginApp()); + assertNull(TestValues.NULL, msg.getRequestServiceActive()); } /** @@ -87,13 +87,13 @@ public class PerformAppServiceInteractionTests extends BaseRpcTests { */ public void testRequiredParamsConstructor () { // test with param in constructor - PerformAppServiceInteraction msg = new PerformAppServiceInteraction(Test.GENERAL_STRING,Test.GENERAL_STRING,Test.GENERAL_STRING); + PerformAppServiceInteraction msg = new PerformAppServiceInteraction(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING, TestValues.GENERAL_STRING); String serviceUri = msg.getServiceUri(); String appServiceId = msg.getServiceID(); String originApp = msg.getOriginApp(); - assertEquals(Test.MATCH, Test.GENERAL_STRING, serviceUri); - assertEquals(Test.MATCH, Test.GENERAL_STRING, appServiceId); - assertEquals(Test.MATCH, Test.GENERAL_STRING, originApp); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, serviceUri); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, appServiceId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, originApp); } /** @@ -101,25 +101,25 @@ public class PerformAppServiceInteractionTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); PerformAppServiceInteraction cmd = new PerformAppServiceInteraction(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAppServiceInteraction.KEY_SERVICE_ID), cmd.getServiceID()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAppServiceInteraction.KEY_SERVICE_URI), cmd.getServiceUri()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAppServiceInteraction.KEY_ORIGIN_APP), cmd.getOriginApp()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, PerformAppServiceInteraction.KEY_REQUEST_SERVICE_ACTIVE), cmd.getRequestServiceActive()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAppServiceInteraction.KEY_SERVICE_ID), cmd.getServiceID()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAppServiceInteraction.KEY_SERVICE_URI), cmd.getServiceUri()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAppServiceInteraction.KEY_ORIGIN_APP), cmd.getOriginApp()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, PerformAppServiceInteraction.KEY_REQUEST_SERVICE_ACTIVE), cmd.getRequestServiceActive()); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAudioPassThruTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAudioPassThruTests.java index f3ccf0a59..19d65f6e5 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAudioPassThruTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAudioPassThruTests.java @@ -10,7 +10,7 @@ import com.smartdevicelink.proxy.rpc.enums.BitsPerSample; import com.smartdevicelink.proxy.rpc.enums.SamplingRate; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -32,14 +32,14 @@ public class PerformAudioPassThruTests extends BaseRpcTests { protected RPCMessage createMessage() { PerformAudioPassThru msg = new PerformAudioPassThru(); - msg.setInitialPrompt(Test.GENERAL_TTSCHUNK_LIST); - msg.setAudioPassThruDisplayText1(Test.GENERAL_STRING); - msg.setAudioPassThruDisplayText2(Test.GENERAL_STRING); - msg.setSamplingRate(Test.GENERAL_SAMPLINGRATE); - msg.setAudioType(Test.GENERAL_AUDIOTYPE); - msg.setBitsPerSample(Test.GENERAL_BITSPERSAMPLE); - msg.setMaxDuration(Test.GENERAL_INT); - msg.setMuteAudio(Test.GENERAL_BOOLEAN); + msg.setInitialPrompt(TestValues.GENERAL_TTSCHUNK_LIST); + msg.setAudioPassThruDisplayText1(TestValues.GENERAL_STRING); + msg.setAudioPassThruDisplayText2(TestValues.GENERAL_STRING); + msg.setSamplingRate(TestValues.GENERAL_SAMPLINGRATE); + msg.setAudioType(TestValues.GENERAL_AUDIOTYPE); + msg.setBitsPerSample(TestValues.GENERAL_BITSPERSAMPLE); + msg.setMaxDuration(TestValues.GENERAL_INT); + msg.setMuteAudio(TestValues.GENERAL_BOOLEAN); return msg; } @@ -58,16 +58,16 @@ public class PerformAudioPassThruTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1, Test.GENERAL_STRING); - result.put(PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2, Test.GENERAL_STRING); - result.put(PerformAudioPassThru.KEY_MUTE_AUDIO, Test.GENERAL_BOOLEAN); - result.put(PerformAudioPassThru.KEY_MAX_DURATION, Test.GENERAL_INT); - result.put(PerformAudioPassThru.KEY_AUDIO_TYPE, Test.GENERAL_AUDIOTYPE); - result.put(PerformAudioPassThru.KEY_SAMPLING_RATE, Test.GENERAL_SAMPLINGRATE); - result.put(PerformAudioPassThru.KEY_BITS_PER_SAMPLE, Test.GENERAL_BITSPERSAMPLE); - result.put(PerformAudioPassThru.KEY_INITIAL_PROMPT, Test.JSON_TTSCHUNKS); + result.put(PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1, TestValues.GENERAL_STRING); + result.put(PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2, TestValues.GENERAL_STRING); + result.put(PerformAudioPassThru.KEY_MUTE_AUDIO, TestValues.GENERAL_BOOLEAN); + result.put(PerformAudioPassThru.KEY_MAX_DURATION, TestValues.GENERAL_INT); + result.put(PerformAudioPassThru.KEY_AUDIO_TYPE, TestValues.GENERAL_AUDIOTYPE); + result.put(PerformAudioPassThru.KEY_SAMPLING_RATE, TestValues.GENERAL_SAMPLINGRATE); + result.put(PerformAudioPassThru.KEY_BITS_PER_SAMPLE, TestValues.GENERAL_BITSPERSAMPLE); + result.put(PerformAudioPassThru.KEY_INITIAL_PROMPT, TestValues.JSON_TTSCHUNKS); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -88,31 +88,31 @@ public class PerformAudioPassThruTests extends BaseRpcTests { List<TTSChunk> testInitialPrompt = ( (PerformAudioPassThru) msg ).getInitialPrompt(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_TTSCHUNK_LIST.size(), testInitialPrompt.size()); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testText1); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testText2); - assertEquals(Test.MATCH, Test.GENERAL_SAMPLINGRATE, testSamplingRate); - assertEquals(Test.MATCH, Test.GENERAL_BITSPERSAMPLE, testBitsPerSample); - assertEquals(Test.MATCH, Test.GENERAL_AUDIOTYPE, testAudioType); - assertEquals(Test.MATCH, Test.GENERAL_INT, testMaxDuration); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testMuteAudio); - for (int i = 0; i < Test.GENERAL_TTSCHUNK_LIST.size(); i++) { - assertEquals(Test.MATCH, Test.GENERAL_TTSCHUNK_LIST.get(i), testInitialPrompt.get(i)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_TTSCHUNK_LIST.size(), testInitialPrompt.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testText1); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testText2); + assertEquals(TestValues.MATCH, TestValues.GENERAL_SAMPLINGRATE, testSamplingRate); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BITSPERSAMPLE, testBitsPerSample); + assertEquals(TestValues.MATCH, TestValues.GENERAL_AUDIOTYPE, testAudioType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, testMaxDuration); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, testMuteAudio); + for (int i = 0; i < TestValues.GENERAL_TTSCHUNK_LIST.size(); i++) { + assertEquals(TestValues.MATCH, TestValues.GENERAL_TTSCHUNK_LIST.get(i), testInitialPrompt.get(i)); } // Invalid/Null Tests PerformAudioPassThru msg = new PerformAudioPassThru(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getInitialPrompt()); - assertNull(Test.NULL, msg.getAudioPassThruDisplayText1()); - assertNull(Test.NULL, msg.getAudioPassThruDisplayText2()); - assertNull(Test.NULL, msg.getSamplingRate()); - assertNull(Test.NULL, msg.getBitsPerSample()); - assertNull(Test.NULL, msg.getAudioType()); - assertNull(Test.NULL, msg.getMaxDuration()); - assertNull(Test.NULL, msg.getMuteAudio()); + assertNull(TestValues.NULL, msg.getInitialPrompt()); + assertNull(TestValues.NULL, msg.getAudioPassThruDisplayText1()); + assertNull(TestValues.NULL, msg.getAudioPassThruDisplayText2()); + assertNull(TestValues.NULL, msg.getSamplingRate()); + assertNull(TestValues.NULL, msg.getBitsPerSample()); + assertNull(TestValues.NULL, msg.getAudioType()); + assertNull(TestValues.NULL, msg.getMaxDuration()); + assertNull(TestValues.NULL, msg.getMuteAudio()); } /** @@ -120,26 +120,26 @@ public class PerformAudioPassThruTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); PerformAudioPassThru cmd = new PerformAudioPassThru(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, PerformAudioPassThru.KEY_MAX_DURATION), (Integer)cmd.getMaxDuration()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1), cmd.getAudioPassThruDisplayText1()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2), cmd.getAudioPassThruDisplayText2()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, PerformAudioPassThru.KEY_MUTE_AUDIO), cmd.getMuteAudio()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_SAMPLING_RATE), cmd.getSamplingRate().toString()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_AUDIO_TYPE), cmd.getAudioType().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, PerformAudioPassThru.KEY_MAX_DURATION), (Integer)cmd.getMaxDuration()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1), cmd.getAudioPassThruDisplayText1()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2), cmd.getAudioPassThruDisplayText2()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, PerformAudioPassThru.KEY_MUTE_AUDIO), cmd.getMuteAudio()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_SAMPLING_RATE), cmd.getSamplingRate().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_AUDIO_TYPE), cmd.getAudioType().toString()); JSONArray ttsChunkArray = JsonUtils.readJsonArrayFromJsonObject(parameters, PerformAudioPassThru.KEY_INITIAL_PROMPT); List<TTSChunk> ttsChunkList = new ArrayList<TTSChunk>(); @@ -147,11 +147,11 @@ public class PerformAudioPassThruTests extends BaseRpcTests { TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)ttsChunkArray.get(index)) ); ttsChunkList.add(chunk); } - assertTrue(Test.TRUE, Validator.validateTtsChunks(ttsChunkList, cmd.getInitialPrompt())); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(ttsChunkList, cmd.getInitialPrompt())); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_BITS_PER_SAMPLE), cmd.getBitsPerSample().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAudioPassThru.KEY_BITS_PER_SAMPLE), cmd.getBitsPerSample().toString()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformInteractionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformInteractionTests.java index cd3ea00b4..6b0060e13 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformInteractionTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformInteractionTests.java @@ -10,7 +10,7 @@ import com.smartdevicelink.proxy.rpc.enums.InteractionMode; import com.smartdevicelink.proxy.rpc.enums.LayoutMode; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -32,16 +32,16 @@ public class PerformInteractionTests extends BaseRpcTests { protected RPCMessage createMessage() { PerformInteraction msg = new PerformInteraction(); - msg.setInitialPrompt(Test.GENERAL_TTSCHUNK_LIST); - msg.setHelpPrompt(Test.GENERAL_TTSCHUNK_LIST); - msg.setTimeoutPrompt(Test.GENERAL_TTSCHUNK_LIST); - msg.setVrHelp(Test.GENERAL_VRHELPITEM_LIST); - msg.setInteractionChoiceSetIDList(Test.GENERAL_INTEGER_LIST); - msg.setInteractionLayout(Test.GENERAL_LAYOUTMODE); - msg.setInitialText(Test.GENERAL_STRING); - msg.setInteractionMode(Test.GENERAL_INTERACTIONMODE); - msg.setTimeout(Test.GENERAL_INT); - msg.setCancelID(Test.GENERAL_INTEGER); + msg.setInitialPrompt(TestValues.GENERAL_TTSCHUNK_LIST); + msg.setHelpPrompt(TestValues.GENERAL_TTSCHUNK_LIST); + msg.setTimeoutPrompt(TestValues.GENERAL_TTSCHUNK_LIST); + msg.setVrHelp(TestValues.GENERAL_VRHELPITEM_LIST); + msg.setInteractionChoiceSetIDList(TestValues.GENERAL_INTEGER_LIST); + msg.setInteractionLayout(TestValues.GENERAL_LAYOUTMODE); + msg.setInitialText(TestValues.GENERAL_STRING); + msg.setInteractionMode(TestValues.GENERAL_INTERACTIONMODE); + msg.setTimeout(TestValues.GENERAL_INT); + msg.setCancelID(TestValues.GENERAL_INTEGER); return msg; } @@ -61,18 +61,18 @@ public class PerformInteractionTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(PerformInteraction.KEY_INITIAL_PROMPT, Test.JSON_TTSCHUNKS); - result.put(PerformInteraction.KEY_HELP_PROMPT, Test.JSON_TTSCHUNKS); - result.put(PerformInteraction.KEY_TIMEOUT_PROMPT, Test.JSON_TTSCHUNKS); - result.put(PerformInteraction.KEY_VR_HELP, Test.JSON_VRHELPITEMS); - result.put(PerformInteraction.KEY_INTERACTION_CHOICE_SET_ID_LIST, JsonUtils.createJsonArray(Test.GENERAL_INTEGER_LIST)); - result.put(PerformInteraction.KEY_INTERACTION_LAYOUT, Test.GENERAL_LAYOUTMODE); - result.put(PerformInteraction.KEY_INITIAL_TEXT, Test.GENERAL_STRING); - result.put(PerformInteraction.KEY_INTERACTION_MODE, Test.GENERAL_INTERACTIONMODE); - result.put(PerformInteraction.KEY_TIMEOUT, Test.GENERAL_INT); - result.put(PerformInteraction.KEY_CANCEL_ID, Test.GENERAL_INTEGER); + result.put(PerformInteraction.KEY_INITIAL_PROMPT, TestValues.JSON_TTSCHUNKS); + result.put(PerformInteraction.KEY_HELP_PROMPT, TestValues.JSON_TTSCHUNKS); + result.put(PerformInteraction.KEY_TIMEOUT_PROMPT, TestValues.JSON_TTSCHUNKS); + result.put(PerformInteraction.KEY_VR_HELP, TestValues.JSON_VRHELPITEMS); + result.put(PerformInteraction.KEY_INTERACTION_CHOICE_SET_ID_LIST, JsonUtils.createJsonArray(TestValues.GENERAL_INTEGER_LIST)); + result.put(PerformInteraction.KEY_INTERACTION_LAYOUT, TestValues.GENERAL_LAYOUTMODE); + result.put(PerformInteraction.KEY_INITIAL_TEXT, TestValues.GENERAL_STRING); + result.put(PerformInteraction.KEY_INTERACTION_MODE, TestValues.GENERAL_INTERACTIONMODE); + result.put(PerformInteraction.KEY_TIMEOUT, TestValues.GENERAL_INT); + result.put(PerformInteraction.KEY_CANCEL_ID, TestValues.GENERAL_INTEGER); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -95,33 +95,33 @@ public class PerformInteractionTests extends BaseRpcTests { Integer testCancelID = ( (PerformInteraction) msg ).getCancelID(); // Valid Tests - assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testInitialPrompt)); - assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testHelpPrompt)); - assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testTimeoutPrompt)); - assertTrue(Test.TRUE, Validator.validateVrHelpItems(Test.GENERAL_VRHELPITEM_LIST, testVrHelpItems)); - assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST, testChoiceSetIds); - assertEquals(Test.MATCH, Test.GENERAL_LAYOUTMODE, testLayout); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testInitialText); - assertEquals(Test.MATCH, Test.GENERAL_INTERACTIONMODE, testMode); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testTimeout); - assertEquals(Test.MATCH, Test.GENERAL_INTEGER, testCancelID); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(TestValues.GENERAL_TTSCHUNK_LIST, testInitialPrompt)); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(TestValues.GENERAL_TTSCHUNK_LIST, testHelpPrompt)); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(TestValues.GENERAL_TTSCHUNK_LIST, testTimeoutPrompt)); + assertTrue(TestValues.TRUE, Validator.validateVrHelpItems(TestValues.GENERAL_VRHELPITEM_LIST, testVrHelpItems)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER_LIST, testChoiceSetIds); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LAYOUTMODE, testLayout); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testInitialText); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTERACTIONMODE, testMode); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, testTimeout); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER, testCancelID); // Invald/Null Tests PerformInteraction msg = new PerformInteraction(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getInitialPrompt()); - assertNull(Test.NULL, msg.getHelpPrompt()); - assertNull(Test.NULL, msg.getTimeoutPrompt()); - assertNull(Test.NULL, msg.getVrHelp()); - assertNull(Test.NULL, msg.getInteractionChoiceSetIDList()); - assertNull(Test.NULL, msg.getInteractionLayout()); - assertNull(Test.NULL, msg.getInitialText()); - assertNull(Test.NULL, msg.getInteractionMode()); - assertNull(Test.NULL, msg.getTimeout()); - assertNull(Test.NULL, msg.getCancelID()); + assertNull(TestValues.NULL, msg.getInitialPrompt()); + assertNull(TestValues.NULL, msg.getHelpPrompt()); + assertNull(TestValues.NULL, msg.getTimeoutPrompt()); + assertNull(TestValues.NULL, msg.getVrHelp()); + assertNull(TestValues.NULL, msg.getInteractionChoiceSetIDList()); + assertNull(TestValues.NULL, msg.getInteractionLayout()); + assertNull(TestValues.NULL, msg.getInitialText()); + assertNull(TestValues.NULL, msg.getInteractionMode()); + assertNull(TestValues.NULL, msg.getTimeout()); + assertNull(TestValues.NULL, msg.getCancelID()); } /** @@ -129,30 +129,30 @@ public class PerformInteractionTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); PerformInteraction cmd = new PerformInteraction(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteraction.KEY_INITIAL_TEXT), cmd.getInitialText()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteraction.KEY_INTERACTION_MODE), cmd.getInteractionMode().toString()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, PerformInteraction.KEY_CANCEL_ID), cmd.getCancelID()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteraction.KEY_INITIAL_TEXT), cmd.getInitialText()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteraction.KEY_INTERACTION_MODE), cmd.getInteractionMode().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, PerformInteraction.KEY_CANCEL_ID), cmd.getCancelID()); List<Integer> interactionIDList = JsonUtils.readIntegerListFromJsonObject(parameters, PerformInteraction.KEY_INTERACTION_CHOICE_SET_ID_LIST); List<Integer> testIDList = cmd.getInteractionChoiceSetIDList(); - assertEquals(Test.MATCH, interactionIDList.size(), testIDList.size()); - assertTrue(Test.TRUE, Validator.validateIntegerList(interactionIDList, testIDList)); + assertEquals(TestValues.MATCH, interactionIDList.size(), testIDList.size()); + assertTrue(TestValues.TRUE, Validator.validateIntegerList(interactionIDList, testIDList)); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteraction.KEY_INTERACTION_LAYOUT), cmd.getInteractionLayout().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteraction.KEY_INTERACTION_LAYOUT), cmd.getInteractionLayout().toString()); JSONArray initalPromptArray = JsonUtils.readJsonArrayFromJsonObject(parameters, PerformInteraction.KEY_INITIAL_PROMPT); List<TTSChunk> initalPromptList = new ArrayList<TTSChunk>(); @@ -160,7 +160,7 @@ public class PerformInteractionTests extends BaseRpcTests { TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)initalPromptArray.get(index)) ); initalPromptList.add(chunk); } - assertTrue(Test.TRUE, Validator.validateTtsChunks(initalPromptList, cmd.getInitialPrompt())); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(initalPromptList, cmd.getInitialPrompt())); JSONArray helpPromptArray = JsonUtils.readJsonArrayFromJsonObject(parameters, PerformInteraction.KEY_HELP_PROMPT); List<TTSChunk> helpPromptList = new ArrayList<TTSChunk>(); @@ -168,7 +168,7 @@ public class PerformInteractionTests extends BaseRpcTests { TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)helpPromptArray.get(index)) ); helpPromptList.add(chunk); } - assertTrue(Test.TRUE, Validator.validateTtsChunks(helpPromptList, cmd.getHelpPrompt())); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(helpPromptList, cmd.getHelpPrompt())); JSONArray timeoutPromptArray = JsonUtils.readJsonArrayFromJsonObject(parameters, PerformInteraction.KEY_TIMEOUT_PROMPT); List<TTSChunk> timeoutPromptList = new ArrayList<TTSChunk>(); @@ -176,8 +176,8 @@ public class PerformInteractionTests extends BaseRpcTests { TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)timeoutPromptArray.get(index)) ); timeoutPromptList.add(chunk); } - assertTrue(Test.TRUE, Validator.validateTtsChunks(timeoutPromptList, cmd.getTimeoutPrompt())); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, PerformInteraction.KEY_TIMEOUT), cmd.getTimeout()); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(timeoutPromptList, cmd.getTimeoutPrompt())); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, PerformInteraction.KEY_TIMEOUT), cmd.getTimeout()); JSONArray vrHelpArray = JsonUtils.readJsonArrayFromJsonObject(parameters, PerformInteraction.KEY_VR_HELP); List<VrHelpItem> vrHelpList= new ArrayList<VrHelpItem>(); @@ -185,9 +185,9 @@ public class PerformInteractionTests extends BaseRpcTests { VrHelpItem vrHelpItem = new VrHelpItem(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)vrHelpArray.get(index)) ); vrHelpList.add(vrHelpItem); } - assertTrue(Test.TRUE, Validator.validateVrHelpItems(vrHelpList, cmd.getVrHelp()) ); + assertTrue(TestValues.TRUE, Validator.validateVrHelpItems(vrHelpList, cmd.getVrHelp()) ); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PublishAppServiceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PublishAppServiceTests.java index ffe7a60b4..8a1443537 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PublishAppServiceTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PublishAppServiceTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.AppServiceManifest; import com.smartdevicelink.proxy.rpc.PublishAppService; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -21,7 +21,7 @@ public class PublishAppServiceTests extends BaseRpcTests { @Override protected RPCMessage createMessage() { PublishAppService msg = new PublishAppService(); - msg.setAppServiceManifest(Test.GENERAL_APPSERVICEMANIFEST); + msg.setAppServiceManifest(TestValues.GENERAL_APPSERVICEMANIFEST); return msg; } @@ -40,9 +40,9 @@ public class PublishAppServiceTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(PublishAppService.KEY_APP_SERVICE_MANIFEST, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_APPSERVICEMANIFEST.getStore())); + result.put(PublishAppService.KEY_APP_SERVICE_MANIFEST, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_APPSERVICEMANIFEST.getStore())); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -56,14 +56,14 @@ public class PublishAppServiceTests extends BaseRpcTests { AppServiceManifest copy = ( (PublishAppService) msg ).getAppServiceManifest(); // Valid Tests - assertTrue(Validator.validateAppServiceManifest(Test.GENERAL_APPSERVICEMANIFEST, copy)); + assertTrue(Validator.validateAppServiceManifest(TestValues.GENERAL_APPSERVICEMANIFEST, copy)); // Invalid/Null Tests PublishAppService msg = new PublishAppService(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.MATCH, msg.getAppServiceManifest()); + assertNull(TestValues.MATCH, msg.getAppServiceManifest()); } /** @@ -71,10 +71,10 @@ public class PublishAppServiceTests extends BaseRpcTests { */ public void testRequiredParamsConstructor () { - PublishAppService msg = new PublishAppService(Test.GENERAL_APPSERVICEMANIFEST); - assertNotNull(Test.NOT_NULL, msg); + PublishAppService msg = new PublishAppService(TestValues.GENERAL_APPSERVICEMANIFEST); + assertNotNull(TestValues.NOT_NULL, msg); // Valid Tests - assertTrue(Validator.validateAppServiceManifest(Test.GENERAL_APPSERVICEMANIFEST, msg.getAppServiceManifest())); + assertTrue(Validator.validateAppServiceManifest(TestValues.GENERAL_APPSERVICEMANIFEST, msg.getAppServiceManifest())); } /** @@ -82,24 +82,24 @@ public class PublishAppServiceTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); PublishAppService cmd = new PublishAppService(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); JSONObject appServiceManifestObject = JsonUtils.readJsonObjectFromJsonObject(parameters, PublishAppService.KEY_APP_SERVICE_MANIFEST); AppServiceManifest manifestTest = new AppServiceManifest(JsonRPCMarshaller.deserializeJSONObject(appServiceManifestObject)); - assertTrue(Test.TRUE, Validator.validateAppServiceManifest(manifestTest, cmd.getAppServiceManifest())); + assertTrue(TestValues.TRUE, Validator.validateAppServiceManifest(manifestTest, cmd.getAppServiceManifest())); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PutFileTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PutFileTests.java index 2d55dde4b..3b6eb297b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PutFileTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PutFileTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.PutFile; import com.smartdevicelink.proxy.rpc.enums.FileType; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -26,13 +26,13 @@ public class PutFileTests extends BaseRpcTests { protected RPCMessage createMessage() { PutFile msg = new PutFile(); - msg.setFileType(Test.GENERAL_FILETYPE); - msg.setPersistentFile(Test.GENERAL_BOOLEAN); - msg.setSystemFile(Test.GENERAL_BOOLEAN); - msg.setOffset(Test.GENERAL_LONG); - msg.setLength(Test.GENERAL_LONG); - msg.setCRC(Test.GENERAL_BYTE_ARRAY); - msg.setCRC(Test.GENERAL_LONG); + msg.setFileType(TestValues.GENERAL_FILETYPE); + msg.setPersistentFile(TestValues.GENERAL_BOOLEAN); + msg.setSystemFile(TestValues.GENERAL_BOOLEAN); + msg.setOffset(TestValues.GENERAL_LONG); + msg.setLength(TestValues.GENERAL_LONG); + msg.setCRC(TestValues.GENERAL_BYTE_ARRAY); + msg.setCRC(TestValues.GENERAL_LONG); return msg; } @@ -52,14 +52,14 @@ public class PutFileTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(PutFile.KEY_FILE_TYPE, Test.GENERAL_FILETYPE); - result.put(PutFile.KEY_PERSISTENT_FILE, Test.GENERAL_BOOLEAN); - result.put(PutFile.KEY_SYSTEM_FILE, Test.GENERAL_BOOLEAN); - result.put(PutFile.KEY_OFFSET, Test.GENERAL_LONG); - result.put(PutFile.KEY_LENGTH, Test.GENERAL_LONG); - result.put(PutFile.KEY_CRC, Test.GENERAL_LONG); + result.put(PutFile.KEY_FILE_TYPE, TestValues.GENERAL_FILETYPE); + result.put(PutFile.KEY_PERSISTENT_FILE, TestValues.GENERAL_BOOLEAN); + result.put(PutFile.KEY_SYSTEM_FILE, TestValues.GENERAL_BOOLEAN); + result.put(PutFile.KEY_OFFSET, TestValues.GENERAL_LONG); + result.put(PutFile.KEY_LENGTH, TestValues.GENERAL_LONG); + result.put(PutFile.KEY_CRC, TestValues.GENERAL_LONG); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -78,24 +78,24 @@ public class PutFileTests extends BaseRpcTests { Long testCRC = ( (PutFile) msg ).getCRC(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_FILETYPE, testFileType); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testPersistentFile); - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testSystemFile); - assertEquals(Test.MATCH, Test.GENERAL_LONG, testOffset); - assertEquals(Test.MATCH, Test.GENERAL_LONG, testLength); - assertEquals(Test.MATCH, Test.GENERAL_LONG, testCRC); + assertEquals(TestValues.MATCH, TestValues.GENERAL_FILETYPE, testFileType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, testPersistentFile); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, testSystemFile); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LONG, testOffset); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LONG, testLength); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LONG, testCRC); // Invalid/Null Tests PutFile msg = new PutFile(); assertNotNull("Null object creation failed.", msg); testNullBase(msg); - assertNull(Test.NULL, msg.getFileType()); - assertNull(Test.NULL, msg.getPersistentFile()); - assertNull(Test.NULL, msg.getSystemFile()); - assertNull(Test.NULL, msg.getOffset()); - assertNull(Test.NULL, msg.getLength()); - assertNull(Test.NULL, msg.getCRC()); + assertNull(TestValues.NULL, msg.getFileType()); + assertNull(TestValues.NULL, msg.getPersistentFile()); + assertNull(TestValues.NULL, msg.getSystemFile()); + assertNull(TestValues.NULL, msg.getOffset()); + assertNull(TestValues.NULL, msg.getLength()); + assertNull(TestValues.NULL, msg.getCRC()); } /** @@ -104,14 +104,14 @@ public class PutFileTests extends BaseRpcTests { public void testByteArrayCheckSum () { // Test Values PutFile msgCRC = new PutFile(); - msgCRC.setCRC(Test.GENERAL_BYTE_ARRAY); + msgCRC.setCRC(TestValues.GENERAL_BYTE_ARRAY); Long testCRCByteArray = msgCRC.getCRC(); CRC32 crc = new CRC32(); - crc.update(Test.GENERAL_BYTE_ARRAY); + crc.update(TestValues.GENERAL_BYTE_ARRAY); Long crcValue = crc.getValue(); - assertEquals(Test.MATCH, crcValue, testCRCByteArray); + assertEquals(TestValues.MATCH, crcValue, testCRCByteArray); } @@ -121,29 +121,29 @@ public class PutFileTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); PutFile cmd = new PutFile(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, PutFile.KEY_PERSISTENT_FILE), cmd.getPersistentFile()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, PutFile.KEY_SYSTEM_FILE), cmd.getSystemFile()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PutFile.KEY_FILE_TYPE), cmd.getFileType().toString()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PutFile.KEY_SDL_FILE_NAME), cmd.getSdlFileName()); - assertEquals(Test.MATCH, (Long) JsonUtils.readIntegerFromJsonObject(parameters, PutFile.KEY_OFFSET).longValue(), cmd.getOffset()); - assertEquals(Test.MATCH, (Long) JsonUtils.readIntegerFromJsonObject(parameters, PutFile.KEY_LENGTH).longValue(), cmd.getLength()); - assertEquals(Test.MATCH, (Long) JsonUtils.readIntegerFromJsonObject(parameters, PutFile.KEY_CRC).longValue(), cmd.getCRC()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, PutFile.KEY_PERSISTENT_FILE), cmd.getPersistentFile()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, PutFile.KEY_SYSTEM_FILE), cmd.getSystemFile()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, PutFile.KEY_FILE_TYPE), cmd.getFileType().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, PutFile.KEY_SDL_FILE_NAME), cmd.getSdlFileName()); + assertEquals(TestValues.MATCH, (Long) JsonUtils.readIntegerFromJsonObject(parameters, PutFile.KEY_OFFSET).longValue(), cmd.getOffset()); + assertEquals(TestValues.MATCH, (Long) JsonUtils.readIntegerFromJsonObject(parameters, PutFile.KEY_LENGTH).longValue(), cmd.getLength()); + assertEquals(TestValues.MATCH, (Long) JsonUtils.readIntegerFromJsonObject(parameters, PutFile.KEY_CRC).longValue(), cmd.getCRC()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReadDidTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReadDidTests.java index 77889839f..0e1231886 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReadDidTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReadDidTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.ReadDID; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -26,8 +26,8 @@ public class ReadDidTests extends BaseRpcTests { protected RPCMessage createMessage() { ReadDID msg = new ReadDID(); - msg.setEcuName(Test.GENERAL_INT); - msg.setDidLocation(Test.GENERAL_INTEGER_LIST); + msg.setEcuName(TestValues.GENERAL_INT); + msg.setDidLocation(TestValues.GENERAL_INTEGER_LIST); return msg; } @@ -47,10 +47,10 @@ public class ReadDidTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(ReadDID.KEY_ECU_NAME, Test.GENERAL_INT); - result.put(ReadDID.KEY_DID_LOCATION, JsonUtils.createJsonArray(Test.GENERAL_INTEGER_LIST)); + result.put(ReadDID.KEY_ECU_NAME, TestValues.GENERAL_INT); + result.put(ReadDID.KEY_DID_LOCATION, JsonUtils.createJsonArray(TestValues.GENERAL_INTEGER_LIST)); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -65,16 +65,16 @@ public class ReadDidTests extends BaseRpcTests { List<Integer> testDidLocation = ( (ReadDID) msg ).getDidLocation(); // Valid Tests - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testEcuName); - assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST, testDidLocation); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, testEcuName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER_LIST, testDidLocation); // Invalid/Null Tests ReadDID msg = new ReadDID(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getEcuName()); - assertNull(Test.NULL, msg.getDidLocation()); + assertNull(TestValues.NULL, msg.getEcuName()); + assertNull(TestValues.NULL, msg.getDidLocation()); } /** @@ -82,28 +82,28 @@ public class ReadDidTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ReadDID cmd = new ReadDID(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, ReadDID.KEY_ECU_NAME), cmd.getEcuName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, ReadDID.KEY_ECU_NAME), cmd.getEcuName()); List<Integer> didLocationList = JsonUtils.readIntegerListFromJsonObject(parameters, ReadDID.KEY_DID_LOCATION); List<Integer> testLocationList = cmd.getDidLocation(); - assertEquals(Test.MATCH, didLocationList.size(), testLocationList.size()); - assertTrue(Test.TRUE, Validator.validateIntegerList(didLocationList, testLocationList)); + assertEquals(TestValues.MATCH, didLocationList.size(), testLocationList.size()); + assertTrue(TestValues.TRUE, Validator.validateIntegerList(didLocationList, testLocationList)); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java index e8bd66219..c4351743a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java @@ -13,7 +13,7 @@ import com.smartdevicelink.proxy.rpc.enums.AppHMIType; import com.smartdevicelink.proxy.rpc.enums.Language; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -35,21 +35,21 @@ public class RegisterAppInterfaceTests extends BaseRpcTests { protected RPCMessage createMessage() { RegisterAppInterface msg = new RegisterAppInterface(); - msg.setSdlMsgVersion(Test.GENERAL_SDLMSGVERSION); - msg.setAppName(Test.GENERAL_STRING); - msg.setNgnMediaScreenAppName(Test.GENERAL_STRING); - msg.setFullAppID(Test.GENERAL_FULL_APP_ID); - msg.setLanguageDesired(Test.GENERAL_LANGUAGE); - msg.setHmiDisplayLanguageDesired(Test.GENERAL_LANGUAGE); - msg.setHashID(Test.GENERAL_STRING); - msg.setTtsName(Test.GENERAL_TTSCHUNK_LIST); - msg.setVrSynonyms(Test.GENERAL_STRING_LIST); - msg.setAppHMIType(Test.GENERAL_APPHMITYPE_LIST); - msg.setIsMediaApplication(Test.GENERAL_BOOLEAN); - msg.setDeviceInfo(Test.GENERAL_DEVICEINFO); - msg.setAppInfo(Test.GENERAL_APPINFO); - msg.setDayColorScheme(Test.GENERAL_DAYCOLORSCHEME); - msg.setNightColorScheme(Test.GENERAL_NIGHTCOLORSCHEME); + msg.setSdlMsgVersion(TestValues.GENERAL_SDLMSGVERSION); + msg.setAppName(TestValues.GENERAL_STRING); + msg.setNgnMediaScreenAppName(TestValues.GENERAL_STRING); + msg.setFullAppID(TestValues.GENERAL_FULL_APP_ID); + msg.setLanguageDesired(TestValues.GENERAL_LANGUAGE); + msg.setHmiDisplayLanguageDesired(TestValues.GENERAL_LANGUAGE); + msg.setHashID(TestValues.GENERAL_STRING); + msg.setTtsName(TestValues.GENERAL_TTSCHUNK_LIST); + msg.setVrSynonyms(TestValues.GENERAL_STRING_LIST); + msg.setAppHMIType(TestValues.GENERAL_APPHMITYPE_LIST); + msg.setIsMediaApplication(TestValues.GENERAL_BOOLEAN); + msg.setDeviceInfo(TestValues.GENERAL_DEVICEINFO); + msg.setAppInfo(TestValues.GENERAL_APPINFO); + msg.setDayColorScheme(TestValues.GENERAL_DAYCOLORSCHEME); + msg.setNightColorScheme(TestValues.GENERAL_NIGHTCOLORSCHEME); return msg; } @@ -69,24 +69,24 @@ public class RegisterAppInterfaceTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(RegisterAppInterface.KEY_SDL_MSG_VERSION, Test.JSON_SDLMSGVERSION); - result.put(RegisterAppInterface.KEY_APP_NAME, Test.GENERAL_STRING); - result.put(RegisterAppInterface.KEY_NGN_MEDIA_SCREEN_APP_NAME, Test.GENERAL_STRING); - result.put(RegisterAppInterface.KEY_APP_ID, Test.GENERAL_APP_ID); - result.put(RegisterAppInterface.KEY_FULL_APP_ID, Test.GENERAL_FULL_APP_ID); - result.put(RegisterAppInterface.KEY_LANGUAGE_DESIRED, Test.GENERAL_LANGUAGE); - result.put(RegisterAppInterface.KEY_HMI_DISPLAY_LANGUAGE_DESIRED, Test.GENERAL_LANGUAGE); - result.put(RegisterAppInterface.KEY_HASH_ID, Test.GENERAL_STRING); - result.put(RegisterAppInterface.KEY_TTS_NAME, Test.JSON_TTSCHUNKS); - result.put(RegisterAppInterface.KEY_VR_SYNONYMS, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST)); - result.put(RegisterAppInterface.KEY_APP_HMI_TYPE, JsonUtils.createJsonArrayOfJsonNames(Test.GENERAL_APPHMITYPE_LIST, SDL_VERSION_UNDER_TEST)); - result.put(RegisterAppInterface.KEY_IS_MEDIA_APPLICATION, Test.GENERAL_BOOLEAN); - result.put(RegisterAppInterface.KEY_DEVICE_INFO, Test.JSON_DEVICEINFO); - result.put(RegisterAppInterface.KEY_APP_INFO, Test.JSON_APPINFO); - result.put(RegisterAppInterface.KEY_DAY_COLOR_SCHEME, Test.JSON_DAYCOLORSCHEME); - result.put(RegisterAppInterface.KEY_NIGHT_COLOR_SCHEME, Test.JSON_NIGHTCOLORSCHEME); + result.put(RegisterAppInterface.KEY_SDL_MSG_VERSION, TestValues.JSON_SDLMSGVERSION); + result.put(RegisterAppInterface.KEY_APP_NAME, TestValues.GENERAL_STRING); + result.put(RegisterAppInterface.KEY_NGN_MEDIA_SCREEN_APP_NAME, TestValues.GENERAL_STRING); + result.put(RegisterAppInterface.KEY_APP_ID, TestValues.GENERAL_APP_ID); + result.put(RegisterAppInterface.KEY_FULL_APP_ID, TestValues.GENERAL_FULL_APP_ID); + result.put(RegisterAppInterface.KEY_LANGUAGE_DESIRED, TestValues.GENERAL_LANGUAGE); + result.put(RegisterAppInterface.KEY_HMI_DISPLAY_LANGUAGE_DESIRED, TestValues.GENERAL_LANGUAGE); + result.put(RegisterAppInterface.KEY_HASH_ID, TestValues.GENERAL_STRING); + result.put(RegisterAppInterface.KEY_TTS_NAME, TestValues.JSON_TTSCHUNKS); + result.put(RegisterAppInterface.KEY_VR_SYNONYMS, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); + result.put(RegisterAppInterface.KEY_APP_HMI_TYPE, JsonUtils.createJsonArrayOfJsonNames(TestValues.GENERAL_APPHMITYPE_LIST, SDL_VERSION_UNDER_TEST)); + result.put(RegisterAppInterface.KEY_IS_MEDIA_APPLICATION, TestValues.GENERAL_BOOLEAN); + result.put(RegisterAppInterface.KEY_DEVICE_INFO, TestValues.JSON_DEVICEINFO); + result.put(RegisterAppInterface.KEY_APP_INFO, TestValues.JSON_APPINFO); + result.put(RegisterAppInterface.KEY_DAY_COLOR_SCHEME, TestValues.JSON_DAYCOLORSCHEME); + result.put(RegisterAppInterface.KEY_NIGHT_COLOR_SCHEME, TestValues.JSON_NIGHTCOLORSCHEME); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -115,44 +115,44 @@ public class RegisterAppInterfaceTests extends BaseRpcTests { TemplateColorScheme testNightColorScheme = ( (RegisterAppInterface) msg).getNightColorScheme(); // Valid Tests - assertTrue(Test.TRUE, Validator.validateSdlMsgVersion(Test.GENERAL_SDLMSGVERSION, testVersion)); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testName); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testNgnName); - assertEquals(Test.MATCH, Test.GENERAL_APP_ID, testAppId); - assertEquals(Test.MATCH, Test.GENERAL_FULL_APP_ID, testFullAppId); - assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, testLang); - assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, testHmiLang); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testHashId); - assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testTts)); - assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST, testSynonyms); - assertEquals(Test.MATCH, Test.GENERAL_APPHMITYPE_LIST, testApps); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, testMedia); - assertTrue(Test.TRUE, Validator.validateDeviceInfo(Test.GENERAL_DEVICEINFO, testDeviceInfo)); - assertTrue(Test.TRUE, Validator.validateAppInfo(Test.GENERAL_APPINFO, testAppInfo)); - assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(Test.GENERAL_DAYCOLORSCHEME, testDayColorScheme)); - assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(Test.GENERAL_NIGHTCOLORSCHEME, testNightColorScheme)); + assertTrue(TestValues.TRUE, Validator.validateSdlMsgVersion(TestValues.GENERAL_SDLMSGVERSION, testVersion)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testNgnName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_APP_ID, testAppId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_FULL_APP_ID, testFullAppId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LANGUAGE, testLang); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LANGUAGE, testHmiLang); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testHashId); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(TestValues.GENERAL_TTSCHUNK_LIST, testTts)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING_LIST, testSynonyms); + assertEquals(TestValues.MATCH, TestValues.GENERAL_APPHMITYPE_LIST, testApps); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, testMedia); + assertTrue(TestValues.TRUE, Validator.validateDeviceInfo(TestValues.GENERAL_DEVICEINFO, testDeviceInfo)); + assertTrue(TestValues.TRUE, Validator.validateAppInfo(TestValues.GENERAL_APPINFO, testAppInfo)); + assertTrue(TestValues.TRUE, Validator.validateTemplateColorScheme(TestValues.GENERAL_DAYCOLORSCHEME, testDayColorScheme)); + assertTrue(TestValues.TRUE, Validator.validateTemplateColorScheme(TestValues.GENERAL_NIGHTCOLORSCHEME, testNightColorScheme)); // Invalid/Null Tests RegisterAppInterface msg = new RegisterAppInterface(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getSdlMsgVersion()); - assertNull(Test.NULL, msg.getAppName()); - assertNull(Test.NULL, msg.getNgnMediaScreenAppName()); - assertNull(Test.NULL, msg.getAppID()); - assertNull(Test.NULL, msg.getFullAppID()); - assertNull(Test.NULL, msg.getLanguageDesired()); - assertNull(Test.NULL, msg.getHmiDisplayLanguageDesired()); - assertNull(Test.NULL, msg.getHashID()); - assertNull(Test.NULL, msg.getTtsName()); - assertNull(Test.NULL, msg.getVrSynonyms()); - assertNull(Test.NULL, msg.getAppHMIType()); - assertNull(Test.NULL, msg.getIsMediaApplication()); - assertNull(Test.NULL, msg.getDeviceInfo()); - assertNull(Test.NULL, msg.getAppInfo()); - assertNull(Test.NULL, msg.getDayColorScheme()); - assertNull(Test.NULL, msg.getNightColorScheme()); + assertNull(TestValues.NULL, msg.getSdlMsgVersion()); + assertNull(TestValues.NULL, msg.getAppName()); + assertNull(TestValues.NULL, msg.getNgnMediaScreenAppName()); + assertNull(TestValues.NULL, msg.getAppID()); + assertNull(TestValues.NULL, msg.getFullAppID()); + assertNull(TestValues.NULL, msg.getLanguageDesired()); + assertNull(TestValues.NULL, msg.getHmiDisplayLanguageDesired()); + assertNull(TestValues.NULL, msg.getHashID()); + assertNull(TestValues.NULL, msg.getTtsName()); + assertNull(TestValues.NULL, msg.getVrSynonyms()); + assertNull(TestValues.NULL, msg.getAppHMIType()); + assertNull(TestValues.NULL, msg.getIsMediaApplication()); + assertNull(TestValues.NULL, msg.getDeviceInfo()); + assertNull(TestValues.NULL, msg.getAppInfo()); + assertNull(TestValues.NULL, msg.getDayColorScheme()); + assertNull(TestValues.NULL, msg.getNightColorScheme()); } /** @@ -160,18 +160,18 @@ public class RegisterAppInterfaceTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); RegisterAppInterface cmd = new RegisterAppInterface(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); JSONArray ttsNameArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterface.KEY_TTS_NAME); @@ -180,49 +180,49 @@ public class RegisterAppInterfaceTests extends BaseRpcTests { TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)ttsNameArray.get(index)) ); ttsNameList.add(chunk); } - assertTrue(Test.TRUE, Validator.validateTtsChunks(ttsNameList, cmd.getTtsName())); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_HMI_DISPLAY_LANGUAGE_DESIRED), cmd.getHmiDisplayLanguageDesired().toString()); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(ttsNameList, cmd.getTtsName())); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_HMI_DISPLAY_LANGUAGE_DESIRED), cmd.getHmiDisplayLanguageDesired().toString()); JSONArray appHmiTypeArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterface.KEY_APP_HMI_TYPE); for (int index = 0; index < appHmiTypeArray.length(); index++) { AppHMIType appHmiTypeItem = AppHMIType.valueForString( appHmiTypeArray.get(index).toString() ); - assertEquals(Test.MATCH, appHmiTypeItem, cmd.getAppHMIType().get(index) ); + assertEquals(TestValues.MATCH, appHmiTypeItem, cmd.getAppHMIType().get(index) ); } - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_APP_ID), cmd.getAppID()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_FULL_APP_ID), cmd.getFullAppID()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_LANGUAGE_DESIRED), cmd.getLanguageDesired().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_APP_ID), cmd.getAppID()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_FULL_APP_ID), cmd.getFullAppID()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_LANGUAGE_DESIRED), cmd.getLanguageDesired().toString()); JSONObject deviceInfoObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterface.KEY_DEVICE_INFO); DeviceInfo deviceInfo = new DeviceInfo(JsonRPCMarshaller.deserializeJSONObject(deviceInfoObj)); - assertTrue(Test.TRUE, Validator.validateDeviceInfo(deviceInfo, cmd.getDeviceInfo()) ); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_APP_NAME), cmd.getAppName()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_NGN_MEDIA_SCREEN_APP_NAME), cmd.getNgnMediaScreenAppName()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, RegisterAppInterface.KEY_IS_MEDIA_APPLICATION), cmd.getIsMediaApplication()); + assertTrue(TestValues.TRUE, Validator.validateDeviceInfo(deviceInfo, cmd.getDeviceInfo()) ); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_APP_NAME), cmd.getAppName()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_NGN_MEDIA_SCREEN_APP_NAME), cmd.getNgnMediaScreenAppName()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, RegisterAppInterface.KEY_IS_MEDIA_APPLICATION), cmd.getIsMediaApplication()); JSONObject appInfoObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterface.KEY_APP_INFO); AppInfo appInfo = new AppInfo(JsonRPCMarshaller.deserializeJSONObject(appInfoObj)); - assertTrue(Test.TRUE, Validator.validateAppInfo(appInfo, cmd.getAppInfo())); + assertTrue(TestValues.TRUE, Validator.validateAppInfo(appInfo, cmd.getAppInfo())); List<String> vrSynonymsList = JsonUtils.readStringListFromJsonObject(parameters, RegisterAppInterface.KEY_VR_SYNONYMS); List<String> testSynonymsList = cmd.getVrSynonyms(); - assertEquals(Test.MATCH, vrSynonymsList.size(), testSynonymsList.size()); - assertTrue(Test.TRUE, Validator.validateStringList(vrSynonymsList, testSynonymsList)); + assertEquals(TestValues.MATCH, vrSynonymsList.size(), testSynonymsList.size()); + assertTrue(TestValues.TRUE, Validator.validateStringList(vrSynonymsList, testSynonymsList)); JSONObject sdlMsgVersionObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterface.KEY_SDL_MSG_VERSION); SdlMsgVersion sdlMsgVersion = new SdlMsgVersion(JsonRPCMarshaller.deserializeJSONObject(sdlMsgVersionObj)); - assertTrue(Test.TRUE, Validator.validateSdlMsgVersion(sdlMsgVersion, cmd.getSdlMsgVersion()) ); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_HASH_ID), cmd.getHashID()); + assertTrue(TestValues.TRUE, Validator.validateSdlMsgVersion(sdlMsgVersion, cmd.getSdlMsgVersion()) ); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_HASH_ID), cmd.getHashID()); JSONObject dayColorSchemeObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterface.KEY_DAY_COLOR_SCHEME); TemplateColorScheme dayColorScheme = new TemplateColorScheme(JsonRPCMarshaller.deserializeJSONObject(dayColorSchemeObj)); - assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(dayColorScheme, cmd.getDayColorScheme()) ); + assertTrue(TestValues.TRUE, Validator.validateTemplateColorScheme(dayColorScheme, cmd.getDayColorScheme()) ); JSONObject nightColorSchemeObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterface.KEY_DAY_COLOR_SCHEME); TemplateColorScheme nightColorScheme = new TemplateColorScheme(JsonRPCMarshaller.deserializeJSONObject(nightColorSchemeObj)); - assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(nightColorScheme, cmd.getDayColorScheme()) ); + assertTrue(TestValues.TRUE, Validator.validateTemplateColorScheme(nightColorScheme, cmd.getDayColorScheme()) ); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReleaseInteriorVehicleDataModuleTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReleaseInteriorVehicleDataModuleTests.java index c2bd3b3d6..4f8570c25 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReleaseInteriorVehicleDataModuleTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReleaseInteriorVehicleDataModuleTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.ReleaseInteriorVehicleDataModule; import com.smartdevicelink.proxy.rpc.enums.ModuleType; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -20,8 +20,8 @@ public class ReleaseInteriorVehicleDataModuleTests extends BaseRpcTests { @Override protected RPCMessage createMessage() { ReleaseInteriorVehicleDataModule msg = new ReleaseInteriorVehicleDataModule(); - msg.setModuleType(Test.GENERAL_MODULETYPE); - msg.setModuleId(Test.GENERAL_STRING); + msg.setModuleType(TestValues.GENERAL_MODULETYPE); + msg.setModuleId(TestValues.GENERAL_STRING); return msg; } @@ -29,10 +29,10 @@ public class ReleaseInteriorVehicleDataModuleTests extends BaseRpcTests { protected JSONObject getExpectedParameters(int sdlVersion) { JSONObject result = new JSONObject(); try { - result.put(ReleaseInteriorVehicleDataModule.KEY_MODULE_TYPE, Test.GENERAL_MODULETYPE); - result.put(ReleaseInteriorVehicleDataModule.KEY_MODULE_ID, Test.GENERAL_STRING); + result.put(ReleaseInteriorVehicleDataModule.KEY_MODULE_TYPE, TestValues.GENERAL_MODULETYPE); + result.put(ReleaseInteriorVehicleDataModule.KEY_MODULE_ID, TestValues.GENERAL_STRING); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; } @@ -52,38 +52,38 @@ public class ReleaseInteriorVehicleDataModuleTests extends BaseRpcTests { String id = ((ReleaseInteriorVehicleDataModule) msg).getModuleId(); //valid tests - assertEquals(Test.MATCH, Test.GENERAL_MODULETYPE, type); - assertEquals(Test.MATCH, Test.GENERAL_STRING, id); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MODULETYPE, type); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, id); //null tests ReleaseInteriorVehicleDataModule msg = new ReleaseInteriorVehicleDataModule(); - assertNull(Test.NULL, msg.getModuleType()); - assertNull(Test.NULL, msg.getModuleId()); + assertNull(TestValues.NULL, msg.getModuleType()); + assertNull(TestValues.NULL, msg.getModuleId()); // required param tests - ReleaseInteriorVehicleDataModule msg2 = new ReleaseInteriorVehicleDataModule(Test.GENERAL_MODULETYPE); - assertEquals(Test.MATCH, Test.GENERAL_MODULETYPE, msg2.getModuleType()); + ReleaseInteriorVehicleDataModule msg2 = new ReleaseInteriorVehicleDataModule(TestValues.GENERAL_MODULETYPE); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MODULETYPE, msg2.getModuleType()); } public void testJsonConstructor() { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ReleaseInteriorVehicleDataModule cmd = new ReleaseInteriorVehicleDataModule(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.NOT_NULL, 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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, ReleaseInteriorVehicleDataModule.KEY_MODULE_TYPE).toString(), cmd.getModuleType().toString()); - assertEquals(Test.MATCH, JsonUtils.readStringListFromJsonObject(parameters, ReleaseInteriorVehicleDataModule.KEY_MODULE_ID), cmd.getModuleId()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, ReleaseInteriorVehicleDataModule.KEY_MODULE_TYPE).toString(), cmd.getModuleType().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readStringListFromJsonObject(parameters, ReleaseInteriorVehicleDataModule.KEY_MODULE_ID), cmd.getModuleId()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ResetGlobalPropertiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ResetGlobalPropertiesTests.java index 408c809be..2ae30e8d8 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ResetGlobalPropertiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ResetGlobalPropertiesTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.ResetGlobalProperties; import com.smartdevicelink.proxy.rpc.enums.GlobalProperty; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONArray; @@ -27,7 +27,7 @@ public class ResetGlobalPropertiesTests extends BaseRpcTests { protected RPCMessage createMessage() { ResetGlobalProperties msg = new ResetGlobalProperties(); - msg.setProperties(Test.GENERAL_GLOBALPROPERTY_LIST); + msg.setProperties(TestValues.GENERAL_GLOBALPROPERTY_LIST); return msg; } @@ -47,9 +47,9 @@ public class ResetGlobalPropertiesTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(ResetGlobalProperties.KEY_PROPERTIES, JsonUtils.createJsonArray(Test.GENERAL_GLOBALPROPERTY_LIST)); + result.put(ResetGlobalProperties.KEY_PROPERTIES, JsonUtils.createJsonArray(TestValues.GENERAL_GLOBALPROPERTY_LIST)); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -63,17 +63,17 @@ public class ResetGlobalPropertiesTests extends BaseRpcTests { List<GlobalProperty> copy = ( (ResetGlobalProperties) msg ).getProperties(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_GLOBALPROPERTY_LIST.size(), copy.size()); - for(int i = 0; i < Test.GENERAL_GLOBALPROPERTY_LIST.size(); i++){ - assertEquals(Test.MATCH, Test.GENERAL_GLOBALPROPERTY_LIST.get(i), copy.get(i)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_GLOBALPROPERTY_LIST.size(), copy.size()); + for(int i = 0; i < TestValues.GENERAL_GLOBALPROPERTY_LIST.size(); i++){ + assertEquals(TestValues.MATCH, TestValues.GENERAL_GLOBALPROPERTY_LIST.get(i), copy.get(i)); } // Invalid/Null Tests ResetGlobalProperties msg = new ResetGlobalProperties(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getProperties()); + assertNull(TestValues.NULL, msg.getProperties()); } /** @@ -81,28 +81,28 @@ public class ResetGlobalPropertiesTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ResetGlobalProperties cmd = new ResetGlobalProperties(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); JSONArray propertiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, ResetGlobalProperties.KEY_PROPERTIES); for (int index = 0; index < propertiesArray.length(); index++) { GlobalProperty property = GlobalProperty.valueOf(propertiesArray.get(index).toString()); - assertEquals(Test.MATCH, property, cmd.getProperties().get(index)); + assertEquals(TestValues.MATCH, property, cmd.getProperties().get(index)); } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ScrollableMessageTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ScrollableMessageTests.java index 195cb7973..a814d33a9 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ScrollableMessageTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ScrollableMessageTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.ScrollableMessage; import com.smartdevicelink.proxy.rpc.SoftButton; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -29,10 +29,10 @@ public class ScrollableMessageTests extends BaseRpcTests { protected RPCMessage createMessage() { ScrollableMessage msg = new ScrollableMessage(); - msg.setTimeout(Test.GENERAL_INT); - msg.setSoftButtons(Test.GENERAL_SOFTBUTTON_LIST); - msg.setScrollableMessageBody(Test.GENERAL_STRING); - msg.setCancelID(Test.GENERAL_INTEGER); + msg.setTimeout(TestValues.GENERAL_INT); + msg.setSoftButtons(TestValues.GENERAL_SOFTBUTTON_LIST); + msg.setScrollableMessageBody(TestValues.GENERAL_STRING); + msg.setCancelID(TestValues.GENERAL_INTEGER); return msg; } @@ -52,12 +52,12 @@ public class ScrollableMessageTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(ScrollableMessage.KEY_SCROLLABLE_MESSAGE_BODY, Test.GENERAL_STRING); - result.put(ScrollableMessage.KEY_TIMEOUT, Test.GENERAL_INT); - result.put(ScrollableMessage.KEY_SOFT_BUTTONS, Test.JSON_SOFTBUTTONS); - result.put(ScrollableMessage.KEY_CANCEL_ID, Test.GENERAL_INTEGER); + result.put(ScrollableMessage.KEY_SCROLLABLE_MESSAGE_BODY, TestValues.GENERAL_STRING); + result.put(ScrollableMessage.KEY_TIMEOUT, TestValues.GENERAL_INT); + result.put(ScrollableMessage.KEY_SOFT_BUTTONS, TestValues.JSON_SOFTBUTTONS); + result.put(ScrollableMessage.KEY_CANCEL_ID, TestValues.GENERAL_INTEGER); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -74,24 +74,24 @@ public class ScrollableMessageTests extends BaseRpcTests { Integer testCancelID = ( (ScrollableMessage) msg ).getCancelID(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, testBody); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testTimeout); - assertEquals(Test.MATCH, Test.GENERAL_SOFTBUTTON_LIST.size(), testSoftButtons.size()); - for (int i = 0; i < Test.GENERAL_SOFTBUTTON_LIST.size(); i++) { - assertEquals(Test.MATCH, Test.GENERAL_SOFTBUTTON_LIST.get(i), testSoftButtons.get(i)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testBody); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, testTimeout); + assertEquals(TestValues.MATCH, TestValues.GENERAL_SOFTBUTTON_LIST.size(), testSoftButtons.size()); + for (int i = 0; i < TestValues.GENERAL_SOFTBUTTON_LIST.size(); i++) { + assertEquals(TestValues.MATCH, TestValues.GENERAL_SOFTBUTTON_LIST.get(i), testSoftButtons.get(i)); } - assertEquals(Test.MATCH, Test.GENERAL_INTEGER, testCancelID); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER, testCancelID); // Invalid/Null Tests ScrollableMessage msg = new ScrollableMessage(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getScrollableMessageBody()); - assertNull(Test.NULL, msg.getTimeout()); - assertNull(Test.NULL, msg.getSoftButtons()); - assertNull(Test.NULL, msg.getCancelID()); + assertNull(TestValues.NULL, msg.getScrollableMessageBody()); + assertNull(TestValues.NULL, msg.getTimeout()); + assertNull(TestValues.NULL, msg.getSoftButtons()); + assertNull(TestValues.NULL, msg.getCancelID()); } /** @@ -99,23 +99,23 @@ public class ScrollableMessageTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ScrollableMessage cmd = new ScrollableMessage(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ScrollableMessage.KEY_SCROLLABLE_MESSAGE_BODY), cmd.getScrollableMessageBody()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, ScrollableMessage.KEY_TIMEOUT), cmd.getTimeout()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, ScrollableMessage.KEY_CANCEL_ID), cmd.getCancelID()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, ScrollableMessage.KEY_SCROLLABLE_MESSAGE_BODY), cmd.getScrollableMessageBody()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, ScrollableMessage.KEY_TIMEOUT), cmd.getTimeout()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, ScrollableMessage.KEY_CANCEL_ID), cmd.getCancelID()); JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, ScrollableMessage.KEY_SOFT_BUTTONS); List<SoftButton> softButtonList = new ArrayList<SoftButton>(); @@ -123,9 +123,9 @@ public class ScrollableMessageTests extends BaseRpcTests { SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonArray.get(index)) ); softButtonList.add(chunk); } - assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons())); + assertTrue(TestValues.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons())); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendHapticDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendHapticDataTests.java index 7c3b0ed90..556bcdc6e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendHapticDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendHapticDataTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.HapticRect; import com.smartdevicelink.proxy.rpc.SendHapticData; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONArray; import org.json.JSONException; @@ -28,7 +28,7 @@ public class SendHapticDataTests extends BaseRpcTests { msg = new SendHapticData(); List<HapticRect> list = new ArrayList<>(); - list.add(Test.GENERAL_HAPTIC_RECT); + list.add(TestValues.GENERAL_HAPTIC_RECT); msg.setHapticRectData(list); @@ -51,7 +51,7 @@ public class SendHapticDataTests extends BaseRpcTests { JSONArray jsonArray = new JSONArray(); try { - jsonArray.put(JsonRPCMarshaller.serializeHashtable(Test.GENERAL_HAPTIC_RECT.getStore())); + jsonArray.put(JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_HAPTIC_RECT.getStore())); } catch (JSONException e) { e.printStackTrace(); } @@ -73,14 +73,14 @@ public class SendHapticDataTests extends BaseRpcTests { List<HapticRect> list = msg.getHapticRectData(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_HAPTIC_RECT, list.get(0)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_HAPTIC_RECT, list.get(0)); // Invalid/Null Tests SendHapticData msg = new SendHapticData(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getHapticRectData()); + assertNull(TestValues.NULL, msg.getHapticRectData()); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendLocationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendLocationTests.java index 9849caee5..e530677e6 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendLocationTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendLocationTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.Image; import com.smartdevicelink.proxy.rpc.SendLocation; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -27,13 +27,13 @@ public class SendLocationTests extends BaseRpcTests { protected RPCMessage createMessage(){ SendLocation msg = new SendLocation(); - msg.setLatitudeDegrees(Test.GENERAL_DOUBLE); - msg.setLongitudeDegrees(Test.GENERAL_DOUBLE); - msg.setLocationName(Test.GENERAL_STRING); - msg.setLocationDescription(Test.GENERAL_STRING); - msg.setPhoneNumber(Test.GENERAL_STRING); - msg.setAddressLines(Test.GENERAL_STRING_LIST); - msg.setLocationImage(Test.GENERAL_IMAGE); + msg.setLatitudeDegrees(TestValues.GENERAL_DOUBLE); + msg.setLongitudeDegrees(TestValues.GENERAL_DOUBLE); + msg.setLocationName(TestValues.GENERAL_STRING); + msg.setLocationDescription(TestValues.GENERAL_STRING); + msg.setPhoneNumber(TestValues.GENERAL_STRING); + msg.setAddressLines(TestValues.GENERAL_STRING_LIST); + msg.setLocationImage(TestValues.GENERAL_IMAGE); return msg; } @@ -53,15 +53,15 @@ public class SendLocationTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(SendLocation.KEY_LAT_DEGREES, Test.GENERAL_DOUBLE); - result.put(SendLocation.KEY_LON_DEGREES, Test.GENERAL_DOUBLE); - result.put(SendLocation.KEY_LOCATION_NAME, Test.GENERAL_STRING); - result.put(SendLocation.KEY_LOCATION_DESCRIPTION, Test.GENERAL_STRING); - result.put(SendLocation.KEY_PHONE_NUMBER, Test.GENERAL_STRING); - result.put(SendLocation.KEY_LOCATION_IMAGE, Test.GENERAL_IMAGE.serializeJSON()); - result.put(SendLocation.KEY_ADDRESS_LINES, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST)); + result.put(SendLocation.KEY_LAT_DEGREES, TestValues.GENERAL_DOUBLE); + result.put(SendLocation.KEY_LON_DEGREES, TestValues.GENERAL_DOUBLE); + result.put(SendLocation.KEY_LOCATION_NAME, TestValues.GENERAL_STRING); + result.put(SendLocation.KEY_LOCATION_DESCRIPTION, TestValues.GENERAL_STRING); + result.put(SendLocation.KEY_PHONE_NUMBER, TestValues.GENERAL_STRING); + result.put(SendLocation.KEY_LOCATION_IMAGE, TestValues.GENERAL_IMAGE.serializeJSON()); + result.put(SendLocation.KEY_ADDRESS_LINES, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -81,26 +81,26 @@ public class SendLocationTests extends BaseRpcTests { Image locationImage = ((SendLocation) msg).getLocationImage(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, longitude); - assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, latitude); - assertEquals(Test.MATCH, Test.GENERAL_STRING, locationDesc); - assertEquals(Test.MATCH, Test.GENERAL_STRING, locationName); - assertEquals(Test.MATCH, Test.GENERAL_STRING, phoneNumber); - assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, addressLines)); - assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, locationImage)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DOUBLE, longitude); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DOUBLE, latitude); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, locationDesc); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, locationName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, phoneNumber); + assertTrue(TestValues.TRUE, Validator.validateStringList(TestValues.GENERAL_STRING_LIST, addressLines)); + assertTrue(TestValues.TRUE, Validator.validateImage(TestValues.GENERAL_IMAGE, locationImage)); // Invalid/Null Tests SendLocation msg = new SendLocation(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getLatitudeDegrees()); - assertNull(Test.NULL, msg.getLongitudeDegrees()); - assertNull(Test.NULL, msg.getLocationName()); - assertNull(Test.NULL, msg.getLocationDescription()); - assertNull(Test.NULL, msg.getPhoneNumber()); - assertNull(Test.NULL, msg.getAddressLines()); - assertNull(Test.NULL, msg.getLocationImage()); + assertNull(TestValues.NULL, msg.getLatitudeDegrees()); + assertNull(TestValues.NULL, msg.getLongitudeDegrees()); + assertNull(TestValues.NULL, msg.getLocationName()); + assertNull(TestValues.NULL, msg.getLocationDescription()); + assertNull(TestValues.NULL, msg.getPhoneNumber()); + assertNull(TestValues.NULL, msg.getAddressLines()); + assertNull(TestValues.NULL, msg.getLocationImage()); } /** @@ -113,33 +113,33 @@ public class SendLocationTests extends BaseRpcTests { try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SendLocation cmd = new SendLocation(hash); - assertNotNull(Test.NOT_NULL, cmd); + assertNotNull(TestValues.NOT_NULL, cmd); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, SendLocation.KEY_LAT_DEGREES), cmd.getLatitudeDegrees()); - assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, SendLocation.KEY_LON_DEGREES), cmd.getLongitudeDegrees()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SendLocation.KEY_LOCATION_NAME), cmd.getLocationName()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SendLocation.KEY_LOCATION_DESCRIPTION), cmd.getLocationDescription()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SendLocation.KEY_PHONE_NUMBER), cmd.getPhoneNumber()); + assertEquals(TestValues.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, SendLocation.KEY_LAT_DEGREES), cmd.getLatitudeDegrees()); + assertEquals(TestValues.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, SendLocation.KEY_LON_DEGREES), cmd.getLongitudeDegrees()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, SendLocation.KEY_LOCATION_NAME), cmd.getLocationName()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, SendLocation.KEY_LOCATION_DESCRIPTION), cmd.getLocationDescription()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, SendLocation.KEY_PHONE_NUMBER), cmd.getPhoneNumber()); List<String> addressList = JsonUtils.readStringListFromJsonObject(parameters, SendLocation.KEY_ADDRESS_LINES); List<String> testList = cmd.getAddressLines(); - assertEquals(Test.MATCH, addressList.size(), testList.size()); - assertTrue(Test.TRUE, Validator.validateStringList(addressList, testList)); + assertEquals(TestValues.MATCH, addressList.size(), testList.size()); + assertTrue(TestValues.TRUE, Validator.validateStringList(addressList, testList)); JSONObject cmdIcon = JsonUtils.readJsonObjectFromJsonObject(parameters, SendLocation.KEY_LOCATION_IMAGE); Image reference = new Image(JsonRPCMarshaller.deserializeJSONObject(cmdIcon)); - assertTrue(Test.TRUE, Validator.validateImage(reference, cmd.getLocationImage())); + assertTrue(TestValues.TRUE, Validator.validateImage(reference, cmd.getLocationImage())); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetAppIconTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetAppIconTests.java index 1be5366f6..bff9650fe 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetAppIconTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetAppIconTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.SetAppIcon; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -24,7 +24,7 @@ public class SetAppIconTests extends BaseRpcTests { protected RPCMessage createMessage() { SetAppIcon msg = new SetAppIcon(); - msg.setSdlFileName(Test.GENERAL_STRING); + msg.setSdlFileName(TestValues.GENERAL_STRING); return msg; } @@ -44,9 +44,9 @@ public class SetAppIconTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(SetAppIcon.KEY_SDL_FILE_NAME, Test.GENERAL_STRING); + result.put(SetAppIcon.KEY_SDL_FILE_NAME, TestValues.GENERAL_STRING); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -60,14 +60,14 @@ public class SetAppIconTests extends BaseRpcTests { String copy = ( (SetAppIcon) msg ).getSdlFileName(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, copy); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, copy); // Invalid/Null Tests SetAppIcon msg = new SetAppIcon(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getSdlFileName()); + assertNull(TestValues.NULL, msg.getSdlFileName()); } /** @@ -75,24 +75,24 @@ public class SetAppIconTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SetAppIcon cmd = new SetAppIcon(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetAppIcon.KEY_SDL_FILE_NAME), cmd.getSdlFileName()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetAppIcon.KEY_SDL_FILE_NAME), cmd.getSdlFileName()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetCloudAppPropertiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetCloudAppPropertiesTests.java index 1a5751701..b7121ee2f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetCloudAppPropertiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetCloudAppPropertiesTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.SetCloudAppProperties; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONException; import org.json.JSONObject; @@ -15,7 +15,7 @@ public class SetCloudAppPropertiesTests extends BaseRpcTests { protected RPCMessage createMessage(){ SetCloudAppProperties msg = new SetCloudAppProperties(); - msg.setProperties(Test.GENERAL_CLOUDAPPPROPERTIES); + msg.setProperties(TestValues.GENERAL_CLOUDAPPPROPERTIES); return msg; } @@ -35,9 +35,9 @@ public class SetCloudAppPropertiesTests extends BaseRpcTests { JSONObject result = new JSONObject(); try{ - result.put(SetCloudAppProperties.KEY_PROPERTIES, Test.GENERAL_CLOUDAPPPROPERTIES.serializeJSON()); + result.put(SetCloudAppProperties.KEY_PROPERTIES, TestValues.GENERAL_CLOUDAPPPROPERTIES.serializeJSON()); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetDisplayLayoutTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetDisplayLayoutTests.java index f56cab807..b67f06152 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetDisplayLayoutTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetDisplayLayoutTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.SetDisplayLayout; import com.smartdevicelink.proxy.rpc.TemplateColorScheme; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -27,9 +27,9 @@ public class SetDisplayLayoutTests extends BaseRpcTests { protected RPCMessage createMessage() { SetDisplayLayout msg = new SetDisplayLayout(); - msg.setDisplayLayout(Test.GENERAL_STRING); - msg.setDayColorScheme(Test.GENERAL_DAYCOLORSCHEME); - msg.setNightColorScheme(Test.GENERAL_NIGHTCOLORSCHEME); + msg.setDisplayLayout(TestValues.GENERAL_STRING); + msg.setDayColorScheme(TestValues.GENERAL_DAYCOLORSCHEME); + msg.setNightColorScheme(TestValues.GENERAL_NIGHTCOLORSCHEME); return msg; } @@ -49,11 +49,11 @@ public class SetDisplayLayoutTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(SetDisplayLayout.KEY_DISPLAY_LAYOUT, Test.GENERAL_STRING); - result.put(SetDisplayLayout.KEY_DAY_COLOR_SCHEME, Test.JSON_DAYCOLORSCHEME); - result.put(SetDisplayLayout.KEY_NIGHT_COLOR_SCHEME, Test.JSON_NIGHTCOLORSCHEME); + result.put(SetDisplayLayout.KEY_DISPLAY_LAYOUT, TestValues.GENERAL_STRING); + result.put(SetDisplayLayout.KEY_DAY_COLOR_SCHEME, TestValues.JSON_DAYCOLORSCHEME); + result.put(SetDisplayLayout.KEY_NIGHT_COLOR_SCHEME, TestValues.JSON_NIGHTCOLORSCHEME); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -69,18 +69,18 @@ public class SetDisplayLayoutTests extends BaseRpcTests { TemplateColorScheme testNightColorScheme = ( (SetDisplayLayout) msg).getNightColorScheme(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, testDisplayLayout); - assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(Test.GENERAL_DAYCOLORSCHEME, testDayColorScheme)); - assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(Test.GENERAL_NIGHTCOLORSCHEME, testNightColorScheme)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testDisplayLayout); + assertTrue(TestValues.TRUE, Validator.validateTemplateColorScheme(TestValues.GENERAL_DAYCOLORSCHEME, testDayColorScheme)); + assertTrue(TestValues.TRUE, Validator.validateTemplateColorScheme(TestValues.GENERAL_NIGHTCOLORSCHEME, testNightColorScheme)); // Invalid/Null Tests SetDisplayLayout msg = new SetDisplayLayout(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getDisplayLayout()); - assertNull(Test.NULL, msg.getDayColorScheme()); - assertNull(Test.NULL, msg.getNightColorScheme()); + assertNull(TestValues.NULL, msg.getDisplayLayout()); + assertNull(TestValues.NULL, msg.getDayColorScheme()); + assertNull(TestValues.NULL, msg.getNightColorScheme()); } /** @@ -88,34 +88,34 @@ public class SetDisplayLayoutTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.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); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetDisplayLayout.KEY_DISPLAY_LAYOUT), cmd.getDisplayLayout()); JSONObject dayColorSchemeObj = JsonUtils.readJsonObjectFromJsonObject(parameters, SetDisplayLayout.KEY_DAY_COLOR_SCHEME); TemplateColorScheme dayColorScheme = new TemplateColorScheme(JsonRPCMarshaller.deserializeJSONObject(dayColorSchemeObj)); - assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(dayColorScheme, cmd.getDayColorScheme()) ); + assertTrue(TestValues.TRUE, Validator.validateTemplateColorScheme(dayColorScheme, cmd.getDayColorScheme()) ); JSONObject nightColorSchemeObj = JsonUtils.readJsonObjectFromJsonObject(parameters, SetDisplayLayout.KEY_DAY_COLOR_SCHEME); TemplateColorScheme nightColorScheme = new TemplateColorScheme(JsonRPCMarshaller.deserializeJSONObject(nightColorSchemeObj)); - assertTrue(Test.TRUE, Validator.validateTemplateColorScheme(nightColorScheme, cmd.getDayColorScheme()) ); + assertTrue(TestValues.TRUE, Validator.validateTemplateColorScheme(nightColorScheme, cmd.getDayColorScheme()) ); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetGlobalPropertiesTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetGlobalPropertiesTests.java index 1ca333e73..13020e26e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetGlobalPropertiesTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetGlobalPropertiesTests.java @@ -11,7 +11,7 @@ import com.smartdevicelink.proxy.rpc.VrHelpItem; import com.smartdevicelink.proxy.rpc.enums.MenuLayout; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -33,14 +33,14 @@ public class SetGlobalPropertiesTests extends BaseRpcTests { protected RPCMessage createMessage() { SetGlobalProperties msg = new SetGlobalProperties(); - msg.setVrHelpTitle(Test.GENERAL_STRING); - msg.setMenuTitle(Test.GENERAL_STRING); - msg.setMenuIcon(Test.GENERAL_IMAGE); - msg.setVrHelp(Test.GENERAL_VRHELPITEM_LIST); - msg.setHelpPrompt(Test.GENERAL_TTSCHUNK_LIST); - msg.setTimeoutPrompt(Test.GENERAL_TTSCHUNK_LIST); - msg.setKeyboardProperties(Test.GENERAL_KEYBOARDPROPERTIES); - msg.setMenuLayout(Test.GENERAL_MENU_LAYOUT); + msg.setVrHelpTitle(TestValues.GENERAL_STRING); + msg.setMenuTitle(TestValues.GENERAL_STRING); + msg.setMenuIcon(TestValues.GENERAL_IMAGE); + msg.setVrHelp(TestValues.GENERAL_VRHELPITEM_LIST); + msg.setHelpPrompt(TestValues.GENERAL_TTSCHUNK_LIST); + msg.setTimeoutPrompt(TestValues.GENERAL_TTSCHUNK_LIST); + msg.setKeyboardProperties(TestValues.GENERAL_KEYBOARDPROPERTIES); + msg.setMenuLayout(TestValues.GENERAL_MENU_LAYOUT); return msg; } @@ -60,16 +60,16 @@ public class SetGlobalPropertiesTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(SetGlobalProperties.KEY_MENU_ICON, Test.JSON_IMAGE); - result.put(SetGlobalProperties.KEY_VR_HELP, Test.JSON_VRHELPITEMS); - result.put(SetGlobalProperties.KEY_HELP_PROMPT, Test.JSON_TTSCHUNKS); - result.put(SetGlobalProperties.KEY_TIMEOUT_PROMPT, Test.JSON_TTSCHUNKS); - result.put(SetGlobalProperties.KEY_MENU_TITLE, Test.GENERAL_STRING); - result.put(SetGlobalProperties.KEY_VR_HELP_TITLE, Test.GENERAL_STRING); - result.put(SetGlobalProperties.KEY_KEYBOARD_PROPERTIES, Test.JSON_KEYBOARDPROPERTIES); - result.put(SetGlobalProperties.KEY_MENU_LAYOUT, Test.GENERAL_MENU_LAYOUT); + result.put(SetGlobalProperties.KEY_MENU_ICON, TestValues.JSON_IMAGE); + result.put(SetGlobalProperties.KEY_VR_HELP, TestValues.JSON_VRHELPITEMS); + result.put(SetGlobalProperties.KEY_HELP_PROMPT, TestValues.JSON_TTSCHUNKS); + result.put(SetGlobalProperties.KEY_TIMEOUT_PROMPT, TestValues.JSON_TTSCHUNKS); + result.put(SetGlobalProperties.KEY_MENU_TITLE, TestValues.GENERAL_STRING); + result.put(SetGlobalProperties.KEY_VR_HELP_TITLE, TestValues.GENERAL_STRING); + result.put(SetGlobalProperties.KEY_KEYBOARD_PROPERTIES, TestValues.JSON_KEYBOARDPROPERTIES); + result.put(SetGlobalProperties.KEY_MENU_LAYOUT, TestValues.GENERAL_MENU_LAYOUT); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -90,28 +90,28 @@ public class SetGlobalPropertiesTests extends BaseRpcTests { MenuLayout testMenuLayout = ( (SetGlobalProperties) msg ).getMenuLayout(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, testMenuTitle); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testVrHelpTitle); - assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, testImage)); - assertTrue(Test.TRUE, Validator.validateVrHelpItems(Test.GENERAL_VRHELPITEM_LIST, testVrHelpItems)); - assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testHelpPrompt)); - assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, testTimeout)); - assertTrue(Test.TRUE, Validator.validateKeyboardProperties(Test.GENERAL_KEYBOARDPROPERTIES, testKeyboardProperties)); - assertEquals(Test.MATCH, Test.GENERAL_MENU_LAYOUT, testMenuLayout); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testMenuTitle); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testVrHelpTitle); + assertTrue(TestValues.TRUE, Validator.validateImage(TestValues.GENERAL_IMAGE, testImage)); + assertTrue(TestValues.TRUE, Validator.validateVrHelpItems(TestValues.GENERAL_VRHELPITEM_LIST, testVrHelpItems)); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(TestValues.GENERAL_TTSCHUNK_LIST, testHelpPrompt)); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(TestValues.GENERAL_TTSCHUNK_LIST, testTimeout)); + assertTrue(TestValues.TRUE, Validator.validateKeyboardProperties(TestValues.GENERAL_KEYBOARDPROPERTIES, testKeyboardProperties)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_MENU_LAYOUT, testMenuLayout); // Invalid/Null Tests SetGlobalProperties msg = new SetGlobalProperties(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getMenuIcon()); - assertNull(Test.NULL, msg.getMenuTitle()); - assertNull(Test.NULL, msg.getVrHelp()); - assertNull(Test.NULL, msg.getHelpPrompt()); - assertNull(Test.NULL, msg.getTimeoutPrompt()); - assertNull(Test.NULL, msg.getKeyboardProperties()); - assertNull(Test.NULL, msg.getVrHelpTitle()); - assertNull(Test.NULL, msg.getMenuLayout()); + assertNull(TestValues.NULL, msg.getMenuIcon()); + assertNull(TestValues.NULL, msg.getMenuTitle()); + assertNull(TestValues.NULL, msg.getVrHelp()); + assertNull(TestValues.NULL, msg.getHelpPrompt()); + assertNull(TestValues.NULL, msg.getTimeoutPrompt()); + assertNull(TestValues.NULL, msg.getKeyboardProperties()); + assertNull(TestValues.NULL, msg.getVrHelpTitle()); + assertNull(TestValues.NULL, msg.getMenuLayout()); } /** @@ -119,32 +119,32 @@ public class SetGlobalPropertiesTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SetGlobalProperties cmd = new SetGlobalProperties(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetGlobalProperties.KEY_VR_HELP_TITLE), cmd.getVrHelpTitle()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetGlobalProperties.KEY_MENU_TITLE), cmd.getMenuTitle()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetGlobalProperties.KEY_VR_HELP_TITLE), cmd.getVrHelpTitle()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetGlobalProperties.KEY_MENU_TITLE), cmd.getMenuTitle()); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, SetGlobalProperties.KEY_MENU_LAYOUT), cmd.getMenuLayout()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, SetGlobalProperties.KEY_MENU_LAYOUT), cmd.getMenuLayout()); JSONObject menuIcon = JsonUtils.readJsonObjectFromJsonObject(parameters, SetGlobalProperties.KEY_MENU_ICON); Image referenceMenuIcon = new Image(JsonRPCMarshaller.deserializeJSONObject(menuIcon)); - assertTrue(Test.TRUE, Validator.validateImage(referenceMenuIcon, cmd.getMenuIcon())); + assertTrue(TestValues.TRUE, Validator.validateImage(referenceMenuIcon, cmd.getMenuIcon())); JSONObject keyboardProperties = JsonUtils.readJsonObjectFromJsonObject(parameters, SetGlobalProperties.KEY_KEYBOARD_PROPERTIES); KeyboardProperties referenceKeyboardProperties = new KeyboardProperties(JsonRPCMarshaller.deserializeJSONObject(keyboardProperties)); - assertTrue(Test.TRUE, Validator.validateKeyboardProperties(referenceKeyboardProperties, cmd.getKeyboardProperties())); + assertTrue(TestValues.TRUE, Validator.validateKeyboardProperties(referenceKeyboardProperties, cmd.getKeyboardProperties())); JSONArray helpPromptArray = JsonUtils.readJsonArrayFromJsonObject(parameters, SetGlobalProperties.KEY_HELP_PROMPT); List<TTSChunk> helpPromptList = new ArrayList<TTSChunk>(); @@ -152,7 +152,7 @@ public class SetGlobalPropertiesTests extends BaseRpcTests { TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)helpPromptArray.get(index)) ); helpPromptList.add(chunk); } - assertTrue(Test.TRUE, Validator.validateTtsChunks(helpPromptList, cmd.getHelpPrompt())); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(helpPromptList, cmd.getHelpPrompt())); JSONArray timeoutPromptArray = JsonUtils.readJsonArrayFromJsonObject(parameters, SetGlobalProperties.KEY_TIMEOUT_PROMPT); List<TTSChunk> timeoutPromptList = new ArrayList<TTSChunk>(); @@ -160,7 +160,7 @@ public class SetGlobalPropertiesTests extends BaseRpcTests { TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)timeoutPromptArray.get(index)) ); timeoutPromptList.add(chunk); } - assertTrue(Test.TRUE, Validator.validateTtsChunks(timeoutPromptList, cmd.getTimeoutPrompt())); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(timeoutPromptList, cmd.getTimeoutPrompt())); JSONArray vrHelpArray = JsonUtils.readJsonArrayFromJsonObject(parameters, SetGlobalProperties.KEY_VR_HELP); List<VrHelpItem> vrHelpList = new ArrayList<VrHelpItem>(); @@ -168,9 +168,9 @@ public class SetGlobalPropertiesTests extends BaseRpcTests { VrHelpItem chunk = new VrHelpItem(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)vrHelpArray.get(index)) ); vrHelpList.add(chunk); } - assertTrue(Test.TRUE, Validator.validateVrHelpItems(vrHelpList, cmd.getVrHelp())); + assertTrue(TestValues.TRUE, Validator.validateVrHelpItems(vrHelpList, cmd.getVrHelp())); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetInteriorVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetInteriorVehicleDataTests.java index f5ecb0d06..2e448d521 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetInteriorVehicleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetInteriorVehicleDataTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.ModuleData; import com.smartdevicelink.proxy.rpc.SetInteriorVehicleData; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -26,7 +26,7 @@ public class SetInteriorVehicleDataTests extends BaseRpcTests { protected RPCMessage createMessage(){ SetInteriorVehicleData msg = new SetInteriorVehicleData(); - msg.setModuleData(Test.GENERAL_MODULEDATA); + msg.setModuleData(TestValues.GENERAL_MODULEDATA); return msg; } @@ -46,9 +46,9 @@ public class SetInteriorVehicleDataTests extends BaseRpcTests { JSONObject result = new JSONObject(); try{ - result.put(SetInteriorVehicleData.KEY_MODULE_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_MODULEDATA.getStore())); + result.put(SetInteriorVehicleData.KEY_MODULE_DATA, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_MODULEDATA.getStore())); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -62,14 +62,14 @@ public class SetInteriorVehicleDataTests extends BaseRpcTests { ModuleData testModuleData = ( (SetInteriorVehicleData) msg ).getModuleData(); // Valid Tests - assertTrue(Test.TRUE, Validator.validateModuleData(Test.GENERAL_MODULEDATA, testModuleData)); + assertTrue(TestValues.TRUE, Validator.validateModuleData(TestValues.GENERAL_MODULEDATA, testModuleData)); // Invalid/Null Tests SetInteriorVehicleData msg = new SetInteriorVehicleData(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getModuleData()); + assertNull(TestValues.NULL, msg.getModuleData()); } /** @@ -77,26 +77,26 @@ public class SetInteriorVehicleDataTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SetInteriorVehicleData cmd = new SetInteriorVehicleData(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); ModuleData referenceModuleData = new ModuleData(JsonRPCMarshaller.deserializeJSONObject((JSONObject) JsonUtils.readObjectFromJsonObject(parameters, SetInteriorVehicleData.KEY_MODULE_DATA))); - assertTrue(Test.TRUE, Validator.validateModuleData(referenceModuleData, cmd.getModuleData())); + assertTrue(TestValues.TRUE, Validator.validateModuleData(referenceModuleData, cmd.getModuleData())); }catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetMediaClockTimerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetMediaClockTimerTests.java index b422937a8..b11554704 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetMediaClockTimerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetMediaClockTimerTests.java @@ -9,7 +9,7 @@ import com.smartdevicelink.proxy.rpc.enums.AudioStreamingIndicator; import com.smartdevicelink.proxy.rpc.enums.UpdateMode; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -28,10 +28,10 @@ public class SetMediaClockTimerTests extends BaseRpcTests { protected RPCMessage createMessage() { SetMediaClockTimer msg = new SetMediaClockTimer(); - msg.setStartTime(Test.GENERAL_STARTTIME); - msg.setEndTime(Test.GENERAL_STARTTIME); - msg.setUpdateMode(Test.GENERAL_UPDATEMODE); - msg.setAudioStreamingIndicator(Test.GENERAL_AUDIO_STREAMING_INDICATOR); + msg.setStartTime(TestValues.GENERAL_STARTTIME); + msg.setEndTime(TestValues.GENERAL_STARTTIME); + msg.setUpdateMode(TestValues.GENERAL_UPDATEMODE); + msg.setAudioStreamingIndicator(TestValues.GENERAL_AUDIO_STREAMING_INDICATOR); return msg; } @@ -51,12 +51,12 @@ public class SetMediaClockTimerTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(SetMediaClockTimer.KEY_START_TIME, Test.JSON_STARTTIME); - result.put(SetMediaClockTimer.KEY_END_TIME, Test.JSON_STARTTIME); - result.put(SetMediaClockTimer.KEY_UPDATE_MODE, Test.GENERAL_UPDATEMODE); - result.put(SetMediaClockTimer.KEY_AUDIO_STREAMING_INDICATOR, Test.GENERAL_AUDIO_STREAMING_INDICATOR); + result.put(SetMediaClockTimer.KEY_START_TIME, TestValues.JSON_STARTTIME); + result.put(SetMediaClockTimer.KEY_END_TIME, TestValues.JSON_STARTTIME); + result.put(SetMediaClockTimer.KEY_UPDATE_MODE, TestValues.GENERAL_UPDATEMODE); + result.put(SetMediaClockTimer.KEY_AUDIO_STREAMING_INDICATOR, TestValues.GENERAL_AUDIO_STREAMING_INDICATOR); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -73,20 +73,20 @@ public class SetMediaClockTimerTests extends BaseRpcTests { AudioStreamingIndicator testAudioStreamingIndicator = ( (SetMediaClockTimer) msg ).getAudioStreamingIndicator(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_UPDATEMODE, testUpdateMode); - assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, testAudioStreamingIndicator); - assertTrue(Test.TRUE, Validator.validateStartTime(Test.GENERAL_STARTTIME, testStartTime)); - assertTrue(Test.TRUE, Validator.validateStartTime(Test.GENERAL_STARTTIME, testEndTime)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_UPDATEMODE, testUpdateMode); + assertEquals(TestValues.MATCH, TestValues.GENERAL_AUDIO_STREAMING_INDICATOR, testAudioStreamingIndicator); + assertTrue(TestValues.TRUE, Validator.validateStartTime(TestValues.GENERAL_STARTTIME, testStartTime)); + assertTrue(TestValues.TRUE, Validator.validateStartTime(TestValues.GENERAL_STARTTIME, testEndTime)); // Invalid/Null Tests SetMediaClockTimer msg = new SetMediaClockTimer(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getStartTime()); - assertNull(Test.NULL, msg.getEndTime()); - assertNull(Test.NULL, msg.getUpdateMode()); - assertNull(Test.NULL, msg.getAudioStreamingIndicator()); + assertNull(TestValues.NULL, msg.getStartTime()); + assertNull(TestValues.NULL, msg.getEndTime()); + assertNull(TestValues.NULL, msg.getUpdateMode()); + assertNull(TestValues.NULL, msg.getAudioStreamingIndicator()); } /** @@ -99,59 +99,59 @@ public class SetMediaClockTimerTests extends BaseRpcTests { StartTime startTime2 = new StartTime(timeInterval2); SetMediaClockTimer msg; - msg = SetMediaClockTimer.countUpFromStartTimeInterval(timeInterval1, timeInterval2, Test.GENERAL_AUDIO_STREAMING_INDICATOR); - assertEquals(Test.MATCH, msg.getUpdateMode(), UpdateMode.COUNTUP); - assertTrue(Test.TRUE, Validator.validateStartTime(startTime1, msg.getStartTime())); - assertTrue(Test.TRUE, Validator.validateStartTime(startTime2, msg.getEndTime())); - assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator()); - - msg = SetMediaClockTimer.countUpFromStartTime(startTime1, startTime2, Test.GENERAL_AUDIO_STREAMING_INDICATOR); - assertEquals(Test.MATCH, msg.getUpdateMode(), UpdateMode.COUNTUP); - assertTrue(Test.TRUE, Validator.validateStartTime(startTime1, msg.getStartTime())); - assertTrue(Test.TRUE, Validator.validateStartTime(startTime2, msg.getEndTime())); - assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator()); - - msg = SetMediaClockTimer.countDownFromStartTimeInterval(timeInterval1, timeInterval2, Test.GENERAL_AUDIO_STREAMING_INDICATOR); - assertEquals(Test.MATCH, msg.getUpdateMode(), UpdateMode.COUNTDOWN); - assertTrue(Test.TRUE, Validator.validateStartTime(startTime1, msg.getStartTime())); - assertTrue(Test.TRUE, Validator.validateStartTime(startTime2, msg.getEndTime())); - assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator()); - - msg = SetMediaClockTimer.countDownFromStartTime(startTime1, startTime2, Test.GENERAL_AUDIO_STREAMING_INDICATOR); - assertEquals(Test.MATCH, msg.getUpdateMode(), UpdateMode.COUNTDOWN); - assertTrue(Test.TRUE, Validator.validateStartTime(startTime1, msg.getStartTime())); - assertTrue(Test.TRUE, Validator.validateStartTime(startTime2, msg.getEndTime())); - assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator()); - - msg = SetMediaClockTimer.pauseWithPlayPauseIndicator(Test.GENERAL_AUDIO_STREAMING_INDICATOR); - assertEquals(Test.MATCH, msg.getUpdateMode(), UpdateMode.PAUSE); - assertNull(Test.NULL, msg.getStartTime()); - assertNull(Test.NULL, msg.getEndTime()); - assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator()); - - msg = SetMediaClockTimer.updatePauseWithNewStartTimeInterval(timeInterval1, timeInterval2, Test.GENERAL_AUDIO_STREAMING_INDICATOR); - assertEquals(Test.MATCH, msg.getUpdateMode(), UpdateMode.PAUSE); - assertTrue(Test.TRUE, Validator.validateStartTime(startTime1, msg.getStartTime())); - assertTrue(Test.TRUE, Validator.validateStartTime(startTime2, msg.getEndTime())); - assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator()); - - msg = SetMediaClockTimer.updatePauseWithNewStartTime(startTime1, startTime2, Test.GENERAL_AUDIO_STREAMING_INDICATOR); - assertEquals(Test.MATCH, msg.getUpdateMode(), UpdateMode.PAUSE); - assertTrue(Test.TRUE, Validator.validateStartTime(startTime1, msg.getStartTime())); - assertTrue(Test.TRUE, Validator.validateStartTime(startTime2, msg.getEndTime())); - assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator()); - - msg = SetMediaClockTimer.resumeWithPlayPauseIndicator(Test.GENERAL_AUDIO_STREAMING_INDICATOR); - assertEquals(Test.MATCH, msg.getUpdateMode(), UpdateMode.RESUME); - assertNull(Test.NULL, msg.getStartTime()); - assertNull(Test.NULL, msg.getEndTime()); - assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator()); - - msg = SetMediaClockTimer.clearWithPlayPauseIndicator(Test.GENERAL_AUDIO_STREAMING_INDICATOR); - assertEquals(Test.MATCH, msg.getUpdateMode(), UpdateMode.CLEAR); - assertNull(Test.NULL, msg.getStartTime()); - assertNull(Test.NULL, msg.getEndTime()); - assertEquals(Test.MATCH, Test.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator()); + msg = SetMediaClockTimer.countUpFromStartTimeInterval(timeInterval1, timeInterval2, TestValues.GENERAL_AUDIO_STREAMING_INDICATOR); + assertEquals(TestValues.MATCH, msg.getUpdateMode(), UpdateMode.COUNTUP); + assertTrue(TestValues.TRUE, Validator.validateStartTime(startTime1, msg.getStartTime())); + assertTrue(TestValues.TRUE, Validator.validateStartTime(startTime2, msg.getEndTime())); + assertEquals(TestValues.MATCH, TestValues.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator()); + + msg = SetMediaClockTimer.countUpFromStartTime(startTime1, startTime2, TestValues.GENERAL_AUDIO_STREAMING_INDICATOR); + assertEquals(TestValues.MATCH, msg.getUpdateMode(), UpdateMode.COUNTUP); + assertTrue(TestValues.TRUE, Validator.validateStartTime(startTime1, msg.getStartTime())); + assertTrue(TestValues.TRUE, Validator.validateStartTime(startTime2, msg.getEndTime())); + assertEquals(TestValues.MATCH, TestValues.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator()); + + msg = SetMediaClockTimer.countDownFromStartTimeInterval(timeInterval1, timeInterval2, TestValues.GENERAL_AUDIO_STREAMING_INDICATOR); + assertEquals(TestValues.MATCH, msg.getUpdateMode(), UpdateMode.COUNTDOWN); + assertTrue(TestValues.TRUE, Validator.validateStartTime(startTime1, msg.getStartTime())); + assertTrue(TestValues.TRUE, Validator.validateStartTime(startTime2, msg.getEndTime())); + assertEquals(TestValues.MATCH, TestValues.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator()); + + msg = SetMediaClockTimer.countDownFromStartTime(startTime1, startTime2, TestValues.GENERAL_AUDIO_STREAMING_INDICATOR); + assertEquals(TestValues.MATCH, msg.getUpdateMode(), UpdateMode.COUNTDOWN); + assertTrue(TestValues.TRUE, Validator.validateStartTime(startTime1, msg.getStartTime())); + assertTrue(TestValues.TRUE, Validator.validateStartTime(startTime2, msg.getEndTime())); + assertEquals(TestValues.MATCH, TestValues.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator()); + + msg = SetMediaClockTimer.pauseWithPlayPauseIndicator(TestValues.GENERAL_AUDIO_STREAMING_INDICATOR); + assertEquals(TestValues.MATCH, msg.getUpdateMode(), UpdateMode.PAUSE); + assertNull(TestValues.NULL, msg.getStartTime()); + assertNull(TestValues.NULL, msg.getEndTime()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator()); + + msg = SetMediaClockTimer.updatePauseWithNewStartTimeInterval(timeInterval1, timeInterval2, TestValues.GENERAL_AUDIO_STREAMING_INDICATOR); + assertEquals(TestValues.MATCH, msg.getUpdateMode(), UpdateMode.PAUSE); + assertTrue(TestValues.TRUE, Validator.validateStartTime(startTime1, msg.getStartTime())); + assertTrue(TestValues.TRUE, Validator.validateStartTime(startTime2, msg.getEndTime())); + assertEquals(TestValues.MATCH, TestValues.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator()); + + msg = SetMediaClockTimer.updatePauseWithNewStartTime(startTime1, startTime2, TestValues.GENERAL_AUDIO_STREAMING_INDICATOR); + assertEquals(TestValues.MATCH, msg.getUpdateMode(), UpdateMode.PAUSE); + assertTrue(TestValues.TRUE, Validator.validateStartTime(startTime1, msg.getStartTime())); + assertTrue(TestValues.TRUE, Validator.validateStartTime(startTime2, msg.getEndTime())); + assertEquals(TestValues.MATCH, TestValues.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator()); + + msg = SetMediaClockTimer.resumeWithPlayPauseIndicator(TestValues.GENERAL_AUDIO_STREAMING_INDICATOR); + assertEquals(TestValues.MATCH, msg.getUpdateMode(), UpdateMode.RESUME); + assertNull(TestValues.NULL, msg.getStartTime()); + assertNull(TestValues.NULL, msg.getEndTime()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator()); + + msg = SetMediaClockTimer.clearWithPlayPauseIndicator(TestValues.GENERAL_AUDIO_STREAMING_INDICATOR); + assertEquals(TestValues.MATCH, msg.getUpdateMode(), UpdateMode.CLEAR); + assertNull(TestValues.NULL, msg.getStartTime()); + assertNull(TestValues.NULL, msg.getEndTime()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_AUDIO_STREAMING_INDICATOR, msg.getAudioStreamingIndicator()); } /** @@ -159,31 +159,31 @@ public class SetMediaClockTimerTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SetMediaClockTimer cmd = new SetMediaClockTimer(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); JSONObject startTime = JsonUtils.readJsonObjectFromJsonObject(parameters, SetMediaClockTimer.KEY_START_TIME); StartTime referenceStartTime = new StartTime(JsonRPCMarshaller.deserializeJSONObject(startTime)); - assertTrue(Test.TRUE, Validator.validateStartTime(referenceStartTime, cmd.getStartTime())); + assertTrue(TestValues.TRUE, Validator.validateStartTime(referenceStartTime, cmd.getStartTime())); JSONObject endTime = JsonUtils.readJsonObjectFromJsonObject(parameters, SetMediaClockTimer.KEY_END_TIME); StartTime referenceEndTime = new StartTime(JsonRPCMarshaller.deserializeJSONObject(endTime)); - assertTrue(Test.TRUE, Validator.validateStartTime(referenceEndTime, cmd.getEndTime())); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetMediaClockTimer.KEY_UPDATE_MODE), cmd.getUpdateMode().toString()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetMediaClockTimer.KEY_AUDIO_STREAMING_INDICATOR), cmd.getAudioStreamingIndicator().toString()); + assertTrue(TestValues.TRUE, Validator.validateStartTime(referenceEndTime, cmd.getEndTime())); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetMediaClockTimer.KEY_UPDATE_MODE), cmd.getUpdateMode().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, SetMediaClockTimer.KEY_AUDIO_STREAMING_INDICATOR), cmd.getAudioStreamingIndicator().toString()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowAppMenuTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowAppMenuTests.java index 07ff2fbfc..2bec40ca6 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowAppMenuTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowAppMenuTests.java @@ -41,7 +41,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.ShowAppMenu; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -58,7 +58,7 @@ public class ShowAppMenuTests extends BaseRpcTests { @Override protected RPCMessage createMessage() { ShowAppMenu msg = new ShowAppMenu(); - msg.setMenuID(Test.GENERAL_INTEGER); + msg.setMenuID(TestValues.GENERAL_INTEGER); return msg; } @@ -77,9 +77,9 @@ public class ShowAppMenuTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(ShowAppMenu.KEY_MENU_ID, Test.GENERAL_INTEGER); + result.put(ShowAppMenu.KEY_MENU_ID, TestValues.GENERAL_INTEGER); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -93,14 +93,14 @@ public class ShowAppMenuTests extends BaseRpcTests { Integer copy = ( (ShowAppMenu) msg ).getMenuID(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INTEGER, copy); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER, copy); // Invalid/Null Tests ShowAppMenu msg = new ShowAppMenu(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.MATCH, msg.getMenuID()); + assertNull(TestValues.MATCH, msg.getMenuID()); } /** @@ -108,23 +108,23 @@ public class ShowAppMenuTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ShowAppMenu cmd = new ShowAppMenu(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); Integer serviceID = JsonUtils.readIntegerFromJsonObject(parameters, ShowAppMenu.KEY_MENU_ID); - assertEquals(Test.MATCH, Test.GENERAL_INTEGER, serviceID); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER, serviceID); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowConstantTbtTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowConstantTbtTests.java index 0fd7f0d19..0ec2100d2 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowConstantTbtTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowConstantTbtTests.java @@ -8,7 +8,7 @@ import com.smartdevicelink.proxy.rpc.ShowConstantTbt; import com.smartdevicelink.proxy.rpc.SoftButton; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -30,17 +30,17 @@ public class ShowConstantTbtTests extends BaseRpcTests { protected RPCMessage createMessage() { ShowConstantTbt msg = new ShowConstantTbt(); - msg.setDistanceToManeuver(Test.GENERAL_DOUBLE); - msg.setDistanceToManeuverScale(Test.GENERAL_DOUBLE); - msg.setEta(Test.GENERAL_STRING); + msg.setDistanceToManeuver(TestValues.GENERAL_DOUBLE); + msg.setDistanceToManeuverScale(TestValues.GENERAL_DOUBLE); + msg.setEta(TestValues.GENERAL_STRING); msg.setManeuverComplete(true); - msg.setNavigationText1(Test.GENERAL_STRING); - msg.setNavigationText2(Test.GENERAL_STRING); - msg.setNextTurnIcon(Test.GENERAL_IMAGE); - msg.setSoftButtons(Test.GENERAL_SOFTBUTTON_LIST); - msg.setTimeToDestination(Test.GENERAL_STRING); - msg.setTotalDistance(Test.GENERAL_STRING); - msg.setTurnIcon(Test.GENERAL_IMAGE); + msg.setNavigationText1(TestValues.GENERAL_STRING); + msg.setNavigationText2(TestValues.GENERAL_STRING); + msg.setNextTurnIcon(TestValues.GENERAL_IMAGE); + msg.setSoftButtons(TestValues.GENERAL_SOFTBUTTON_LIST); + msg.setTimeToDestination(TestValues.GENERAL_STRING); + msg.setTotalDistance(TestValues.GENERAL_STRING); + msg.setTurnIcon(TestValues.GENERAL_IMAGE); return msg; } @@ -60,19 +60,19 @@ public class ShowConstantTbtTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(ShowConstantTbt.KEY_SOFT_BUTTONS, Test.JSON_SOFTBUTTONS); - result.put(ShowConstantTbt.KEY_ETA, Test.GENERAL_STRING); + result.put(ShowConstantTbt.KEY_SOFT_BUTTONS, TestValues.JSON_SOFTBUTTONS); + result.put(ShowConstantTbt.KEY_ETA, TestValues.GENERAL_STRING); result.put(ShowConstantTbt.KEY_MANEUVER_COMPLETE, true); - result.put(ShowConstantTbt.KEY_MANEUVER_DISTANCE, Test.GENERAL_DOUBLE); - result.put(ShowConstantTbt.KEY_MANEUVER_DISTANCE_SCALE, Test.GENERAL_DOUBLE); - result.put(ShowConstantTbt.KEY_TEXT1, Test.GENERAL_STRING); - result.put(ShowConstantTbt.KEY_TEXT2, Test.GENERAL_STRING); - result.put(ShowConstantTbt.KEY_TIME_TO_DESTINATION, Test.GENERAL_STRING); - result.put(ShowConstantTbt.KEY_TOTAL_DISTANCE, Test.GENERAL_STRING); - result.put(ShowConstantTbt.KEY_MANEUVER_IMAGE, Test.GENERAL_IMAGE.serializeJSON()); - result.put(ShowConstantTbt.KEY_NEXT_MANEUVER_IMAGE, Test.GENERAL_IMAGE.serializeJSON()); + result.put(ShowConstantTbt.KEY_MANEUVER_DISTANCE, TestValues.GENERAL_DOUBLE); + result.put(ShowConstantTbt.KEY_MANEUVER_DISTANCE_SCALE, TestValues.GENERAL_DOUBLE); + result.put(ShowConstantTbt.KEY_TEXT1, TestValues.GENERAL_STRING); + result.put(ShowConstantTbt.KEY_TEXT2, TestValues.GENERAL_STRING); + result.put(ShowConstantTbt.KEY_TIME_TO_DESTINATION, TestValues.GENERAL_STRING); + result.put(ShowConstantTbt.KEY_TOTAL_DISTANCE, TestValues.GENERAL_STRING); + result.put(ShowConstantTbt.KEY_MANEUVER_IMAGE, TestValues.GENERAL_IMAGE.serializeJSON()); + result.put(ShowConstantTbt.KEY_NEXT_MANEUVER_IMAGE, TestValues.GENERAL_IMAGE.serializeJSON()); } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -96,34 +96,34 @@ public class ShowConstantTbtTests extends BaseRpcTests { List<SoftButton> testSoftButtons = ((ShowConstantTbt) msg).getSoftButtons(); // Valid Test - assertEquals(Test.MATCH, Test.GENERAL_STRING, testTimeToDestination); - assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, testScale); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testNavText1); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testNavText2); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testEta); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testTotalDistance); - assertEquals(Test.MATCH, Test.GENERAL_DOUBLE, testDistance); - assertTrue(Test.TRUE, testManeuverComplete); - assertTrue(Test.TRUE, Validator.validateSoftButtons(Test.GENERAL_SOFTBUTTON_LIST, testSoftButtons)); - assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, testTurnIcon)); - assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, testNextTurnIcon)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testTimeToDestination); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DOUBLE, testScale); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testNavText1); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testNavText2); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testEta); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testTotalDistance); + assertEquals(TestValues.MATCH, TestValues.GENERAL_DOUBLE, testDistance); + assertTrue(TestValues.TRUE, testManeuverComplete); + assertTrue(TestValues.TRUE, Validator.validateSoftButtons(TestValues.GENERAL_SOFTBUTTON_LIST, testSoftButtons)); + assertTrue(TestValues.TRUE, Validator.validateImage(TestValues.GENERAL_IMAGE, testTurnIcon)); + assertTrue(TestValues.TRUE, Validator.validateImage(TestValues.GENERAL_IMAGE, testNextTurnIcon)); // Invalid/Null Tests ShowConstantTbt msg = new ShowConstantTbt(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getSoftButtons()); - assertNull(Test.NULL, msg.getNavigationText1()); - assertNull(Test.NULL, msg.getNavigationText2()); - assertNull(Test.NULL, msg.getDistanceToManeuver()); - assertNull(Test.NULL, msg.getDistanceToManeuverScale()); - assertNull(Test.NULL, msg.getEta()); - assertNull(Test.NULL, msg.getManeuverComplete()); - assertNull(Test.NULL, msg.getNextTurnIcon()); - assertNull(Test.NULL, msg.getTimeToDestination()); - assertNull(Test.NULL, msg.getTotalDistance()); - assertNull(Test.NULL, msg.getTurnIcon()); + assertNull(TestValues.NULL, msg.getSoftButtons()); + assertNull(TestValues.NULL, msg.getNavigationText1()); + assertNull(TestValues.NULL, msg.getNavigationText2()); + assertNull(TestValues.NULL, msg.getDistanceToManeuver()); + assertNull(TestValues.NULL, msg.getDistanceToManeuverScale()); + assertNull(TestValues.NULL, msg.getEta()); + assertNull(TestValues.NULL, msg.getManeuverComplete()); + assertNull(TestValues.NULL, msg.getNextTurnIcon()); + assertNull(TestValues.NULL, msg.getTimeToDestination()); + assertNull(TestValues.NULL, msg.getTotalDistance()); + assertNull(TestValues.NULL, msg.getTurnIcon()); } /** @@ -131,35 +131,35 @@ public class ShowConstantTbtTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ShowConstantTbt cmd = new ShowConstantTbt(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_ETA), cmd.getEta()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, ShowConstantTbt.KEY_MANEUVER_COMPLETE), cmd.getManeuverComplete()); - assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, ShowConstantTbt.KEY_MANEUVER_DISTANCE), cmd.getDistanceToManeuver()); - assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, ShowConstantTbt.KEY_MANEUVER_DISTANCE_SCALE), cmd.getDistanceToManeuverScale()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TEXT1), cmd.getNavigationText1()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TEXT2), cmd.getNavigationText2()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TIME_TO_DESTINATION), cmd.getTimeToDestination()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TOTAL_DISTANCE), cmd.getTotalDistance()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_ETA), cmd.getEta()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, ShowConstantTbt.KEY_MANEUVER_COMPLETE), cmd.getManeuverComplete()); + assertEquals(TestValues.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, ShowConstantTbt.KEY_MANEUVER_DISTANCE), cmd.getDistanceToManeuver()); + assertEquals(TestValues.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, ShowConstantTbt.KEY_MANEUVER_DISTANCE_SCALE), cmd.getDistanceToManeuverScale()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TEXT1), cmd.getNavigationText1()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TEXT2), cmd.getNavigationText2()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TIME_TO_DESTINATION), cmd.getTimeToDestination()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TOTAL_DISTANCE), cmd.getTotalDistance()); JSONObject icon1 = JsonUtils.readJsonObjectFromJsonObject(parameters, ShowConstantTbt.KEY_MANEUVER_IMAGE); Image refIcon1 = new Image(JsonRPCMarshaller.deserializeJSONObject(icon1)); - assertTrue(Test.TRUE, Validator.validateImage(refIcon1, cmd.getTurnIcon())); + assertTrue(TestValues.TRUE, Validator.validateImage(refIcon1, cmd.getTurnIcon())); JSONObject icon2 = JsonUtils.readJsonObjectFromJsonObject(parameters, ShowConstantTbt.KEY_NEXT_MANEUVER_IMAGE); Image refIcon2 = new Image(JsonRPCMarshaller.deserializeJSONObject(icon2)); - assertTrue(Test.TRUE, Validator.validateImage(refIcon2, cmd.getNextTurnIcon())); + assertTrue(TestValues.TRUE, Validator.validateImage(refIcon2, cmd.getNextTurnIcon())); JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, ShowConstantTbt.KEY_SOFT_BUTTONS); List<SoftButton> softButtonList = new ArrayList<SoftButton>(); @@ -167,9 +167,9 @@ public class ShowConstantTbtTests extends BaseRpcTests { SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonArray.get(index)) ); softButtonList.add(chunk); } - assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons())); + assertTrue(TestValues.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons())); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowTests.java index 77f6e65e7..4d9d7843c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowTests.java @@ -11,7 +11,7 @@ import com.smartdevicelink.proxy.rpc.TemplateConfiguration; import com.smartdevicelink.proxy.rpc.enums.TextAlignment; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -33,21 +33,21 @@ public class ShowTests extends BaseRpcTests { protected RPCMessage createMessage() { Show msg = new Show(); - msg.setMainField1(Test.GENERAL_STRING); - msg.setMainField2(Test.GENERAL_STRING); - msg.setMainField3(Test.GENERAL_STRING); - msg.setMainField4(Test.GENERAL_STRING); - msg.setStatusBar(Test.GENERAL_STRING); - msg.setMediaTrack(Test.GENERAL_STRING); - msg.setTemplateTitle(Test.GENERAL_STRING); - msg.setAlignment(Test.GENERAL_TEXTALIGNMENT); - msg.setGraphic(Test.GENERAL_IMAGE); - msg.setSecondaryGraphic(Test.GENERAL_IMAGE); - msg.setCustomPresets(Test.GENERAL_STRING_LIST); - msg.setSoftButtons(Test.GENERAL_SOFTBUTTON_LIST); - msg.setMetadataTags(Test.GENERAL_METADATASTRUCT); - msg.setWindowID(Test.GENERAL_INT); - msg.setTemplateConfiguration(Test.GENERAL_TEMPLATE_CONFIGURATION); + msg.setMainField1(TestValues.GENERAL_STRING); + msg.setMainField2(TestValues.GENERAL_STRING); + msg.setMainField3(TestValues.GENERAL_STRING); + msg.setMainField4(TestValues.GENERAL_STRING); + msg.setStatusBar(TestValues.GENERAL_STRING); + msg.setMediaTrack(TestValues.GENERAL_STRING); + msg.setTemplateTitle(TestValues.GENERAL_STRING); + msg.setAlignment(TestValues.GENERAL_TEXTALIGNMENT); + msg.setGraphic(TestValues.GENERAL_IMAGE); + msg.setSecondaryGraphic(TestValues.GENERAL_IMAGE); + msg.setCustomPresets(TestValues.GENERAL_STRING_LIST); + msg.setSoftButtons(TestValues.GENERAL_SOFTBUTTON_LIST); + msg.setMetadataTags(TestValues.GENERAL_METADATASTRUCT); + msg.setWindowID(TestValues.GENERAL_INT); + msg.setTemplateConfiguration(TestValues.GENERAL_TEMPLATE_CONFIGURATION); return msg; } @@ -67,23 +67,23 @@ public class ShowTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(Show.KEY_MAIN_FIELD_1, Test.GENERAL_STRING); - result.put(Show.KEY_MAIN_FIELD_2, Test.GENERAL_STRING); - result.put(Show.KEY_MAIN_FIELD_3, Test.GENERAL_STRING); - result.put(Show.KEY_MAIN_FIELD_4, Test.GENERAL_STRING); - result.put(Show.KEY_STATUS_BAR, Test.GENERAL_STRING); - result.put(Show.KEY_MEDIA_TRACK, Test.GENERAL_STRING); - result.put(Show.KEY_TEMPLATE_TITLE, Test.GENERAL_STRING); - result.put(Show.KEY_GRAPHIC, Test.JSON_IMAGE); - result.put(Show.KEY_SECONDARY_GRAPHIC, Test.JSON_IMAGE); - result.put(Show.KEY_ALIGNMENT, Test.GENERAL_TEXTALIGNMENT); - result.put(Show.KEY_CUSTOM_PRESETS, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST)); - result.put(Show.KEY_SOFT_BUTTONS, Test.JSON_SOFTBUTTONS); - result.put(Show.KEY_METADATA_TAGS, Test.GENERAL_METADATASTRUCT.serializeJSON()); - result.put(Show.KEY_WINDOW_ID, Test.GENERAL_INT); - result.put(Show.KEY_TEMPLATE_CONFIGURATION, Test.GENERAL_TEMPLATE_CONFIGURATION.serializeJSON()); + result.put(Show.KEY_MAIN_FIELD_1, TestValues.GENERAL_STRING); + result.put(Show.KEY_MAIN_FIELD_2, TestValues.GENERAL_STRING); + result.put(Show.KEY_MAIN_FIELD_3, TestValues.GENERAL_STRING); + result.put(Show.KEY_MAIN_FIELD_4, TestValues.GENERAL_STRING); + result.put(Show.KEY_STATUS_BAR, TestValues.GENERAL_STRING); + result.put(Show.KEY_MEDIA_TRACK, TestValues.GENERAL_STRING); + result.put(Show.KEY_TEMPLATE_TITLE, TestValues.GENERAL_STRING); + result.put(Show.KEY_GRAPHIC, TestValues.JSON_IMAGE); + result.put(Show.KEY_SECONDARY_GRAPHIC, TestValues.JSON_IMAGE); + result.put(Show.KEY_ALIGNMENT, TestValues.GENERAL_TEXTALIGNMENT); + result.put(Show.KEY_CUSTOM_PRESETS, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); + result.put(Show.KEY_SOFT_BUTTONS, TestValues.JSON_SOFTBUTTONS); + result.put(Show.KEY_METADATA_TAGS, TestValues.GENERAL_METADATASTRUCT.serializeJSON()); + result.put(Show.KEY_WINDOW_ID, TestValues.GENERAL_INT); + result.put(Show.KEY_TEMPLATE_CONFIGURATION, TestValues.GENERAL_TEMPLATE_CONFIGURATION.serializeJSON()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -106,40 +106,40 @@ public class ShowTests extends BaseRpcTests { MetadataTags testMetadata = ( (Show) msg ).getMetadataTags(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, testTrack); - assertEquals(Test.MATCH, Test.GENERAL_STRING, templateTitle); - assertEquals(Test.MATCH, Test.GENERAL_TEXTALIGNMENT, testAlignment); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testStatusBar); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testText1); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testText2); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testText3); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testText4); - assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), testCustomPresets.size()); - assertEquals(Test.MATCH, Test.GENERAL_METADATASTRUCT, testMetadata); - assertTrue(Test.TRUE, Validator.validateSoftButtons(Test.GENERAL_SOFTBUTTON_LIST, testSoftButtons)); - assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, testGraphic2)); - assertTrue(Test.TRUE, Validator.validateImage(Test.GENERAL_IMAGE, testGraphic1)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testTrack); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, templateTitle); + assertEquals(TestValues.MATCH, TestValues.GENERAL_TEXTALIGNMENT, testAlignment); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testStatusBar); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testText1); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testText2); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testText3); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testText4); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING_LIST.size(), testCustomPresets.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_METADATASTRUCT, testMetadata); + assertTrue(TestValues.TRUE, Validator.validateSoftButtons(TestValues.GENERAL_SOFTBUTTON_LIST, testSoftButtons)); + assertTrue(TestValues.TRUE, Validator.validateImage(TestValues.GENERAL_IMAGE, testGraphic2)); + assertTrue(TestValues.TRUE, Validator.validateImage(TestValues.GENERAL_IMAGE, testGraphic1)); // Invalid/Null Tests Show msg = new Show(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getMainField1()); - assertNull(Test.NULL, msg.getMainField2()); - assertNull(Test.NULL, msg.getMainField3()); - assertNull(Test.NULL, msg.getMainField4()); - assertNull(Test.NULL, msg.getStatusBar()); - assertNull(Test.NULL, msg.getAlignment()); - assertNull(Test.NULL, msg.getGraphic()); - assertNull(Test.NULL, msg.getSecondaryGraphic()); - assertNull(Test.NULL, msg.getCustomPresets()); - assertNull(Test.NULL, msg.getMediaTrack()); - assertNull(Test.NULL, msg.getTemplateTitle()); - assertNull(Test.NULL, msg.getSoftButtons()); - assertNull(Test.NULL, msg.getMetadataTags()); - assertNull(Test.NULL, msg.getWindowID()); - assertNull(Test.NULL, msg.getTemplateConfiguration()); + assertNull(TestValues.NULL, msg.getMainField1()); + assertNull(TestValues.NULL, msg.getMainField2()); + assertNull(TestValues.NULL, msg.getMainField3()); + assertNull(TestValues.NULL, msg.getMainField4()); + assertNull(TestValues.NULL, msg.getStatusBar()); + assertNull(TestValues.NULL, msg.getAlignment()); + assertNull(TestValues.NULL, msg.getGraphic()); + assertNull(TestValues.NULL, msg.getSecondaryGraphic()); + assertNull(TestValues.NULL, msg.getCustomPresets()); + assertNull(TestValues.NULL, msg.getMediaTrack()); + assertNull(TestValues.NULL, msg.getTemplateTitle()); + assertNull(TestValues.NULL, msg.getSoftButtons()); + assertNull(TestValues.NULL, msg.getMetadataTags()); + assertNull(TestValues.NULL, msg.getWindowID()); + assertNull(TestValues.NULL, msg.getTemplateConfiguration()); } /** @@ -147,48 +147,48 @@ public class ShowTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext,getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); Show cmd = new Show(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); JSONObject graphic = JsonUtils.readJsonObjectFromJsonObject(parameters, Show.KEY_GRAPHIC); Image referenceGraphic = new Image(JsonRPCMarshaller.deserializeJSONObject(graphic)); - assertTrue(Test.TRUE, Validator.validateImage(referenceGraphic, cmd.getGraphic())); + assertTrue(TestValues.TRUE, Validator.validateImage(referenceGraphic, cmd.getGraphic())); List<String> customPresetsList = JsonUtils.readStringListFromJsonObject(parameters, Show.KEY_CUSTOM_PRESETS); List<String> testPresetsList = cmd.getCustomPresets(); - assertEquals(Test.MATCH, customPresetsList.size(), testPresetsList.size()); - assertTrue(Test.TRUE, Validator.validateStringList(customPresetsList, testPresetsList)); - - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MAIN_FIELD_1), cmd.getMainField1()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MAIN_FIELD_2), cmd.getMainField2()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MAIN_FIELD_3), cmd.getMainField3()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MAIN_FIELD_4), cmd.getMainField4()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_STATUS_BAR), cmd.getStatusBar()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_ALIGNMENT), cmd.getAlignment().toString()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MEDIA_TRACK), cmd.getMediaTrack()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_TEMPLATE_TITLE), cmd.getTemplateTitle()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_METADATA_TAGS), cmd.getMetadataTags()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Show.KEY_WINDOW_ID), cmd.getWindowID()); + assertEquals(TestValues.MATCH, customPresetsList.size(), testPresetsList.size()); + assertTrue(TestValues.TRUE, Validator.validateStringList(customPresetsList, testPresetsList)); + + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MAIN_FIELD_1), cmd.getMainField1()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MAIN_FIELD_2), cmd.getMainField2()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MAIN_FIELD_3), cmd.getMainField3()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MAIN_FIELD_4), cmd.getMainField4()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_STATUS_BAR), cmd.getStatusBar()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_ALIGNMENT), cmd.getAlignment().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_MEDIA_TRACK), cmd.getMediaTrack()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_TEMPLATE_TITLE), cmd.getTemplateTitle()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, Show.KEY_METADATA_TAGS), cmd.getMetadataTags()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Show.KEY_WINDOW_ID), cmd.getWindowID()); JSONObject templateConfiguration = JsonUtils.readJsonObjectFromJsonObject(parameters, Show.KEY_TEMPLATE_CONFIGURATION); TemplateConfiguration refTemplateConfiguration = new TemplateConfiguration(JsonRPCMarshaller.deserializeJSONObject(templateConfiguration)); - assertTrue(Test.TRUE, Validator.validateTemplateConfiguration(refTemplateConfiguration, cmd.getTemplateConfiguration())); + assertTrue(TestValues.TRUE, Validator.validateTemplateConfiguration(refTemplateConfiguration, cmd.getTemplateConfiguration())); JSONObject secondaryGraphic = JsonUtils.readJsonObjectFromJsonObject(parameters, Show.KEY_SECONDARY_GRAPHIC); Image referenceSecondaryGraphic = new Image(JsonRPCMarshaller.deserializeJSONObject(secondaryGraphic)); - assertTrue(Test.TRUE, Validator.validateImage(referenceSecondaryGraphic, cmd.getSecondaryGraphic())); + assertTrue(TestValues.TRUE, Validator.validateImage(referenceSecondaryGraphic, cmd.getSecondaryGraphic())); JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, Show.KEY_SOFT_BUTTONS); List<SoftButton> softButtonList = new ArrayList<SoftButton>(); @@ -196,10 +196,10 @@ public class ShowTests extends BaseRpcTests { SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonArray.get(index)) ); softButtonList.add(chunk); } - assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons())); + assertTrue(TestValues.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons())); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SliderTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SliderTests.java index cce913632..e1c164fc9 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SliderTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SliderTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.Slider; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -26,12 +26,12 @@ public class SliderTests extends BaseRpcTests { protected RPCMessage createMessage() { Slider msg = new Slider(); - msg.setNumTicks(Test.GENERAL_INT); - msg.setPosition(Test.GENERAL_INT); - msg.setTimeout(Test.GENERAL_INT); - msg.setSliderHeader(Test.GENERAL_STRING); - msg.setSliderFooter(Test.GENERAL_STRING_LIST); - msg.setCancelID(Test.GENERAL_INTEGER); + msg.setNumTicks(TestValues.GENERAL_INT); + msg.setPosition(TestValues.GENERAL_INT); + msg.setTimeout(TestValues.GENERAL_INT); + msg.setSliderHeader(TestValues.GENERAL_STRING); + msg.setSliderFooter(TestValues.GENERAL_STRING_LIST); + msg.setCancelID(TestValues.GENERAL_INTEGER); return msg; } @@ -51,14 +51,14 @@ public class SliderTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(Slider.KEY_SLIDER_HEADER, Test.GENERAL_STRING); - result.put(Slider.KEY_SLIDER_FOOTER, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST)); - result.put(Slider.KEY_POSITION, Test.GENERAL_INT); - result.put(Slider.KEY_TIMEOUT, Test.GENERAL_INT); - result.put(Slider.KEY_NUM_TICKS, Test.GENERAL_INT); - result.put(Slider.KEY_CANCEL_ID, Test.GENERAL_INTEGER); + result.put(Slider.KEY_SLIDER_HEADER, TestValues.GENERAL_STRING); + result.put(Slider.KEY_SLIDER_FOOTER, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); + result.put(Slider.KEY_POSITION, TestValues.GENERAL_INT); + result.put(Slider.KEY_TIMEOUT, TestValues.GENERAL_INT); + result.put(Slider.KEY_NUM_TICKS, TestValues.GENERAL_INT); + result.put(Slider.KEY_CANCEL_ID, TestValues.GENERAL_INTEGER); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -77,24 +77,24 @@ public class SliderTests extends BaseRpcTests { Integer testCancelID = ( (Slider) msg ).getCancelID(); // Valid Tests - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testNumTicks); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testTimeout); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testPosition); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testSlider); - assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, testFooter)); - assertEquals(Test.MATCH, Test.GENERAL_INTEGER, testCancelID); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, testNumTicks); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, testTimeout); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, testPosition); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testSlider); + assertTrue(TestValues.TRUE, Validator.validateStringList(TestValues.GENERAL_STRING_LIST, testFooter)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER, testCancelID); // Invalid/Null Tests Slider msg = new Slider(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getSliderHeader()); - assertNull(Test.NULL, msg.getSliderFooter()); - assertNull(Test.NULL, msg.getPosition()); - assertNull(Test.NULL, msg.getTimeout()); - assertNull(Test.NULL, msg.getNumTicks()); - assertNull(Test.NULL, msg.getCancelID()); + assertNull(TestValues.NULL, msg.getSliderHeader()); + assertNull(TestValues.NULL, msg.getSliderFooter()); + assertNull(TestValues.NULL, msg.getPosition()); + assertNull(TestValues.NULL, msg.getTimeout()); + assertNull(TestValues.NULL, msg.getNumTicks()); + assertNull(TestValues.NULL, msg.getCancelID()); } /** @@ -102,34 +102,34 @@ public class SliderTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); Slider cmd = new Slider(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Slider.KEY_NUM_TICKS), cmd.getNumTicks()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Slider.KEY_SLIDER_HEADER), cmd.getSliderHeader()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Slider.KEY_NUM_TICKS), cmd.getNumTicks()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, Slider.KEY_SLIDER_HEADER), cmd.getSliderHeader()); List<String> sliderFooterList = JsonUtils.readStringListFromJsonObject(parameters, Slider.KEY_SLIDER_FOOTER); List<String> testFooterList = cmd.getSliderFooter(); - assertEquals(Test.MATCH, sliderFooterList.size(), testFooterList.size()); - assertTrue(Test.TRUE, Validator.validateStringList(sliderFooterList, testFooterList)); + assertEquals(TestValues.MATCH, sliderFooterList.size(), testFooterList.size()); + assertTrue(TestValues.TRUE, Validator.validateStringList(sliderFooterList, testFooterList)); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Slider.KEY_POSITION), cmd.getPosition()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Slider.KEY_TIMEOUT), cmd.getTimeout()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Slider.KEY_CANCEL_ID), cmd.getCancelID()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Slider.KEY_POSITION), cmd.getPosition()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Slider.KEY_TIMEOUT), cmd.getTimeout()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, Slider.KEY_CANCEL_ID), cmd.getCancelID()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SpeakTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SpeakTests.java index e926c9b78..fb49eef50 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SpeakTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SpeakTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.Speak; import com.smartdevicelink.proxy.rpc.TTSChunk; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -25,7 +25,7 @@ public class SpeakTests extends BaseRpcTests { protected RPCMessage createMessage() { Speak msg = new Speak(); - msg.setTtsChunks(Test.GENERAL_TTSCHUNK_LIST); + msg.setTtsChunks(TestValues.GENERAL_TTSCHUNK_LIST); return msg; } @@ -45,9 +45,9 @@ public class SpeakTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(Speak.KEY_TTS_CHUNKS, Test.JSON_TTSCHUNKS); + result.put(Speak.KEY_TTS_CHUNKS, TestValues.JSON_TTSCHUNKS); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -61,14 +61,14 @@ public class SpeakTests extends BaseRpcTests { List<TTSChunk> copy = ( (Speak) msg ).getTtsChunks(); // Valid Tests - assertTrue(Test.TRUE, Validator.validateTtsChunks(Test.GENERAL_TTSCHUNK_LIST, copy)); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(TestValues.GENERAL_TTSCHUNK_LIST, copy)); // Invalid/Null Tests Speak msg = new Speak(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.MATCH, msg.getTtsChunks()); + assertNull(TestValues.MATCH, msg.getTtsChunks()); } /** @@ -76,18 +76,18 @@ public class SpeakTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); Speak cmd = new Speak(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); @@ -97,7 +97,7 @@ public class SpeakTests extends BaseRpcTests { TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)ttsChunkArray.get(index)) ); ttsChunkList.add(chunk); } - assertTrue(Test.TRUE, Validator.validateTtsChunks(ttsChunkList, cmd.getTtsChunks())); + assertTrue(TestValues.TRUE, Validator.validateTtsChunks(ttsChunkList, cmd.getTtsChunks())); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeButtonTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeButtonTests.java index 6860122bb..133dc29b1 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeButtonTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeButtonTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.SubscribeButton; import com.smartdevicelink.proxy.rpc.enums.ButtonName; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -25,7 +25,7 @@ public class SubscribeButtonTests extends BaseRpcTests { protected RPCMessage createMessage() { SubscribeButton msg = new SubscribeButton(); - msg.setButtonName(Test.GENERAL_BUTTONNAME); + msg.setButtonName(TestValues.GENERAL_BUTTONNAME); return msg; } @@ -45,9 +45,9 @@ public class SubscribeButtonTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(SubscribeButton.KEY_BUTTON_NAME, Test.GENERAL_BUTTONNAME); + result.put(SubscribeButton.KEY_BUTTON_NAME, TestValues.GENERAL_BUTTONNAME); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -61,14 +61,14 @@ public class SubscribeButtonTests extends BaseRpcTests { ButtonName testButtonName = ( (SubscribeButton) msg ).getButtonName(); // Valid Tests - assertEquals("Data didn't match input data.", Test.GENERAL_BUTTONNAME, testButtonName); + assertEquals("Data didn't match input data.", TestValues.GENERAL_BUTTONNAME, testButtonName); // Invalid/Null Tests SubscribeButton msg = new SubscribeButton(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getButtonName()); + assertNull(TestValues.NULL, msg.getButtonName()); } /** @@ -76,23 +76,23 @@ public class SubscribeButtonTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SubscribeButton cmd = new SubscribeButton(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SubscribeButton.KEY_BUTTON_NAME), cmd.getButtonName().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, SubscribeButton.KEY_BUTTON_NAME), cmd.getButtonName().toString()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java index 6cfeb8816..ea46c975a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.SubscribeVehicleData; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -24,35 +24,35 @@ public class SubscribeVehicleDataTests extends BaseRpcTests { protected RPCMessage createMessage() { SubscribeVehicleData msg = new SubscribeVehicleData(); - msg.setSpeed(Test.GENERAL_BOOLEAN); - msg.setRpm(Test.GENERAL_BOOLEAN); - msg.setExternalTemperature(Test.GENERAL_BOOLEAN); - msg.setFuelLevel(Test.GENERAL_BOOLEAN); - msg.setPrndl(Test.GENERAL_BOOLEAN); - msg.setTirePressure(Test.GENERAL_BOOLEAN); - msg.setEngineTorque(Test.GENERAL_BOOLEAN); - msg.setEngineOilLife(Test.GENERAL_BOOLEAN); - msg.setOdometer(Test.GENERAL_BOOLEAN); - msg.setGps(Test.GENERAL_BOOLEAN); - msg.setFuelLevelState(Test.GENERAL_BOOLEAN); - msg.setInstantFuelConsumption(Test.GENERAL_BOOLEAN); - msg.setBeltStatus(Test.GENERAL_BOOLEAN); - msg.setBodyInformation(Test.GENERAL_BOOLEAN); - msg.setDeviceStatus(Test.GENERAL_BOOLEAN); - msg.setDriverBraking(Test.GENERAL_BOOLEAN); - msg.setWiperStatus(Test.GENERAL_BOOLEAN); - msg.setHeadLampStatus(Test.GENERAL_BOOLEAN); - msg.setAccPedalPosition(Test.GENERAL_BOOLEAN); - msg.setSteeringWheelAngle(Test.GENERAL_BOOLEAN); - msg.setECallInfo(Test.GENERAL_BOOLEAN); - msg.setAirbagStatus(Test.GENERAL_BOOLEAN); - msg.setEmergencyEvent(Test.GENERAL_BOOLEAN); - msg.setClusterModeStatus(Test.GENERAL_BOOLEAN); - msg.setMyKey(Test.GENERAL_BOOLEAN); - msg.setFuelRange(Test.GENERAL_BOOLEAN); - msg.setTurnSignal(Test.GENERAL_BOOLEAN); - msg.setElectronicParkBrakeStatus(Test.GENERAL_BOOLEAN); - msg.setOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, Test.GENERAL_BOOLEAN); + msg.setSpeed(TestValues.GENERAL_BOOLEAN); + msg.setRpm(TestValues.GENERAL_BOOLEAN); + msg.setExternalTemperature(TestValues.GENERAL_BOOLEAN); + msg.setFuelLevel(TestValues.GENERAL_BOOLEAN); + msg.setPrndl(TestValues.GENERAL_BOOLEAN); + msg.setTirePressure(TestValues.GENERAL_BOOLEAN); + msg.setEngineTorque(TestValues.GENERAL_BOOLEAN); + msg.setEngineOilLife(TestValues.GENERAL_BOOLEAN); + msg.setOdometer(TestValues.GENERAL_BOOLEAN); + msg.setGps(TestValues.GENERAL_BOOLEAN); + msg.setFuelLevelState(TestValues.GENERAL_BOOLEAN); + msg.setInstantFuelConsumption(TestValues.GENERAL_BOOLEAN); + msg.setBeltStatus(TestValues.GENERAL_BOOLEAN); + msg.setBodyInformation(TestValues.GENERAL_BOOLEAN); + msg.setDeviceStatus(TestValues.GENERAL_BOOLEAN); + msg.setDriverBraking(TestValues.GENERAL_BOOLEAN); + msg.setWiperStatus(TestValues.GENERAL_BOOLEAN); + msg.setHeadLampStatus(TestValues.GENERAL_BOOLEAN); + msg.setAccPedalPosition(TestValues.GENERAL_BOOLEAN); + msg.setSteeringWheelAngle(TestValues.GENERAL_BOOLEAN); + msg.setECallInfo(TestValues.GENERAL_BOOLEAN); + msg.setAirbagStatus(TestValues.GENERAL_BOOLEAN); + msg.setEmergencyEvent(TestValues.GENERAL_BOOLEAN); + msg.setClusterModeStatus(TestValues.GENERAL_BOOLEAN); + msg.setMyKey(TestValues.GENERAL_BOOLEAN); + msg.setFuelRange(TestValues.GENERAL_BOOLEAN); + msg.setTurnSignal(TestValues.GENERAL_BOOLEAN); + msg.setElectronicParkBrakeStatus(TestValues.GENERAL_BOOLEAN); + msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN); return msg; } @@ -72,37 +72,37 @@ public class SubscribeVehicleDataTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(SubscribeVehicleData.KEY_SPEED, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_RPM, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_EXTERNAL_TEMPERATURE, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_FUEL_LEVEL, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_PRNDL, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_TIRE_PRESSURE, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_ENGINE_TORQUE, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_ENGINE_OIL_LIFE, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_ODOMETER, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_GPS, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_FUEL_LEVEL_STATE, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_INSTANT_FUEL_CONSUMPTION, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_BELT_STATUS, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_BODY_INFORMATION, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_DEVICE_STATUS, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_DRIVER_BRAKING, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_WIPER_STATUS, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_HEAD_LAMP_STATUS, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_ACC_PEDAL_POSITION, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_STEERING_WHEEL_ANGLE, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_E_CALL_INFO, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_AIRBAG_STATUS, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_EMERGENCY_EVENT, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_CLUSTER_MODE_STATUS, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_MY_KEY, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_FUEL_RANGE, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_TURN_SIGNAL, Test.GENERAL_BOOLEAN); - result.put(SubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, Test.GENERAL_BOOLEAN); - result.put(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, Test.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_SPEED, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_RPM, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_EXTERNAL_TEMPERATURE, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_FUEL_LEVEL, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_PRNDL, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_TIRE_PRESSURE, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_ENGINE_TORQUE, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_ENGINE_OIL_LIFE, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_ODOMETER, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_GPS, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_FUEL_LEVEL_STATE, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_INSTANT_FUEL_CONSUMPTION, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_BELT_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_BODY_INFORMATION, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_DEVICE_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_DRIVER_BRAKING, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_WIPER_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_HEAD_LAMP_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_ACC_PEDAL_POSITION, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_STEERING_WHEEL_ANGLE, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_E_CALL_INFO, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_AIRBAG_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_EMERGENCY_EVENT, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_CLUSTER_MODE_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_MY_KEY, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_FUEL_RANGE, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_TURN_SIGNAL, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -114,70 +114,70 @@ public class SubscribeVehicleDataTests extends BaseRpcTests { public void testRpcValues () { // Valid Tests - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getSpeed()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getRpm()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getExternalTemperature()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getFuelLevel()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getPrndl()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getTirePressure()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getEngineTorque()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getEngineOilLife()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getOdometer()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getGps()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getFuelLevelState()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getInstantFuelConsumption()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getBeltStatus()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getBodyInformation()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getDeviceStatus()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getDriverBraking()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getWiperStatus()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getHeadLampStatus()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getAccPedalPosition()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getSteeringWheelAngle()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getECallInfo()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getAirbagStatus()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getEmergencyEvent()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getClusterModeStatus()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getMyKey()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getFuelRange()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getTurnSignal()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getElectronicParkBrakeStatus()); - assertTrue(Test.MATCH,( (SubscribeVehicleData) msg ).getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getSpeed()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getRpm()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getExternalTemperature()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getFuelLevel()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getPrndl()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getTirePressure()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getEngineTorque()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getEngineOilLife()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getOdometer()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getGps()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getFuelLevelState()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getInstantFuelConsumption()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getBeltStatus()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getBodyInformation()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getDeviceStatus()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getDriverBraking()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getWiperStatus()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getHeadLampStatus()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getAccPedalPosition()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getSteeringWheelAngle()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getECallInfo()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getAirbagStatus()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getEmergencyEvent()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getClusterModeStatus()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getMyKey()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getFuelRange()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getTurnSignal()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getElectronicParkBrakeStatus()); + assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); // Invalid/Null Tests SubscribeVehicleData msg = new SubscribeVehicleData(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getAccPedalPosition()); - assertNull(Test.NULL, msg.getAirbagStatus()); - assertNull(Test.NULL, msg.getBeltStatus()); - assertNull(Test.NULL, msg.getDriverBraking()); - assertNull(Test.NULL, msg.getFuelLevel()); - assertNull(Test.NULL, msg.getTirePressure()); - assertNull(Test.NULL, msg.getWiperStatus()); - assertNull(Test.NULL, msg.getGps()); - assertNull(Test.NULL, msg.getSpeed()); - assertNull(Test.NULL, msg.getRpm()); - assertNull(Test.NULL, msg.getFuelLevelState()); - assertNull(Test.NULL, msg.getInstantFuelConsumption()); - assertNull(Test.NULL, msg.getExternalTemperature()); - assertNull(Test.NULL, msg.getPrndl()); - assertNull(Test.NULL, msg.getOdometer()); - assertNull(Test.NULL, msg.getBodyInformation()); - assertNull(Test.NULL, msg.getDeviceStatus()); - assertNull(Test.NULL, msg.getHeadLampStatus()); - assertNull(Test.NULL, msg.getEngineTorque()); - assertNull(Test.NULL, msg.getEngineOilLife()); - assertNull(Test.NULL, msg.getSteeringWheelAngle()); - assertNull(Test.NULL, msg.getECallInfo()); - assertNull(Test.NULL, msg.getEmergencyEvent()); - assertNull(Test.NULL, msg.getClusterModeStatus()); - assertNull(Test.NULL, msg.getMyKey()); - assertNull(Test.NULL, msg.getFuelRange()); - assertNull(Test.NULL, msg.getTurnSignal()); - assertNull(Test.NULL, msg.getElectronicParkBrakeStatus()); - assertNull(Test.NULL, msg.getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); + assertNull(TestValues.NULL, msg.getAccPedalPosition()); + assertNull(TestValues.NULL, msg.getAirbagStatus()); + assertNull(TestValues.NULL, msg.getBeltStatus()); + assertNull(TestValues.NULL, msg.getDriverBraking()); + assertNull(TestValues.NULL, msg.getFuelLevel()); + assertNull(TestValues.NULL, msg.getTirePressure()); + assertNull(TestValues.NULL, msg.getWiperStatus()); + assertNull(TestValues.NULL, msg.getGps()); + assertNull(TestValues.NULL, msg.getSpeed()); + assertNull(TestValues.NULL, msg.getRpm()); + assertNull(TestValues.NULL, msg.getFuelLevelState()); + assertNull(TestValues.NULL, msg.getInstantFuelConsumption()); + assertNull(TestValues.NULL, msg.getExternalTemperature()); + assertNull(TestValues.NULL, msg.getPrndl()); + assertNull(TestValues.NULL, msg.getOdometer()); + assertNull(TestValues.NULL, msg.getBodyInformation()); + assertNull(TestValues.NULL, msg.getDeviceStatus()); + assertNull(TestValues.NULL, msg.getHeadLampStatus()); + assertNull(TestValues.NULL, msg.getEngineTorque()); + assertNull(TestValues.NULL, msg.getEngineOilLife()); + assertNull(TestValues.NULL, msg.getSteeringWheelAngle()); + assertNull(TestValues.NULL, msg.getECallInfo()); + assertNull(TestValues.NULL, msg.getEmergencyEvent()); + assertNull(TestValues.NULL, msg.getClusterModeStatus()); + assertNull(TestValues.NULL, msg.getMyKey()); + assertNull(TestValues.NULL, msg.getFuelRange()); + assertNull(TestValues.NULL, msg.getTurnSignal()); + assertNull(TestValues.NULL, msg.getElectronicParkBrakeStatus()); + assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } /** @@ -185,51 +185,51 @@ public class SubscribeVehicleDataTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SubscribeVehicleData cmd = new SubscribeVehicleData(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_SPEED), cmd.getSpeed()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_RPM), cmd.getRpm()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_EXTERNAL_TEMPERATURE), cmd.getExternalTemperature()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_FUEL_LEVEL), cmd.getFuelLevel()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_PRNDL), cmd.getPrndl()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_TIRE_PRESSURE), cmd.getTirePressure()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ENGINE_TORQUE), cmd.getEngineTorque()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ENGINE_OIL_LIFE), cmd.getEngineOilLife()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ODOMETER), cmd.getOdometer()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_GPS), cmd.getGps()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_FUEL_LEVEL_STATE), cmd.getFuelLevelState()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_INSTANT_FUEL_CONSUMPTION), cmd.getInstantFuelConsumption()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_BELT_STATUS), cmd.getBeltStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_BODY_INFORMATION), cmd.getBodyInformation()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_DEVICE_STATUS), cmd.getDeviceStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_DRIVER_BRAKING), cmd.getDriverBraking()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_WIPER_STATUS), cmd.getWiperStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_HEAD_LAMP_STATUS), cmd.getHeadLampStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ACC_PEDAL_POSITION), cmd.getAccPedalPosition()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_STEERING_WHEEL_ANGLE), cmd.getSteeringWheelAngle()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_E_CALL_INFO), cmd.getECallInfo()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_AIRBAG_STATUS), cmd.getAirbagStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_EMERGENCY_EVENT), cmd.getEmergencyEvent()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_CLUSTER_MODE_STATUS), cmd.getClusterModeStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_MY_KEY), cmd.getMyKey()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_FUEL_RANGE), cmd.getFuelRange()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_TURN_SIGNAL), cmd.getTurnSignal()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_SPEED), cmd.getSpeed()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_RPM), cmd.getRpm()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_EXTERNAL_TEMPERATURE), cmd.getExternalTemperature()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_FUEL_LEVEL), cmd.getFuelLevel()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_PRNDL), cmd.getPrndl()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_TIRE_PRESSURE), cmd.getTirePressure()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ENGINE_TORQUE), cmd.getEngineTorque()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ENGINE_OIL_LIFE), cmd.getEngineOilLife()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ODOMETER), cmd.getOdometer()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_GPS), cmd.getGps()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_FUEL_LEVEL_STATE), cmd.getFuelLevelState()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_INSTANT_FUEL_CONSUMPTION), cmd.getInstantFuelConsumption()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_BELT_STATUS), cmd.getBeltStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_BODY_INFORMATION), cmd.getBodyInformation()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_DEVICE_STATUS), cmd.getDeviceStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_DRIVER_BRAKING), cmd.getDriverBraking()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_WIPER_STATUS), cmd.getWiperStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_HEAD_LAMP_STATUS), cmd.getHeadLampStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ACC_PEDAL_POSITION), cmd.getAccPedalPosition()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_STEERING_WHEEL_ANGLE), cmd.getSteeringWheelAngle()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_E_CALL_INFO), cmd.getECallInfo()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_AIRBAG_STATUS), cmd.getAirbagStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_EMERGENCY_EVENT), cmd.getEmergencyEvent()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_CLUSTER_MODE_STATUS), cmd.getClusterModeStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_MY_KEY), cmd.getMyKey()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_FUEL_RANGE), cmd.getFuelRange()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_TURN_SIGNAL), cmd.getTurnSignal()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeWayPointsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeWayPointsTests.java index 06b6ee330..7d3b77520 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeWayPointsTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeWayPointsTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.SubscribeWayPoints; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -45,7 +45,7 @@ public class SubscribeWayPointsTests extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests SubscribeWayPoints msg = new SubscribeWayPoints(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -54,20 +54,20 @@ public class SubscribeWayPointsTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SubscribeWayPoints cmd = new SubscribeWayPoints(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SystemRequestTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SystemRequestTests.java index e6c7d72ee..217385966 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SystemRequestTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SystemRequestTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.SystemRequest; import com.smartdevicelink.proxy.rpc.enums.RequestType; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -27,10 +27,10 @@ public class SystemRequestTests extends BaseRpcTests { protected RPCMessage createMessage() { SystemRequest msg = new SystemRequest(); - msg.setLegacyData(Test.GENERAL_STRING_LIST); - msg.setFileName(Test.GENERAL_STRING); - msg.setRequestType(Test.GENERAL_REQUESTTYPE); - msg.setRequestSubType(Test.GENERAL_STRING); + msg.setLegacyData(TestValues.GENERAL_STRING_LIST); + msg.setFileName(TestValues.GENERAL_STRING); + msg.setRequestType(TestValues.GENERAL_REQUESTTYPE); + msg.setRequestSubType(TestValues.GENERAL_STRING); return msg; } @@ -50,12 +50,12 @@ public class SystemRequestTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(SystemRequest.KEY_DATA, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST)); - result.put(SystemRequest.KEY_FILE_NAME, Test.GENERAL_STRING); - result.put(SystemRequest.KEY_REQUEST_TYPE, Test.GENERAL_REQUESTTYPE); - result.put(SystemRequest.KEY_REQUEST_SUB_TYPE, Test.GENERAL_STRING); + result.put(SystemRequest.KEY_DATA, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); + result.put(SystemRequest.KEY_FILE_NAME, TestValues.GENERAL_STRING); + result.put(SystemRequest.KEY_REQUEST_TYPE, TestValues.GENERAL_REQUESTTYPE); + result.put(SystemRequest.KEY_REQUEST_SUB_TYPE, TestValues.GENERAL_STRING); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -72,21 +72,21 @@ public class SystemRequestTests extends BaseRpcTests { List<String> testLegacyData = ( (SystemRequest) msg ).getLegacyData(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_REQUESTTYPE, testRequestType); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testRequestSubType); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testFileName); - assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, testLegacyData)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_REQUESTTYPE, testRequestType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testRequestSubType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testFileName); + assertTrue(TestValues.TRUE, Validator.validateStringList(TestValues.GENERAL_STRING_LIST, testLegacyData)); // Invalid/Null Tests SystemRequest msg = new SystemRequest(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getLegacyData()); - assertNull(Test.NULL, msg.getFileName()); - assertNull(Test.NULL, msg.getRequestType()); - assertNull(Test.NULL, msg.getRequestSubType()); - assertNull(Test.NULL, msg.getBulkData()); + assertNull(TestValues.NULL, msg.getLegacyData()); + assertNull(TestValues.NULL, msg.getFileName()); + assertNull(TestValues.NULL, msg.getRequestType()); + assertNull(TestValues.NULL, msg.getRequestSubType()); + assertNull(TestValues.NULL, msg.getBulkData()); } /** @@ -94,30 +94,30 @@ public class SystemRequestTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SystemRequest cmd = new SystemRequest(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SystemRequest.KEY_FILE_NAME), cmd.getFileName()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SystemRequest.KEY_REQUEST_TYPE), cmd.getRequestType().toString()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, SystemRequest.KEY_REQUEST_SUB_TYPE), cmd.getRequestSubType()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, SystemRequest.KEY_FILE_NAME), cmd.getFileName()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, SystemRequest.KEY_REQUEST_TYPE), cmd.getRequestType().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, SystemRequest.KEY_REQUEST_SUB_TYPE), cmd.getRequestSubType()); List<String> dataList = JsonUtils.readStringListFromJsonObject(parameters, SystemRequest.KEY_DATA); List<String> testDataList = cmd.getLegacyData(); - assertEquals(Test.MATCH, dataList.size(), testDataList.size()); - assertTrue(Test.TRUE, Validator.validateStringList(dataList, testDataList)); + assertEquals(TestValues.MATCH, dataList.size(), testDataList.size()); + assertTrue(TestValues.TRUE, Validator.validateStringList(dataList, testDataList)); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnpublishAppServiceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnpublishAppServiceTests.java index 1bc0532f8..6c9a3117d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnpublishAppServiceTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnpublishAppServiceTests.java @@ -41,7 +41,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.UnpublishAppService; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -58,7 +58,7 @@ public class UnpublishAppServiceTests extends BaseRpcTests { @Override protected RPCMessage createMessage() { UnpublishAppService msg = new UnpublishAppService(); - msg.setServiceID(Test.GENERAL_STRING); + msg.setServiceID(TestValues.GENERAL_STRING); return msg; } @@ -77,9 +77,9 @@ public class UnpublishAppServiceTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(UnpublishAppService.KEY_SERVICE_ID, Test.GENERAL_STRING); + result.put(UnpublishAppService.KEY_SERVICE_ID, TestValues.GENERAL_STRING); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -93,14 +93,14 @@ public class UnpublishAppServiceTests extends BaseRpcTests { String copy = ( (UnpublishAppService) msg ).getServiceID(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, copy); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, copy); // Invalid/Null Tests UnpublishAppService msg = new UnpublishAppService(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.MATCH, msg.getServiceID()); + assertNull(TestValues.MATCH, msg.getServiceID()); } /** @@ -108,10 +108,10 @@ public class UnpublishAppServiceTests extends BaseRpcTests { */ public void testRequiredParamsConstructor () { - UnpublishAppService msg = new UnpublishAppService(Test.GENERAL_STRING); - assertNotNull(Test.NOT_NULL, msg); + UnpublishAppService msg = new UnpublishAppService(TestValues.GENERAL_STRING); + assertNotNull(TestValues.NOT_NULL, msg); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, msg.getServiceID()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, msg.getServiceID()); } /** @@ -119,23 +119,23 @@ public class UnpublishAppServiceTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); UnpublishAppService cmd = new UnpublishAppService(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); String serviceID = JsonUtils.readStringFromJsonObject(parameters, UnpublishAppService.KEY_SERVICE_ID); - assertEquals(Test.MATCH, Test.GENERAL_STRING, serviceID); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, serviceID); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnregisterAppInterfaceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnregisterAppInterfaceTests.java index a49cc12fb..603dfb2a6 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnregisterAppInterfaceTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnregisterAppInterfaceTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.UnregisterAppInterface; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class UnregisterAppInterfaceTests extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests UnregisterAppInterface msg = new UnregisterAppInterface(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,21 +55,21 @@ public class UnregisterAppInterfaceTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); UnregisterAppInterface cmd = new UnregisterAppInterface(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeButtonTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeButtonTests.java index c587b2358..bce9fd806 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeButtonTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeButtonTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.UnsubscribeButton; import com.smartdevicelink.proxy.rpc.enums.ButtonName; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -25,7 +25,7 @@ public class UnsubscribeButtonTests extends BaseRpcTests { protected RPCMessage createMessage() { UnsubscribeButton msg = new UnsubscribeButton(); - msg.setButtonName(Test.GENERAL_BUTTONNAME); + msg.setButtonName(TestValues.GENERAL_BUTTONNAME); return msg; } @@ -45,10 +45,10 @@ public class UnsubscribeButtonTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(UnsubscribeButton.KEY_BUTTON_NAME, Test.GENERAL_BUTTONNAME); + result.put(UnsubscribeButton.KEY_BUTTON_NAME, TestValues.GENERAL_BUTTONNAME); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -62,14 +62,14 @@ public class UnsubscribeButtonTests extends BaseRpcTests { ButtonName testButtonName = ( (UnsubscribeButton) msg ).getButtonName(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_BUTTONNAME, testButtonName); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BUTTONNAME, testButtonName); // Invalid/Null Tests UnsubscribeButton msg = new UnsubscribeButton(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getButtonName()); + assertNull(TestValues.NULL, msg.getButtonName()); } /** @@ -77,21 +77,21 @@ public class UnsubscribeButtonTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); UnsubscribeButton cmd = new UnsubscribeButton(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, UnsubscribeButton.KEY_BUTTON_NAME), cmd.getButtonName().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, UnsubscribeButton.KEY_BUTTON_NAME), cmd.getButtonName().toString()); } catch (JSONException e) { e.printStackTrace(); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java index 634bb8ee6..464131aed 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.UnsubscribeVehicleData; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -25,36 +25,36 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests { protected RPCMessage createMessage() { UnsubscribeVehicleData msg = new UnsubscribeVehicleData(); - msg.setSpeed(Test.GENERAL_BOOLEAN); - msg.setRpm(Test.GENERAL_BOOLEAN); - msg.setExternalTemperature(Test.GENERAL_BOOLEAN); - msg.setFuelLevel(Test.GENERAL_BOOLEAN); - msg.setPrndl(Test.GENERAL_BOOLEAN); - msg.setTirePressure(Test.GENERAL_BOOLEAN); - msg.setEngineTorque(Test.GENERAL_BOOLEAN); - msg.setEngineOilLife(Test.GENERAL_BOOLEAN); - msg.setOdometer(Test.GENERAL_BOOLEAN); - msg.setGps(Test.GENERAL_BOOLEAN); - msg.setFuelLevelState(Test.GENERAL_BOOLEAN); - msg.setInstantFuelConsumption(Test.GENERAL_BOOLEAN); - msg.setBeltStatus(Test.GENERAL_BOOLEAN); - msg.setBodyInformation(Test.GENERAL_BOOLEAN); - msg.setDeviceStatus(Test.GENERAL_BOOLEAN); - msg.setDriverBraking(Test.GENERAL_BOOLEAN); - msg.setWiperStatus(Test.GENERAL_BOOLEAN); - msg.setHeadLampStatus(Test.GENERAL_BOOLEAN); - msg.setAccPedalPosition(Test.GENERAL_BOOLEAN); - msg.setSteeringWheelAngle(Test.GENERAL_BOOLEAN); - msg.setECallInfo(Test.GENERAL_BOOLEAN); - msg.setAirbagStatus(Test.GENERAL_BOOLEAN); - msg.setEmergencyEvent(Test.GENERAL_BOOLEAN); - msg.setClusterModeStatus(Test.GENERAL_BOOLEAN); - msg.setMyKey(Test.GENERAL_BOOLEAN); - msg.setFuelRange(Test.GENERAL_BOOLEAN); - msg.setTurnSignal(Test.GENERAL_BOOLEAN); - msg.setElectronicParkBrakeStatus(Test.GENERAL_BOOLEAN); - msg.setCloudAppVehicleID(Test.GENERAL_BOOLEAN); - msg.setOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, Test.GENERAL_BOOLEAN); + msg.setSpeed(TestValues.GENERAL_BOOLEAN); + msg.setRpm(TestValues.GENERAL_BOOLEAN); + msg.setExternalTemperature(TestValues.GENERAL_BOOLEAN); + msg.setFuelLevel(TestValues.GENERAL_BOOLEAN); + msg.setPrndl(TestValues.GENERAL_BOOLEAN); + msg.setTirePressure(TestValues.GENERAL_BOOLEAN); + msg.setEngineTorque(TestValues.GENERAL_BOOLEAN); + msg.setEngineOilLife(TestValues.GENERAL_BOOLEAN); + msg.setOdometer(TestValues.GENERAL_BOOLEAN); + msg.setGps(TestValues.GENERAL_BOOLEAN); + msg.setFuelLevelState(TestValues.GENERAL_BOOLEAN); + msg.setInstantFuelConsumption(TestValues.GENERAL_BOOLEAN); + msg.setBeltStatus(TestValues.GENERAL_BOOLEAN); + msg.setBodyInformation(TestValues.GENERAL_BOOLEAN); + msg.setDeviceStatus(TestValues.GENERAL_BOOLEAN); + msg.setDriverBraking(TestValues.GENERAL_BOOLEAN); + msg.setWiperStatus(TestValues.GENERAL_BOOLEAN); + msg.setHeadLampStatus(TestValues.GENERAL_BOOLEAN); + msg.setAccPedalPosition(TestValues.GENERAL_BOOLEAN); + msg.setSteeringWheelAngle(TestValues.GENERAL_BOOLEAN); + msg.setECallInfo(TestValues.GENERAL_BOOLEAN); + msg.setAirbagStatus(TestValues.GENERAL_BOOLEAN); + msg.setEmergencyEvent(TestValues.GENERAL_BOOLEAN); + msg.setClusterModeStatus(TestValues.GENERAL_BOOLEAN); + msg.setMyKey(TestValues.GENERAL_BOOLEAN); + msg.setFuelRange(TestValues.GENERAL_BOOLEAN); + msg.setTurnSignal(TestValues.GENERAL_BOOLEAN); + msg.setElectronicParkBrakeStatus(TestValues.GENERAL_BOOLEAN); + msg.setCloudAppVehicleID(TestValues.GENERAL_BOOLEAN); + msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN); return msg; } @@ -74,38 +74,38 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(UnsubscribeVehicleData.KEY_SPEED, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_RPM, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_EXTERNAL_TEMPERATURE, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_FUEL_LEVEL, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_PRNDL, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_TIRE_PRESSURE, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_ENGINE_TORQUE, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_ENGINE_OIL_LIFE, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_ODOMETER, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_GPS, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_FUEL_LEVEL_STATE, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_INSTANT_FUEL_CONSUMPTION, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_BELT_STATUS, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_BODY_INFORMATION, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_DEVICE_STATUS, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_DRIVER_BRAKING, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_WIPER_STATUS, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_HEAD_LAMP_STATUS, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_ACC_PEDAL_POSITION, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_STEERING_WHEEL_ANGLE, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_E_CALL_INFO, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_AIRBAG_STATUS, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_EMERGENCY_EVENT, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_CLUSTER_MODE_STATUS, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_MY_KEY, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_FUEL_RANGE, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_TURN_SIGNAL, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, Test.GENERAL_BOOLEAN); - result.put(UnsubscribeVehicleData.KEY_CLOUD_APP_VEHICLE_ID, Test.GENERAL_BOOLEAN); - result.put(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, Test.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_SPEED, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_RPM, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_EXTERNAL_TEMPERATURE, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_FUEL_LEVEL, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_PRNDL, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_TIRE_PRESSURE, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_ENGINE_TORQUE, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_ENGINE_OIL_LIFE, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_ODOMETER, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_GPS, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_FUEL_LEVEL_STATE, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_INSTANT_FUEL_CONSUMPTION, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_BELT_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_BODY_INFORMATION, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_DEVICE_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_DRIVER_BRAKING, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_WIPER_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_HEAD_LAMP_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_ACC_PEDAL_POSITION, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_STEERING_WHEEL_ANGLE, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_E_CALL_INFO, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_AIRBAG_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_EMERGENCY_EVENT, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_CLUSTER_MODE_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_MY_KEY, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_FUEL_RANGE, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_TURN_SIGNAL, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_CLOUD_APP_VEHICLE_ID, TestValues.GENERAL_BOOLEAN); + result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -116,72 +116,72 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests { */ public void testRpcValues(){ // Valid Tests - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getSpeed()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getRpm()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getExternalTemperature()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getFuelLevel()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getPrndl()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getTirePressure()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getEngineTorque()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getEngineOilLife()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getOdometer()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getGps()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getFuelLevelState()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getInstantFuelConsumption()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getBeltStatus()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getBodyInformation()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getDeviceStatus()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getDriverBraking()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getWiperStatus()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getHeadLampStatus()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getAccPedalPosition()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getSteeringWheelAngle()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getECallInfo()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getAirbagStatus()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getEmergencyEvent()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getClusterModeStatus()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getMyKey()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getFuelRange()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getTurnSignal()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getElectronicParkBrakeStatus()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getCloudAppVehicleID()); - assertTrue(Test.TRUE,( (UnsubscribeVehicleData) msg ).getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getSpeed()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getRpm()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getExternalTemperature()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getFuelLevel()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getPrndl()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getTirePressure()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getEngineTorque()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getEngineOilLife()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getOdometer()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getGps()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getFuelLevelState()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getInstantFuelConsumption()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getBeltStatus()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getBodyInformation()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getDeviceStatus()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getDriverBraking()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getWiperStatus()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getHeadLampStatus()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getAccPedalPosition()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getSteeringWheelAngle()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getECallInfo()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getAirbagStatus()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getEmergencyEvent()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getClusterModeStatus()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getMyKey()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getFuelRange()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getTurnSignal()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getElectronicParkBrakeStatus()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getCloudAppVehicleID()); + assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); // Invalid/Null Tests UnsubscribeVehicleData msg = new UnsubscribeVehicleData(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getAccPedalPosition()); - assertNull(Test.NULL, msg.getAirbagStatus()); - assertNull(Test.NULL, msg.getBeltStatus()); - assertNull(Test.NULL, msg.getDriverBraking()); - assertNull(Test.NULL, msg.getFuelLevel()); - assertNull(Test.NULL, msg.getTirePressure()); - assertNull(Test.NULL, msg.getWiperStatus()); - assertNull(Test.NULL, msg.getGps()); - assertNull(Test.NULL, msg.getSpeed()); - assertNull(Test.NULL, msg.getRpm()); - assertNull(Test.NULL, msg.getFuelLevelState()); - assertNull(Test.NULL, msg.getInstantFuelConsumption()); - assertNull(Test.NULL, msg.getExternalTemperature()); - assertNull(Test.NULL, msg.getPrndl()); - assertNull(Test.NULL, msg.getOdometer()); - assertNull(Test.NULL, msg.getBodyInformation()); - assertNull(Test.NULL, msg.getDeviceStatus()); - assertNull(Test.NULL, msg.getHeadLampStatus()); - assertNull(Test.NULL, msg.getEngineTorque()); - assertNull(Test.NULL, msg.getEngineOilLife()); - assertNull(Test.NULL, msg.getSteeringWheelAngle()); - assertNull(Test.NULL, msg.getECallInfo()); - assertNull(Test.NULL, msg.getEmergencyEvent()); - assertNull(Test.NULL, msg.getClusterModeStatus()); - assertNull(Test.NULL, msg.getMyKey()); - assertNull(Test.NULL, msg.getFuelRange()); - assertNull(Test.NULL, msg.getTurnSignal()); - assertNull(Test.NULL, msg.getElectronicParkBrakeStatus()); - assertNull(Test.NULL, msg.getCloudAppVehicleID()); - assertNull(Test.NULL, msg.getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); + assertNull(TestValues.NULL, msg.getAccPedalPosition()); + assertNull(TestValues.NULL, msg.getAirbagStatus()); + assertNull(TestValues.NULL, msg.getBeltStatus()); + assertNull(TestValues.NULL, msg.getDriverBraking()); + assertNull(TestValues.NULL, msg.getFuelLevel()); + assertNull(TestValues.NULL, msg.getTirePressure()); + assertNull(TestValues.NULL, msg.getWiperStatus()); + assertNull(TestValues.NULL, msg.getGps()); + assertNull(TestValues.NULL, msg.getSpeed()); + assertNull(TestValues.NULL, msg.getRpm()); + assertNull(TestValues.NULL, msg.getFuelLevelState()); + assertNull(TestValues.NULL, msg.getInstantFuelConsumption()); + assertNull(TestValues.NULL, msg.getExternalTemperature()); + assertNull(TestValues.NULL, msg.getPrndl()); + assertNull(TestValues.NULL, msg.getOdometer()); + assertNull(TestValues.NULL, msg.getBodyInformation()); + assertNull(TestValues.NULL, msg.getDeviceStatus()); + assertNull(TestValues.NULL, msg.getHeadLampStatus()); + assertNull(TestValues.NULL, msg.getEngineTorque()); + assertNull(TestValues.NULL, msg.getEngineOilLife()); + assertNull(TestValues.NULL, msg.getSteeringWheelAngle()); + assertNull(TestValues.NULL, msg.getECallInfo()); + assertNull(TestValues.NULL, msg.getEmergencyEvent()); + assertNull(TestValues.NULL, msg.getClusterModeStatus()); + assertNull(TestValues.NULL, msg.getMyKey()); + assertNull(TestValues.NULL, msg.getFuelRange()); + assertNull(TestValues.NULL, msg.getTurnSignal()); + assertNull(TestValues.NULL, msg.getElectronicParkBrakeStatus()); + assertNull(TestValues.NULL, msg.getCloudAppVehicleID()); + assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } /** @@ -189,54 +189,54 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); UnsubscribeVehicleData cmd = new UnsubscribeVehicleData(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_SPEED), cmd.getSpeed()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_RPM), cmd.getRpm()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_EXTERNAL_TEMPERATURE), cmd.getExternalTemperature()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_FUEL_LEVEL), cmd.getFuelLevel()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_PRNDL), cmd.getPrndl()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_TIRE_PRESSURE), cmd.getTirePressure()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ENGINE_TORQUE), cmd.getEngineTorque()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ENGINE_OIL_LIFE), cmd.getEngineOilLife()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ODOMETER), cmd.getOdometer()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_GPS), cmd.getGps()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_FUEL_LEVEL_STATE), cmd.getFuelLevelState()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_INSTANT_FUEL_CONSUMPTION), cmd.getInstantFuelConsumption()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_BELT_STATUS), cmd.getBeltStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_BODY_INFORMATION), cmd.getBodyInformation()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_DEVICE_STATUS), cmd.getDeviceStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_DRIVER_BRAKING), cmd.getDriverBraking()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_WIPER_STATUS), cmd.getWiperStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_HEAD_LAMP_STATUS), cmd.getHeadLampStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ACC_PEDAL_POSITION), cmd.getAccPedalPosition()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_STEERING_WHEEL_ANGLE), cmd.getSteeringWheelAngle()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_E_CALL_INFO), cmd.getECallInfo()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_AIRBAG_STATUS), cmd.getAirbagStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_EMERGENCY_EVENT), cmd.getEmergencyEvent()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_CLUSTER_MODE_STATUS), cmd.getClusterModeStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_MY_KEY), cmd.getMyKey()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_FUEL_RANGE), cmd.getFuelRange()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_TURN_SIGNAL), cmd.getTurnSignal()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_CLOUD_APP_VEHICLE_ID), cmd.getCloudAppVehicleID()); - assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_SPEED), cmd.getSpeed()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_RPM), cmd.getRpm()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_EXTERNAL_TEMPERATURE), cmd.getExternalTemperature()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_FUEL_LEVEL), cmd.getFuelLevel()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_PRNDL), cmd.getPrndl()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_TIRE_PRESSURE), cmd.getTirePressure()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ENGINE_TORQUE), cmd.getEngineTorque()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ENGINE_OIL_LIFE), cmd.getEngineOilLife()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ODOMETER), cmd.getOdometer()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_GPS), cmd.getGps()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_FUEL_LEVEL_STATE), cmd.getFuelLevelState()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_INSTANT_FUEL_CONSUMPTION), cmd.getInstantFuelConsumption()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_BELT_STATUS), cmd.getBeltStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_BODY_INFORMATION), cmd.getBodyInformation()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_DEVICE_STATUS), cmd.getDeviceStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_DRIVER_BRAKING), cmd.getDriverBraking()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_WIPER_STATUS), cmd.getWiperStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_HEAD_LAMP_STATUS), cmd.getHeadLampStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ACC_PEDAL_POSITION), cmd.getAccPedalPosition()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_STEERING_WHEEL_ANGLE), cmd.getSteeringWheelAngle()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_E_CALL_INFO), cmd.getECallInfo()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_AIRBAG_STATUS), cmd.getAirbagStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_EMERGENCY_EVENT), cmd.getEmergencyEvent()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_CLUSTER_MODE_STATUS), cmd.getClusterModeStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_MY_KEY), cmd.getMyKey()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_FUEL_RANGE), cmd.getFuelRange()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_TURN_SIGNAL), cmd.getTurnSignal()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_CLOUD_APP_VEHICLE_ID), cmd.getCloudAppVehicleID()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeWayPointsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeWayPointsTests.java index ac4afbbea..f8bf0a332 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeWayPointsTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeWayPointsTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.UnsubscribeWayPoints; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -45,7 +45,7 @@ public class UnsubscribeWayPointsTests extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests UnsubscribeWayPoints msg = new UnsubscribeWayPoints(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -54,20 +54,20 @@ public class UnsubscribeWayPointsTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); UnsubscribeWayPoints cmd = new UnsubscribeWayPoints(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UpdateTurnListTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UpdateTurnListTests.java index a8e88aee8..4591cb40a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UpdateTurnListTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UpdateTurnListTests.java @@ -8,7 +8,7 @@ import com.smartdevicelink.proxy.rpc.Turn; import com.smartdevicelink.proxy.rpc.UpdateTurnList; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -30,8 +30,8 @@ public class UpdateTurnListTests extends BaseRpcTests { protected RPCMessage createMessage() { UpdateTurnList msg = new UpdateTurnList(); - msg.setTurnList(Test.GENERAL_TURN_LIST); - msg.setSoftButtons(Test.GENERAL_SOFTBUTTON_LIST); + msg.setTurnList(TestValues.GENERAL_TURN_LIST); + msg.setSoftButtons(TestValues.GENERAL_SOFTBUTTON_LIST); return msg; } @@ -51,10 +51,10 @@ public class UpdateTurnListTests extends BaseRpcTests { JSONObject result = new JSONObject(); try{ - result.put(UpdateTurnList.KEY_SOFT_BUTTONS, Test.JSON_SOFTBUTTONS); - result.put(UpdateTurnList.KEY_TURN_LIST, Test.JSON_TURNS); + result.put(UpdateTurnList.KEY_SOFT_BUTTONS, TestValues.JSON_SOFTBUTTONS); + result.put(UpdateTurnList.KEY_TURN_LIST, TestValues.JSON_TURNS); } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -69,19 +69,19 @@ public class UpdateTurnListTests extends BaseRpcTests { List<Turn> testTurnList = ( (UpdateTurnList) msg ).getTurnList(); // Valid Tests - assertNotNull(Test.NOT_NULL, testSoftButtonList); - assertNotNull(Test.NOT_NULL, testTurnList); + assertNotNull(TestValues.NOT_NULL, testSoftButtonList); + assertNotNull(TestValues.NOT_NULL, testTurnList); - assertTrue(Test.TRUE, Validator.validateSoftButtons(Test.GENERAL_SOFTBUTTON_LIST, testSoftButtonList)); - assertTrue(Test.TRUE, Validator.validateTurnList(Test.GENERAL_TURN_LIST, testTurnList)); + assertTrue(TestValues.TRUE, Validator.validateSoftButtons(TestValues.GENERAL_SOFTBUTTON_LIST, testSoftButtonList)); + assertTrue(TestValues.TRUE, Validator.validateTurnList(TestValues.GENERAL_TURN_LIST, testTurnList)); // Invalid/Null Tests UpdateTurnList msg = new UpdateTurnList(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getTurnList()); - assertNull(Test.NULL, msg.getSoftButtons()); + assertNull(TestValues.NULL, msg.getTurnList()); + assertNull(TestValues.NULL, msg.getSoftButtons()); } /** @@ -89,17 +89,17 @@ public class UpdateTurnListTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); UpdateTurnList cmd = new UpdateTurnList(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); JSONArray softButtonArray = JsonUtils.readJsonArrayFromJsonObject(parameters, UpdateTurnList.KEY_SOFT_BUTTONS); @@ -108,7 +108,7 @@ public class UpdateTurnListTests extends BaseRpcTests { SoftButton chunk = new SoftButton(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonArray.get(index)) ); softButtonList.add(chunk); } - assertTrue(Test.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons())); + assertTrue(TestValues.TRUE, Validator.validateSoftButtons(softButtonList, cmd.getSoftButtons())); JSONArray turnArray = JsonUtils.readJsonArrayFromJsonObject(parameters, UpdateTurnList.KEY_TURN_LIST); List<Turn> turnList = new ArrayList<Turn>(); @@ -117,9 +117,9 @@ public class UpdateTurnListTests extends BaseRpcTests { if (chunk != null) turnList.add(chunk); } - assertTrue(Test.TRUE, Validator.validateTurnList(turnList, cmd.getTurnList())); + assertTrue(TestValues.TRUE, Validator.validateTurnList(turnList, cmd.getTurnList())); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddCommandResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddCommandResponseTests.java index 3536809ec..09f8443a6 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddCommandResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddCommandResponseTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.AddCommand; import com.smartdevicelink.proxy.rpc.AddCommandResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -47,7 +47,7 @@ public class AddCommandResponseTests extends BaseRpcTests{ public void testRpcValues () { // Invalid/Null Tests AddCommandResponse msg = new AddCommandResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -56,18 +56,18 @@ public class AddCommandResponseTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); AddCommand cmd = new AddCommand(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddSubmenuResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddSubmenuResponseTests.java index d49f91443..e178b36aa 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddSubmenuResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddSubmenuResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.AddSubMenuResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class AddSubmenuResponseTests extends BaseRpcTests{ public void testRpcValues () { // Invalid/Null Tests AddSubMenuResponse msg = new AddSubMenuResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class AddSubmenuResponseTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); AddSubMenuResponse cmd = new AddSubMenuResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertManeuverResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertManeuverResponseTests.java index b296cccf0..153b44197 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertManeuverResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertManeuverResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.AlertManeuverResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class AlertManeuverResponseTests extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests AlertManeuverResponse msg = new AlertManeuverResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class AlertManeuverResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); AlertManeuverResponse cmd = new AlertManeuverResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertResponseTests.java index b46a83c62..2b48cd9f8 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.AlertResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class AlertResponseTests extends BaseRpcTests{ try{ result.put(AlertResponse.KEY_TRY_AGAIN_TIME, TRY_AGAIN_TIME); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -60,14 +60,14 @@ public class AlertResponseTests extends BaseRpcTests{ int tryAgainTime = ( (AlertResponse) msg ).getTryAgainTime(); // Valid Tests - assertEquals(Test.MATCH, TRY_AGAIN_TIME, tryAgainTime); + assertEquals(TestValues.MATCH, TRY_AGAIN_TIME, tryAgainTime); // Invalid/Null Tests AlertResponse msg = new AlertResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getTryAgainTime()); + assertNull(TestValues.NULL, msg.getTryAgainTime()); } /** @@ -75,20 +75,20 @@ public class AlertResponseTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); AlertResponse cmd = new AlertResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, AlertResponse.KEY_TRY_AGAIN_TIME), cmd.getTryAgainTime()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, AlertResponse.KEY_TRY_AGAIN_TIME), cmd.getTryAgainTime()); } catch (JSONException e) { e.printStackTrace(); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ButtonPressResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ButtonPressResponseTest.java index 64f5b0c75..bb12d2515 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ButtonPressResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ButtonPressResponseTest.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.ButtonPressResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class ButtonPressResponseTest extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests ButtonPressResponse msg = new ButtonPressResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class ButtonPressResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ButtonPressResponse cmd = new ButtonPressResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CancelInteractionResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CancelInteractionResponseTests.java index e983327f2..f24b74317 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CancelInteractionResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CancelInteractionResponseTests.java @@ -40,7 +40,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.CancelInteractionResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -80,7 +80,7 @@ public class CancelInteractionResponseTests extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests CancelInteractionResponse msg = new CancelInteractionResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -89,18 +89,18 @@ public class CancelInteractionResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); CancelInteractionResponse cmd = new CancelInteractionResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ChangeRegistrationResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ChangeRegistrationResponseTests.java index dc0ebd285..76bc24852 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ChangeRegistrationResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ChangeRegistrationResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.ChangeRegistrationResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class ChangeRegistrationResponseTests extends BaseRpcTests{ public void testRpcValues () { // Invalid/Null Tests ChangeRegistrationResponse msg = new ChangeRegistrationResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class ChangeRegistrationResponseTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ChangeRegistrationResponse cmd = new ChangeRegistrationResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CloseApplicationResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CloseApplicationResponseTests.java index eb56a5293..3c3b2446f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CloseApplicationResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CloseApplicationResponseTests.java @@ -40,7 +40,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.CloseApplicationResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -80,7 +80,7 @@ public class CloseApplicationResponseTests extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests CloseApplicationResponse msg = new CloseApplicationResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -89,18 +89,18 @@ public class CloseApplicationResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); CloseApplicationResponse cmd = new CloseApplicationResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateInteractionChoiceSetResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateInteractionChoiceSetResponseTests.java index 5acf53c08..a15af8fd8 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateInteractionChoiceSetResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateInteractionChoiceSetResponseTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSetResponse; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONObject; @@ -40,7 +40,7 @@ public class CreateInteractionChoiceSetResponseTests extends BaseRpcTests{ public void testRpcValues () { // Invalid/Null Tests CreateInteractionChoiceSetResponse msg = new CreateInteractionChoiceSetResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateWindowResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateWindowResponseTest.java index 8099a9ce7..9d049429f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateWindowResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateWindowResponseTest.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.CreateWindowResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class CreateWindowResponseTest extends BaseRpcTests { public void testRpcValues() { // Invalid/Null Tests CreateWindowResponse msg = new CreateWindowResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class CreateWindowResponseTest extends BaseRpcTests { */ public void testJsonConstructor() { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); CreateWindowResponse cmd = new CreateWindowResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteCommandResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteCommandResponseTests.java index cde460a81..fe2568eb5 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteCommandResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteCommandResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.DeleteCommandResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class DeleteCommandResponseTests extends BaseRpcTests{ public void testRpcValues () { // Invalid/Null Tests DeleteCommandResponse msg = new DeleteCommandResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class DeleteCommandResponseTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); DeleteCommandResponse cmd = new DeleteCommandResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteFileResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteFileResponseTests.java index 7d0c293c5..1a8f1f951 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteFileResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteFileResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.DeleteFileResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -24,7 +24,7 @@ public class DeleteFileResponseTests extends BaseRpcTests{ protected RPCMessage createMessage(){ DeleteFileResponse msg = new DeleteFileResponse(); - msg.setSpaceAvailable(Test.GENERAL_INT); + msg.setSpaceAvailable(TestValues.GENERAL_INT); return msg; } @@ -44,9 +44,9 @@ public class DeleteFileResponseTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(DeleteFileResponse.KEY_SPACE_AVAILABLE, Test.GENERAL_INT); + result.put(DeleteFileResponse.KEY_SPACE_AVAILABLE, TestValues.GENERAL_INT); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -60,14 +60,14 @@ public class DeleteFileResponseTests extends BaseRpcTests{ int spaceAvailable = ( (DeleteFileResponse) msg ).getSpaceAvailable(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INT, spaceAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, spaceAvailable); // Invalid/Null Tests DeleteFileResponse msg = new DeleteFileResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getSpaceAvailable()); + assertNull(TestValues.NULL, msg.getSpaceAvailable()); } /** @@ -75,21 +75,21 @@ public class DeleteFileResponseTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); DeleteFileResponse cmd = new DeleteFileResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DeleteFileResponse.KEY_SPACE_AVAILABLE), cmd.getSpaceAvailable()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, DeleteFileResponse.KEY_SPACE_AVAILABLE), cmd.getSpaceAvailable()); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteInteractionChoiceSetResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteInteractionChoiceSetResponseTests.java index f57b0277f..6ab93240f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteInteractionChoiceSetResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteInteractionChoiceSetResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSetResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class DeleteInteractionChoiceSetResponseTests extends BaseRpcTests{ public void testRpcValues () { // Invalid/Null Tests DeleteInteractionChoiceSetResponse msg = new DeleteInteractionChoiceSetResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class DeleteInteractionChoiceSetResponseTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); DeleteInteractionChoiceSetResponse cmd = new DeleteInteractionChoiceSetResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteSubMenuResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteSubMenuResponseTests.java index 5a405b78c..f5b60143b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteSubMenuResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteSubMenuResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.DeleteSubMenuResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class DeleteSubMenuResponseTests extends BaseRpcTests{ public void testRpcValues () { // Invalid/Null Tests DeleteSubMenuResponse msg = new DeleteSubMenuResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class DeleteSubMenuResponseTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); DeleteSubMenuResponse cmd = new DeleteSubMenuResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteWindowResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteWindowResponseTest.java index 01bcd1491..0cb7e8caa 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteWindowResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteWindowResponseTest.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.DeleteWindowResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class DeleteWindowResponseTest extends BaseRpcTests { public void testRpcValues() { // Invalid/Null Tests DeleteWindowResponse msg = new DeleteWindowResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class DeleteWindowResponseTest extends BaseRpcTests { */ public void testJsonConstructor() { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); DeleteWindowResponse cmd = new DeleteWindowResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DiagnosticMessageResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DiagnosticMessageResponseTests.java index c55cc5098..eb916bf5a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DiagnosticMessageResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DiagnosticMessageResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.DiagnosticMessageResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -26,7 +26,7 @@ public class DiagnosticMessageResponseTests extends BaseRpcTests{ protected RPCMessage createMessage(){ DiagnosticMessageResponse msg = new DiagnosticMessageResponse(); - msg.setMessageDataResult(Test.GENERAL_INTEGER_LIST); + msg.setMessageDataResult(TestValues.GENERAL_INTEGER_LIST); return msg; } @@ -47,9 +47,9 @@ public class DiagnosticMessageResponseTests extends BaseRpcTests{ try{ result.put(DiagnosticMessageResponse.KEY_MESSAGE_DATA_RESULT, - JsonUtils.createJsonArray(Test.GENERAL_INTEGER_LIST)); + JsonUtils.createJsonArray(TestValues.GENERAL_INTEGER_LIST)); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -64,18 +64,18 @@ public class DiagnosticMessageResponseTests extends BaseRpcTests{ List<Integer> cmdId = ( (DiagnosticMessageResponse) msg ).getMessageDataResult(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST.size(), cmdId.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER_LIST.size(), cmdId.size()); - for(int i = 0; i < Test.GENERAL_INTEGER_LIST.size(); i++){ - assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST.get(i), cmdId.get(i)); + for(int i = 0; i < TestValues.GENERAL_INTEGER_LIST.size(); i++){ + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER_LIST.get(i), cmdId.get(i)); } // Invalid/Null Tests DiagnosticMessageResponse msg = new DiagnosticMessageResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getMessageDataResult()); + assertNull(TestValues.NULL, msg.getMessageDataResult()); } /** @@ -83,26 +83,26 @@ public class DiagnosticMessageResponseTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); DiagnosticMessageResponse cmd = new DiagnosticMessageResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); List<Integer> dataResultList = JsonUtils.readIntegerListFromJsonObject(parameters, DiagnosticMessageResponse.KEY_MESSAGE_DATA_RESULT); List<Integer> testResultList = cmd.getMessageDataResult(); - assertEquals(Test.MATCH, dataResultList.size(), testResultList.size()); - assertTrue(Test.TRUE, Validator.validateIntegerList(dataResultList, testResultList)); + assertEquals(TestValues.MATCH, dataResultList.size(), testResultList.size()); + assertTrue(TestValues.TRUE, Validator.validateIntegerList(dataResultList, testResultList)); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DialNumberResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DialNumberResponseTests.java index bf625f19a..900444704 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DialNumberResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DialNumberResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.DialNumberResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class DialNumberResponseTests extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests DialNumberResponse msg = new DialNumberResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class DialNumberResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); DialNumberResponse cmd = new DialNumberResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/EndAudioPassThruResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/EndAudioPassThruResponseTests.java index 5bf4c33da..8026ca756 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/EndAudioPassThruResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/EndAudioPassThruResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.EndAudioPassThruResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class EndAudioPassThruResponseTests extends BaseRpcTests{ public void testRpcValues () { // Invalid/Null Tests EndAudioPassThruResponse msg = new EndAudioPassThruResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class EndAudioPassThruResponseTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); EndAudioPassThruResponse cmd = new EndAudioPassThruResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GenericResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GenericResponseTests.java index fafb7c22a..09e1c754a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GenericResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GenericResponseTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.GenericResponse; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONObject; @@ -40,7 +40,7 @@ public class GenericResponseTests extends BaseRpcTests{ public void testRpcValues () { // Invalid/Null Tests GenericResponse msg = new GenericResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetAppServiceDataResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetAppServiceDataResponseTests.java index ef3e53424..ddd92ee22 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetAppServiceDataResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetAppServiceDataResponseTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.AppServiceData; import com.smartdevicelink.proxy.rpc.GetAppServiceDataResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -47,13 +47,13 @@ public class GetAppServiceDataResponseTests extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests GetAppServiceDataResponse msg = new GetAppServiceDataResponse(); - msg.setServiceData(Test.GENERAL_APPSERVICEDATA); - assertNotNull(Test.NOT_NULL, msg); + msg.setServiceData(TestValues.GENERAL_APPSERVICEDATA); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); // test getter AppServiceData serviceData = msg.getServiceData(); - assertEquals(Test.GENERAL_APPSERVICEDATA, serviceData); + assertEquals(TestValues.GENERAL_APPSERVICEDATA, serviceData); } /** @@ -61,17 +61,17 @@ public class GetAppServiceDataResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); GetAppServiceDataResponse cmd = new GetAppServiceDataResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.NOT_NULL, body); // Test everything in the json body. - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetCloudAppPropertiesResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetCloudAppPropertiesResponseTests.java index e082c82f9..571b91c99 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetCloudAppPropertiesResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetCloudAppPropertiesResponseTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.GetCloudAppPropertiesResponse; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONObject; @@ -35,7 +35,7 @@ public class GetCloudAppPropertiesResponseTests extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests GetCloudAppPropertiesResponse msg = new GetCloudAppPropertiesResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetDTCsResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetDTCsResponseTests.java index 5df87b425..f87de7e50 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetDTCsResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetDTCsResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.GetDTCsResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -26,7 +26,7 @@ public class GetDTCsResponseTests extends BaseRpcTests{ protected RPCMessage createMessage(){ GetDTCsResponse msg = new GetDTCsResponse(); - msg.setDtc(Test.GENERAL_STRING_LIST); + msg.setDtc(TestValues.GENERAL_STRING_LIST); return msg; } @@ -46,9 +46,9 @@ public class GetDTCsResponseTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(GetDTCsResponse.KEY_DTC, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST)); + result.put(GetDTCsResponse.KEY_DTC, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -62,18 +62,18 @@ public class GetDTCsResponseTests extends BaseRpcTests{ List<String> cmdId = ( (GetDTCsResponse) msg ).getDtc(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), cmdId.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING_LIST.size(), cmdId.size()); - for(int i = 0; i < Test.GENERAL_STRING_LIST.size(); i++){ - assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.get(i), cmdId.get(i)); + for(int i = 0; i < TestValues.GENERAL_STRING_LIST.size(); i++){ + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING_LIST.get(i), cmdId.get(i)); } // Invalid/Null Tests GetDTCsResponse msg = new GetDTCsResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getDtc()); + assertNull(TestValues.NULL, msg.getDtc()); } /** @@ -81,25 +81,25 @@ public class GetDTCsResponseTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); GetDTCsResponse cmd = new GetDTCsResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); List<String> dtcList = JsonUtils.readStringListFromJsonObject(parameters, GetDTCsResponse.KEY_DTC); List<String> testDtcList = cmd.getDtc(); - assertEquals(Test.MATCH, dtcList.size(), testDtcList.size()); - assertTrue(Test.TRUE, Validator.validateStringList(dtcList, testDtcList)); + assertEquals(TestValues.MATCH, dtcList.size(), testDtcList.size()); + assertTrue(TestValues.TRUE, Validator.validateStringList(dtcList, testDtcList)); } catch (JSONException e) { e.printStackTrace(); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetFileResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetFileResponseTests.java index 25ba20949..815f4e400 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetFileResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetFileResponseTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.GetFileResponse; import com.smartdevicelink.proxy.rpc.enums.FileType; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -26,10 +26,10 @@ public class GetFileResponseTests extends BaseRpcTests { GetFileResponse msg = new GetFileResponse(); - msg.setCRC(Test.GENERAL_INT); - msg.setFileType(Test.GENERAL_FILETYPE); - msg.setOffset(Test.GENERAL_INT); - msg.setLength(Test.GENERAL_INT); + msg.setCRC(TestValues.GENERAL_INT); + msg.setFileType(TestValues.GENERAL_FILETYPE); + msg.setOffset(TestValues.GENERAL_INT); + msg.setLength(TestValues.GENERAL_INT); return msg; } @@ -49,12 +49,12 @@ public class GetFileResponseTests extends BaseRpcTests { JSONObject result = new JSONObject(); try{ - result.put(GetFileResponse.KEY_CRC, Test.GENERAL_INTEGER); - result.put(GetFileResponse.KEY_FILE_TYPE, Test.GENERAL_FILETYPE); - result.put(GetFileResponse.KEY_OFFSET, Test.GENERAL_INTEGER); - result.put(GetFileResponse.KEY_LENGTH, Test.GENERAL_INTEGER); + result.put(GetFileResponse.KEY_CRC, TestValues.GENERAL_INTEGER); + result.put(GetFileResponse.KEY_FILE_TYPE, TestValues.GENERAL_FILETYPE); + result.put(GetFileResponse.KEY_OFFSET, TestValues.GENERAL_INTEGER); + result.put(GetFileResponse.KEY_LENGTH, TestValues.GENERAL_INTEGER); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -71,20 +71,20 @@ public class GetFileResponseTests extends BaseRpcTests { Integer length = ( (GetFileResponse) msg ).getLength(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INTEGER, crc); - assertEquals(Test.MATCH, Test.GENERAL_FILETYPE, fileType); - assertEquals(Test.MATCH, Test.GENERAL_INTEGER, offset); - assertEquals(Test.MATCH, Test.GENERAL_INTEGER, length); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER, crc); + assertEquals(TestValues.MATCH, TestValues.GENERAL_FILETYPE, fileType); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER, offset); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER, length); // Invalid/Null Tests GetFileResponse msg = new GetFileResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getCRC()); - assertNull(Test.NULL, msg.getFileType()); - assertNull(Test.NULL, msg.getOffset()); - assertNull(Test.NULL, msg.getLength()); + assertNull(TestValues.NULL, msg.getCRC()); + assertNull(TestValues.NULL, msg.getFileType()); + assertNull(TestValues.NULL, msg.getOffset()); + assertNull(TestValues.NULL, msg.getLength()); } /** @@ -92,25 +92,25 @@ public class GetFileResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); GetFileResponse cmd = new GetFileResponse (hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetFileResponse.KEY_CRC), cmd.getCRC()); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetFileResponse.KEY_FILE_TYPE).toString(), cmd.getFileType().toString()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetFileResponse.KEY_LENGTH), cmd.getLength()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetFileResponse.KEY_OFFSET), cmd.getOffset()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetFileResponse.KEY_CRC), cmd.getCRC()); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetFileResponse.KEY_FILE_TYPE).toString(), cmd.getFileType().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetFileResponse.KEY_LENGTH), cmd.getLength()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetFileResponse.KEY_OFFSET), cmd.getOffset()); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataConsentResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataConsentResponseTests.java index e100f4b86..2d1ee88c7 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataConsentResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataConsentResponseTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.GetInteriorVehicleDataConsentResponse; import com.smartdevicelink.proxy.rpc.enums.Result; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -21,7 +21,7 @@ public class GetInteriorVehicleDataConsentResponseTests extends BaseRpcTests { @Override protected RPCMessage createMessage() { GetInteriorVehicleDataConsentResponse msg = new GetInteriorVehicleDataConsentResponse(); - msg.setAllowances(Test.GENERAL_BOOLEAN_LIST); + msg.setAllowances(TestValues.GENERAL_BOOLEAN_LIST); return msg; } @@ -40,43 +40,43 @@ public class GetInteriorVehicleDataConsentResponseTests extends BaseRpcTests { JSONObject result = new JSONObject(); try{ - result.put(GetInteriorVehicleDataConsentResponse.KEY_ALLOWED, JsonUtils.createJsonArray(Test.GENERAL_BOOLEAN_LIST)); + result.put(GetInteriorVehicleDataConsentResponse.KEY_ALLOWED, JsonUtils.createJsonArray(TestValues.GENERAL_BOOLEAN_LIST)); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; } public void testRpcValues() { List<Boolean> list = ((GetInteriorVehicleDataConsentResponse) msg).getAllowances(); - assertEquals(Test.MATCH, list, Test.GENERAL_BOOLEAN_LIST); + assertEquals(TestValues.MATCH, list, TestValues.GENERAL_BOOLEAN_LIST); } public void testRequiredParams(){ GetInteriorVehicleDataConsentResponse msg = new GetInteriorVehicleDataConsentResponse(true, Result.SUCCESS); assertTrue(msg.getSuccess()); - assertEquals(Test.MATCH, msg.getResultCode(), Result.SUCCESS); + assertEquals(TestValues.MATCH, msg.getResultCode(), Result.SUCCESS); } public void testJsonConstructor() { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); GetInteriorVehicleDataConsentResponse cmd = new GetInteriorVehicleDataConsentResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.NOT_NULL, 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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readBooleanListFromJsonObject(parameters, + assertEquals(TestValues.MATCH, JsonUtils.readBooleanListFromJsonObject(parameters, GetInteriorVehicleDataConsentResponse.KEY_ALLOWED), cmd.getAllowances()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataResponseTests.java index c76388c69..f64325dea 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataResponseTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.GetInteriorVehicleDataResponse; import com.smartdevicelink.proxy.rpc.ModuleData; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -27,8 +27,8 @@ public class GetInteriorVehicleDataResponseTests extends BaseRpcTests { GetInteriorVehicleDataResponse msg = new GetInteriorVehicleDataResponse(); - msg.setIsSubscribed(Test.GENERAL_BOOLEAN); - msg.setModuleData(Test.GENERAL_MODULEDATA); + msg.setIsSubscribed(TestValues.GENERAL_BOOLEAN); + msg.setModuleData(TestValues.GENERAL_MODULEDATA); return msg; } @@ -48,10 +48,10 @@ public class GetInteriorVehicleDataResponseTests extends BaseRpcTests { JSONObject result = new JSONObject(); try{ - result.put(GetInteriorVehicleDataResponse.KEY_IS_SUBSCRIBED, Test.GENERAL_BOOLEAN); - result.put(GetInteriorVehicleDataResponse.KEY_MODULE_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_MODULEDATA.getStore())); + result.put(GetInteriorVehicleDataResponse.KEY_IS_SUBSCRIBED, TestValues.GENERAL_BOOLEAN); + result.put(GetInteriorVehicleDataResponse.KEY_MODULE_DATA, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_MODULEDATA.getStore())); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -66,16 +66,16 @@ public class GetInteriorVehicleDataResponseTests extends BaseRpcTests { ModuleData testModuleData = ( (GetInteriorVehicleDataResponse) msg ).getModuleData(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, testIsSubscribed); - assertTrue(Test.TRUE, Validator.validateModuleData(Test.GENERAL_MODULEDATA, testModuleData)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BOOLEAN, testIsSubscribed); + assertTrue(TestValues.TRUE, Validator.validateModuleData(TestValues.GENERAL_MODULEDATA, testModuleData)); // Invalid/Null Tests GetInteriorVehicleDataResponse msg = new GetInteriorVehicleDataResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getIsSubscribed()); - assertNull(Test.NULL, msg.getModuleData()); + assertNull(TestValues.NULL, msg.getIsSubscribed()); + assertNull(TestValues.NULL, msg.getModuleData()); } /** @@ -83,26 +83,26 @@ public class GetInteriorVehicleDataResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); GetInteriorVehicleDataResponse cmd = new GetInteriorVehicleDataResponse (hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); ModuleData testModuleData = new ModuleData(JsonRPCMarshaller.deserializeJSONObject((JSONObject) JsonUtils.readObjectFromJsonObject(parameters, GetInteriorVehicleDataResponse.KEY_MODULE_DATA))); ModuleData cmdModuleData = cmd.getModuleData(); - assertTrue(Test.TRUE, Validator.validateModuleData(testModuleData, cmdModuleData) ); - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetInteriorVehicleDataResponse.KEY_IS_SUBSCRIBED), cmd.getIsSubscribed()); + assertTrue(TestValues.TRUE, Validator.validateModuleData(testModuleData, cmdModuleData) ); + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, GetInteriorVehicleDataResponse.KEY_IS_SUBSCRIBED), cmd.getIsSubscribed()); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetSystemCapabilityResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetSystemCapabilityResponseTests.java index b9fd85a8e..d18e89350 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetSystemCapabilityResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetSystemCapabilityResponseTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.GetSystemCapabilityResponse; import com.smartdevicelink.proxy.rpc.SystemCapability; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -21,7 +21,7 @@ public class GetSystemCapabilityResponseTests extends BaseRpcTests { protected RPCMessage createMessage(){ GetSystemCapabilityResponse msg = new GetSystemCapabilityResponse(); - msg.setSystemCapability(Test.GENERAL_SYSTEMCAPABILITY); + msg.setSystemCapability(TestValues.GENERAL_SYSTEMCAPABILITY); return msg; } @@ -41,9 +41,9 @@ public class GetSystemCapabilityResponseTests extends BaseRpcTests { JSONObject result = new JSONObject(); try{ - result.put(GetSystemCapabilityResponse.KEY_SYSTEM_CAPABILITY, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_SYSTEMCAPABILITY.getStore())); + result.put(GetSystemCapabilityResponse.KEY_SYSTEM_CAPABILITY, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_SYSTEMCAPABILITY.getStore())); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -57,14 +57,14 @@ public class GetSystemCapabilityResponseTests extends BaseRpcTests { SystemCapability testCapability = ( (GetSystemCapabilityResponse) msg ).getSystemCapability(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_SYSTEMCAPABILITY.getSystemCapabilityType(), testCapability.getSystemCapabilityType()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_SYSTEMCAPABILITY.getSystemCapabilityType(), testCapability.getSystemCapabilityType()); // Invalid/Null Tests GetSystemCapabilityResponse msg = new GetSystemCapabilityResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getSystemCapability()); + assertNull(TestValues.NULL, msg.getSystemCapability()); } /** @@ -72,24 +72,24 @@ public class GetSystemCapabilityResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); GetSystemCapabilityResponse cmd = new GetSystemCapabilityResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); SystemCapability testCapability = new SystemCapability(JsonRPCMarshaller.deserializeJSONObject((JSONObject) JsonUtils.readObjectFromJsonObject(parameters, GetSystemCapabilityResponse.KEY_SYSTEM_CAPABILITY))); SystemCapability cmdCapability = cmd.getSystemCapability(); - assertEquals(Test.MATCH, testCapability.getSystemCapabilityType(), cmdCapability.getSystemCapabilityType()); + assertEquals(TestValues.MATCH, testCapability.getSystemCapabilityType(), cmdCapability.getSystemCapabilityType()); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java index fbba38025..71eeed435 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java @@ -20,7 +20,7 @@ import com.smartdevicelink.proxy.rpc.TireStatus; import com.smartdevicelink.proxy.rpc.enums.TurnSignal; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.VehicleDataHelper; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -90,9 +90,9 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{ result.put(GetVehicleDataResponse.KEY_FUEL_RANGE, VehicleDataHelper.JSON_FUEL_RANGE); result.put(GetVehicleDataResponse.KEY_TURN_SIGNAL, VehicleDataHelper.TURN_SIGNAL); result.put(GetVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS); - result.put(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE); + result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE); } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -269,7 +269,7 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{ reference.put(GetVehicleDataResponse.KEY_FUEL_RANGE, fuelRangeArrayObj); reference.put(GetVehicleDataResponse.KEY_TURN_SIGNAL, TurnSignal.OFF); reference.put(GetVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS); - reference.put(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE); + reference.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE); JSONObject underTest = msg.serializeJSON(); @@ -416,7 +416,7 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{ } } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } @@ -425,68 +425,68 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{ */ public void testRpcValues(){ // Valid Tests - assertEquals(Test.MATCH, VehicleDataHelper.SPEED, ( (GetVehicleDataResponse) msg ).getSpeed()); - assertEquals(Test.MATCH, (Integer) VehicleDataHelper.RPM, ( (GetVehicleDataResponse) msg ).getRpm()); - assertEquals(Test.MATCH, VehicleDataHelper.EXTERNAL_TEMPERATURE, ( (GetVehicleDataResponse) msg ).getExternalTemperature()); - assertEquals(Test.MATCH, VehicleDataHelper.FUEL_LEVEL, ( (GetVehicleDataResponse) msg ).getFuelLevel()); - assertEquals(Test.MATCH, VehicleDataHelper.PRNDL_FINAL, ( (GetVehicleDataResponse) msg ).getPrndl()); - assertEquals(Test.MATCH, VehicleDataHelper.TIRE_PRESSURE, ( (GetVehicleDataResponse) msg ).getTirePressure()); - assertEquals(Test.MATCH, VehicleDataHelper.ENGINE_TORQUE, ( (GetVehicleDataResponse) msg ).getEngineTorque()); - assertEquals(Test.MATCH, VehicleDataHelper.ENGINE_OIL_LIFE, ( (GetVehicleDataResponse) msg ).getEngineOilLife()); - assertEquals(Test.MATCH, (Integer) VehicleDataHelper.ODOMETER, ( (GetVehicleDataResponse) msg ).getOdometer()); - assertEquals(Test.MATCH, VehicleDataHelper.GPS, ( (GetVehicleDataResponse) msg ).getGps()); - assertEquals(Test.MATCH, VehicleDataHelper.FUEL_LEVEL_STATE, ( (GetVehicleDataResponse) msg ).getFuelLevelState()); - assertEquals(Test.MATCH, VehicleDataHelper.INSTANT_FUEL_CONSUMPTION, ( (GetVehicleDataResponse) msg ).getInstantFuelConsumption()); - assertEquals(Test.MATCH, VehicleDataHelper.BELT_STATUS, ( (GetVehicleDataResponse) msg ).getBeltStatus()); - assertEquals(Test.MATCH, VehicleDataHelper.BODY_INFORMATION, ( (GetVehicleDataResponse) msg ).getBodyInformation()); - assertEquals(Test.MATCH, VehicleDataHelper.DEVICE_STATUS, ( (GetVehicleDataResponse) msg ).getDeviceStatus()); - assertEquals(Test.MATCH, VehicleDataHelper.DRIVER_BRAKING, ( (GetVehicleDataResponse) msg ).getDriverBraking()); - assertEquals(Test.MATCH, VehicleDataHelper.WIPER_STATUS, ( (GetVehicleDataResponse) msg ).getWiperStatus()); - assertEquals(Test.MATCH, VehicleDataHelper.HEAD_LAMP_STATUS, ( (GetVehicleDataResponse) msg ).getHeadLampStatus()); - assertEquals(Test.MATCH, VehicleDataHelper.ACC_PEDAL_POSITION, ( (GetVehicleDataResponse) msg ).getAccPedalPosition()); - assertEquals(Test.MATCH, VehicleDataHelper.STEERING_WHEEL_ANGLE, ( (GetVehicleDataResponse) msg ).getSteeringWheelAngle()); - assertEquals(Test.MATCH, VehicleDataHelper.E_CALL_INFO, ( (GetVehicleDataResponse) msg ).getECallInfo()); - assertEquals(Test.MATCH, VehicleDataHelper.AIRBAG_STATUS, ( (GetVehicleDataResponse) msg ).getAirbagStatus()); - assertEquals(Test.MATCH, VehicleDataHelper.EMERGENCY_EVENT, ( (GetVehicleDataResponse) msg ).getEmergencyEvent()); - assertEquals(Test.MATCH, VehicleDataHelper.CLUSTER_MODE_STATUS, ( (GetVehicleDataResponse) msg ).getClusterModeStatus()); - assertEquals(Test.MATCH, VehicleDataHelper.MY_KEY, ( (GetVehicleDataResponse) msg ).getMyKey()); - assertEquals(Test.MATCH, VehicleDataHelper.TURN_SIGNAL, ( (GetVehicleDataResponse) msg ).getTurnSignal()); - assertEquals(Test.MATCH, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS, ( (GetVehicleDataResponse) msg ).getElectronicParkBrakeStatus()); - assertEquals(Test.MATCH, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE, ( (GetVehicleDataResponse) msg ).getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); + assertEquals(TestValues.MATCH, VehicleDataHelper.SPEED, ( (GetVehicleDataResponse) msg ).getSpeed()); + assertEquals(TestValues.MATCH, (Integer) VehicleDataHelper.RPM, ( (GetVehicleDataResponse) msg ).getRpm()); + assertEquals(TestValues.MATCH, VehicleDataHelper.EXTERNAL_TEMPERATURE, ( (GetVehicleDataResponse) msg ).getExternalTemperature()); + assertEquals(TestValues.MATCH, VehicleDataHelper.FUEL_LEVEL, ( (GetVehicleDataResponse) msg ).getFuelLevel()); + assertEquals(TestValues.MATCH, VehicleDataHelper.PRNDL_FINAL, ( (GetVehicleDataResponse) msg ).getPrndl()); + assertEquals(TestValues.MATCH, VehicleDataHelper.TIRE_PRESSURE, ( (GetVehicleDataResponse) msg ).getTirePressure()); + assertEquals(TestValues.MATCH, VehicleDataHelper.ENGINE_TORQUE, ( (GetVehicleDataResponse) msg ).getEngineTorque()); + assertEquals(TestValues.MATCH, VehicleDataHelper.ENGINE_OIL_LIFE, ( (GetVehicleDataResponse) msg ).getEngineOilLife()); + assertEquals(TestValues.MATCH, (Integer) VehicleDataHelper.ODOMETER, ( (GetVehicleDataResponse) msg ).getOdometer()); + assertEquals(TestValues.MATCH, VehicleDataHelper.GPS, ( (GetVehicleDataResponse) msg ).getGps()); + assertEquals(TestValues.MATCH, VehicleDataHelper.FUEL_LEVEL_STATE, ( (GetVehicleDataResponse) msg ).getFuelLevelState()); + assertEquals(TestValues.MATCH, VehicleDataHelper.INSTANT_FUEL_CONSUMPTION, ( (GetVehicleDataResponse) msg ).getInstantFuelConsumption()); + assertEquals(TestValues.MATCH, VehicleDataHelper.BELT_STATUS, ( (GetVehicleDataResponse) msg ).getBeltStatus()); + assertEquals(TestValues.MATCH, VehicleDataHelper.BODY_INFORMATION, ( (GetVehicleDataResponse) msg ).getBodyInformation()); + assertEquals(TestValues.MATCH, VehicleDataHelper.DEVICE_STATUS, ( (GetVehicleDataResponse) msg ).getDeviceStatus()); + assertEquals(TestValues.MATCH, VehicleDataHelper.DRIVER_BRAKING, ( (GetVehicleDataResponse) msg ).getDriverBraking()); + assertEquals(TestValues.MATCH, VehicleDataHelper.WIPER_STATUS, ( (GetVehicleDataResponse) msg ).getWiperStatus()); + assertEquals(TestValues.MATCH, VehicleDataHelper.HEAD_LAMP_STATUS, ( (GetVehicleDataResponse) msg ).getHeadLampStatus()); + assertEquals(TestValues.MATCH, VehicleDataHelper.ACC_PEDAL_POSITION, ( (GetVehicleDataResponse) msg ).getAccPedalPosition()); + assertEquals(TestValues.MATCH, VehicleDataHelper.STEERING_WHEEL_ANGLE, ( (GetVehicleDataResponse) msg ).getSteeringWheelAngle()); + assertEquals(TestValues.MATCH, VehicleDataHelper.E_CALL_INFO, ( (GetVehicleDataResponse) msg ).getECallInfo()); + assertEquals(TestValues.MATCH, VehicleDataHelper.AIRBAG_STATUS, ( (GetVehicleDataResponse) msg ).getAirbagStatus()); + assertEquals(TestValues.MATCH, VehicleDataHelper.EMERGENCY_EVENT, ( (GetVehicleDataResponse) msg ).getEmergencyEvent()); + assertEquals(TestValues.MATCH, VehicleDataHelper.CLUSTER_MODE_STATUS, ( (GetVehicleDataResponse) msg ).getClusterModeStatus()); + assertEquals(TestValues.MATCH, VehicleDataHelper.MY_KEY, ( (GetVehicleDataResponse) msg ).getMyKey()); + assertEquals(TestValues.MATCH, VehicleDataHelper.TURN_SIGNAL, ( (GetVehicleDataResponse) msg ).getTurnSignal()); + assertEquals(TestValues.MATCH, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS, ( (GetVehicleDataResponse) msg ).getElectronicParkBrakeStatus()); + assertEquals(TestValues.MATCH, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE, ( (GetVehicleDataResponse) msg ).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); // Invalid/Null Tests GetVehicleDataResponse msg = new GetVehicleDataResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getAccPedalPosition()); - assertNull(Test.NULL, msg.getAirbagStatus()); - assertNull(Test.NULL, msg.getBeltStatus()); - assertNull(Test.NULL, msg.getDriverBraking()); - assertNull(Test.NULL, msg.getFuelLevel()); - assertNull(Test.NULL, msg.getTirePressure()); - assertNull(Test.NULL, msg.getWiperStatus()); - assertNull(Test.NULL, msg.getGps()); - assertNull(Test.NULL, msg.getSpeed()); - assertNull(Test.NULL, msg.getRpm()); - assertNull(Test.NULL, msg.getFuelLevelState()); - assertNull(Test.NULL, msg.getInstantFuelConsumption()); - assertNull(Test.NULL, msg.getExternalTemperature()); - assertNull(Test.NULL, msg.getPrndl()); - assertNull(Test.NULL, msg.getOdometer()); - assertNull(Test.NULL, msg.getBodyInformation()); - assertNull(Test.NULL, msg.getDeviceStatus()); - assertNull(Test.NULL, msg.getHeadLampStatus()); - assertNull(Test.NULL, msg.getEngineTorque()); - assertNull(Test.NULL, msg.getEngineOilLife()); - assertNull(Test.NULL, msg.getSteeringWheelAngle()); - assertNull(Test.NULL, msg.getECallInfo()); - assertNull(Test.NULL, msg.getEmergencyEvent()); - assertNull(Test.NULL, msg.getClusterModeStatus()); - assertNull(Test.NULL, msg.getMyKey()); - assertNull(Test.NULL, msg.getTurnSignal()); - assertNull(Test.NULL, msg.getElectronicParkBrakeStatus()); - assertNull(Test.NULL, msg.getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); + assertNull(TestValues.NULL, msg.getAccPedalPosition()); + assertNull(TestValues.NULL, msg.getAirbagStatus()); + assertNull(TestValues.NULL, msg.getBeltStatus()); + assertNull(TestValues.NULL, msg.getDriverBraking()); + assertNull(TestValues.NULL, msg.getFuelLevel()); + assertNull(TestValues.NULL, msg.getTirePressure()); + assertNull(TestValues.NULL, msg.getWiperStatus()); + assertNull(TestValues.NULL, msg.getGps()); + assertNull(TestValues.NULL, msg.getSpeed()); + assertNull(TestValues.NULL, msg.getRpm()); + assertNull(TestValues.NULL, msg.getFuelLevelState()); + assertNull(TestValues.NULL, msg.getInstantFuelConsumption()); + assertNull(TestValues.NULL, msg.getExternalTemperature()); + assertNull(TestValues.NULL, msg.getPrndl()); + assertNull(TestValues.NULL, msg.getOdometer()); + assertNull(TestValues.NULL, msg.getBodyInformation()); + assertNull(TestValues.NULL, msg.getDeviceStatus()); + assertNull(TestValues.NULL, msg.getHeadLampStatus()); + assertNull(TestValues.NULL, msg.getEngineTorque()); + assertNull(TestValues.NULL, msg.getEngineOilLife()); + assertNull(TestValues.NULL, msg.getSteeringWheelAngle()); + assertNull(TestValues.NULL, msg.getECallInfo()); + assertNull(TestValues.NULL, msg.getEmergencyEvent()); + assertNull(TestValues.NULL, msg.getClusterModeStatus()); + assertNull(TestValues.NULL, msg.getMyKey()); + assertNull(TestValues.NULL, msg.getTurnSignal()); + assertNull(TestValues.NULL, msg.getElectronicParkBrakeStatus()); + assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } @@ -495,87 +495,87 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); GetVehicleDataResponse cmd = new GetVehicleDataResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_SPEED), cmd.getSpeed()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetVehicleDataResponse.KEY_RPM), cmd.getRpm()); - assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE), cmd.getExternalTemperature()); - assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_FUEL_LEVEL), cmd.getFuelLevel()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_VIN), cmd.getVin()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_PRNDL), cmd.getPrndl().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_SPEED), cmd.getSpeed()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetVehicleDataResponse.KEY_RPM), cmd.getRpm()); + assertEquals(TestValues.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE), cmd.getExternalTemperature()); + assertEquals(TestValues.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_FUEL_LEVEL), cmd.getFuelLevel()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_VIN), cmd.getVin()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_PRNDL), cmd.getPrndl().toString()); JSONObject tireStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_TIRE_PRESSURE); TireStatus tireStatus = new TireStatus(JsonRPCMarshaller.deserializeJSONObject(tireStatusObj)); - assertTrue(Test.TRUE, Validator.validateTireStatus(tireStatus, cmd.getTirePressure()) ); + assertTrue(TestValues.TRUE, Validator.validateTireStatus(tireStatus, cmd.getTirePressure()) ); - assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_ENGINE_TORQUE), cmd.getEngineTorque()); - assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_ENGINE_OIL_LIFE), cmd.getEngineOilLife(), 0.0002); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetVehicleDataResponse.KEY_ODOMETER), cmd.getOdometer()); + assertEquals(TestValues.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_ENGINE_TORQUE), cmd.getEngineTorque()); + assertEquals(TestValues.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_ENGINE_OIL_LIFE), cmd.getEngineOilLife(), 0.0002); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, GetVehicleDataResponse.KEY_ODOMETER), cmd.getOdometer()); JSONObject gpsDataObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_GPS); GPSData gpsData = new GPSData(JsonRPCMarshaller.deserializeJSONObject(gpsDataObj)); - assertTrue(Test.TRUE, Validator.validateGpsData(gpsData, cmd.getGps()) ); + assertTrue(TestValues.TRUE, Validator.validateGpsData(gpsData, cmd.getGps()) ); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_FUEL_LEVEL_STATE), cmd.getFuelLevelState().toString()); - assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION), cmd.getInstantFuelConsumption()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_FUEL_LEVEL_STATE), cmd.getFuelLevelState().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION), cmd.getInstantFuelConsumption()); JSONObject beltStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_BELT_STATUS); BeltStatus beltStatus = new BeltStatus(JsonRPCMarshaller.deserializeJSONObject(beltStatusObj)); - assertTrue(Test.TRUE, Validator.validateBeltStatus(beltStatus, cmd.getBeltStatus()) ); + assertTrue(TestValues.TRUE, Validator.validateBeltStatus(beltStatus, cmd.getBeltStatus()) ); JSONObject bodyInformationObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_BODY_INFORMATION); BodyInformation bodyInformation = new BodyInformation(JsonRPCMarshaller.deserializeJSONObject(bodyInformationObj)); - assertTrue(Test.TRUE, Validator.validateBodyInformation(bodyInformation, cmd.getBodyInformation()) ); + assertTrue(TestValues.TRUE, Validator.validateBodyInformation(bodyInformation, cmd.getBodyInformation()) ); JSONObject deviceStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_DEVICE_STATUS); DeviceStatus deviceStatus = new DeviceStatus(JsonRPCMarshaller.deserializeJSONObject(deviceStatusObj)); - assertTrue(Test.TRUE, Validator.validateDeviceStatus(deviceStatus, cmd.getDeviceStatus()) ); + assertTrue(TestValues.TRUE, Validator.validateDeviceStatus(deviceStatus, cmd.getDeviceStatus()) ); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_DRIVER_BRAKING), cmd.getDriverBraking().toString()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_WIPER_STATUS), cmd.getWiperStatus().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_DRIVER_BRAKING), cmd.getDriverBraking().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_WIPER_STATUS), cmd.getWiperStatus().toString()); JSONObject headLampStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_HEAD_LAMP_STATUS); HeadLampStatus headLampStatus = new HeadLampStatus(JsonRPCMarshaller.deserializeJSONObject(headLampStatusObj)); - assertTrue(Test.TRUE, Validator.validateHeadLampStatus(headLampStatus, cmd.getHeadLampStatus()) ); + assertTrue(TestValues.TRUE, Validator.validateHeadLampStatus(headLampStatus, cmd.getHeadLampStatus()) ); - assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_ACC_PEDAL_POSITION), cmd.getAccPedalPosition()); - assertEquals(Test.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE), cmd.getSteeringWheelAngle()); + assertEquals(TestValues.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_ACC_PEDAL_POSITION), cmd.getAccPedalPosition()); + assertEquals(TestValues.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, GetVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE), cmd.getSteeringWheelAngle()); JSONObject eCallInfoObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_E_CALL_INFO); ECallInfo eCallInfo = new ECallInfo(JsonRPCMarshaller.deserializeJSONObject(eCallInfoObj)); - assertTrue(Test.TRUE, Validator.validateECallInfo(eCallInfo, cmd.getECallInfo()) ); + assertTrue(TestValues.TRUE, Validator.validateECallInfo(eCallInfo, cmd.getECallInfo()) ); JSONObject airbagStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_AIRBAG_STATUS); AirbagStatus airbagStatus = new AirbagStatus(JsonRPCMarshaller.deserializeJSONObject(airbagStatusObj)); - assertTrue(Test.TRUE, Validator.validateAirbagStatus(airbagStatus, cmd.getAirbagStatus()) ); + assertTrue(TestValues.TRUE, Validator.validateAirbagStatus(airbagStatus, cmd.getAirbagStatus()) ); JSONObject emergencyEventObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_EMERGENCY_EVENT); EmergencyEvent emergencyEvent = new EmergencyEvent(JsonRPCMarshaller.deserializeJSONObject(emergencyEventObj)); - assertTrue(Test.TRUE, Validator.validateEmergencyEvent(emergencyEvent, cmd.getEmergencyEvent()) ); + assertTrue(TestValues.TRUE, Validator.validateEmergencyEvent(emergencyEvent, cmd.getEmergencyEvent()) ); JSONObject clusterModeStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_CLUSTER_MODE_STATUS); ClusterModeStatus clusterModeStatus = new ClusterModeStatus(JsonRPCMarshaller.deserializeJSONObject(clusterModeStatusObj)); - assertTrue(Test.TRUE, Validator.validateClusterModeStatus(clusterModeStatus, cmd.getClusterModeStatus()) ); + assertTrue(TestValues.TRUE, Validator.validateClusterModeStatus(clusterModeStatus, cmd.getClusterModeStatus()) ); JSONObject myKeyObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_MY_KEY); MyKey myKey = new MyKey(JsonRPCMarshaller.deserializeJSONObject(myKeyObj)); - assertTrue(Test.TRUE, Validator.validateMyKey(myKey, cmd.getMyKey()) ); + assertTrue(TestValues.TRUE, Validator.validateMyKey(myKey, cmd.getMyKey()) ); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_TURN_SIGNAL), cmd.getTurnSignal().toString()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus().toString()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_TURN_SIGNAL), cmd.getTurnSignal().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetWayPointsResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetWayPointsResponseTests.java index 57d8499df..0ff0e1260 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetWayPointsResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetWayPointsResponseTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.GetWayPointsResponse; import com.smartdevicelink.proxy.rpc.LocationDetails; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONArray; @@ -28,8 +28,8 @@ public class GetWayPointsResponseTests extends BaseRpcTests { @Override protected RPCMessage createMessage() { - waypoints.add(Test.GENERAL_LOCATIONDETAILS); - waypoints.add(Test.GENERAL_LOCATIONDETAILS); + waypoints.add(TestValues.GENERAL_LOCATIONDETAILS); + waypoints.add(TestValues.GENERAL_LOCATIONDETAILS); GetWayPointsResponse getWayPointsResponse = new GetWayPointsResponse(); getWayPointsResponse.setWayPoints(waypoints); @@ -53,8 +53,8 @@ public class GetWayPointsResponseTests extends BaseRpcTests { JSONArray jsonArray = new JSONArray(); try { - jsonArray.put(JsonRPCMarshaller.serializeHashtable(Test.GENERAL_LOCATIONDETAILS.getStore())); - jsonArray.put(JsonRPCMarshaller.serializeHashtable(Test.GENERAL_LOCATIONDETAILS.getStore())); + jsonArray.put(JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_LOCATIONDETAILS.getStore())); + jsonArray.put(JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_LOCATIONDETAILS.getStore())); } catch (JSONException e) { e.printStackTrace(); } @@ -77,14 +77,14 @@ public class GetWayPointsResponseTests extends BaseRpcTests { List<LocationDetails> testWPs = ( (GetWayPointsResponse) msg ).getWayPoints(); // Valid Tests - assertEquals(Test.MATCH, waypoints, testWPs); + assertEquals(TestValues.MATCH, waypoints, testWPs); // Invalid/Null Tests GetWayPointsResponse msg = new GetWayPointsResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getWayPoints()); + assertNull(TestValues.NULL, msg.getWayPoints()); } /** @@ -92,18 +92,18 @@ public class GetWayPointsResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); GetWayPointsResponse cmd = new GetWayPointsResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); @@ -114,7 +114,7 @@ public class GetWayPointsResponseTests extends BaseRpcTests { locationList.add(det); } List<LocationDetails> dets = cmd.getWayPoints(); - assertEquals(Test.MATCH, locationList.size(), dets.size()); + assertEquals(TestValues.MATCH, locationList.size(), dets.size()); } catch (JSONException e) { e.printStackTrace(); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ListFilesResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ListFilesResponseTests.java index 466961bcc..890aa2753 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ListFilesResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ListFilesResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.ListFilesResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -26,8 +26,8 @@ public class ListFilesResponseTests extends BaseRpcTests{ protected RPCMessage createMessage(){ ListFilesResponse msg = new ListFilesResponse(); - msg.setFilenames(Test.GENERAL_STRING_LIST); - msg.setSpaceAvailable(Test.GENERAL_INT); + msg.setFilenames(TestValues.GENERAL_STRING_LIST); + msg.setSpaceAvailable(TestValues.GENERAL_INT); return msg; } @@ -47,10 +47,10 @@ public class ListFilesResponseTests extends BaseRpcTests{ JSONObject result = new JSONObject(); try{ - result.put(ListFilesResponse.KEY_FILENAMES, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST)); - result.put(ListFilesResponse.KEY_SPACE_AVAILABLE, Test.GENERAL_INT); + result.put(ListFilesResponse.KEY_FILENAMES, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); + result.put(ListFilesResponse.KEY_SPACE_AVAILABLE, TestValues.GENERAL_INT); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -65,17 +65,17 @@ public class ListFilesResponseTests extends BaseRpcTests{ int spaceAvailable = ( (ListFilesResponse) msg ).getSpaceAvailable(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING_LIST.size(), filenames.size()); - assertTrue(Test.TRUE, Validator.validateStringList(Test.GENERAL_STRING_LIST, filenames)); - assertEquals(Test.MATCH, Test.GENERAL_INT, spaceAvailable); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING_LIST.size(), filenames.size()); + assertTrue(TestValues.TRUE, Validator.validateStringList(TestValues.GENERAL_STRING_LIST, filenames)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, spaceAvailable); // Invalid/Null Tests ListFilesResponse msg = new ListFilesResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getFilenames()); - assertNull(Test.NULL, msg.getSpaceAvailable()); + assertNull(TestValues.NULL, msg.getFilenames()); + assertNull(TestValues.NULL, msg.getSpaceAvailable()); } /** @@ -83,26 +83,26 @@ public class ListFilesResponseTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ListFilesResponse cmd = new ListFilesResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); List<String> fileNamesList = JsonUtils.readStringListFromJsonObject(parameters, ListFilesResponse.KEY_FILENAMES); List<String> testNamesList = cmd.getFilenames(); - assertEquals(Test.MATCH, fileNamesList.size(), testNamesList.size()); - assertTrue(Test.TRUE, Validator.validateStringList(fileNamesList, testNamesList)); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, ListFilesResponse.KEY_SPACE_AVAILABLE), cmd.getSpaceAvailable()); + assertEquals(TestValues.MATCH, fileNamesList.size(), testNamesList.size()); + assertTrue(TestValues.TRUE, Validator.validateStringList(fileNamesList, testNamesList)); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, ListFilesResponse.KEY_SPACE_AVAILABLE), cmd.getSpaceAvailable()); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAppServiceInteractionResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAppServiceInteractionResponseTests.java index a6ba3c96c..7665f214b 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAppServiceInteractionResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAppServiceInteractionResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.PerformAppServiceInteractionResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -25,7 +25,7 @@ public class PerformAppServiceInteractionResponseTests extends BaseRpcTests { PerformAppServiceInteractionResponse msg = new PerformAppServiceInteractionResponse(); - msg.setServiceSpecificResult(Test.GENERAL_STRING); + msg.setServiceSpecificResult(TestValues.GENERAL_STRING); return msg; } @@ -45,9 +45,9 @@ public class PerformAppServiceInteractionResponseTests extends BaseRpcTests { JSONObject result = new JSONObject(); try{ - result.put(PerformAppServiceInteractionResponse.KEY_SERVICE_SPECIFIC_RESULT, Test.GENERAL_STRING); + result.put(PerformAppServiceInteractionResponse.KEY_SERVICE_SPECIFIC_RESULT, TestValues.GENERAL_STRING); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -61,14 +61,14 @@ public class PerformAppServiceInteractionResponseTests extends BaseRpcTests { String serviceSpecificResult = ( (PerformAppServiceInteractionResponse) msg ).getServiceSpecificResult(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_STRING, serviceSpecificResult); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, serviceSpecificResult); // Invalid/Null Tests PerformAppServiceInteractionResponse msg = new PerformAppServiceInteractionResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getServiceSpecificResult()); + assertNull(TestValues.NULL, msg.getServiceSpecificResult()); } /** @@ -76,22 +76,22 @@ public class PerformAppServiceInteractionResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); PerformAppServiceInteractionResponse cmd = new PerformAppServiceInteractionResponse (hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAppServiceInteractionResponse.KEY_SERVICE_SPECIFIC_RESULT), cmd.getServiceSpecificResult()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformAppServiceInteractionResponse.KEY_SERVICE_SPECIFIC_RESULT), cmd.getServiceSpecificResult()); } catch (JSONException e) { e.printStackTrace(); } 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 19e62bd28..ae7436d63 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 @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.PerformAudioPassThruResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class PerformAudioPassThruResponseTest extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests PerformAudioPassThruResponse msg = new PerformAudioPassThruResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class PerformAudioPassThruResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + 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(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformInteractionResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformInteractionResponseTest.java index 8e9145b27..94acc21c5 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformInteractionResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformInteractionResponseTest.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.PerformInteractionResponse; import com.smartdevicelink.proxy.rpc.enums.TriggerSource; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -25,9 +25,9 @@ public class PerformInteractionResponseTest extends BaseRpcTests { protected RPCMessage createMessage() { PerformInteractionResponse msg = new PerformInteractionResponse(); - msg.setChoiceID(Test.GENERAL_INT); - msg.setTriggerSource(Test.GENERAL_TRIGGERSOURCE); - msg.setManualTextEntry(Test.GENERAL_STRING); + msg.setChoiceID(TestValues.GENERAL_INT); + msg.setTriggerSource(TestValues.GENERAL_TRIGGERSOURCE); + msg.setManualTextEntry(TestValues.GENERAL_STRING); return msg; } @@ -47,11 +47,11 @@ public class PerformInteractionResponseTest extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(PerformInteractionResponse.KEY_CHOICE_ID, Test.GENERAL_INT); - result.put(PerformInteractionResponse.KEY_TRIGGER_SOURCE, Test.GENERAL_TRIGGERSOURCE); - result.put(PerformInteractionResponse.KEY_MANUAL_TEXT_ENTRY, Test.GENERAL_STRING); + result.put(PerformInteractionResponse.KEY_CHOICE_ID, TestValues.GENERAL_INT); + result.put(PerformInteractionResponse.KEY_TRIGGER_SOURCE, TestValues.GENERAL_TRIGGERSOURCE); + result.put(PerformInteractionResponse.KEY_MANUAL_TEXT_ENTRY, TestValues.GENERAL_STRING); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -67,18 +67,18 @@ public class PerformInteractionResponseTest extends BaseRpcTests { String testText = ( (PerformInteractionResponse) msg).getManualTextEntry(); // Valid Tests - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testId); - assertEquals(Test.MATCH, Test.GENERAL_TRIGGERSOURCE, testSource); - assertEquals(Test.MATCH, Test.GENERAL_STRING, testText); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, testId); + assertEquals(TestValues.MATCH, TestValues.GENERAL_TRIGGERSOURCE, testSource); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testText); // Invalid/Null Tests PerformInteractionResponse msg = new PerformInteractionResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getChoiceID()); - assertNull(Test.NULL, msg.getTriggerSource()); - assertNull(Test.NULL, msg.getManualTextEntry()); + assertNull(TestValues.NULL, msg.getChoiceID()); + assertNull(TestValues.NULL, msg.getTriggerSource()); + assertNull(TestValues.NULL, msg.getManualTextEntry()); } /** @@ -86,23 +86,23 @@ public class PerformInteractionResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); PerformInteractionResponse cmd = new PerformInteractionResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteractionResponse.KEY_MANUAL_TEXT_ENTRY), cmd.getManualTextEntry()); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteractionResponse.KEY_TRIGGER_SOURCE), cmd.getTriggerSource().toString()); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, PerformInteractionResponse.KEY_CHOICE_ID), cmd.getChoiceID()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteractionResponse.KEY_MANUAL_TEXT_ENTRY), cmd.getManualTextEntry()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, PerformInteractionResponse.KEY_TRIGGER_SOURCE), cmd.getTriggerSource().toString()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, PerformInteractionResponse.KEY_CHOICE_ID), cmd.getChoiceID()); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PublishAppServiceResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PublishAppServiceResponseTests.java index 97ded7f67..ed84ac722 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PublishAppServiceResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PublishAppServiceResponseTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.AppServiceRecord; import com.smartdevicelink.proxy.rpc.PublishAppServiceResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -27,7 +27,7 @@ public class PublishAppServiceResponseTests extends BaseRpcTests { PublishAppServiceResponse msg = new PublishAppServiceResponse(); - msg.setServiceRecord(Test.GENERAL_APPSERVICERECORD); + msg.setServiceRecord(TestValues.GENERAL_APPSERVICERECORD); return msg; } @@ -47,9 +47,9 @@ public class PublishAppServiceResponseTests extends BaseRpcTests { JSONObject result = new JSONObject(); try{ - result.put(PublishAppServiceResponse.KEY_APP_SERVICE_RECORD, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_APPSERVICERECORD.getStore())); + result.put(PublishAppServiceResponse.KEY_APP_SERVICE_RECORD, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_APPSERVICERECORD.getStore())); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -63,14 +63,14 @@ public class PublishAppServiceResponseTests extends BaseRpcTests { AppServiceRecord testRecord = ( (PublishAppServiceResponse) msg ).getServiceRecord(); // Valid Tests - assertTrue(Test.TRUE, Validator.validateAppServiceRecord(Test.GENERAL_APPSERVICERECORD, testRecord)); + assertTrue(TestValues.TRUE, Validator.validateAppServiceRecord(TestValues.GENERAL_APPSERVICERECORD, testRecord)); // Invalid/Null Tests PublishAppServiceResponse msg = new PublishAppServiceResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getServiceRecord()); + assertNull(TestValues.NULL, msg.getServiceRecord()); } /** @@ -78,24 +78,24 @@ public class PublishAppServiceResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); PublishAppServiceResponse cmd = new PublishAppServiceResponse (hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); JSONObject appServiceRecordObject = JsonUtils.readJsonObjectFromJsonObject(parameters, PublishAppServiceResponse.KEY_APP_SERVICE_RECORD); AppServiceRecord recordTest = new AppServiceRecord(JsonRPCMarshaller.deserializeJSONObject(appServiceRecordObject)); - assertTrue(Test.TRUE, Validator.validateAppServiceRecord(recordTest, cmd.getServiceRecord())); + assertTrue(TestValues.TRUE, Validator.validateAppServiceRecord(recordTest, cmd.getServiceRecord())); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PutFileResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PutFileResponseTest.java index a3fc1a2fd..b8e36b578 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PutFileResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PutFileResponseTest.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.PutFileResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -24,7 +24,7 @@ public class PutFileResponseTest extends BaseRpcTests { protected RPCMessage createMessage() { PutFileResponse msg = new PutFileResponse(); - msg.setSpaceAvailable(Test.GENERAL_INT); + msg.setSpaceAvailable(TestValues.GENERAL_INT); return msg; } @@ -44,9 +44,9 @@ public class PutFileResponseTest extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(PutFileResponse.KEY_SPACE_AVAILABLE, Test.GENERAL_INT); + result.put(PutFileResponse.KEY_SPACE_AVAILABLE, TestValues.GENERAL_INT); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -60,14 +60,14 @@ public class PutFileResponseTest extends BaseRpcTests { Integer testSpace = ( (PutFileResponse) msg ).getSpaceAvailable(); // Valid Tests - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, testSpace); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, testSpace); // Invalid/Null Tests PutFileResponse msg = new PutFileResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getSpaceAvailable()); + assertNull(TestValues.NULL, msg.getSpaceAvailable()); } /** @@ -75,21 +75,21 @@ public class PutFileResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); PutFileResponse cmd = new PutFileResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, PutFileResponse.KEY_SPACE_AVAILABLE), cmd.getSpaceAvailable()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, PutFileResponse.KEY_SPACE_AVAILABLE), cmd.getSpaceAvailable()); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReadDIDResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReadDIDResponseTest.java index 2e383b8da..f11b21140 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReadDIDResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReadDIDResponseTest.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.DIDResult; import com.smartdevicelink.proxy.rpc.ReadDIDResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -29,7 +29,7 @@ public class ReadDIDResponseTest extends BaseRpcTests { protected RPCMessage createMessage() { ReadDIDResponse msg = new ReadDIDResponse(); - msg.setDidResult(Test.GENERAL_DIDRESULT_LIST); + msg.setDidResult(TestValues.GENERAL_DIDRESULT_LIST); return msg; } @@ -49,9 +49,9 @@ public class ReadDIDResponseTest extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(ReadDIDResponse.KEY_DID_RESULT, Test.JSON_DIDRESULTS); + result.put(ReadDIDResponse.KEY_DID_RESULT, TestValues.JSON_DIDRESULTS); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -65,14 +65,14 @@ public class ReadDIDResponseTest extends BaseRpcTests { List<DIDResult> testResults = ( (ReadDIDResponse) msg ).getDidResult(); // Valid Tests - assertTrue("Did results didn't match input data.", Validator.validateDIDResults(Test.GENERAL_DIDRESULT_LIST, testResults)); + assertTrue("Did results didn't match input data.", Validator.validateDIDResults(TestValues.GENERAL_DIDRESULT_LIST, testResults)); // Invalid/Null Tests ReadDIDResponse msg = new ReadDIDResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getDidResult()); + assertNull(TestValues.NULL, msg.getDidResult()); } /** @@ -80,18 +80,18 @@ public class ReadDIDResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ReadDIDResponse cmd = new ReadDIDResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); @@ -101,7 +101,7 @@ public class ReadDIDResponseTest extends BaseRpcTests { DIDResult chunk = new DIDResult(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)didResultArray.get(index)) ); didResultList.add(chunk); } - assertTrue(Test.MATCH, Validator.validateDIDResults(didResultList, cmd.getDidResult())); + assertTrue(TestValues.MATCH, Validator.validateDIDResults(didResultList, cmd.getDidResult())); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/RegisterAppInterfaceResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/RegisterAppInterfaceResponseTest.java index 73528e577..f2edaa592 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/RegisterAppInterfaceResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/RegisterAppInterfaceResponseTest.java @@ -18,7 +18,7 @@ import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities; import com.smartdevicelink.proxy.rpc.enums.VrCapabilities; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -40,22 +40,22 @@ public class RegisterAppInterfaceResponseTest extends BaseRpcTests { protected RPCMessage createMessage() { RegisterAppInterfaceResponse msg = new RegisterAppInterfaceResponse(); - msg.setSdlMsgVersion(Test.GENERAL_SDLMSGVERSION); - msg.setLanguage(Test.GENERAL_LANGUAGE); - msg.setHmiDisplayLanguage(Test.GENERAL_LANGUAGE); - msg.setDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES); - msg.setPresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES); - msg.setVehicleType(Test.GENERAL_VEHICLETYPE); - msg.setButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST); - msg.setSoftButtonCapabilities(Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST); - msg.setAudioPassThruCapabilities(Test.GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST); - msg.setPcmStreamingCapabilities(Test.GENERAL_AUDIOPASSTHRUCAPABILITIES); - msg.setHmiZoneCapabilities(Test.GENERAL_HMIZONECAPABILITIES_LIST); - msg.setSpeechCapabilities(Test.GENERAL_SPEECHCAPABILITIES_LIST); - msg.setVrCapabilities(Test.GENERAL_VRCAPABILITIES_LIST); - msg.setPrerecordedSpeech(Test.GENERAL_PRERECORDEDSPEECH_LIST); - msg.setSupportedDiagModes(Test.GENERAL_INTEGER_LIST); - msg.setIconResumed(Test.GENERAL_BOOLEAN); + msg.setSdlMsgVersion(TestValues.GENERAL_SDLMSGVERSION); + msg.setLanguage(TestValues.GENERAL_LANGUAGE); + msg.setHmiDisplayLanguage(TestValues.GENERAL_LANGUAGE); + msg.setDisplayCapabilities(TestValues.GENERAL_DISPLAYCAPABILITIES); + msg.setPresetBankCapabilities(TestValues.GENERAL_PRESETBANKCAPABILITIES); + msg.setVehicleType(TestValues.GENERAL_VEHICLETYPE); + msg.setButtonCapabilities(TestValues.GENERAL_BUTTONCAPABILITIES_LIST); + msg.setSoftButtonCapabilities(TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST); + msg.setAudioPassThruCapabilities(TestValues.GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST); + msg.setPcmStreamingCapabilities(TestValues.GENERAL_AUDIOPASSTHRUCAPABILITIES); + msg.setHmiZoneCapabilities(TestValues.GENERAL_HMIZONECAPABILITIES_LIST); + msg.setSpeechCapabilities(TestValues.GENERAL_SPEECHCAPABILITIES_LIST); + msg.setVrCapabilities(TestValues.GENERAL_VRCAPABILITIES_LIST); + msg.setPrerecordedSpeech(TestValues.GENERAL_PRERECORDEDSPEECH_LIST); + msg.setSupportedDiagModes(TestValues.GENERAL_INTEGER_LIST); + msg.setIconResumed(TestValues.GENERAL_BOOLEAN); return msg; } @@ -76,24 +76,24 @@ public class RegisterAppInterfaceResponseTest extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(RegisterAppInterfaceResponse.KEY_LANGUAGE, Test.GENERAL_LANGUAGE); - result.put(RegisterAppInterfaceResponse.KEY_HMI_DISPLAY_LANGUAGE, Test.GENERAL_LANGUAGE); - result.put(RegisterAppInterfaceResponse.KEY_SUPPORTED_DIAG_MODES, JsonUtils.createJsonArray(Test.GENERAL_INTEGER_LIST)); - result.put(RegisterAppInterfaceResponse.KEY_SDL_MSG_VERSION, Test.JSON_SDLMSGVERSION); - result.put(RegisterAppInterfaceResponse.KEY_VEHICLE_TYPE, Test.GENERAL_VEHICLETYPE.serializeJSON()); - result.put(RegisterAppInterfaceResponse.KEY_PRESET_BANK_CAPABILITIES, Test.JSON_PRESETBANKCAPABILITIES); - result.put(RegisterAppInterfaceResponse.KEY_DISPLAY_CAPABILITIES, Test.JSON_DISPLAYCAPABILITIES); - result.put(RegisterAppInterfaceResponse.KEY_BUTTON_CAPABILITIES, Test.JSON_BUTTONCAPABILITIES); - result.put(RegisterAppInterfaceResponse.KEY_SOFT_BUTTON_CAPABILITIES, Test.JSON_SOFTBUTTONCAPABILITIES); - result.put(RegisterAppInterfaceResponse.KEY_AUDIO_PASS_THRU_CAPABILITIES, Test.JSON_AUDIOPASSTHRUCAPABILITIES); - result.put(RegisterAppInterfaceResponse.KEY_PCM_STREAM_CAPABILITIES, Test.JSON_PCMSTREAMCAPABILITIES); - result.put(RegisterAppInterfaceResponse.KEY_SPEECH_CAPABILITIES, JsonUtils.createJsonArray(Test.GENERAL_SPEECHCAPABILITIES_LIST)); - result.put(RegisterAppInterfaceResponse.KEY_VR_CAPABILITIES, JsonUtils.createJsonArray(Test.GENERAL_VRCAPABILITIES_LIST)); - result.put(RegisterAppInterfaceResponse.KEY_HMI_ZONE_CAPABILITIES, JsonUtils.createJsonArray(Test.GENERAL_HMIZONECAPABILITIES_LIST)); - result.put(RegisterAppInterfaceResponse.KEY_PRERECORDED_SPEECH, JsonUtils.createJsonArray(Test.GENERAL_PRERECORDEDSPEECH_LIST)); - result.put(RegisterAppInterfaceResponse.KEY_ICON_RESUMED, Test.GENERAL_BOOLEAN); + result.put(RegisterAppInterfaceResponse.KEY_LANGUAGE, TestValues.GENERAL_LANGUAGE); + result.put(RegisterAppInterfaceResponse.KEY_HMI_DISPLAY_LANGUAGE, TestValues.GENERAL_LANGUAGE); + result.put(RegisterAppInterfaceResponse.KEY_SUPPORTED_DIAG_MODES, JsonUtils.createJsonArray(TestValues.GENERAL_INTEGER_LIST)); + result.put(RegisterAppInterfaceResponse.KEY_SDL_MSG_VERSION, TestValues.JSON_SDLMSGVERSION); + result.put(RegisterAppInterfaceResponse.KEY_VEHICLE_TYPE, TestValues.GENERAL_VEHICLETYPE.serializeJSON()); + result.put(RegisterAppInterfaceResponse.KEY_PRESET_BANK_CAPABILITIES, TestValues.JSON_PRESETBANKCAPABILITIES); + result.put(RegisterAppInterfaceResponse.KEY_DISPLAY_CAPABILITIES, TestValues.JSON_DISPLAYCAPABILITIES); + result.put(RegisterAppInterfaceResponse.KEY_BUTTON_CAPABILITIES, TestValues.JSON_BUTTONCAPABILITIES); + result.put(RegisterAppInterfaceResponse.KEY_SOFT_BUTTON_CAPABILITIES, TestValues.JSON_SOFTBUTTONCAPABILITIES); + result.put(RegisterAppInterfaceResponse.KEY_AUDIO_PASS_THRU_CAPABILITIES, TestValues.JSON_AUDIOPASSTHRUCAPABILITIES); + result.put(RegisterAppInterfaceResponse.KEY_PCM_STREAM_CAPABILITIES, TestValues.JSON_PCMSTREAMCAPABILITIES); + result.put(RegisterAppInterfaceResponse.KEY_SPEECH_CAPABILITIES, JsonUtils.createJsonArray(TestValues.GENERAL_SPEECHCAPABILITIES_LIST)); + result.put(RegisterAppInterfaceResponse.KEY_VR_CAPABILITIES, JsonUtils.createJsonArray(TestValues.GENERAL_VRCAPABILITIES_LIST)); + result.put(RegisterAppInterfaceResponse.KEY_HMI_ZONE_CAPABILITIES, JsonUtils.createJsonArray(TestValues.GENERAL_HMIZONECAPABILITIES_LIST)); + result.put(RegisterAppInterfaceResponse.KEY_PRERECORDED_SPEECH, JsonUtils.createJsonArray(TestValues.GENERAL_PRERECORDEDSPEECH_LIST)); + result.put(RegisterAppInterfaceResponse.KEY_ICON_RESUMED, TestValues.GENERAL_BOOLEAN); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -122,44 +122,44 @@ public class RegisterAppInterfaceResponseTest extends BaseRpcTests { Boolean testIconResumed = ( (RegisterAppInterfaceResponse) msg ).getIconResumed(); // Valid Tests - assertEquals(Test.MATCH, Test.GENERAL_INTEGER_LIST, testSupportedDiagModes); - assertEquals(Test.MATCH, Test.GENERAL_PRERECORDEDSPEECH_LIST, testPrerecordedSpeech); - assertEquals(Test.MATCH, Test.GENERAL_VRCAPABILITIES_LIST, testVrCapabilities); - assertEquals(Test.MATCH, Test.GENERAL_SPEECHCAPABILITIES_LIST, testSpeechCapabilities); - assertEquals(Test.MATCH, Test.GENERAL_HMIZONECAPABILITIES_LIST, testHmiZoneCapabilities); - assertTrue(Test.TRUE, Validator.validateSoftButtonCapabilities(Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST, testSoftButtonCapabilities)); - assertTrue(Test.TRUE, Validator.validateButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST, testButtonCapabilities)); - assertTrue(Test.TRUE, Validator.validateVehicleType(Test.GENERAL_VEHICLETYPE, testVehicleType)); - assertTrue(Test.TRUE, Validator.validatePresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES, testPbc)); - assertTrue(Test.TRUE, Validator.validateDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES, testDc)); - assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, testHmiLang); - assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, testLang); - assertTrue(Test.TRUE, Validator.validateSdlMsgVersion(Test.GENERAL_SDLMSGVERSION, testMsgVersion)); - assertTrue(Test.TRUE, Validator.validateAudioPassThruCapabilities(Test.GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST, testAptc)); - assertTrue(Test.TRUE, Validator.validatePcmStreamCapabilities(Test.GENERAL_AUDIOPASSTHRUCAPABILITIES, testPcmStream)); - assertEquals(Test.MATCH, (Boolean) Test.GENERAL_BOOLEAN, testIconResumed); + assertEquals(TestValues.MATCH, TestValues.GENERAL_INTEGER_LIST, testSupportedDiagModes); + assertEquals(TestValues.MATCH, TestValues.GENERAL_PRERECORDEDSPEECH_LIST, testPrerecordedSpeech); + assertEquals(TestValues.MATCH, TestValues.GENERAL_VRCAPABILITIES_LIST, testVrCapabilities); + assertEquals(TestValues.MATCH, TestValues.GENERAL_SPEECHCAPABILITIES_LIST, testSpeechCapabilities); + assertEquals(TestValues.MATCH, TestValues.GENERAL_HMIZONECAPABILITIES_LIST, testHmiZoneCapabilities); + assertTrue(TestValues.TRUE, Validator.validateSoftButtonCapabilities(TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST, testSoftButtonCapabilities)); + assertTrue(TestValues.TRUE, Validator.validateButtonCapabilities(TestValues.GENERAL_BUTTONCAPABILITIES_LIST, testButtonCapabilities)); + assertTrue(TestValues.TRUE, Validator.validateVehicleType(TestValues.GENERAL_VEHICLETYPE, testVehicleType)); + assertTrue(TestValues.TRUE, Validator.validatePresetBankCapabilities(TestValues.GENERAL_PRESETBANKCAPABILITIES, testPbc)); + assertTrue(TestValues.TRUE, Validator.validateDisplayCapabilities(TestValues.GENERAL_DISPLAYCAPABILITIES, testDc)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LANGUAGE, testHmiLang); + assertEquals(TestValues.MATCH, TestValues.GENERAL_LANGUAGE, testLang); + assertTrue(TestValues.TRUE, Validator.validateSdlMsgVersion(TestValues.GENERAL_SDLMSGVERSION, testMsgVersion)); + assertTrue(TestValues.TRUE, Validator.validateAudioPassThruCapabilities(TestValues.GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST, testAptc)); + assertTrue(TestValues.TRUE, Validator.validatePcmStreamCapabilities(TestValues.GENERAL_AUDIOPASSTHRUCAPABILITIES, testPcmStream)); + assertEquals(TestValues.MATCH, (Boolean) TestValues.GENERAL_BOOLEAN, testIconResumed); // Invalid/Null Tests RegisterAppInterfaceResponse msg = new RegisterAppInterfaceResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getSdlMsgVersion()); - assertNull(Test.NULL, msg.getLanguage()); - assertNull(Test.NULL, msg.getHmiDisplayLanguage()); - assertNull(Test.NULL, msg.getDisplayCapabilities()); - assertNull(Test.NULL, msg.getPresetBankCapabilities()); - assertNull(Test.NULL, msg.getVehicleType()); - assertNull(Test.NULL, msg.getButtonCapabilities()); - assertNull(Test.NULL, msg.getSoftButtonCapabilities()); - assertNull(Test.NULL, msg.getAudioPassThruCapabilities()); - assertNull(Test.NULL, msg.getPcmStreamingCapabilities()); - assertNull(Test.NULL, msg.getHmiZoneCapabilities()); - assertNull(Test.NULL, msg.getSpeechCapabilities()); - assertNull(Test.NULL, msg.getVrCapabilities()); - assertNull(Test.NULL, msg.getPrerecordedSpeech()); - assertNull(Test.NULL, msg.getSupportedDiagModes()); - assertNull(Test.NULL, msg.getIconResumed()); + assertNull(TestValues.NULL, msg.getSdlMsgVersion()); + assertNull(TestValues.NULL, msg.getLanguage()); + assertNull(TestValues.NULL, msg.getHmiDisplayLanguage()); + assertNull(TestValues.NULL, msg.getDisplayCapabilities()); + assertNull(TestValues.NULL, msg.getPresetBankCapabilities()); + assertNull(TestValues.NULL, msg.getVehicleType()); + assertNull(TestValues.NULL, msg.getButtonCapabilities()); + assertNull(TestValues.NULL, msg.getSoftButtonCapabilities()); + assertNull(TestValues.NULL, msg.getAudioPassThruCapabilities()); + assertNull(TestValues.NULL, msg.getPcmStreamingCapabilities()); + assertNull(TestValues.NULL, msg.getHmiZoneCapabilities()); + assertNull(TestValues.NULL, msg.getSpeechCapabilities()); + assertNull(TestValues.NULL, msg.getVrCapabilities()); + assertNull(TestValues.NULL, msg.getPrerecordedSpeech()); + assertNull(TestValues.NULL, msg.getSupportedDiagModes()); + assertNull(TestValues.NULL, msg.getIconResumed()); } /** @@ -167,39 +167,39 @@ public class RegisterAppInterfaceResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); RegisterAppInterfaceResponse cmd = new RegisterAppInterfaceResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); JSONObject vehicleTypeObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_VEHICLE_TYPE); VehicleType vehicleType = new VehicleType(JsonRPCMarshaller.deserializeJSONObject(vehicleTypeObj)); - assertTrue(Test.TRUE, Validator.validateVehicleType(vehicleType, cmd.getVehicleType())); + assertTrue(TestValues.TRUE, Validator.validateVehicleType(vehicleType, cmd.getVehicleType())); JSONObject pcmStreamObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_PCM_STREAM_CAPABILITIES); AudioPassThruCapabilities pcmStreamCap = new AudioPassThruCapabilities(JsonRPCMarshaller.deserializeJSONObject(pcmStreamObj)); - assertTrue(Test.TRUE, Validator.validatePcmStreamCapabilities(pcmStreamCap, cmd.getPcmStreamingCapabilities())); + assertTrue(TestValues.TRUE, Validator.validatePcmStreamCapabilities(pcmStreamCap, cmd.getPcmStreamingCapabilities())); JSONArray speechCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_SPEECH_CAPABILITIES); for (int index = 0; index < speechCapabilitiesArray.length(); index++) { SpeechCapabilities speechCapability = SpeechCapabilities.valueForString( speechCapabilitiesArray.get(index).toString() ); - assertEquals(Test.MATCH, speechCapability, cmd.getSpeechCapabilities().get(index)); + assertEquals(TestValues.MATCH, speechCapability, cmd.getSpeechCapabilities().get(index)); } JSONArray vrCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_VR_CAPABILITIES); for (int index = 0; index < vrCapabilitiesArray.length(); index++) { VrCapabilities vrCapability = VrCapabilities.valueForString( vrCapabilitiesArray.get(index).toString() ); - assertEquals(Test.MATCH, vrCapability, cmd.getVrCapabilities().get(index)); + assertEquals(TestValues.MATCH, vrCapability, cmd.getVrCapabilities().get(index)); } JSONArray audioPassThruCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_AUDIO_PASS_THRU_CAPABILITIES); @@ -209,29 +209,29 @@ public class RegisterAppInterfaceResponseTest extends BaseRpcTests { new AudioPassThruCapabilities(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)audioPassThruCapabilitiesArray.get(index) )); audioPassThruCapabilitiesList.add(audioPassThruCapability); } - assertTrue(Test.TRUE, Validator.validateAudioPassThruCapabilities(audioPassThruCapabilitiesList, cmd.getAudioPassThruCapabilities() )); + assertTrue(TestValues.TRUE, Validator.validateAudioPassThruCapabilities(audioPassThruCapabilitiesList, cmd.getAudioPassThruCapabilities() )); JSONArray hmiZoneCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_HMI_ZONE_CAPABILITIES); for (int index = 0; index < hmiZoneCapabilitiesArray.length(); index++) { HmiZoneCapabilities hmiZoneCapability = HmiZoneCapabilities.valueForString( hmiZoneCapabilitiesArray.get(index).toString() ); - assertEquals(Test.MATCH, hmiZoneCapability, cmd.getHmiZoneCapabilities().get(index)); + assertEquals(TestValues.MATCH, hmiZoneCapability, cmd.getHmiZoneCapabilities().get(index)); } JSONArray prerecordedSpeechArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_PRERECORDED_SPEECH); for (int index = 0; index < prerecordedSpeechArray.length(); index++) { PrerecordedSpeech prerecordedSpeech = PrerecordedSpeech.valueForString( prerecordedSpeechArray.get(index).toString() ); - assertEquals(Test.MATCH, prerecordedSpeech, cmd.getPrerecordedSpeech().get(index)); + assertEquals(TestValues.MATCH, prerecordedSpeech, cmd.getPrerecordedSpeech().get(index)); } List<Integer> supportedDiagnosticModesList = JsonUtils.readIntegerListFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_SUPPORTED_DIAG_MODES); List<Integer> testDiagnosticModesList = cmd.getSupportedDiagModes(); - assertEquals(Test.MATCH, supportedDiagnosticModesList.size(), testDiagnosticModesList.size()); - assertTrue(Test.TRUE, Validator.validateIntegerList(supportedDiagnosticModesList, testDiagnosticModesList)); + assertEquals(TestValues.MATCH, supportedDiagnosticModesList.size(), testDiagnosticModesList.size()); + assertTrue(TestValues.TRUE, Validator.validateIntegerList(supportedDiagnosticModesList, testDiagnosticModesList)); JSONObject sdlMsgVersionObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_SDL_MSG_VERSION); SdlMsgVersion sdlMsgVersion = new SdlMsgVersion(JsonRPCMarshaller.deserializeJSONObject(sdlMsgVersionObj)); - assertTrue(Test.TRUE, Validator.validateSdlMsgVersion(sdlMsgVersion, cmd.getSdlMsgVersion()) ); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_LANGUAGE), cmd.getLanguage().toString()); + assertTrue(TestValues.TRUE, Validator.validateSdlMsgVersion(sdlMsgVersion, cmd.getSdlMsgVersion()) ); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_LANGUAGE), cmd.getLanguage().toString()); JSONArray buttonCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_BUTTON_CAPABILITIES); List<ButtonCapabilities> buttonCapabilitiesList = new ArrayList<ButtonCapabilities>(); @@ -239,12 +239,12 @@ public class RegisterAppInterfaceResponseTest extends BaseRpcTests { ButtonCapabilities buttonCapability = new ButtonCapabilities(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)buttonCapabilitiesArray.get(index) )); buttonCapabilitiesList.add(buttonCapability); } - assertTrue(Test.TRUE, Validator.validateButtonCapabilities(buttonCapabilitiesList, cmd.getButtonCapabilities() )); + assertTrue(TestValues.TRUE, Validator.validateButtonCapabilities(buttonCapabilitiesList, cmd.getButtonCapabilities() )); JSONObject displayCapabilitiesObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_DISPLAY_CAPABILITIES); DisplayCapabilities displayCapabilities = new DisplayCapabilities(JsonRPCMarshaller.deserializeJSONObject(displayCapabilitiesObj)); - assertTrue(Test.TRUE, Validator.validateDisplayCapabilities(displayCapabilities, cmd.getDisplayCapabilities()) ); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_HMI_DISPLAY_LANGUAGE), cmd.getHmiDisplayLanguage().toString()); + assertTrue(TestValues.TRUE, Validator.validateDisplayCapabilities(displayCapabilities, cmd.getDisplayCapabilities()) ); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_HMI_DISPLAY_LANGUAGE), cmd.getHmiDisplayLanguage().toString()); JSONArray softButtonCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_SOFT_BUTTON_CAPABILITIES); List<SoftButtonCapabilities> softButtonCapabilitiesList = new ArrayList<SoftButtonCapabilities>(); @@ -253,14 +253,14 @@ public class RegisterAppInterfaceResponseTest extends BaseRpcTests { new SoftButtonCapabilities(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonCapabilitiesArray.get(index) )); softButtonCapabilitiesList.add(softButtonCapability); } - assertTrue(Test.TRUE, Validator.validateSoftButtonCapabilities(softButtonCapabilitiesList, cmd.getSoftButtonCapabilities() )); + assertTrue(TestValues.TRUE, Validator.validateSoftButtonCapabilities(softButtonCapabilitiesList, cmd.getSoftButtonCapabilities() )); JSONObject presetBankCapabilitiesObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_PRESET_BANK_CAPABILITIES); PresetBankCapabilities presetBankCapabilities = new PresetBankCapabilities(JsonRPCMarshaller.deserializeJSONObject(presetBankCapabilitiesObj)); - assertTrue(Test.TRUE, Validator.validatePresetBankCapabilities(presetBankCapabilities, cmd.getPresetBankCapabilities()) ); + assertTrue(TestValues.TRUE, Validator.validatePresetBankCapabilities(presetBankCapabilities, cmd.getPresetBankCapabilities()) ); Boolean iconResumed = JsonUtils.readBooleanFromJsonObject(parameters, RegisterAppInterfaceResponse.KEY_ICON_RESUMED); - assertEquals(Test.MATCH, iconResumed, cmd.getIconResumed()); + assertEquals(TestValues.MATCH, iconResumed, cmd.getIconResumed()); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReleaseInteriorVehicleDataModuleResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReleaseInteriorVehicleDataModuleResponseTests.java index f1d2b6e5a..60c567656 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReleaseInteriorVehicleDataModuleResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReleaseInteriorVehicleDataModuleResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.ReleaseInteriorVehicleDataModuleResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -38,19 +38,19 @@ public class ReleaseInteriorVehicleDataModuleResponseTests extends BaseRpcTests public void testJsonConstructor() { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ReleaseInteriorVehicleDataModuleResponse cmd = new ReleaseInteriorVehicleDataModuleResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.NOT_NULL, 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()); + 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) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ResetGlobalPropertiesResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ResetGlobalPropertiesResponseTest.java index fa3c870fb..710da67cb 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ResetGlobalPropertiesResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ResetGlobalPropertiesResponseTest.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.ResetGlobalPropertiesResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class ResetGlobalPropertiesResponseTest extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests ResetGlobalPropertiesResponse msg = new ResetGlobalPropertiesResponse(); - assertNotNull(Test.NULL, msg); + assertNotNull(TestValues.NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class ResetGlobalPropertiesResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ResetGlobalPropertiesResponse cmd = new ResetGlobalPropertiesResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ScrollableMessageResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ScrollableMessageResponseTest.java index 2795b6621..709c915a0 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ScrollableMessageResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ScrollableMessageResponseTest.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.ScrollableMessageResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class ScrollableMessageResponseTest extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests ScrollableMessageResponse msg = new ScrollableMessageResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class ScrollableMessageResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ScrollableMessageResponse cmd = new ScrollableMessageResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SendLocationResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SendLocationResponseTests.java index 43163608e..305e8bdb3 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SendLocationResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SendLocationResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.SendLocationResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -47,7 +47,7 @@ public class SendLocationResponseTests extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests SendLocationResponse msg = new SendLocationResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -56,17 +56,17 @@ public class SendLocationResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SendLocationResponse cmd = new SendLocationResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetAppIconResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetAppIconResponseTest.java index 8efb6f006..b2f0fd696 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetAppIconResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetAppIconResponseTest.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.SetAppIconResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class SetAppIconResponseTest extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests SetAppIconResponse msg = new SetAppIconResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class SetAppIconResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SetAppIconResponse cmd = new SetAppIconResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetCloudAppPropertiesResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetCloudAppPropertiesResponseTests.java index 894c7ee78..dec748b32 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetCloudAppPropertiesResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetCloudAppPropertiesResponseTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.SetCloudAppPropertiesResponse; import com.smartdevicelink.test.BaseRpcTests; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import org.json.JSONObject; @@ -35,7 +35,7 @@ public class SetCloudAppPropertiesResponseTests extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests SetCloudAppPropertiesResponse msg = new SetCloudAppPropertiesResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetDisplayLayoutResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetDisplayLayoutResponseTest.java index f6ea2e691..f62412da3 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetDisplayLayoutResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetDisplayLayoutResponseTest.java @@ -10,7 +10,7 @@ import com.smartdevicelink.proxy.rpc.SetDisplayLayoutResponse; import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -32,10 +32,10 @@ public class SetDisplayLayoutResponseTest extends BaseRpcTests { protected RPCMessage createMessage() { SetDisplayLayoutResponse msg = new SetDisplayLayoutResponse(); - msg.setDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES); - msg.setPresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES); - msg.setButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST); - msg.setSoftButtonCapabilities(Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST); + msg.setDisplayCapabilities(TestValues.GENERAL_DISPLAYCAPABILITIES); + msg.setPresetBankCapabilities(TestValues.GENERAL_PRESETBANKCAPABILITIES); + msg.setButtonCapabilities(TestValues.GENERAL_BUTTONCAPABILITIES_LIST); + msg.setSoftButtonCapabilities(TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST); return msg; } @@ -55,12 +55,12 @@ public class SetDisplayLayoutResponseTest extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(SetDisplayLayoutResponse.KEY_DISPLAY_CAPABILITIES, Test.GENERAL_DISPLAYCAPABILITIES.serializeJSON()); - result.put(SetDisplayLayoutResponse.KEY_PRESET_BANK_CAPABILITIES, Test.JSON_PRESETBANKCAPABILITIES); - result.put(SetDisplayLayoutResponse.KEY_BUTTON_CAPABILITIES, Test.JSON_BUTTONCAPABILITIES); - result.put(SetDisplayLayoutResponse.KEY_SOFT_BUTTON_CAPABILITIES, Test.JSON_SOFTBUTTONCAPABILITIES); + result.put(SetDisplayLayoutResponse.KEY_DISPLAY_CAPABILITIES, TestValues.GENERAL_DISPLAYCAPABILITIES.serializeJSON()); + result.put(SetDisplayLayoutResponse.KEY_PRESET_BANK_CAPABILITIES, TestValues.JSON_PRESETBANKCAPABILITIES); + result.put(SetDisplayLayoutResponse.KEY_BUTTON_CAPABILITIES, TestValues.JSON_BUTTONCAPABILITIES); + result.put(SetDisplayLayoutResponse.KEY_SOFT_BUTTON_CAPABILITIES, TestValues.JSON_SOFTBUTTONCAPABILITIES); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -77,26 +77,26 @@ public class SetDisplayLayoutResponseTest extends BaseRpcTests { List<SoftButtonCapabilities> testSbc = ( (SetDisplayLayoutResponse) msg ).getSoftButtonCapabilities(); // Valid Tests - assertTrue(Test.TRUE, Validator.validateDisplayCapabilities(Test.GENERAL_DISPLAYCAPABILITIES, testDisplay)); - assertTrue(Test.TRUE, Validator.validatePresetBankCapabilities(Test.GENERAL_PRESETBANKCAPABILITIES, testPbc)); - assertEquals(Test.MATCH, Test.GENERAL_BUTTONCAPABILITIES_LIST.size(), testBc.size()); - assertEquals(Test.MATCH, Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST.size(), testSbc.size()); - for (int i = 0; i < Test.GENERAL_BUTTONCAPABILITIES_LIST.size(); i++) { - assertEquals(Test.MATCH, Test.GENERAL_BUTTONCAPABILITIES_LIST.get(i), testBc.get(i)); + assertTrue(TestValues.TRUE, Validator.validateDisplayCapabilities(TestValues.GENERAL_DISPLAYCAPABILITIES, testDisplay)); + assertTrue(TestValues.TRUE, Validator.validatePresetBankCapabilities(TestValues.GENERAL_PRESETBANKCAPABILITIES, testPbc)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_BUTTONCAPABILITIES_LIST.size(), testBc.size()); + assertEquals(TestValues.MATCH, TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST.size(), testSbc.size()); + for (int i = 0; i < TestValues.GENERAL_BUTTONCAPABILITIES_LIST.size(); i++) { + assertEquals(TestValues.MATCH, TestValues.GENERAL_BUTTONCAPABILITIES_LIST.get(i), testBc.get(i)); } - for (int i = 0; i < Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST.size(); i++) { - assertEquals(Test.MATCH, Test.GENERAL_SOFTBUTTONCAPABILITIES_LIST.get(i), testSbc.get(i)); + for (int i = 0; i < TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST.size(); i++) { + assertEquals(TestValues.MATCH, TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST.get(i), testSbc.get(i)); } // Invalid/Null Tests SetDisplayLayoutResponse msg = new SetDisplayLayoutResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getDisplayCapabilities()); - assertNull(Test.NULL, msg.getPresetBankCapabilities()); - assertNull(Test.NULL, msg.getButtonCapabilities()); - assertNull(Test.NULL, msg.getSoftButtonCapabilities()); + assertNull(TestValues.NULL, msg.getDisplayCapabilities()); + assertNull(TestValues.NULL, msg.getPresetBankCapabilities()); + assertNull(TestValues.NULL, msg.getButtonCapabilities()); + assertNull(TestValues.NULL, msg.getSoftButtonCapabilities()); } /** @@ -104,18 +104,18 @@ public class SetDisplayLayoutResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SetDisplayLayoutResponse cmd = new SetDisplayLayoutResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); @@ -125,11 +125,11 @@ public class SetDisplayLayoutResponseTest extends BaseRpcTests { ButtonCapabilities buttonCapability = new ButtonCapabilities(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)buttonCapabilitiesArray.get(index) )); buttonCapabilitiesList.add(buttonCapability); } - assertTrue(Test.TRUE, Validator.validateButtonCapabilities(buttonCapabilitiesList, cmd.getButtonCapabilities() )); + assertTrue(TestValues.TRUE, Validator.validateButtonCapabilities(buttonCapabilitiesList, cmd.getButtonCapabilities() )); JSONObject displayCapabilitiesObj = JsonUtils.readJsonObjectFromJsonObject(parameters, SetDisplayLayoutResponse.KEY_DISPLAY_CAPABILITIES); DisplayCapabilities displayCapabilities = new DisplayCapabilities(JsonRPCMarshaller.deserializeJSONObject(displayCapabilitiesObj)); - assertTrue(Test.TRUE, Validator.validateDisplayCapabilities(displayCapabilities, cmd.getDisplayCapabilities()) ); + assertTrue(TestValues.TRUE, Validator.validateDisplayCapabilities(displayCapabilities, cmd.getDisplayCapabilities()) ); JSONArray softButtonCapabilitiesArray = JsonUtils.readJsonArrayFromJsonObject(parameters, SetDisplayLayoutResponse.KEY_SOFT_BUTTON_CAPABILITIES); List<SoftButtonCapabilities> softButtonCapabilitiesList = new ArrayList<SoftButtonCapabilities>(); @@ -138,11 +138,11 @@ public class SetDisplayLayoutResponseTest extends BaseRpcTests { new SoftButtonCapabilities(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)softButtonCapabilitiesArray.get(index) )); softButtonCapabilitiesList.add(softButtonCapability); } - assertTrue(Test.TRUE, Validator.validateSoftButtonCapabilities(softButtonCapabilitiesList, cmd.getSoftButtonCapabilities() )); + assertTrue(TestValues.TRUE, Validator.validateSoftButtonCapabilities(softButtonCapabilitiesList, cmd.getSoftButtonCapabilities() )); JSONObject presetBankCapabilitiesObj = JsonUtils.readJsonObjectFromJsonObject(parameters, SetDisplayLayoutResponse.KEY_PRESET_BANK_CAPABILITIES); PresetBankCapabilities presetBankCapabilities = new PresetBankCapabilities(JsonRPCMarshaller.deserializeJSONObject(presetBankCapabilitiesObj)); - assertTrue(Test.TRUE, Validator.validatePresetBankCapabilities(presetBankCapabilities, cmd.getPresetBankCapabilities()) ); + assertTrue(TestValues.TRUE, Validator.validatePresetBankCapabilities(presetBankCapabilities, cmd.getPresetBankCapabilities()) ); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetGlobalPropertiesResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetGlobalPropertiesResponseTest.java index 249294228..91e4e12d9 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetGlobalPropertiesResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetGlobalPropertiesResponseTest.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.SetGlobalPropertiesResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class SetGlobalPropertiesResponseTest extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests SetGlobalPropertiesResponse msg = new SetGlobalPropertiesResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class SetGlobalPropertiesResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SetGlobalPropertiesResponse cmd = new SetGlobalPropertiesResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetInteriorVehicleDataResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetInteriorVehicleDataResponseTests.java index c25685157..7e2e09926 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetInteriorVehicleDataResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetInteriorVehicleDataResponseTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.ModuleData; import com.smartdevicelink.proxy.rpc.SetInteriorVehicleDataResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -27,7 +27,7 @@ public class SetInteriorVehicleDataResponseTests extends BaseRpcTests { SetInteriorVehicleDataResponse msg = new SetInteriorVehicleDataResponse(); - msg.setModuleData(Test.GENERAL_MODULEDATA); + msg.setModuleData(TestValues.GENERAL_MODULEDATA); return msg; } @@ -47,9 +47,9 @@ public class SetInteriorVehicleDataResponseTests extends BaseRpcTests { JSONObject result = new JSONObject(); try{ - result.put(SetInteriorVehicleDataResponse.KEY_MODULE_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_MODULEDATA.getStore())); + result.put(SetInteriorVehicleDataResponse.KEY_MODULE_DATA, JsonRPCMarshaller.serializeHashtable(TestValues.GENERAL_MODULEDATA.getStore())); }catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -63,14 +63,14 @@ public class SetInteriorVehicleDataResponseTests extends BaseRpcTests { ModuleData testModuleData = ( (SetInteriorVehicleDataResponse) msg ).getModuleData(); // Valid Tests - assertTrue(Test.TRUE, Validator.validateModuleData(Test.GENERAL_MODULEDATA, testModuleData)); + assertTrue(TestValues.TRUE, Validator.validateModuleData(TestValues.GENERAL_MODULEDATA, testModuleData)); // Invalid/Null Tests SetInteriorVehicleDataResponse msg = new SetInteriorVehicleDataResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getModuleData()); + assertNull(TestValues.NULL, msg.getModuleData()); } /** @@ -78,25 +78,25 @@ public class SetInteriorVehicleDataResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SetInteriorVehicleDataResponse cmd = new SetInteriorVehicleDataResponse (hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); ModuleData testModuleData = new ModuleData(JsonRPCMarshaller.deserializeJSONObject((JSONObject) JsonUtils.readObjectFromJsonObject(parameters, SetInteriorVehicleDataResponse.KEY_MODULE_DATA))); ModuleData cmdModuleData = cmd.getModuleData(); - assertTrue(Test.TRUE, Validator.validateModuleData(testModuleData, cmdModuleData) ); + assertTrue(TestValues.TRUE, Validator.validateModuleData(testModuleData, cmdModuleData) ); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetMediaClockTimerResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetMediaClockTimerResponseTest.java index 9bcc7f841..726551e53 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetMediaClockTimerResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetMediaClockTimerResponseTest.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.SetMediaClockTimerResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class SetMediaClockTimerResponseTest extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests SetMediaClockTimerResponse msg = new SetMediaClockTimerResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class SetMediaClockTimerResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SetMediaClockTimerResponse cmd = new SetMediaClockTimerResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowAppMenuResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowAppMenuResponseTests.java index 397bf43cc..670e72d1c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowAppMenuResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowAppMenuResponseTests.java @@ -41,7 +41,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.ShowAppMenuResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -77,7 +77,7 @@ public class ShowAppMenuResponseTests extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests ShowAppMenuResponse msg = new ShowAppMenuResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -86,18 +86,18 @@ public class ShowAppMenuResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ShowAppMenuResponse cmd = new ShowAppMenuResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowConstantTbtResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowConstantTbtResponseTests.java index dd41d1ea2..82f0a6d4d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowConstantTbtResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowConstantTbtResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.ShowConstantTbtResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -47,7 +47,7 @@ public class ShowConstantTbtResponseTests extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests ShowConstantTbtResponse msg = new ShowConstantTbtResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -56,17 +56,17 @@ public class ShowConstantTbtResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ShowConstantTbtResponse cmd = new ShowConstantTbtResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowResponseTest.java index ba9b2dfb0..7f18cf7a4 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowResponseTest.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.ShowResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class ShowResponseTest extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests ShowResponse msg = new ShowResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class ShowResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); ShowResponse cmd = new ShowResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SliderResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SliderResponseTest.java index 2985b9207..72e55f4f9 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SliderResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SliderResponseTest.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.SliderResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -24,7 +24,7 @@ public class SliderResponseTest extends BaseRpcTests { protected RPCMessage createMessage() { SliderResponse msg = new SliderResponse(); - msg.setSliderPosition(Test.GENERAL_INT); + msg.setSliderPosition(TestValues.GENERAL_INT); return msg; } @@ -44,10 +44,10 @@ public class SliderResponseTest extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(SliderResponse.KEY_SLIDER_POSITION, Test.GENERAL_INT); + result.put(SliderResponse.KEY_SLIDER_POSITION, TestValues.GENERAL_INT); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -55,16 +55,16 @@ public class SliderResponseTest extends BaseRpcTests { public void testPosition() { Integer copy = ( (SliderResponse) msg ).getSliderPosition(); - assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, copy); + assertEquals(TestValues.MATCH, (Integer) TestValues.GENERAL_INT, copy); } public void testNull() { SliderResponse msg = new SliderResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); - assertNull(Test.NULL, msg.getSliderPosition()); + assertNull(TestValues.NULL, msg.getSliderPosition()); } /** @@ -72,21 +72,21 @@ public class SliderResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SliderResponse cmd = new SliderResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, SliderResponse.KEY_SLIDER_POSITION), cmd.getSliderPosition()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, SliderResponse.KEY_SLIDER_POSITION), cmd.getSliderPosition()); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SpeakResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SpeakResponseTest.java index 6606b3df5..d96f20564 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SpeakResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SpeakResponseTest.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.SpeakResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class SpeakResponseTest extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests SpeakResponse msg = new SpeakResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class SpeakResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SpeakResponse cmd = new SpeakResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/StreamRPCResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/StreamRPCResponseTests.java index 47801ea90..3f3f3d25f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/StreamRPCResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/StreamRPCResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.StreamRPCResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -22,8 +22,8 @@ public class StreamRPCResponseTests extends BaseRpcTests { @Override protected RPCMessage createMessage(){ StreamRPCResponse response = new StreamRPCResponse(); - response.setFileSize((Long) Test.GENERAL_LONG); - response.setFileName(Test.GENERAL_STRING); + response.setFileSize((Long) TestValues.GENERAL_LONG); + response.setFileName(TestValues.GENERAL_STRING); return response; } @@ -42,8 +42,8 @@ public class StreamRPCResponseTests extends BaseRpcTests { JSONObject result = new JSONObject(); try { - result.put(StreamRPCResponse.KEY_FILESIZE, (Long) Test.GENERAL_LONG); - result.put(StreamRPCResponse.KEY_FILENAME, Test.GENERAL_STRING); + result.put(StreamRPCResponse.KEY_FILESIZE, (Long) TestValues.GENERAL_LONG); + result.put(StreamRPCResponse.KEY_FILENAME, TestValues.GENERAL_STRING); } catch (JSONException e) { e.printStackTrace(); } @@ -57,7 +57,7 @@ public class StreamRPCResponseTests extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests StreamRPCResponse msg = new StreamRPCResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -66,22 +66,22 @@ public class StreamRPCResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); StreamRPCResponse cmd = new StreamRPCResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, StreamRPCResponse.KEY_FILENAME), cmd.getFileName()); - assertEquals(Test.MATCH, JsonUtils.readLongFromJsonObject(parameters, StreamRPCResponse.KEY_FILESIZE), cmd.getFileSize()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, StreamRPCResponse.KEY_FILENAME), cmd.getFileName()); + assertEquals(TestValues.MATCH, JsonUtils.readLongFromJsonObject(parameters, StreamRPCResponse.KEY_FILESIZE), cmd.getFileSize()); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeButtonResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeButtonResponseTest.java index b835354e3..4f64be431 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeButtonResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeButtonResponseTest.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.SubscribeButtonResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class SubscribeButtonResponseTest extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests SubscribeButtonResponse msg = new SubscribeButtonResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,17 +55,17 @@ public class SubscribeButtonResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SubscribeButtonResponse cmd = new SubscribeButtonResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.NOT_NULL, body); // Test everything in the json body. - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); assertEquals("Correlation ID doesn't match input ID", JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); } catch (JSONException e) { e.printStackTrace(); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java index 88eb20221..bb7c1f90c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java @@ -8,7 +8,7 @@ import com.smartdevicelink.proxy.rpc.VehicleDataResult; import com.smartdevicelink.proxy.rpc.enums.VehicleDataType; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -29,35 +29,35 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests { protected RPCMessage createMessage() { SubscribeVehicleDataResponse msg = new SubscribeVehicleDataResponse(); - msg.setSpeed(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SPEED.ordinal())); - msg.setRpm(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_RPM.ordinal())); - msg.setExternalTemperature(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EXTERNTEMP.ordinal())); - msg.setFuelLevel(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL.ordinal())); - msg.setPrndl(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_PRNDL.ordinal())); - msg.setTirePressure(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TIREPRESSURE.ordinal())); - msg.setEngineTorque(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINETORQUE.ordinal())); - msg.setEngineOilLife(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE.ordinal())); - msg.setOdometer(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ODOMETER.ordinal())); - msg.setGps(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GPS.ordinal())); - msg.setFuelLevelState(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE.ordinal())); - msg.setInstantFuelConsumption(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION.ordinal())); - msg.setBeltStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BELTSTATUS.ordinal())); - msg.setBodyInformation(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BODYINFO.ordinal())); - msg.setDeviceStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_DEVICESTATUS.ordinal())); - msg.setDriverBraking(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BRAKING.ordinal())); - msg.setWiperStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WIPERSTATUS.ordinal())); - msg.setHeadLampStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS.ordinal())); - msg.setAccPedalPosition(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ACCPEDAL.ordinal())); - msg.setSteeringWheelAngle(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STEERINGWHEEL.ordinal())); - msg.setECallInfo(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ECALLINFO.ordinal())); - msg.setAirbagStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS.ordinal())); - msg.setEmergencyEvent(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT.ordinal())); - msg.setClusterModeStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS.ordinal())); - msg.setMyKey(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_MYKEY.ordinal())); - msg.setFuelRange(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELRANGE.ordinal())); - msg.setTurnSignal(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal())); - msg.setElectronicParkBrakeStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal())); - msg.setOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA); + msg.setSpeed(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SPEED.ordinal())); + msg.setRpm(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_RPM.ordinal())); + msg.setExternalTemperature(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EXTERNTEMP.ordinal())); + msg.setFuelLevel(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL.ordinal())); + msg.setPrndl(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_PRNDL.ordinal())); + msg.setTirePressure(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TIREPRESSURE.ordinal())); + msg.setEngineTorque(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINETORQUE.ordinal())); + msg.setEngineOilLife(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE.ordinal())); + msg.setOdometer(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ODOMETER.ordinal())); + msg.setGps(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GPS.ordinal())); + msg.setFuelLevelState(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE.ordinal())); + msg.setInstantFuelConsumption(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION.ordinal())); + msg.setBeltStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BELTSTATUS.ordinal())); + msg.setBodyInformation(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BODYINFO.ordinal())); + msg.setDeviceStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_DEVICESTATUS.ordinal())); + msg.setDriverBraking(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BRAKING.ordinal())); + msg.setWiperStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WIPERSTATUS.ordinal())); + msg.setHeadLampStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS.ordinal())); + msg.setAccPedalPosition(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ACCPEDAL.ordinal())); + msg.setSteeringWheelAngle(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STEERINGWHEEL.ordinal())); + msg.setECallInfo(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ECALLINFO.ordinal())); + msg.setAirbagStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS.ordinal())); + msg.setEmergencyEvent(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT.ordinal())); + msg.setClusterModeStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS.ordinal())); + msg.setMyKey(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_MYKEY.ordinal())); + msg.setFuelRange(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELRANGE.ordinal())); + msg.setTurnSignal(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal())); + msg.setElectronicParkBrakeStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal())); + msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA); return msg; } @@ -82,37 +82,37 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests { // were to be in a list then this could be easily looped through // instead of individually set. - result.put(SubscribeVehicleDataResponse.KEY_SPEED, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SPEED.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_RPM, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_RPM.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EXTERNTEMP.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_FUEL_LEVEL, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_PRNDL, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_PRNDL.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_TIRE_PRESSURE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TIREPRESSURE.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_ENGINE_TORQUE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINETORQUE.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_ENGINE_OIL_LIFE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_ODOMETER, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ODOMETER.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_GPS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GPS.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_FUEL_LEVEL_STATE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_BELT_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BELTSTATUS.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_BODY_INFORMATION, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BODYINFO.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_DEVICE_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_DEVICESTATUS.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_DRIVER_BRAKING, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BRAKING.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_WIPER_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WIPERSTATUS.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_HEAD_LAMP_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_ACC_PEDAL_POSITION, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ACCPEDAL.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STEERINGWHEEL.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_E_CALL_INFO, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ECALLINFO.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_AIRBAG_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_EMERGENCY_EVENT, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_CLUSTER_MODE_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_MY_KEY, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_MYKEY.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_FUEL_RANGE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELRANGE.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_TURN_SIGNAL, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()).serializeJSON()); - result.put(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA.serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_SPEED, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SPEED.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_RPM, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_RPM.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EXTERNTEMP.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_FUEL_LEVEL, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_PRNDL, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_PRNDL.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_TIRE_PRESSURE, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TIREPRESSURE.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_ENGINE_TORQUE, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINETORQUE.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_ENGINE_OIL_LIFE, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_ODOMETER, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ODOMETER.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_GPS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GPS.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_FUEL_LEVEL_STATE, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_BELT_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BELTSTATUS.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_BODY_INFORMATION, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BODYINFO.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_DEVICE_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_DEVICESTATUS.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_DRIVER_BRAKING, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BRAKING.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_WIPER_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WIPERSTATUS.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_HEAD_LAMP_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_ACC_PEDAL_POSITION, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ACCPEDAL.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STEERINGWHEEL.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_E_CALL_INFO, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ECALLINFO.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_AIRBAG_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_EMERGENCY_EVENT, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_CLUSTER_MODE_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_MY_KEY, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_MYKEY.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_FUEL_RANGE, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELRANGE.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_TURN_SIGNAL, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()).serializeJSON()); + result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA.serializeJSON()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -151,73 +151,73 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests { VehicleDataResult testFuelRange = ( (SubscribeVehicleDataResponse) msg ).getFuelRange(); VehicleDataResult testTurnSignal = ( (SubscribeVehicleDataResponse) msg ).getTurnSignal(); VehicleDataResult testEBrakeStatus = ( (SubscribeVehicleDataResponse) msg ).getElectronicParkBrakeStatus(); - VehicleDataResult testOEMCustomVehicleData = ( (SubscribeVehicleDataResponse) msg ).getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); + VehicleDataResult testOEMCustomVehicleData = ( (SubscribeVehicleDataResponse) msg ).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); // Valid Tests - assertTrue(Test.TRUE, testGps.getDataType().equals(VehicleDataType.VEHICLEDATA_GPS)); - assertTrue(Test.TRUE, testOdometer.getDataType().equals(VehicleDataType.VEHICLEDATA_ODOMETER)); - assertTrue(Test.TRUE, testTirePressure.getDataType().equals(VehicleDataType.VEHICLEDATA_TIREPRESSURE)); - assertTrue(Test.TRUE, testBeltStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_BELTSTATUS)); - assertTrue(Test.TRUE, testBodyInfo.getDataType().equals(VehicleDataType.VEHICLEDATA_BODYINFO)); - assertTrue(Test.TRUE, testDeviceStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_DEVICESTATUS)); - assertTrue(Test.TRUE, testHeadLampStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS)); - assertTrue(Test.TRUE, testECallInfo.getDataType().equals(VehicleDataType.VEHICLEDATA_ECALLINFO)); - assertTrue(Test.TRUE, testAirbagStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS)); - assertTrue(Test.TRUE, testEmergencyEvent.getDataType().equals(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT)); - assertTrue(Test.TRUE, testClusterMode.getDataType().equals(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS)); - assertTrue(Test.TRUE, testMyKey.getDataType().equals(VehicleDataType.VEHICLEDATA_MYKEY)); - assertTrue(Test.TRUE, testSpeed.getDataType().equals(VehicleDataType.VEHICLEDATA_SPEED)); - assertTrue(Test.TRUE, testRpm.getDataType().equals(VehicleDataType.VEHICLEDATA_RPM)); - assertTrue(Test.TRUE, testFuelLevel.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELLEVEL)); - assertTrue(Test.TRUE, testConsumption.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION)); - assertTrue(Test.TRUE, testExternalTemp.getDataType().equals(VehicleDataType.VEHICLEDATA_EXTERNTEMP)); - assertTrue(Test.TRUE, testEngineTorque.getDataType().equals(VehicleDataType.VEHICLEDATA_ENGINETORQUE)); - assertTrue(Test.TRUE, testEngineOilLife.getDataType().equals(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE)); - assertTrue(Test.TRUE, testAccPedal.getDataType().equals(VehicleDataType.VEHICLEDATA_ACCPEDAL)); - assertTrue(Test.TRUE, testSteeringWheel.getDataType().equals(VehicleDataType.VEHICLEDATA_STEERINGWHEEL)); - assertTrue(Test.TRUE, testFuelLevelState.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE)); - assertTrue(Test.TRUE, testPrndl.getDataType().equals(VehicleDataType.VEHICLEDATA_PRNDL)); - assertTrue(Test.TRUE, testBraking.getDataType().equals(VehicleDataType.VEHICLEDATA_BRAKING)); - assertTrue(Test.TRUE, testWiperStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_WIPERSTATUS)); - assertTrue(Test.TRUE, testFuelRange.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELRANGE)); - assertTrue(Test.TRUE, testTurnSignal.getDataType().equals(VehicleDataType.VEHICLEDATA_TURNSIGNAL)); - assertTrue(Test.TRUE, testEBrakeStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS)); - assertTrue(Test.TRUE, testOEMCustomVehicleData.getOEMCustomVehicleDataType().equals(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); + assertTrue(TestValues.TRUE, testGps.getDataType().equals(VehicleDataType.VEHICLEDATA_GPS)); + assertTrue(TestValues.TRUE, testOdometer.getDataType().equals(VehicleDataType.VEHICLEDATA_ODOMETER)); + assertTrue(TestValues.TRUE, testTirePressure.getDataType().equals(VehicleDataType.VEHICLEDATA_TIREPRESSURE)); + assertTrue(TestValues.TRUE, testBeltStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_BELTSTATUS)); + assertTrue(TestValues.TRUE, testBodyInfo.getDataType().equals(VehicleDataType.VEHICLEDATA_BODYINFO)); + assertTrue(TestValues.TRUE, testDeviceStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_DEVICESTATUS)); + assertTrue(TestValues.TRUE, testHeadLampStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS)); + assertTrue(TestValues.TRUE, testECallInfo.getDataType().equals(VehicleDataType.VEHICLEDATA_ECALLINFO)); + assertTrue(TestValues.TRUE, testAirbagStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS)); + assertTrue(TestValues.TRUE, testEmergencyEvent.getDataType().equals(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT)); + assertTrue(TestValues.TRUE, testClusterMode.getDataType().equals(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS)); + assertTrue(TestValues.TRUE, testMyKey.getDataType().equals(VehicleDataType.VEHICLEDATA_MYKEY)); + assertTrue(TestValues.TRUE, testSpeed.getDataType().equals(VehicleDataType.VEHICLEDATA_SPEED)); + assertTrue(TestValues.TRUE, testRpm.getDataType().equals(VehicleDataType.VEHICLEDATA_RPM)); + assertTrue(TestValues.TRUE, testFuelLevel.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELLEVEL)); + assertTrue(TestValues.TRUE, testConsumption.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION)); + assertTrue(TestValues.TRUE, testExternalTemp.getDataType().equals(VehicleDataType.VEHICLEDATA_EXTERNTEMP)); + assertTrue(TestValues.TRUE, testEngineTorque.getDataType().equals(VehicleDataType.VEHICLEDATA_ENGINETORQUE)); + assertTrue(TestValues.TRUE, testEngineOilLife.getDataType().equals(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE)); + assertTrue(TestValues.TRUE, testAccPedal.getDataType().equals(VehicleDataType.VEHICLEDATA_ACCPEDAL)); + assertTrue(TestValues.TRUE, testSteeringWheel.getDataType().equals(VehicleDataType.VEHICLEDATA_STEERINGWHEEL)); + assertTrue(TestValues.TRUE, testFuelLevelState.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE)); + assertTrue(TestValues.TRUE, testPrndl.getDataType().equals(VehicleDataType.VEHICLEDATA_PRNDL)); + assertTrue(TestValues.TRUE, testBraking.getDataType().equals(VehicleDataType.VEHICLEDATA_BRAKING)); + assertTrue(TestValues.TRUE, testWiperStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_WIPERSTATUS)); + assertTrue(TestValues.TRUE, testFuelRange.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELRANGE)); + assertTrue(TestValues.TRUE, testTurnSignal.getDataType().equals(VehicleDataType.VEHICLEDATA_TURNSIGNAL)); + assertTrue(TestValues.TRUE, testEBrakeStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS)); + assertTrue(TestValues.TRUE, testOEMCustomVehicleData.getOEMCustomVehicleDataType().equals(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); // Invalid/Null Tests SubscribeVehicleDataResponse msg = new SubscribeVehicleDataResponse(); assertNotNull("Null object creation failed.", msg); testNullBase(msg); - assertNull(Test.NULL, msg.getAccPedalPosition()); - assertNull(Test.NULL, msg.getAirbagStatus()); - assertNull(Test.NULL, msg.getBeltStatus()); - assertNull(Test.NULL, msg.getDriverBraking()); - assertNull(Test.NULL, msg.getFuelLevel()); - assertNull(Test.NULL, msg.getTirePressure()); - assertNull(Test.NULL, msg.getWiperStatus()); - assertNull(Test.NULL, msg.getGps()); - assertNull(Test.NULL, msg.getSpeed()); - assertNull(Test.NULL, msg.getRpm()); - assertNull(Test.NULL, msg.getFuelLevelState()); - assertNull(Test.NULL, msg.getInstantFuelConsumption()); - assertNull(Test.NULL, msg.getExternalTemperature()); - assertNull(Test.NULL, msg.getPrndl()); - assertNull(Test.NULL, msg.getOdometer()); - assertNull(Test.NULL, msg.getBodyInformation()); - assertNull(Test.NULL, msg.getDeviceStatus()); - assertNull(Test.NULL, msg.getHeadLampStatus()); - assertNull(Test.NULL, msg.getEngineTorque()); - assertNull(Test.NULL, msg.getEngineOilLife()); - assertNull(Test.NULL, msg.getSteeringWheelAngle()); - assertNull(Test.NULL, msg.getECallInfo()); - assertNull(Test.NULL, msg.getEmergencyEvent()); - assertNull(Test.NULL, msg.getClusterModeStatus()); - assertNull(Test.NULL, msg.getMyKey()); - assertNull(Test.NULL, msg.getFuelRange()); - assertNull(Test.NULL, msg.getTurnSignal()); - assertNull(Test.NULL, msg.getElectronicParkBrakeStatus()); - assertNull(Test.NULL, msg.getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); + assertNull(TestValues.NULL, msg.getAccPedalPosition()); + assertNull(TestValues.NULL, msg.getAirbagStatus()); + assertNull(TestValues.NULL, msg.getBeltStatus()); + assertNull(TestValues.NULL, msg.getDriverBraking()); + assertNull(TestValues.NULL, msg.getFuelLevel()); + assertNull(TestValues.NULL, msg.getTirePressure()); + assertNull(TestValues.NULL, msg.getWiperStatus()); + assertNull(TestValues.NULL, msg.getGps()); + assertNull(TestValues.NULL, msg.getSpeed()); + assertNull(TestValues.NULL, msg.getRpm()); + assertNull(TestValues.NULL, msg.getFuelLevelState()); + assertNull(TestValues.NULL, msg.getInstantFuelConsumption()); + assertNull(TestValues.NULL, msg.getExternalTemperature()); + assertNull(TestValues.NULL, msg.getPrndl()); + assertNull(TestValues.NULL, msg.getOdometer()); + assertNull(TestValues.NULL, msg.getBodyInformation()); + assertNull(TestValues.NULL, msg.getDeviceStatus()); + assertNull(TestValues.NULL, msg.getHeadLampStatus()); + assertNull(TestValues.NULL, msg.getEngineTorque()); + assertNull(TestValues.NULL, msg.getEngineOilLife()); + assertNull(TestValues.NULL, msg.getSteeringWheelAngle()); + assertNull(TestValues.NULL, msg.getECallInfo()); + assertNull(TestValues.NULL, msg.getEmergencyEvent()); + assertNull(TestValues.NULL, msg.getClusterModeStatus()); + assertNull(TestValues.NULL, msg.getMyKey()); + assertNull(TestValues.NULL, msg.getFuelRange()); + assertNull(TestValues.NULL, msg.getTurnSignal()); + assertNull(TestValues.NULL, msg.getElectronicParkBrakeStatus()); + assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } /** @@ -225,136 +225,136 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SubscribeVehicleDataResponse cmd = new SubscribeVehicleDataResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); JSONObject speed = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_SPEED); VehicleDataResult referenceSpeed = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(speed)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceSpeed, cmd.getSpeed())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceSpeed, cmd.getSpeed())); JSONObject rpm = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_RPM); VehicleDataResult referenceRpm = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(rpm)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceRpm, cmd.getRpm())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceRpm, cmd.getRpm())); JSONObject fuelLevel = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_FUEL_LEVEL); VehicleDataResult referenceFuelLevel = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelLevel)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelLevel, cmd.getFuelLevel())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceFuelLevel, cmd.getFuelLevel())); JSONObject externalTemperature = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE); VehicleDataResult referenceExternalTemperature = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(externalTemperature)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceExternalTemperature, cmd.getExternalTemperature())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceExternalTemperature, cmd.getExternalTemperature())); JSONObject prndl = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_PRNDL); VehicleDataResult referencePrndl = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(prndl)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referencePrndl, cmd.getPrndl())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referencePrndl, cmd.getPrndl())); JSONObject tirePressure = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_TIRE_PRESSURE); VehicleDataResult referenceTirePressure = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(tirePressure)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceTirePressure, cmd.getTirePressure())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceTirePressure, cmd.getTirePressure())); JSONObject engineTorque = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_ENGINE_TORQUE); VehicleDataResult referenceEngineTorque = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(engineTorque)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEngineTorque, cmd.getEngineTorque())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceEngineTorque, cmd.getEngineTorque())); JSONObject engineOilLife = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_ENGINE_OIL_LIFE); VehicleDataResult referenceEngineOilLife = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(engineOilLife)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEngineOilLife, cmd.getEngineOilLife())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceEngineOilLife, cmd.getEngineOilLife())); JSONObject odometer = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_ODOMETER); VehicleDataResult referenceOdometer = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(odometer)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceOdometer, cmd.getOdometer())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceOdometer, cmd.getOdometer())); JSONObject gps = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_GPS); VehicleDataResult referenceGps = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(gps)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceGps, cmd.getGps())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceGps, cmd.getGps())); JSONObject fuelLevelState = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_FUEL_LEVEL_STATE); VehicleDataResult referenceFuelLevelState = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelLevelState)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelLevelState, cmd.getFuelLevelState())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceFuelLevelState, cmd.getFuelLevelState())); JSONObject fuelConsumption = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION); VehicleDataResult referenceFuelConsumption = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelConsumption)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelConsumption, cmd.getInstantFuelConsumption())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceFuelConsumption, cmd.getInstantFuelConsumption())); JSONObject beltStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_BELT_STATUS); VehicleDataResult referenceBeltStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(beltStatus)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceBeltStatus, cmd.getBeltStatus())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceBeltStatus, cmd.getBeltStatus())); JSONObject bodyInformation = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_BODY_INFORMATION); VehicleDataResult referenceBodyInformation = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(bodyInformation)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceBodyInformation, cmd.getBodyInformation())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceBodyInformation, cmd.getBodyInformation())); JSONObject deviceStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_DEVICE_STATUS); VehicleDataResult referenceDeviceStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(deviceStatus)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceDeviceStatus, cmd.getDeviceStatus())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceDeviceStatus, cmd.getDeviceStatus())); JSONObject driverBraking = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_DRIVER_BRAKING); VehicleDataResult referenceDriverBraking = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(driverBraking)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceDriverBraking, cmd.getDriverBraking())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceDriverBraking, cmd.getDriverBraking())); JSONObject wiperStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_WIPER_STATUS); VehicleDataResult referenceWiperStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(wiperStatus)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceWiperStatus, cmd.getWiperStatus())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceWiperStatus, cmd.getWiperStatus())); JSONObject headLampStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_HEAD_LAMP_STATUS); VehicleDataResult referenceHeadLampStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(headLampStatus)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceHeadLampStatus, cmd.getHeadLampStatus())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceHeadLampStatus, cmd.getHeadLampStatus())); JSONObject accPedalPosition = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_ACC_PEDAL_POSITION); VehicleDataResult referenceAccPedalPosition = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(accPedalPosition)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceAccPedalPosition, cmd.getAccPedalPosition())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceAccPedalPosition, cmd.getAccPedalPosition())); JSONObject steeringWheelAngle = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE); VehicleDataResult referenceSteeringWheelAngle = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(steeringWheelAngle)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceSteeringWheelAngle, cmd.getSteeringWheelAngle())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceSteeringWheelAngle, cmd.getSteeringWheelAngle())); JSONObject eCallInfo = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_E_CALL_INFO); VehicleDataResult referenceECallInfo = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(eCallInfo)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceECallInfo, cmd.getECallInfo())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceECallInfo, cmd.getECallInfo())); JSONObject airbagStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_AIRBAG_STATUS); VehicleDataResult referenceAirbagStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(airbagStatus)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceAirbagStatus, cmd.getAirbagStatus())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceAirbagStatus, cmd.getAirbagStatus())); JSONObject emergencyEvent = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_EMERGENCY_EVENT); VehicleDataResult referenceEmergencyEvent = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(emergencyEvent)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEmergencyEvent, cmd.getEmergencyEvent())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceEmergencyEvent, cmd.getEmergencyEvent())); JSONObject clusterModeStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_CLUSTER_MODE_STATUS); VehicleDataResult referenceClusterModeStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(clusterModeStatus)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceClusterModeStatus, cmd.getClusterModeStatus())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceClusterModeStatus, cmd.getClusterModeStatus())); JSONObject myKey = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_MY_KEY); VehicleDataResult referenceMyKey = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(myKey)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceMyKey, cmd.getMyKey())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceMyKey, cmd.getMyKey())); JSONObject fuelRange = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_FUEL_RANGE); VehicleDataResult referenceFuelRange = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelRange)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelRange, cmd.getFuelRange())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceFuelRange, cmd.getFuelRange())); JSONObject turnSignal = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_TURN_SIGNAL); VehicleDataResult referenceTurnSignal = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(turnSignal)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceTurnSignal, cmd.getTurnSignal())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceTurnSignal, cmd.getTurnSignal())); JSONObject electronicParkBrakeStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS); VehicleDataResult referenceEBrakeStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(electronicParkBrakeStatus)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEBrakeStatus, cmd.getElectronicParkBrakeStatus())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceEBrakeStatus, cmd.getElectronicParkBrakeStatus())); - JSONObject oemCustomVehicleDataName = JsonUtils.readJsonObjectFromJsonObject(parameters, Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); + JSONObject oemCustomVehicleDataName = JsonUtils.readJsonObjectFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); VehicleDataResult referenceOemCustomData = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(oemCustomVehicleDataName)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceOemCustomData, cmd.getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME))); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceOemCustomData, cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME))); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeWaypointsResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeWaypointsResponseTests.java index a43220dce..cda7546f3 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeWaypointsResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeWaypointsResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.SubscribeWayPointsResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -45,7 +45,7 @@ public class SubscribeWaypointsResponseTests extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests SubscribeWayPointsResponse msg = new SubscribeWayPointsResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -54,17 +54,17 @@ public class SubscribeWaypointsResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SubscribeWayPointsResponse cmd = new SubscribeWayPointsResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.NOT_NULL, body); // Test everything in the json body. - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); assertEquals("Correlation ID doesn't match input ID", JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); } catch (JSONException e) { e.printStackTrace(); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SystemRequestResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SystemRequestResponseTest.java index 70a4f6279..5c52ea0eb 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SystemRequestResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SystemRequestResponseTest.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.SystemRequestResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class SystemRequestResponseTest extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests SystemRequestResponse msg = new SystemRequestResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class SystemRequestResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); SystemRequestResponse cmd = new SystemRequestResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnpublishAppServiceResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnpublishAppServiceResponseTests.java index ce99a1a4a..0e4a1f81e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnpublishAppServiceResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnpublishAppServiceResponseTests.java @@ -41,7 +41,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.UnpublishAppServiceResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -81,7 +81,7 @@ public class UnpublishAppServiceResponseTests extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests UnpublishAppServiceResponse msg = new UnpublishAppServiceResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -90,18 +90,18 @@ public class UnpublishAppServiceResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); UnpublishAppServiceResponse cmd = new UnpublishAppServiceResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnregisterAppInterfaceResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnregisterAppInterfaceResponseTest.java index a0d33a15d..3b4f02dbb 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnregisterAppInterfaceResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnregisterAppInterfaceResponseTest.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.UnregisterAppInterfaceResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class UnregisterAppInterfaceResponseTest extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests UnregisterAppInterfaceResponse msg = new UnregisterAppInterfaceResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class UnregisterAppInterfaceResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); UnregisterAppInterfaceResponse cmd = new UnregisterAppInterfaceResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeButtonResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeButtonResponseTest.java index 015b0e255..127c62572 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeButtonResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeButtonResponseTest.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.UnsubscribeButtonResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class UnsubscribeButtonResponseTest extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests UnsubscribeButtonResponse msg = new UnsubscribeButtonResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,18 +55,18 @@ public class UnsubscribeButtonResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); UnsubscribeButtonResponse cmd = new UnsubscribeButtonResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java index c2ba6e019..d13e1d539 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java @@ -10,7 +10,7 @@ import com.smartdevicelink.proxy.rpc.VehicleDataResult; import com.smartdevicelink.proxy.rpc.enums.VehicleDataType; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import com.smartdevicelink.test.json.rpc.JsonFileReader; @@ -31,35 +31,35 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests { protected RPCMessage createMessage() { UnsubscribeVehicleDataResponse msg = new UnsubscribeVehicleDataResponse(); - msg.setSpeed(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SPEED.ordinal())); - msg.setRpm(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_RPM.ordinal())); - msg.setExternalTemperature(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EXTERNTEMP.ordinal())); - msg.setFuelLevel(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL.ordinal())); - msg.setPrndl(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_PRNDL.ordinal())); - msg.setTirePressure(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TIREPRESSURE.ordinal())); - msg.setEngineTorque(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINETORQUE.ordinal())); - msg.setEngineOilLife(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE.ordinal())); - msg.setOdometer(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ODOMETER.ordinal())); - msg.setGps(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GPS.ordinal())); - msg.setFuelLevelState(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE.ordinal())); - msg.setInstantFuelConsumption(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION.ordinal())); - msg.setBeltStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BELTSTATUS.ordinal())); - msg.setBodyInformation(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BODYINFO.ordinal())); - msg.setDeviceStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_DEVICESTATUS.ordinal())); - msg.setDriverBraking(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BRAKING.ordinal())); - msg.setWiperStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WIPERSTATUS.ordinal())); - msg.setHeadLampStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS.ordinal())); - msg.setAccPedalPosition(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ACCPEDAL.ordinal())); - msg.setSteeringWheelAngle(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STEERINGWHEEL.ordinal())); - msg.setECallInfo(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ECALLINFO.ordinal())); - msg.setAirbagStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS.ordinal())); - msg.setEmergencyEvent(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT.ordinal())); - msg.setClusterModeStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS.ordinal())); - msg.setMyKey(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_MYKEY.ordinal())); - msg.setFuelRange(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELRANGE.ordinal())); - msg.setTurnSignal(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal())); - msg.setElectronicParkBrakeStatus(Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal())); - msg.setOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA); + msg.setSpeed(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SPEED.ordinal())); + msg.setRpm(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_RPM.ordinal())); + msg.setExternalTemperature(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EXTERNTEMP.ordinal())); + msg.setFuelLevel(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL.ordinal())); + msg.setPrndl(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_PRNDL.ordinal())); + msg.setTirePressure(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TIREPRESSURE.ordinal())); + msg.setEngineTorque(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINETORQUE.ordinal())); + msg.setEngineOilLife(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE.ordinal())); + msg.setOdometer(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ODOMETER.ordinal())); + msg.setGps(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GPS.ordinal())); + msg.setFuelLevelState(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE.ordinal())); + msg.setInstantFuelConsumption(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION.ordinal())); + msg.setBeltStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BELTSTATUS.ordinal())); + msg.setBodyInformation(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BODYINFO.ordinal())); + msg.setDeviceStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_DEVICESTATUS.ordinal())); + msg.setDriverBraking(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BRAKING.ordinal())); + msg.setWiperStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WIPERSTATUS.ordinal())); + msg.setHeadLampStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS.ordinal())); + msg.setAccPedalPosition(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ACCPEDAL.ordinal())); + msg.setSteeringWheelAngle(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STEERINGWHEEL.ordinal())); + msg.setECallInfo(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ECALLINFO.ordinal())); + msg.setAirbagStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS.ordinal())); + msg.setEmergencyEvent(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT.ordinal())); + msg.setClusterModeStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS.ordinal())); + msg.setMyKey(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_MYKEY.ordinal())); + msg.setFuelRange(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELRANGE.ordinal())); + msg.setTurnSignal(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal())); + msg.setElectronicParkBrakeStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal())); + msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA); return msg; } @@ -84,37 +84,37 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests { // were to be in a list then this could be easily looped through // instead of individually set. - result.put(SubscribeVehicleDataResponse.KEY_SPEED, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SPEED.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_RPM, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_RPM.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EXTERNTEMP.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_FUEL_LEVEL, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_PRNDL, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_PRNDL.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_TIRE_PRESSURE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TIREPRESSURE.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_ENGINE_TORQUE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINETORQUE.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_ENGINE_OIL_LIFE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_ODOMETER, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ODOMETER.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_GPS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GPS.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_FUEL_LEVEL_STATE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_BELT_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BELTSTATUS.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_BODY_INFORMATION, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BODYINFO.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_DEVICE_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_DEVICESTATUS.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_DRIVER_BRAKING, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BRAKING.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_WIPER_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WIPERSTATUS.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_HEAD_LAMP_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_ACC_PEDAL_POSITION, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ACCPEDAL.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STEERINGWHEEL.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_E_CALL_INFO, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ECALLINFO.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_AIRBAG_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_EMERGENCY_EVENT, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_CLUSTER_MODE_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_MY_KEY, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_MYKEY.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_FUEL_RANGE, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELRANGE.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_TURN_SIGNAL, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal()).serializeJSON()); - result.put(SubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, Test.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()).serializeJSON()); - result.put(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA.serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_SPEED, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SPEED.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_RPM, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_RPM.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EXTERNTEMP.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_FUEL_LEVEL, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_PRNDL, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_PRNDL.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_TIRE_PRESSURE, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TIREPRESSURE.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_ENGINE_TORQUE, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINETORQUE.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_ENGINE_OIL_LIFE, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_ODOMETER, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ODOMETER.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_GPS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GPS.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_FUEL_LEVEL_STATE, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_BELT_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BELTSTATUS.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_BODY_INFORMATION, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BODYINFO.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_DEVICE_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_DEVICESTATUS.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_DRIVER_BRAKING, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_BRAKING.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_WIPER_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WIPERSTATUS.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_HEAD_LAMP_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_ACC_PEDAL_POSITION, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ACCPEDAL.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STEERINGWHEEL.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_E_CALL_INFO, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ECALLINFO.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_AIRBAG_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_EMERGENCY_EVENT, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_CLUSTER_MODE_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_MY_KEY, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_MYKEY.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_FUEL_RANGE, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_FUELRANGE.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_TURN_SIGNAL, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()).serializeJSON()); + result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA.serializeJSON()); } catch (JSONException e) { - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } return result; @@ -153,73 +153,73 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests { VehicleDataResult testFuelRange = ( (UnsubscribeVehicleDataResponse) msg ).getFuelRange(); VehicleDataResult testTurnSignal = ( (UnsubscribeVehicleDataResponse) msg ).getTurnSignal(); VehicleDataResult testEBrakeStatus = ( (UnsubscribeVehicleDataResponse) msg ).getElectronicParkBrakeStatus(); - VehicleDataResult testOemCustomData = ( (UnsubscribeVehicleDataResponse) msg ).getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); + VehicleDataResult testOemCustomData = ( (UnsubscribeVehicleDataResponse) msg ).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); // Valid Tests - assertTrue(Test.TRUE, testGps.getDataType().equals(VehicleDataType.VEHICLEDATA_GPS)); - assertTrue(Test.TRUE, testOdometer.getDataType().equals(VehicleDataType.VEHICLEDATA_ODOMETER)); - assertTrue(Test.TRUE, testTirePressure.getDataType().equals(VehicleDataType.VEHICLEDATA_TIREPRESSURE)); - assertTrue(Test.TRUE, testBeltStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_BELTSTATUS)); - assertTrue(Test.TRUE, testBodyInfo.getDataType().equals(VehicleDataType.VEHICLEDATA_BODYINFO)); - assertTrue(Test.TRUE, testDeviceStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_DEVICESTATUS)); - assertTrue(Test.TRUE, testHeadLampStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS)); - assertTrue(Test.TRUE, testECallInfo.getDataType().equals(VehicleDataType.VEHICLEDATA_ECALLINFO)); - assertTrue(Test.TRUE, testAirbagStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS)); - assertTrue(Test.TRUE, testEmergencyEvent.getDataType().equals(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT)); - assertTrue(Test.TRUE, testClusterMode.getDataType().equals(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS)); - assertTrue(Test.TRUE, testMyKey.getDataType().equals(VehicleDataType.VEHICLEDATA_MYKEY)); - assertTrue(Test.TRUE, testSpeed.getDataType().equals(VehicleDataType.VEHICLEDATA_SPEED)); - assertTrue(Test.TRUE, testRpm.getDataType().equals(VehicleDataType.VEHICLEDATA_RPM)); - assertTrue(Test.TRUE, testFuelLevel.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELLEVEL)); - assertTrue(Test.TRUE, testConsumption.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION)); - assertTrue(Test.TRUE, testExternalTemp.getDataType().equals(VehicleDataType.VEHICLEDATA_EXTERNTEMP)); - assertTrue(Test.TRUE, testEngineTorque.getDataType().equals(VehicleDataType.VEHICLEDATA_ENGINETORQUE)); - assertTrue(Test.TRUE, testEngineOilLife.getDataType().equals(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE)); - assertTrue(Test.TRUE, testAccPedal.getDataType().equals(VehicleDataType.VEHICLEDATA_ACCPEDAL)); - assertTrue(Test.TRUE, testSteeringWheel.getDataType().equals(VehicleDataType.VEHICLEDATA_STEERINGWHEEL)); - assertTrue(Test.TRUE, testFuelLevelState.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE)); - assertTrue(Test.TRUE, testPrndl.getDataType().equals(VehicleDataType.VEHICLEDATA_PRNDL)); - assertTrue(Test.TRUE, testBraking.getDataType().equals(VehicleDataType.VEHICLEDATA_BRAKING)); - assertTrue(Test.TRUE, testWiperStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_WIPERSTATUS)); - assertTrue(Test.TRUE, testFuelRange.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELRANGE)); - assertTrue(Test.TRUE, testTurnSignal.getDataType().equals(VehicleDataType.VEHICLEDATA_TURNSIGNAL)); - assertTrue(Test.TRUE, testEBrakeStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS)); - assertTrue(Test.TRUE, testOemCustomData.getOEMCustomVehicleDataType().equals(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); + assertTrue(TestValues.TRUE, testGps.getDataType().equals(VehicleDataType.VEHICLEDATA_GPS)); + assertTrue(TestValues.TRUE, testOdometer.getDataType().equals(VehicleDataType.VEHICLEDATA_ODOMETER)); + assertTrue(TestValues.TRUE, testTirePressure.getDataType().equals(VehicleDataType.VEHICLEDATA_TIREPRESSURE)); + assertTrue(TestValues.TRUE, testBeltStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_BELTSTATUS)); + assertTrue(TestValues.TRUE, testBodyInfo.getDataType().equals(VehicleDataType.VEHICLEDATA_BODYINFO)); + assertTrue(TestValues.TRUE, testDeviceStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_DEVICESTATUS)); + assertTrue(TestValues.TRUE, testHeadLampStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS)); + assertTrue(TestValues.TRUE, testECallInfo.getDataType().equals(VehicleDataType.VEHICLEDATA_ECALLINFO)); + assertTrue(TestValues.TRUE, testAirbagStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_AIRBAGSTATUS)); + assertTrue(TestValues.TRUE, testEmergencyEvent.getDataType().equals(VehicleDataType.VEHICLEDATA_EMERGENCYEVENT)); + assertTrue(TestValues.TRUE, testClusterMode.getDataType().equals(VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS)); + assertTrue(TestValues.TRUE, testMyKey.getDataType().equals(VehicleDataType.VEHICLEDATA_MYKEY)); + assertTrue(TestValues.TRUE, testSpeed.getDataType().equals(VehicleDataType.VEHICLEDATA_SPEED)); + assertTrue(TestValues.TRUE, testRpm.getDataType().equals(VehicleDataType.VEHICLEDATA_RPM)); + assertTrue(TestValues.TRUE, testFuelLevel.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELLEVEL)); + assertTrue(TestValues.TRUE, testConsumption.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELCONSUMPTION)); + assertTrue(TestValues.TRUE, testExternalTemp.getDataType().equals(VehicleDataType.VEHICLEDATA_EXTERNTEMP)); + assertTrue(TestValues.TRUE, testEngineTorque.getDataType().equals(VehicleDataType.VEHICLEDATA_ENGINETORQUE)); + assertTrue(TestValues.TRUE, testEngineOilLife.getDataType().equals(VehicleDataType.VEHICLEDATA_ENGINEOILLIFE)); + assertTrue(TestValues.TRUE, testAccPedal.getDataType().equals(VehicleDataType.VEHICLEDATA_ACCPEDAL)); + assertTrue(TestValues.TRUE, testSteeringWheel.getDataType().equals(VehicleDataType.VEHICLEDATA_STEERINGWHEEL)); + assertTrue(TestValues.TRUE, testFuelLevelState.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE)); + assertTrue(TestValues.TRUE, testPrndl.getDataType().equals(VehicleDataType.VEHICLEDATA_PRNDL)); + assertTrue(TestValues.TRUE, testBraking.getDataType().equals(VehicleDataType.VEHICLEDATA_BRAKING)); + assertTrue(TestValues.TRUE, testWiperStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_WIPERSTATUS)); + assertTrue(TestValues.TRUE, testFuelRange.getDataType().equals(VehicleDataType.VEHICLEDATA_FUELRANGE)); + assertTrue(TestValues.TRUE, testTurnSignal.getDataType().equals(VehicleDataType.VEHICLEDATA_TURNSIGNAL)); + assertTrue(TestValues.TRUE, testEBrakeStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS)); + assertTrue(TestValues.TRUE, testOemCustomData.getOEMCustomVehicleDataType().equals(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); // Invalid/Null Tests UnsubscribeVehicleDataResponse msg = new UnsubscribeVehicleDataResponse(); assertNotNull("Null object creation failed.", msg); testNullBase(msg); - assertNull(Test.NULL, msg.getAccPedalPosition()); - assertNull(Test.NULL, msg.getAirbagStatus()); - assertNull(Test.NULL, msg.getBeltStatus()); - assertNull(Test.NULL, msg.getDriverBraking()); - assertNull(Test.NULL, msg.getFuelLevel()); - assertNull(Test.NULL, msg.getTirePressure()); - assertNull(Test.NULL, msg.getWiperStatus()); - assertNull(Test.NULL, msg.getGps()); - assertNull(Test.NULL, msg.getSpeed()); - assertNull(Test.NULL, msg.getRpm()); - assertNull(Test.NULL, msg.getFuelLevelState()); - assertNull(Test.NULL, msg.getInstantFuelConsumption()); - assertNull(Test.NULL, msg.getExternalTemperature()); - assertNull(Test.NULL, msg.getPrndl()); - assertNull(Test.NULL, msg.getOdometer()); - assertNull(Test.NULL, msg.getBodyInformation()); - assertNull(Test.NULL, msg.getDeviceStatus()); - assertNull(Test.NULL, msg.getHeadLampStatus()); - assertNull(Test.NULL, msg.getEngineTorque()); - assertNull(Test.NULL, msg.getEngineOilLife()); - assertNull(Test.NULL, msg.getSteeringWheelAngle()); - assertNull(Test.NULL, msg.getECallInfo()); - assertNull(Test.NULL, msg.getEmergencyEvent()); - assertNull(Test.NULL, msg.getClusterModeStatus()); - assertNull(Test.NULL, msg.getMyKey()); - assertNull(Test.NULL, msg.getFuelRange()); - assertNull(Test.NULL, msg.getTurnSignal()); - assertNull(Test.NULL, msg.getElectronicParkBrakeStatus()); - assertNull(Test.NULL, msg.getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); + assertNull(TestValues.NULL, msg.getAccPedalPosition()); + assertNull(TestValues.NULL, msg.getAirbagStatus()); + assertNull(TestValues.NULL, msg.getBeltStatus()); + assertNull(TestValues.NULL, msg.getDriverBraking()); + assertNull(TestValues.NULL, msg.getFuelLevel()); + assertNull(TestValues.NULL, msg.getTirePressure()); + assertNull(TestValues.NULL, msg.getWiperStatus()); + assertNull(TestValues.NULL, msg.getGps()); + assertNull(TestValues.NULL, msg.getSpeed()); + assertNull(TestValues.NULL, msg.getRpm()); + assertNull(TestValues.NULL, msg.getFuelLevelState()); + assertNull(TestValues.NULL, msg.getInstantFuelConsumption()); + assertNull(TestValues.NULL, msg.getExternalTemperature()); + assertNull(TestValues.NULL, msg.getPrndl()); + assertNull(TestValues.NULL, msg.getOdometer()); + assertNull(TestValues.NULL, msg.getBodyInformation()); + assertNull(TestValues.NULL, msg.getDeviceStatus()); + assertNull(TestValues.NULL, msg.getHeadLampStatus()); + assertNull(TestValues.NULL, msg.getEngineTorque()); + assertNull(TestValues.NULL, msg.getEngineOilLife()); + assertNull(TestValues.NULL, msg.getSteeringWheelAngle()); + assertNull(TestValues.NULL, msg.getECallInfo()); + assertNull(TestValues.NULL, msg.getEmergencyEvent()); + assertNull(TestValues.NULL, msg.getClusterModeStatus()); + assertNull(TestValues.NULL, msg.getMyKey()); + assertNull(TestValues.NULL, msg.getFuelRange()); + assertNull(TestValues.NULL, msg.getTurnSignal()); + assertNull(TestValues.NULL, msg.getElectronicParkBrakeStatus()); + assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } /** @@ -227,136 +227,136 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); UnsubscribeVehicleDataResponse cmd = new UnsubscribeVehicleDataResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); JSONObject speed = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_SPEED); VehicleDataResult referenceSpeed = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(speed)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceSpeed, cmd.getSpeed())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceSpeed, cmd.getSpeed())); JSONObject rpm = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_RPM); VehicleDataResult referenceRpm = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(rpm)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceRpm, cmd.getRpm())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceRpm, cmd.getRpm())); JSONObject fuelLevel = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_FUEL_LEVEL); VehicleDataResult referenceFuelLevel = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelLevel)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelLevel, cmd.getFuelLevel())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceFuelLevel, cmd.getFuelLevel())); JSONObject externalTemperature = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE); VehicleDataResult referenceExternalTemperature = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(externalTemperature)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceExternalTemperature, cmd.getExternalTemperature())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceExternalTemperature, cmd.getExternalTemperature())); JSONObject prndl = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_PRNDL); VehicleDataResult referencePrndl = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(prndl)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referencePrndl, cmd.getPrndl())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referencePrndl, cmd.getPrndl())); JSONObject tirePressure = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_TIRE_PRESSURE); VehicleDataResult referenceTirePressure = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(tirePressure)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceTirePressure, cmd.getTirePressure())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceTirePressure, cmd.getTirePressure())); JSONObject engineTorque = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_ENGINE_TORQUE); VehicleDataResult referenceEngineTorque = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(engineTorque)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEngineTorque, cmd.getEngineTorque())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceEngineTorque, cmd.getEngineTorque())); JSONObject engineOilLife = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_ENGINE_OIL_LIFE); VehicleDataResult referenceEngineOilLife = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(engineOilLife)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEngineOilLife, cmd.getEngineOilLife())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceEngineOilLife, cmd.getEngineOilLife())); JSONObject odometer = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_ODOMETER); VehicleDataResult referenceOdometer = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(odometer)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceOdometer, cmd.getOdometer())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceOdometer, cmd.getOdometer())); JSONObject gps = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_GPS); VehicleDataResult referenceGps = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(gps)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceGps, cmd.getGps())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceGps, cmd.getGps())); JSONObject fuelLevelState = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_FUEL_LEVEL_STATE); VehicleDataResult referenceFuelLevelState = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelLevelState)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelLevelState, cmd.getFuelLevelState())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceFuelLevelState, cmd.getFuelLevelState())); JSONObject fuelConsumption = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_INSTANT_FUEL_CONSUMPTION); VehicleDataResult referenceFuelConsumption = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelConsumption)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelConsumption, cmd.getInstantFuelConsumption())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceFuelConsumption, cmd.getInstantFuelConsumption())); JSONObject beltStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_BELT_STATUS); VehicleDataResult referenceBeltStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(beltStatus)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceBeltStatus, cmd.getBeltStatus())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceBeltStatus, cmd.getBeltStatus())); JSONObject bodyInformation = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_BODY_INFORMATION); VehicleDataResult referenceBodyInformation = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(bodyInformation)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceBodyInformation, cmd.getBodyInformation())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceBodyInformation, cmd.getBodyInformation())); JSONObject deviceStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_DEVICE_STATUS); VehicleDataResult referenceDeviceStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(deviceStatus)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceDeviceStatus, cmd.getDeviceStatus())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceDeviceStatus, cmd.getDeviceStatus())); JSONObject driverBraking = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_DRIVER_BRAKING); VehicleDataResult referenceDriverBraking = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(driverBraking)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceDriverBraking, cmd.getDriverBraking())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceDriverBraking, cmd.getDriverBraking())); JSONObject wiperStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_WIPER_STATUS); VehicleDataResult referenceWiperStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(wiperStatus)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceWiperStatus, cmd.getWiperStatus())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceWiperStatus, cmd.getWiperStatus())); JSONObject headLampStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_HEAD_LAMP_STATUS); VehicleDataResult referenceHeadLampStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(headLampStatus)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceHeadLampStatus, cmd.getHeadLampStatus())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceHeadLampStatus, cmd.getHeadLampStatus())); JSONObject accPedalPosition = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_ACC_PEDAL_POSITION); VehicleDataResult referenceAccPedalPosition = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(accPedalPosition)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceAccPedalPosition, cmd.getAccPedalPosition())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceAccPedalPosition, cmd.getAccPedalPosition())); JSONObject steeringWheelAngle = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_STEERING_WHEEL_ANGLE); VehicleDataResult referenceSteeringWheelAngle = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(steeringWheelAngle)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceSteeringWheelAngle, cmd.getSteeringWheelAngle())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceSteeringWheelAngle, cmd.getSteeringWheelAngle())); JSONObject eCallInfo = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_E_CALL_INFO); VehicleDataResult referenceECallInfo = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(eCallInfo)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceECallInfo, cmd.getECallInfo())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceECallInfo, cmd.getECallInfo())); JSONObject airbagStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_AIRBAG_STATUS); VehicleDataResult referenceAirbagStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(airbagStatus)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceAirbagStatus, cmd.getAirbagStatus())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceAirbagStatus, cmd.getAirbagStatus())); JSONObject emergencyEvent = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_EMERGENCY_EVENT); VehicleDataResult referenceEmergencyEvent = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(emergencyEvent)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEmergencyEvent, cmd.getEmergencyEvent())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceEmergencyEvent, cmd.getEmergencyEvent())); JSONObject clusterModeStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_CLUSTER_MODE_STATUS); VehicleDataResult referenceClusterModeStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(clusterModeStatus)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceClusterModeStatus, cmd.getClusterModeStatus())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceClusterModeStatus, cmd.getClusterModeStatus())); JSONObject myKey = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_MY_KEY); VehicleDataResult referenceMyKey = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(myKey)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceMyKey, cmd.getMyKey())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceMyKey, cmd.getMyKey())); JSONObject fuelRange = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_FUEL_RANGE); VehicleDataResult referenceFuelRange = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(fuelRange)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceFuelRange, cmd.getFuelRange())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceFuelRange, cmd.getFuelRange())); JSONObject turnSignal = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_TURN_SIGNAL); VehicleDataResult referenceTurnSignal = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(turnSignal)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceTurnSignal, cmd.getTurnSignal())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceTurnSignal, cmd.getTurnSignal())); JSONObject eBrakeStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS); VehicleDataResult referenceEBrakeStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(eBrakeStatus)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceEBrakeStatus, cmd.getElectronicParkBrakeStatus())); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceEBrakeStatus, cmd.getElectronicParkBrakeStatus())); - JSONObject oemCustomData = JsonUtils.readJsonObjectFromJsonObject(parameters, Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); + JSONObject oemCustomData = JsonUtils.readJsonObjectFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); VehicleDataResult referenceOemCustomData = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(oemCustomData)); - assertTrue(Test.TRUE, Validator.validateVehicleDataResult(referenceOemCustomData, cmd.getOEMCustomVehicleData(Test.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME))); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceOemCustomData, cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME))); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeWayPointsResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeWayPointsResponseTests.java index b8b69be60..644191bdf 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeWayPointsResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeWayPointsResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.UnsubscribeWayPointsResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -45,7 +45,7 @@ public class UnsubscribeWayPointsResponseTests extends BaseRpcTests{ public void testRpcValues () { // Invalid/Null Tests UnsubscribeWayPointsResponse msg = new UnsubscribeWayPointsResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -54,17 +54,17 @@ public class UnsubscribeWayPointsResponseTests extends BaseRpcTests{ */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); UnsubscribeWayPointsResponse cmd = new UnsubscribeWayPointsResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.NOT_NULL, body); // Test everything in the json body. - assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName()); assertEquals("Correlation ID doesn't match input ID", JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID()); } catch (JSONException e) { e.printStackTrace(); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UpdateTurnListResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UpdateTurnListResponseTests.java index 84ecc8b64..c209687bb 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UpdateTurnListResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UpdateTurnListResponseTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.proxy.rpc.UpdateTurnListResponse; import com.smartdevicelink.test.BaseRpcTests; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.json.rpc.JsonFileReader; import org.json.JSONException; @@ -46,7 +46,7 @@ public class UpdateTurnListResponseTests extends BaseRpcTests { public void testRpcValues () { // Invalid/Null Tests UpdateTurnListResponse msg = new UpdateTurnListResponse(); - assertNotNull(Test.NOT_NULL, msg); + assertNotNull(TestValues.NOT_NULL, msg); testNullBase(msg); } @@ -55,17 +55,17 @@ public class UpdateTurnListResponseTests extends BaseRpcTests { */ public void testJsonConstructor () { JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType()); - assertNotNull(Test.NOT_NULL, commandJson); + assertNotNull(TestValues.NOT_NULL, commandJson); try { Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson); UpdateTurnListResponse cmd = new UpdateTurnListResponse(hash); JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType()); - assertNotNull(Test.NOT_NULL, body); + assertNotNull(TestValues.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()); + 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(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/security/SdlSecurityBaseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/security/SdlSecurityBaseTest.java index 730226472..1a089daa0 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/security/SdlSecurityBaseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/security/SdlSecurityBaseTest.java @@ -7,10 +7,11 @@ import com.smartdevicelink.SdlConnection.SdlSession; import com.smartdevicelink.protocol.ProtocolMessage; import com.smartdevicelink.protocol.enums.SessionType; import com.smartdevicelink.security.SdlSecurityBase; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.transport.BTTransportConfig; import com.smartdevicelink.transport.BaseTransportConfig; +import org.junit.Test; import org.junit.runner.RunWith; import java.util.ArrayList; @@ -117,7 +118,7 @@ public class SdlSecurityBaseTest { } - @org.junit.Test + @Test public void testMakeListSetAndGet(){ List<String> makeList = new ArrayList<String>(); MockSdlSecurityBase mockSdlSecurityBase = new MockSdlSecurityBase(); @@ -129,11 +130,11 @@ public class SdlSecurityBaseTest { mockSdlSecurityBase.setMakeList(makeList); - assertNotNull(Test.NOT_NULL, makeList); - assertEquals(Test.MATCH, makeList, mockSdlSecurityBase.getMakeList()); + assertNotNull(TestValues.NOT_NULL, makeList); + assertEquals(TestValues.MATCH, makeList, mockSdlSecurityBase.getMakeList()); } - @org.junit.Test + @Test public void testHandleInitResult() { byte testWiproVersion = (byte) 0x0B; boolean testInitResult = true; @@ -143,22 +144,22 @@ public class SdlSecurityBaseTest { SdlSession testSdlSession = SdlSession.createSession(testWiproVersion,interfaceBroker, transportConfig); - assertNotNull(Test.NOT_NULL, mockSdlSecurityBase); - assertNotNull(Test.NOT_NULL, testSdlSession); + assertNotNull(TestValues.NOT_NULL, mockSdlSecurityBase); + assertNotNull(TestValues.NOT_NULL, testSdlSession); testSdlSession.setSdlSecurity(mockSdlSecurityBase); mockSdlSecurityBase.handleSdlSession(testSdlSession); - assertEquals(Test.MATCH, mockSdlSecurityBase.getSdlSession(), testSdlSession); - assertEquals(Test.MATCH, mockSdlSecurityBase.getSdlSession().getSessionId(), testSdlSession.getSessionId()); + assertEquals(TestValues.MATCH, mockSdlSecurityBase.getSdlSession(), testSdlSession); + assertEquals(TestValues.MATCH, mockSdlSecurityBase.getSdlSession().getSessionId(), testSdlSession.getSessionId()); mockSdlSecurityBase.handleInitResult(testInitResult); - assertEquals(Test.MATCH, testInitResult, mockSdlSecurityBase.getInitSuccess()); + assertEquals(TestValues.MATCH, testInitResult, mockSdlSecurityBase.getInitSuccess()); } - @org.junit.Test + @Test public void testStartServiceListSetAndGet() { List<SessionType> startServiceList = new ArrayList<SessionType>(); MockSdlSecurityBase mockSdlSecurityBase = new MockSdlSecurityBase(); @@ -168,11 +169,11 @@ public class SdlSecurityBaseTest { startServiceList.add(SessionType.PCM); startServiceList.add(SessionType.CONTROL); - assertNotNull(Test.NOT_NULL, startServiceList); + assertNotNull(TestValues.NOT_NULL, startServiceList); mockSdlSecurityBase.setStartServiceList(startServiceList); - assertEquals(Test.MATCH, startServiceList, mockSdlSecurityBase.getServiceList()); + assertEquals(TestValues.MATCH, startServiceList, mockSdlSecurityBase.getServiceList()); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java index aa2c6f073..b4167bef5 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java @@ -4,7 +4,7 @@ import com.smartdevicelink.SdlConnection.SdlSession; import com.smartdevicelink.protocol.enums.SessionType; import com.smartdevicelink.proxy.RPCRequest; import com.smartdevicelink.streaming.IStreamListener; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.transport.BTTransportConfig; import com.smartdevicelink.transport.BaseTransportConfig; @@ -56,26 +56,26 @@ public class AbstractPacketizerTests extends TestCase { // Valid Tests - assertNotNull(Test.NOT_NULL, testPacketizer1); - assertNotNull(Test.NOT_NULL, testPacketizer2); - assertNotNull(Test.NOT_NULL, testPacketizer3); + assertNotNull(TestValues.NOT_NULL, testPacketizer1); + assertNotNull(TestValues.NOT_NULL, testPacketizer2); + assertNotNull(TestValues.NOT_NULL, testPacketizer3); - assertEquals(Test.MATCH, testListener, testPacketizer1.getListener()); - assertEquals(Test.MATCH, testInputStream, testPacketizer1.getInputStream()); - assertEquals(Test.MATCH, testSessionType, testPacketizer1.getSessionType()); - assertEquals(Test.MATCH, testSessionId, testPacketizer1.getSessionId()); - assertEquals(Test.MATCH, testListener, testPacketizer3.getListener()); - assertEquals(Test.MATCH, testInputStream, testPacketizer3.getInputStream()); - assertEquals(Test.MATCH, testSessionType, testPacketizer3.getSessionType()); - assertEquals(Test.MATCH, testSessionId, testPacketizer3.getSessionId()); - assertEquals(Test.MATCH, testWiproVersion, testPacketizer3.getWiproVersion()); - assertEquals(Test.MATCH, testRpcRequest.getFunctionName(), testPacketizer3.getRPCRequest().getFunctionName()); - assertEquals(Test.MATCH, testSdlSession, testPacketizer3.getSdlSession()); + assertEquals(TestValues.MATCH, testListener, testPacketizer1.getListener()); + assertEquals(TestValues.MATCH, testInputStream, testPacketizer1.getInputStream()); + assertEquals(TestValues.MATCH, testSessionType, testPacketizer1.getSessionType()); + assertEquals(TestValues.MATCH, testSessionId, testPacketizer1.getSessionId()); + assertEquals(TestValues.MATCH, testListener, testPacketizer3.getListener()); + assertEquals(TestValues.MATCH, testInputStream, testPacketizer3.getInputStream()); + assertEquals(TestValues.MATCH, testSessionType, testPacketizer3.getSessionType()); + assertEquals(TestValues.MATCH, testSessionId, testPacketizer3.getSessionId()); + assertEquals(TestValues.MATCH, testWiproVersion, testPacketizer3.getWiproVersion()); + assertEquals(TestValues.MATCH, testRpcRequest.getFunctionName(), testPacketizer3.getRPCRequest().getFunctionName()); + assertEquals(TestValues.MATCH, testSdlSession, testPacketizer3.getSdlSession()); // Invalid/Null Tests - assertNull(Test.NULL, testPacketizer2.getListener()); - assertNull(Test.NULL, testPacketizer2.getInputStream()); - assertNull(Test.NULL, testPacketizer2.getSessionType()); + assertNull(TestValues.NULL, testPacketizer2.getListener()); + assertNull(TestValues.NULL, testPacketizer2.getInputStream()); + assertNull(TestValues.NULL, testPacketizer2.getSessionType()); } catch (IOException e) { e.printStackTrace(); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamPacketizerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamPacketizerTests.java index 143e8efec..e7a367d0e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamPacketizerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamPacketizerTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.protocol.enums.SessionType; import com.smartdevicelink.proxy.interfaces.IVideoStreamListener; import com.smartdevicelink.streaming.IStreamListener; import com.smartdevicelink.streaming.StreamPacketizer; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.transport.BTTransportConfig; import com.smartdevicelink.transport.BaseTransportConfig; @@ -133,7 +133,7 @@ public class StreamPacketizerTests extends TestCase { try { testInputStream = new BufferedInputStream(new ByteArrayInputStream("sdl streaming test".getBytes())); StreamPacketizer testStreamPacketizer = new StreamPacketizer(testListener, testInputStream, testSessionType, testSessionId, testSdlSession); - assertNotNull(Test.NOT_NULL, testStreamPacketizer); + assertNotNull(TestValues.NOT_NULL, testStreamPacketizer); // NOTE: Cannot test thread handling methods currently. diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamRPCPacketizerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamRPCPacketizerTests.java index b35877ac3..30a97a09a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamRPCPacketizerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamRPCPacketizerTests.java @@ -6,7 +6,7 @@ import com.smartdevicelink.proxy.RPCRequest; import com.smartdevicelink.proxy.SdlProxyBase; import com.smartdevicelink.streaming.IStreamListener; import com.smartdevicelink.streaming.StreamRPCPacketizer; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.transport.BTTransportConfig; import com.smartdevicelink.transport.BaseTransportConfig; @@ -44,7 +44,7 @@ public class StreamRPCPacketizerTests extends TestCase { try { testInputStream = new BufferedInputStream(new ByteArrayInputStream("sdl streaming test".getBytes())); StreamRPCPacketizer testStreamRpcPacketizer = new StreamRPCPacketizer(null, testListener, testInputStream, testRequest, testSessionType, testSessionId, testWV, testWV, testSdlSession); - assertNotNull(Test.NOT_NULL, testStreamRpcPacketizer); + assertNotNull(TestValues.NOT_NULL, testStreamRpcPacketizer); // NOTE: Cannot test thread handling methods currently. diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/DiagLevelTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/DiagLevelTests.java index ce24ce4e8..34685897f 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/DiagLevelTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/DiagLevelTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.trace; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.trace.DiagLevel; import com.smartdevicelink.trace.enums.DetailLevel; import com.smartdevicelink.trace.enums.Mod; @@ -42,86 +42,86 @@ public class DiagLevelTests extends TestCase { // Valid Tests DiagLevel.setAllLevels(testVerbose); - assertEquals(Test.MATCH, testVerbose, DiagLevel.getLevel(testProto)); - assertEquals(Test.MATCH, testVerbose, DiagLevel.getLevel(testProxy)); - assertEquals(Test.MATCH, testVerbose, DiagLevel.getLevel(testTran)); - assertEquals(Test.MATCH, testVerbose, DiagLevel.getLevel(testApp)); - assertEquals(Test.MATCH, testVerbose, DiagLevel.getLevel(testRpc)); - assertEquals(Test.MATCH, testVerbose, DiagLevel.getLevel(testMar)); + assertEquals(TestValues.MATCH, testVerbose, DiagLevel.getLevel(testProto)); + assertEquals(TestValues.MATCH, testVerbose, DiagLevel.getLevel(testProxy)); + assertEquals(TestValues.MATCH, testVerbose, DiagLevel.getLevel(testTran)); + assertEquals(TestValues.MATCH, testVerbose, DiagLevel.getLevel(testApp)); + assertEquals(TestValues.MATCH, testVerbose, DiagLevel.getLevel(testRpc)); + assertEquals(TestValues.MATCH, testVerbose, DiagLevel.getLevel(testMar)); DiagLevel.setAllLevels(testTerse); - assertEquals(Test.MATCH, testTerse, DiagLevel.getLevel(testProto)); - assertEquals(Test.MATCH, testTerse, DiagLevel.getLevel(testProxy)); - assertEquals(Test.MATCH, testTerse, DiagLevel.getLevel(testTran)); - assertEquals(Test.MATCH, testTerse, DiagLevel.getLevel(testApp)); - assertEquals(Test.MATCH, testTerse, DiagLevel.getLevel(testRpc)); - assertEquals(Test.MATCH, testTerse, DiagLevel.getLevel(testMar)); + assertEquals(TestValues.MATCH, testTerse, DiagLevel.getLevel(testProto)); + assertEquals(TestValues.MATCH, testTerse, DiagLevel.getLevel(testProxy)); + assertEquals(TestValues.MATCH, testTerse, DiagLevel.getLevel(testTran)); + assertEquals(TestValues.MATCH, testTerse, DiagLevel.getLevel(testApp)); + assertEquals(TestValues.MATCH, testTerse, DiagLevel.getLevel(testRpc)); + assertEquals(TestValues.MATCH, testTerse, DiagLevel.getLevel(testMar)); DiagLevel.setAllLevels(testOff); - assertEquals(Test.MATCH, testOff, DiagLevel.getLevel(testProto)); - assertEquals(Test.MATCH, testOff, DiagLevel.getLevel(testProxy)); - assertEquals(Test.MATCH, testOff, DiagLevel.getLevel(testTran)); - assertEquals(Test.MATCH, testOff, DiagLevel.getLevel(testApp)); - assertEquals(Test.MATCH, testOff, DiagLevel.getLevel(testRpc)); - assertEquals(Test.MATCH, testOff, DiagLevel.getLevel(testMar)); + assertEquals(TestValues.MATCH, testOff, DiagLevel.getLevel(testProto)); + assertEquals(TestValues.MATCH, testOff, DiagLevel.getLevel(testProxy)); + assertEquals(TestValues.MATCH, testOff, DiagLevel.getLevel(testTran)); + assertEquals(TestValues.MATCH, testOff, DiagLevel.getLevel(testApp)); + assertEquals(TestValues.MATCH, testOff, DiagLevel.getLevel(testRpc)); + assertEquals(TestValues.MATCH, testOff, DiagLevel.getLevel(testMar)); DiagLevel.setLevel(testMar, testVerbose); - assertEquals(Test.MATCH, testVerbose, DiagLevel.getLevel(testMar)); + assertEquals(TestValues.MATCH, testVerbose, DiagLevel.getLevel(testMar)); DiagLevel.setLevel(testMar, testTerse); - assertEquals(Test.MATCH, testTerse, DiagLevel.getLevel(testMar)); + assertEquals(TestValues.MATCH, testTerse, DiagLevel.getLevel(testMar)); DiagLevel.setLevel(testMar, testOff); - assertEquals(Test.MATCH, testOff, DiagLevel.getLevel(testMar)); + assertEquals(TestValues.MATCH, testOff, DiagLevel.getLevel(testMar)); DiagLevel.setLevel(testRpc, testVerbose); - assertEquals(Test.MATCH, testVerbose, DiagLevel.getLevel(testRpc)); + assertEquals(TestValues.MATCH, testVerbose, DiagLevel.getLevel(testRpc)); DiagLevel.setLevel(testRpc, testTerse); - assertEquals(Test.MATCH, testTerse, DiagLevel.getLevel(testRpc)); + assertEquals(TestValues.MATCH, testTerse, DiagLevel.getLevel(testRpc)); DiagLevel.setLevel(testRpc, testOff); - assertEquals(Test.MATCH, testOff, DiagLevel.getLevel(testRpc)); + assertEquals(TestValues.MATCH, testOff, DiagLevel.getLevel(testRpc)); DiagLevel.setLevel(testApp, testVerbose); - assertEquals(Test.MATCH, testVerbose, DiagLevel.getLevel(testApp)); + assertEquals(TestValues.MATCH, testVerbose, DiagLevel.getLevel(testApp)); DiagLevel.setLevel(testApp, testTerse); - assertEquals(Test.MATCH, testTerse, DiagLevel.getLevel(testApp)); + assertEquals(TestValues.MATCH, testTerse, DiagLevel.getLevel(testApp)); DiagLevel.setLevel(testApp, testOff); - assertEquals(Test.MATCH, testOff, DiagLevel.getLevel(testApp)); + assertEquals(TestValues.MATCH, testOff, DiagLevel.getLevel(testApp)); DiagLevel.setLevel(testTran, testVerbose); - assertEquals(Test.MATCH, testVerbose, DiagLevel.getLevel(testTran)); + assertEquals(TestValues.MATCH, testVerbose, DiagLevel.getLevel(testTran)); DiagLevel.setLevel(testTran, testTerse); - assertEquals(Test.MATCH, testTerse, DiagLevel.getLevel(testTran)); + assertEquals(TestValues.MATCH, testTerse, DiagLevel.getLevel(testTran)); DiagLevel.setLevel(testTran, testOff); - assertEquals(Test.MATCH, testOff, DiagLevel.getLevel(testTran)); + assertEquals(TestValues.MATCH, testOff, DiagLevel.getLevel(testTran)); DiagLevel.setLevel(testProxy, testVerbose); - assertEquals(Test.MATCH, testVerbose, DiagLevel.getLevel(testProxy)); + assertEquals(TestValues.MATCH, testVerbose, DiagLevel.getLevel(testProxy)); DiagLevel.setLevel(testProxy, testTerse); - assertEquals(Test.MATCH, testTerse, DiagLevel.getLevel(testProxy)); + assertEquals(TestValues.MATCH, testTerse, DiagLevel.getLevel(testProxy)); DiagLevel.setLevel(testProxy, testOff); - assertEquals(Test.MATCH, testOff, DiagLevel.getLevel(testProxy)); + assertEquals(TestValues.MATCH, testOff, DiagLevel.getLevel(testProxy)); DiagLevel.setLevel(testProto, testVerbose); - assertEquals(Test.MATCH, testVerbose, DiagLevel.getLevel(testProto)); + assertEquals(TestValues.MATCH, testVerbose, DiagLevel.getLevel(testProto)); DiagLevel.setLevel(testProto, testTerse); - assertEquals(Test.MATCH, testTerse, DiagLevel.getLevel(testProto)); + assertEquals(TestValues.MATCH, testTerse, DiagLevel.getLevel(testProto)); DiagLevel.setLevel(testProto, testOff); - assertEquals(Test.MATCH, testOff, DiagLevel.getLevel(testProto)); + assertEquals(TestValues.MATCH, testOff, DiagLevel.getLevel(testProto)); - assertTrue(Test.TRUE, DiagLevel.isValidDetailLevel(testVerboseS)); - assertTrue(Test.TRUE, DiagLevel.isValidDetailLevel(testTerseS)); - assertTrue(Test.TRUE, DiagLevel.isValidDetailLevel(testOffS)); + assertTrue(TestValues.TRUE, DiagLevel.isValidDetailLevel(testVerboseS)); + assertTrue(TestValues.TRUE, DiagLevel.isValidDetailLevel(testTerseS)); + assertTrue(TestValues.TRUE, DiagLevel.isValidDetailLevel(testOffS)); - assertEquals(Test.MATCH, testVerbose, DiagLevel.toDetailLevel(testVerboseS)); - assertEquals(Test.MATCH, testTerse, DiagLevel.toDetailLevel(testTerseS)); - assertEquals(Test.MATCH, testOff, DiagLevel.toDetailLevel(testOffS)); - assertEquals(Test.MATCH, testOff, DiagLevel.toDetailLevel(testInvalidS)); + assertEquals(TestValues.MATCH, testVerbose, DiagLevel.toDetailLevel(testVerboseS)); + assertEquals(TestValues.MATCH, testTerse, DiagLevel.toDetailLevel(testTerseS)); + assertEquals(TestValues.MATCH, testOff, DiagLevel.toDetailLevel(testOffS)); + assertEquals(TestValues.MATCH, testOff, DiagLevel.toDetailLevel(testInvalidS)); try { // Invalid/Null Tests - assertFalse(Test.FALSE, DiagLevel.isValidDetailLevel(testInvalidS)); - assertFalse(Test.FALSE, DiagLevel.isValidDetailLevel(null)); - assertNull(Test.NULL, DiagLevel.getLevel(null)); + assertFalse(TestValues.FALSE, DiagLevel.isValidDetailLevel(testInvalidS)); + assertFalse(TestValues.FALSE, DiagLevel.isValidDetailLevel(null)); + assertNull(TestValues.NULL, DiagLevel.getLevel(null)); DiagLevel.setLevel(null, null); DiagLevel.setAllLevels(null); } catch (NullPointerException e) { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/MimeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/MimeTests.java index 34c5c1936..c28d4af87 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/MimeTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/MimeTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.trace; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.trace.Mime; import junit.framework.TestCase; @@ -37,15 +37,15 @@ public class MimeTests extends TestCase { String actualEncodedString3 = Mime.base64Encode(testBytes, 0, testBytes.length); // Valid Tests - assertEquals(Test.MATCH, expectedEncodedString, actualEncodedString1); - assertEquals(Test.MATCH, expectedEncodedString, actualEncodedString2); - assertEquals(Test.MATCH, expectedEncodedString, actualEncodedString3); + assertEquals(TestValues.MATCH, expectedEncodedString, actualEncodedString1); + assertEquals(TestValues.MATCH, expectedEncodedString, actualEncodedString2); + assertEquals(TestValues.MATCH, expectedEncodedString, actualEncodedString3); // Invalid/Null Tests - assertNull(Test.NULL, actualNullResult1); - assertNull(Test.NULL, actualNullResult2); - assertNull(Test.NULL, actualNullResult3); - assertNull(Test.NULL, actualInvalidResult); + assertNull(TestValues.NULL, actualNullResult1); + assertNull(TestValues.NULL, actualNullResult2); + assertNull(TestValues.NULL, actualNullResult3); + assertNull(TestValues.NULL, actualInvalidResult); } catch (UnsupportedEncodingException e) { e.printStackTrace(); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/SdlTraceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/SdlTraceTests.java index a46e35542..1a770f609 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/SdlTraceTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/SdlTraceTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.trace; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.trace.DiagLevel; import com.smartdevicelink.trace.SdlTrace; import com.smartdevicelink.trace.enums.DetailLevel; @@ -22,14 +22,14 @@ public class SdlTraceTests extends TestCase { public void testAdjustmentFlags () { SdlTrace.setAcceptAPITraceAdjustments(true); - assertTrue(Test.TRUE, SdlTrace.getAcceptAPITraceAdjustments()); + assertTrue(TestValues.TRUE, SdlTrace.getAcceptAPITraceAdjustments()); SdlTrace.setAcceptAPITraceAdjustments(false); - assertFalse(Test.FALSE, SdlTrace.getAcceptAPITraceAdjustments()); + assertFalse(TestValues.FALSE, SdlTrace.getAcceptAPITraceAdjustments()); // This should not change the value from the previous setting. SdlTrace.setAcceptAPITraceAdjustments(null); - assertFalse(Test.FALSE, SdlTrace.getAcceptAPITraceAdjustments()); + assertFalse(TestValues.FALSE, SdlTrace.getAcceptAPITraceAdjustments()); } /** @@ -47,75 +47,75 @@ public class SdlTraceTests extends TestCase { // App Trace Level - - - - - - - - - - - - - - - - - - - - - - - - - - - SdlTrace.setAppTraceLevel(DetailLevel.VERBOSE); - assertEquals(Test.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.app)); + assertEquals(TestValues.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.app)); SdlTrace.setAppTraceLevel(DetailLevel.TERSE); - assertEquals(Test.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.app)); + assertEquals(TestValues.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.app)); SdlTrace.setAppTraceLevel(DetailLevel.OFF); - assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.app)); + assertEquals(TestValues.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.app)); // This should not change the value from the previous setting. SdlTrace.setAppTraceLevel(null); - assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.app)); + assertEquals(TestValues.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.app)); // Proxy Trace Level - - - - - - - - - - - - - - - - - - - - - - - - - - SdlTrace.setProxyTraceLevel(DetailLevel.VERBOSE); - assertEquals(Test.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.proxy)); + assertEquals(TestValues.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.proxy)); SdlTrace.setProxyTraceLevel(DetailLevel.TERSE); - assertEquals(Test.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.proxy)); + assertEquals(TestValues.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.proxy)); SdlTrace.setProxyTraceLevel(DetailLevel.OFF); - assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.proxy)); + assertEquals(TestValues.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.proxy)); // This should not change the value from the previous setting. SdlTrace.setProxyTraceLevel(null); - assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.proxy)); + assertEquals(TestValues.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.proxy)); // Rpc Trace Level - - - - - - - - - - - - - - - - - - - - - - - - - - - SdlTrace.setRpcTraceLevel(DetailLevel.VERBOSE); - assertEquals(Test.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.rpc)); + assertEquals(TestValues.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.rpc)); SdlTrace.setRpcTraceLevel(DetailLevel.TERSE); - assertEquals(Test.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.rpc)); + assertEquals(TestValues.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.rpc)); SdlTrace.setRpcTraceLevel(DetailLevel.OFF); - assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.rpc)); + assertEquals(TestValues.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.rpc)); // This should not change the value from the previous setting. SdlTrace.setRpcTraceLevel(null); - assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.rpc)); + assertEquals(TestValues.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.rpc)); // Marshalling Trace Level - - - - - - - - - - - - - - - - - - - - - - - SdlTrace.setMarshallingTraceLevel(DetailLevel.VERBOSE); - assertEquals(Test.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.mar)); + assertEquals(TestValues.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.mar)); SdlTrace.setMarshallingTraceLevel(DetailLevel.TERSE); - assertEquals(Test.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.mar)); + assertEquals(TestValues.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.mar)); SdlTrace.setMarshallingTraceLevel(DetailLevel.OFF); - assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.mar)); + assertEquals(TestValues.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.mar)); // This should not change the value from the previous setting. SdlTrace.setMarshallingTraceLevel(null); - assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.mar)); + assertEquals(TestValues.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.mar)); // Protocol Trace Level - - - - - - - - - - - - - - - - - - - - - - - - SdlTrace.setProtocolTraceLevel(DetailLevel.VERBOSE); - assertEquals(Test.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.proto)); + assertEquals(TestValues.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.proto)); SdlTrace.setProtocolTraceLevel(DetailLevel.TERSE); - assertEquals(Test.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.proto)); + assertEquals(TestValues.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.proto)); SdlTrace.setProtocolTraceLevel(DetailLevel.OFF); - assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.proto)); + assertEquals(TestValues.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.proto)); // This should not change the value from the previous setting. SdlTrace.setProtocolTraceLevel(null); - assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.proto)); + assertEquals(TestValues.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.proto)); // Transport Trace Level - - - - - - - - - - - - - - - - - - - - - - - - SdlTrace.setTransportTraceLevel(DetailLevel.VERBOSE); - assertEquals(Test.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.tran)); + assertEquals(TestValues.MATCH, DetailLevel.VERBOSE, DiagLevel.getLevel(Mod.tran)); SdlTrace.setTransportTraceLevel(DetailLevel.TERSE); - assertEquals(Test.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.tran)); + assertEquals(TestValues.MATCH, DetailLevel.TERSE, DiagLevel.getLevel(Mod.tran)); SdlTrace.setTransportTraceLevel(DetailLevel.OFF); - assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.tran)); + assertEquals(TestValues.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.tran)); // This should not change the value from the previous setting. SdlTrace.setTransportTraceLevel(null); - assertEquals(Test.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.tran)); + assertEquals(TestValues.MATCH, DetailLevel.OFF, DiagLevel.getLevel(Mod.tran)); } // NOTE : No testing can currently be done for the logging methods. diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/DetailLevelTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/DetailLevelTests.java index 5f4301b0d..07cd3e56e 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/DetailLevelTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/DetailLevelTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.trace.enums; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.trace.enums.DetailLevel; import junit.framework.TestCase; @@ -45,14 +45,14 @@ public class DetailLevelTests extends TestCase { List<DetailLevel> actualEnumList = Arrays.asList(DetailLevel.values()); // Valid Tests - assertEquals(Test.MATCH, expectedOffEnum, actualOffEnum); - assertEquals(Test.MATCH, expectedTerseEnum, actualTerseEnum); - assertEquals(Test.MATCH, expectedVerboseEnum, actualVerboseEnum); - assertTrue(Test.ARRAY, expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList)); + assertEquals(TestValues.MATCH, expectedOffEnum, actualOffEnum); + assertEquals(TestValues.MATCH, expectedTerseEnum, actualTerseEnum); + assertEquals(TestValues.MATCH, expectedVerboseEnum, actualVerboseEnum); + assertTrue(TestValues.ARRAY, expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList)); // Invalid/Null Tests - assertNull(Test.NULL, actualInvalidEnum); - assertNull(Test.NULL, actualNullEnum); + assertNull(TestValues.NULL, actualInvalidEnum); + assertNull(TestValues.NULL, actualNullEnum); }catch (NullPointerException e) { fail("Could not retrieve value for null string, should return null."); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/InterfaceActivityDirectionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/InterfaceActivityDirectionTests.java index 9ee0fff13..32aae24b1 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/InterfaceActivityDirectionTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/InterfaceActivityDirectionTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.trace.enums; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.trace.enums.InterfaceActivityDirection; import junit.framework.TestCase; @@ -45,14 +45,14 @@ public class InterfaceActivityDirectionTests extends TestCase { List<InterfaceActivityDirection> actualEnumList = Arrays.asList(InterfaceActivityDirection.values()); // Valid Tests - assertEquals(Test.MATCH, expectedNoneEnum, actualNoneEnum); - assertEquals(Test.MATCH, expectedReceiveEnum, actualReceiveEnum); - assertEquals(Test.MATCH, expectedTransmitEnum, actualTransmitEnum); - assertTrue(Test.ARRAY, expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList)); + assertEquals(TestValues.MATCH, expectedNoneEnum, actualNoneEnum); + assertEquals(TestValues.MATCH, expectedReceiveEnum, actualReceiveEnum); + assertEquals(TestValues.MATCH, expectedTransmitEnum, actualTransmitEnum); + assertTrue(TestValues.ARRAY, expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList)); // Invalid/Null - assertNull(Test.NULL, actualInvalidEnum); - assertNull(Test.NULL, actualNullEnum); + assertNull(TestValues.NULL, actualInvalidEnum); + assertNull(TestValues.NULL, actualNullEnum); } catch (NullPointerException e) { fail("Could not retrieve value for null string, should return null."); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/ModTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/ModTests.java index f1f856ef9..c2621d789 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/ModTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/trace/enums/ModTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.trace.enums; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.trace.enums.Mod; import junit.framework.TestCase; @@ -57,17 +57,17 @@ public class ModTests extends TestCase { List<Mod> actualEnumList = Arrays.asList(Mod.values()); // Valid Tests - assertEquals(Test.MATCH, expectedAppEnum, actualAppEnum); - assertEquals(Test.MATCH, expectedRpcEnum, actualRpcEnum); - assertEquals(Test.MATCH, expectedMarEnum, actualMarEnum); - assertEquals(Test.MATCH, expectedTranEnum, actualTranEnum); - assertEquals(Test.MATCH, expectedProtoEnum, actualProtoEnum); - assertEquals(Test.MATCH, expectedProxyEnum, actualProxyEnum); - assertTrue(Test.ARRAY, expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList)); + assertEquals(TestValues.MATCH, expectedAppEnum, actualAppEnum); + assertEquals(TestValues.MATCH, expectedRpcEnum, actualRpcEnum); + assertEquals(TestValues.MATCH, expectedMarEnum, actualMarEnum); + assertEquals(TestValues.MATCH, expectedTranEnum, actualTranEnum); + assertEquals(TestValues.MATCH, expectedProtoEnum, actualProtoEnum); + assertEquals(TestValues.MATCH, expectedProxyEnum, actualProxyEnum); + assertTrue(TestValues.ARRAY, expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList)); // Invalid/Null Tests - assertNull(Test.NULL, actualInvalidEnum); - assertNull(Test.NULL, actualNullEnum); + assertNull(TestValues.NULL, actualInvalidEnum); + assertNull(TestValues.NULL, actualNullEnum); } catch (NullPointerException e) { fail("Could not retrieve value for null string, should return null."); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BTTransportConfigTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BTTransportConfigTests.java index 973cdaa16..edb932f62 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BTTransportConfigTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BTTransportConfigTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.transport; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.transport.BTTransportConfig; import com.smartdevicelink.transport.enums.TransportType; @@ -31,13 +31,13 @@ public class BTTransportConfigTests extends TestCase { TransportType actualTransportType = testConfig1.getTransportType(); // Valid Tests - assertEquals(Test.MATCH, expectedTransportType, actualTransportType); - assertTrue(Test.TRUE, actualShareConnection); + assertEquals(TestValues.MATCH, expectedTransportType, actualTransportType); + assertTrue(TestValues.TRUE, actualShareConnection); testConfig1.setKeepSocketActive(true); - assertTrue(Test.TRUE, testConfig1.getKeepSocketActive()); + assertTrue(TestValues.TRUE, testConfig1.getKeepSocketActive()); testConfig1.setKeepSocketActive(false); - assertFalse(Test.FALSE, testConfig1.getKeepSocketActive()); + assertFalse(TestValues.FALSE, testConfig1.getKeepSocketActive()); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BaseTransportConfigTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BaseTransportConfigTests.java index 6336851fe..d5f6629bd 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BaseTransportConfigTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BaseTransportConfigTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.transport; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.transport.BaseTransportConfig; import com.smartdevicelink.transport.enums.TransportType; @@ -31,12 +31,12 @@ public class BaseTransportConfigTests extends TestCase { int actualMaxValue = testBaseTransportConfig.getHeartBeatTimeout(); // Valid Tests - assertNotNull(Test.NOT_NULL, testBaseTransportConfig); - assertEquals(Test.MATCH, expectedMaxValue, actualMaxValue); - assertTrue(Test.TRUE, actualShareConnection); + assertNotNull(TestValues.NOT_NULL, testBaseTransportConfig); + assertEquals(TestValues.MATCH, expectedMaxValue, actualMaxValue); + assertTrue(TestValues.TRUE, actualShareConnection); testBaseTransportConfig.setHeartBeatTimeout(testInt); - assertEquals(Test.MATCH, testInt, testBaseTransportConfig.getHeartBeatTimeout()); + assertEquals(TestValues.MATCH, testInt, testBaseTransportConfig.getHeartBeatTimeout()); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/SdlPsmTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/SdlPsmTests.java index e6398853a..cca9171c8 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/SdlPsmTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/SdlPsmTests.java @@ -4,7 +4,7 @@ import android.util.Log; import com.smartdevicelink.protocol.SdlPacket; import com.smartdevicelink.protocol.WiProProtocol; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.transport.SdlPsm; import junit.framework.TestCase; @@ -55,7 +55,7 @@ public class SdlPsmTests extends TestCase { dataLength.set(sdlPsm, MAX_DATA_LENGTH + 1); int STATE = (Integer) transitionOnInput.invoke(sdlPsm, rawByte, SdlPsm.DATA_SIZE_4_STATE); - assertEquals(Test.MATCH, SdlPsm.ERROR_STATE, STATE); + assertEquals(TestValues.MATCH, SdlPsm.ERROR_STATE, STATE); }catch (Exception e){ Log.e(TAG, e.toString()); } @@ -71,7 +71,7 @@ public class SdlPsmTests extends TestCase { dataLength.set(sdlPsm, MAX_DATA_LENGTH); int STATE = (Integer) transitionOnInput.invoke(sdlPsm, rawByte, SdlPsm.DATA_SIZE_4_STATE); - assertEquals(Test.MATCH, SdlPsm.DATA_PUMP_STATE, STATE); + assertEquals(TestValues.MATCH, SdlPsm.DATA_PUMP_STATE, STATE); }catch (Exception e){ Log.e(TAG, e.toString()); } @@ -86,7 +86,7 @@ public class SdlPsmTests extends TestCase { dataLength.set(sdlPsm, 2147483647); int STATE = (Integer) transitionOnInput.invoke(sdlPsm, rawByte, SdlPsm.DATA_SIZE_4_STATE); - assertEquals(Test.MATCH, SdlPsm.ERROR_STATE, STATE); + assertEquals(TestValues.MATCH, SdlPsm.ERROR_STATE, STATE); }catch (Exception e){ Log.e(TAG, e.toString()); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TCPTransportConfigTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TCPTransportConfigTests.java index f08deea5a..fded19fd5 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TCPTransportConfigTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TCPTransportConfigTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.transport; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.transport.TCPTransportConfig; import com.smartdevicelink.transport.enums.TransportType; @@ -41,14 +41,14 @@ public class TCPTransportConfigTests extends TestCase { TransportType actualTransportType = testConfig1.getTransportType(); // Valid Tests - assertEquals(Test.MATCH, testInt, actualPort); - assertEquals(Test.MATCH, testString, actualIpAddress); - assertEquals(Test.MATCH, testBoolean, actualAutoReconnect); - assertEquals(Test.MATCH, expectedTransportType, actualTransportType); - assertEquals(Test.MATCH, expectedToString1, actualToString1); - assertEquals(Test.MATCH, expectedToString2, actualToString2); + assertEquals(TestValues.MATCH, testInt, actualPort); + assertEquals(TestValues.MATCH, testString, actualIpAddress); + assertEquals(TestValues.MATCH, testBoolean, actualAutoReconnect); + assertEquals(TestValues.MATCH, expectedTransportType, actualTransportType); + assertEquals(TestValues.MATCH, expectedToString1, actualToString1); + assertEquals(TestValues.MATCH, expectedToString2, actualToString2); // Invalid/Null Tests - assertNull(Test.NULL, actualNullString); + assertNull(TestValues.NULL, actualNullString); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TransportTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TransportTypeTests.java index 62f5a322a..dc54b2197 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TransportTypeTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/TransportTypeTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.transport; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.transport.enums.TransportType; import junit.framework.TestCase; @@ -59,17 +59,17 @@ public class TransportTypeTests extends TestCase { List<TransportType> actualEnumList = Arrays.asList(TransportType.values()); // Valid Tests - assertEquals(Test.MATCH, expectedTcpEnum, actualTcpEnum); - assertEquals(Test.MATCH, expectedUsbEnum, actualUsbEnum); - assertEquals(Test.MATCH, expectedBluetoothEnum, actualBluetoothEnum); - assertEquals(Test.MATCH, expectedMultiplexingEnum, actualMultiplexingEnum); - assertEquals(Test.MATCH, expectedWebSocketServerEnum, actualWebSocketServerEnum); - assertEquals(Test.MATCH, expectedCustomEnum, actualCustomEnum); - assertTrue(Test.ARRAY, expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList)); + assertEquals(TestValues.MATCH, expectedTcpEnum, actualTcpEnum); + assertEquals(TestValues.MATCH, expectedUsbEnum, actualUsbEnum); + assertEquals(TestValues.MATCH, expectedBluetoothEnum, actualBluetoothEnum); + assertEquals(TestValues.MATCH, expectedMultiplexingEnum, actualMultiplexingEnum); + assertEquals(TestValues.MATCH, expectedWebSocketServerEnum, actualWebSocketServerEnum); + assertEquals(TestValues.MATCH, expectedCustomEnum, actualCustomEnum); + assertTrue(TestValues.ARRAY, expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList)); // Invalid/Null Tests - assertNull(Test.NULL, actualInvalidEnum); - assertNull(Test.NULL, actualNullEnum); + assertNull(TestValues.NULL, actualInvalidEnum); + assertNull(TestValues.NULL, actualNullEnum); } catch (NullPointerException e) { fail("Could not retrieve value for null string, should return null."); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/BitConverterTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/BitConverterTests.java index fb6eed3f9..4fd0ca2cb 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/BitConverterTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/BitConverterTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.util; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.util.BitConverter; import junit.framework.TestCase; @@ -36,9 +36,9 @@ public class BitConverterTests extends TestCase { assertTrue("Arrays should match.", Arrays.equals(testBytes, actualBytes)); // Invalid/Null Tests - assertNull(Test.NULL, BitConverter.bytesToHex(null)); - assertNull(Test.NULL, BitConverter.bytesToHex(null, 0, 0)); - assertNull(Test.NULL, BitConverter.hexToBytes(null)); + assertNull(TestValues.NULL, BitConverter.bytesToHex(null)); + assertNull(TestValues.NULL, BitConverter.bytesToHex(null, 0, 0)); + assertNull(TestValues.NULL, BitConverter.hexToBytes(null)); } /** @@ -57,11 +57,11 @@ public class BitConverterTests extends TestCase { int actualNullBytes = BitConverter.intFromByteArray(null, 0); // Valid Tests - assertEquals(Test.MATCH, expectedInt.intValue(), actualInt); - assertTrue(Test.ARRAY, Arrays.equals(expectedBytes, actualBytes)); + assertEquals(TestValues.MATCH, expectedInt.intValue(), actualInt); + assertTrue(TestValues.ARRAY, Arrays.equals(expectedBytes, actualBytes)); // Invalid/Null Tests - assertEquals(Test.MATCH, (int) -1, actualNullBytes); + assertEquals(TestValues.MATCH, (int) -1, actualNullBytes); } /** @@ -79,10 +79,10 @@ public class BitConverterTests extends TestCase { short actualNullBytes = BitConverter.shortFromByteArray(null, 0); // Valid Tests - assertEquals(Test.MATCH, expectedShort, actualShort); - assertTrue(Test.ARRAY, Arrays.equals(expectedBytes, actualBytes)); + assertEquals(TestValues.MATCH, expectedShort, actualShort); + assertTrue(TestValues.ARRAY, Arrays.equals(expectedBytes, actualBytes)); // Invalid/Null Tests - assertEquals(Test.MATCH, (short) -1, actualNullBytes); + assertEquals(TestValues.MATCH, (short) -1, actualNullBytes); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/ByteEnumerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/ByteEnumerTests.java index b056d4fdf..0cf0efc47 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/ByteEnumerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/ByteEnumerTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.util; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.util.ByteEnumer; import junit.framework.TestCase; @@ -37,15 +37,15 @@ public class ByteEnumerTests extends TestCase { String actualNullString = testObject.getName(); // Valid Tests - assertNotNull(Test.NOT_NULL, expectedObject); - assertEquals(Test.MATCH, testByte, actualByte1); - assertEquals(Test.MATCH, testByte, actualByte2); - assertEquals(Test.MATCH, testString, actualString); - assertTrue(Test.TRUE, actualObject.equals(expectedObject)); - assertTrue(Test.TRUE, actualObject.eq(expectedObject)); + assertNotNull(TestValues.NOT_NULL, expectedObject); + assertEquals(TestValues.MATCH, testByte, actualByte1); + assertEquals(TestValues.MATCH, testByte, actualByte2); + assertEquals(TestValues.MATCH, testString, actualString); + assertTrue(TestValues.TRUE, actualObject.equals(expectedObject)); + assertTrue(TestValues.TRUE, actualObject.eq(expectedObject)); // Invalid/Null Tests - assertNull(Test.NULL, actualNullString); + assertNull(TestValues.NULL, actualNullString); } /** @@ -73,15 +73,15 @@ public class ByteEnumerTests extends TestCase { testInvalidList.add(testString2); // Valid Tests - assertEquals(Test.MATCH, expectedObject1, ByteEnumer.get(testList, testByte1)); - assertEquals(Test.MATCH, expectedObject1, ByteEnumer.get(testList, testString1)); - assertEquals(Test.MATCH, expectedObject2, ByteEnumer.get(testList, testByte2)); - assertEquals(Test.MATCH, expectedObject2, ByteEnumer.get(testList, testString2)); + assertEquals(TestValues.MATCH, expectedObject1, ByteEnumer.get(testList, testByte1)); + assertEquals(TestValues.MATCH, expectedObject1, ByteEnumer.get(testList, testString1)); + assertEquals(TestValues.MATCH, expectedObject2, ByteEnumer.get(testList, testByte2)); + assertEquals(TestValues.MATCH, expectedObject2, ByteEnumer.get(testList, testString2)); // Invalid/Null Tests - assertNull(Test.NULL, ByteEnumer.get(testList, null)); - assertNull(Test.NULL, ByteEnumer.get(testInvalidList, testByte1)); - assertNull(Test.NULL, ByteEnumer.get(testInvalidList, testString1)); + assertNull(TestValues.NULL, ByteEnumer.get(testList, null)); + assertNull(TestValues.NULL, ByteEnumer.get(testInvalidList, testByte1)); + assertNull(TestValues.NULL, ByteEnumer.get(testInvalidList, testString1)); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/CompareUtilsTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/CompareUtilsTest.java index 8bb3b378b..17929e909 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/CompareUtilsTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/CompareUtilsTest.java @@ -2,9 +2,10 @@ package com.smartdevicelink.test.util; import android.support.test.runner.AndroidJUnit4; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.util.CompareUtils; +import org.junit.Test; import org.junit.runner.RunWith; import static junit.framework.TestCase.assertFalse; @@ -13,43 +14,43 @@ import static junit.framework.TestCase.assertTrue; @RunWith(AndroidJUnit4.class) public class CompareUtilsTest { - @org.junit.Test + @Test public void testAreStringsEqual(){ - assertTrue(CompareUtils.areStringsEqual(Test.GENERAL_STRING, Test.GENERAL_STRING, true, true)); - assertTrue(CompareUtils.areStringsEqual(Test.GENERAL_STRING, Test.GENERAL_STRING, false, true)); - assertTrue(CompareUtils.areStringsEqual(Test.GENERAL_STRING, Test.GENERAL_STRING, true, false)); - assertTrue(CompareUtils.areStringsEqual(Test.GENERAL_STRING, Test.GENERAL_STRING, false, false)); + assertTrue(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING, true, true)); + assertTrue(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING, false, true)); + assertTrue(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING, true, false)); + assertTrue(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING, false, false)); - assertFalse(CompareUtils.areStringsEqual(Test.GENERAL_STRING, Test.GENERAL_APP_ID, true, true)); - assertFalse(CompareUtils.areStringsEqual(Test.GENERAL_STRING, Test.GENERAL_APP_ID, false, true)); - assertFalse(CompareUtils.areStringsEqual(Test.GENERAL_STRING, Test.GENERAL_APP_ID, true, false)); - assertFalse(CompareUtils.areStringsEqual(Test.GENERAL_STRING, Test.GENERAL_APP_ID, false, false)); + assertFalse(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING, TestValues.GENERAL_APP_ID, true, true)); + assertFalse(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING, TestValues.GENERAL_APP_ID, false, true)); + assertFalse(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING, TestValues.GENERAL_APP_ID, true, false)); + assertFalse(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING, TestValues.GENERAL_APP_ID, false, false)); - assertFalse(CompareUtils.areStringsEqual(Test.GENERAL_STRING, Test.GENERAL_STRING.toUpperCase(), false, false)); - assertFalse(CompareUtils.areStringsEqual(Test.GENERAL_STRING, Test.GENERAL_STRING.toUpperCase(), false, true)); - assertTrue(CompareUtils.areStringsEqual(Test.GENERAL_STRING, Test.GENERAL_STRING.toUpperCase(), true, false)); - assertTrue(CompareUtils.areStringsEqual(Test.GENERAL_STRING, Test.GENERAL_STRING.toUpperCase(), true, true)); + assertFalse(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING.toUpperCase(), false, false)); + assertFalse(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING.toUpperCase(), false, true)); + assertTrue(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING.toUpperCase(), true, false)); + assertTrue(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING.toUpperCase(), true, true)); - assertFalse(CompareUtils.areStringsEqual(Test.GENERAL_STRING.toUpperCase(), Test.GENERAL_STRING, false, false)); - assertFalse(CompareUtils.areStringsEqual(Test.GENERAL_STRING.toUpperCase(), Test.GENERAL_STRING, false, true)); - assertTrue(CompareUtils.areStringsEqual(Test.GENERAL_STRING.toUpperCase(), Test.GENERAL_STRING.toUpperCase(), true, false)); - assertTrue(CompareUtils.areStringsEqual(Test.GENERAL_STRING.toUpperCase(), Test.GENERAL_STRING.toUpperCase(), true, true)); + assertFalse(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING.toUpperCase(), TestValues.GENERAL_STRING, false, false)); + assertFalse(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING.toUpperCase(), TestValues.GENERAL_STRING, false, true)); + assertTrue(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING.toUpperCase(), TestValues.GENERAL_STRING.toUpperCase(), true, false)); + assertTrue(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING.toUpperCase(), TestValues.GENERAL_STRING.toUpperCase(), true, true)); assertTrue(CompareUtils.areStringsEqual(null, null, true, true)); assertFalse(CompareUtils.areStringsEqual(null, null, true, false)); assertTrue(CompareUtils.areStringsEqual(null, null, false, true)); assertFalse(CompareUtils.areStringsEqual(null, null, false, false)); - assertFalse(CompareUtils.areStringsEqual(Test.GENERAL_STRING, null, true, true)); - assertFalse(CompareUtils.areStringsEqual(Test.GENERAL_STRING, null, true, false)); - assertFalse(CompareUtils.areStringsEqual(Test.GENERAL_STRING, null, false, true)); - assertFalse(CompareUtils.areStringsEqual(Test.GENERAL_STRING, null, false, false)); + assertFalse(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING, null, true, true)); + assertFalse(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING, null, true, false)); + assertFalse(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING, null, false, true)); + assertFalse(CompareUtils.areStringsEqual(TestValues.GENERAL_STRING, null, false, false)); - assertFalse(CompareUtils.areStringsEqual(null, Test.GENERAL_STRING, false, true)); - assertFalse(CompareUtils.areStringsEqual(null, Test.GENERAL_STRING, false, false)); - assertFalse(CompareUtils.areStringsEqual(null, Test.GENERAL_STRING, true, true)); - assertFalse(CompareUtils.areStringsEqual(null, Test.GENERAL_STRING, true, false)); + assertFalse(CompareUtils.areStringsEqual(null, TestValues.GENERAL_STRING, false, true)); + assertFalse(CompareUtils.areStringsEqual(null, TestValues.GENERAL_STRING, false, false)); + assertFalse(CompareUtils.areStringsEqual(null, TestValues.GENERAL_STRING, true, true)); + assertFalse(CompareUtils.areStringsEqual(null, TestValues.GENERAL_STRING, true, false)); } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/DebugToolTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/DebugToolTests.java index d4fbacee0..62d159f26 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/DebugToolTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/DebugToolTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.util; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.util.DebugTool; import junit.framework.TestCase; @@ -19,9 +19,9 @@ public class DebugToolTests extends TestCase { */ public void testDebugEnableMethods () { DebugTool.enableDebugTool(); - assertTrue(Test.TRUE, DebugTool.isDebugEnabled()); + assertTrue(TestValues.TRUE, DebugTool.isDebugEnabled()); DebugTool.disableDebugTool(); - assertFalse(Test.FALSE, DebugTool.isDebugEnabled()); + assertFalse(TestValues.FALSE, DebugTool.isDebugEnabled()); } // NOTE : No testing can currently be done for the logging methods. diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/NativeLogToolTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/NativeLogToolTests.java index 38ab8a67f..6071ee9d2 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/NativeLogToolTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/NativeLogToolTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.util; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.util.NativeLogTool; import junit.framework.TestCase; @@ -45,14 +45,14 @@ public class NativeLogToolTests extends TestCase { List<NativeLogTool.LogTarget> actualEnumList = Arrays.asList(NativeLogTool.LogTarget.values()); // Valid Tests - assertEquals(Test.MATCH, expectedInfoEnum, actualInfoEnum); - assertEquals(Test.MATCH, expectedErrorEnum, actualErrorEnum); - assertEquals(Test.MATCH, expectedWarningEnum, actualWarningEnum); + assertEquals(TestValues.MATCH, expectedInfoEnum, actualInfoEnum); + assertEquals(TestValues.MATCH, expectedErrorEnum, actualErrorEnum); + assertEquals(TestValues.MATCH, expectedWarningEnum, actualWarningEnum); assertTrue("Contents should match.", expectedEnumList.containsAll(actualEnumList) && actualEnumList.containsAll(expectedEnumList)); // Invalid/Null Tests - assertNull(Test.NULL, actualInvalidEnum); - assertNull(Test.NULL, actualNullEnum); + assertNull(TestValues.NULL, actualInvalidEnum); + assertNull(TestValues.NULL, actualNullEnum); } catch (NullPointerException e) { fail("Could not retrieve value for null string, should return null."); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlDataTypeConverterTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlDataTypeConverterTests.java index 2792608c6..0912354d7 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlDataTypeConverterTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlDataTypeConverterTests.java @@ -1,6 +1,6 @@ package com.smartdevicelink.test.util; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.util.SdlDataTypeConverter; import junit.framework.TestCase; @@ -34,13 +34,13 @@ public class SdlDataTypeConverterTests extends TestCase { Double actualIntegerValue = SdlDataTypeConverter.objectToDouble(testInteger); // Valid Tests - assertEquals(Test.MATCH, expectedValue, actualDoubleValue); - assertEquals(Test.MATCH, expectedValue, actualIntegerValue); - assertEquals(Test.MATCH, expectedValue, actualFloatValue); + assertEquals(TestValues.MATCH, expectedValue, actualDoubleValue); + assertEquals(TestValues.MATCH, expectedValue, actualIntegerValue); + assertEquals(TestValues.MATCH, expectedValue, actualFloatValue); // Null Tests - assertNull(Test.NULL, actualNullValue); - assertNull(Test.NULL, actualLongValue); - assertNull(Test.NULL, actualShortValue); + assertNull(TestValues.NULL, actualNullValue); + assertNull(TestValues.NULL, actualLongValue); + assertNull(TestValues.NULL, actualShortValue); } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AppServiceFactory.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AppServiceFactory.java index 108d6e457..aa37eda2d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AppServiceFactory.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AppServiceFactory.java @@ -10,7 +10,7 @@ import com.smartdevicelink.proxy.rpc.SdlMsgVersion; import com.smartdevicelink.proxy.rpc.WeatherServiceManifest; import com.smartdevicelink.proxy.rpc.enums.AppServiceType; import com.smartdevicelink.proxy.rpc.enums.ServiceUpdateReason; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import java.util.ArrayList; import java.util.List; @@ -22,7 +22,7 @@ public class AppServiceFactory { AppServiceManifest manifest = new AppServiceManifest(); manifest.setServiceName(serviceName); - manifest.setRpcSpecVersion(new SdlMsgVersion(Test.MAX_RPC_VERSION_SUPPORTED)); + manifest.setRpcSpecVersion(new SdlMsgVersion(TestValues.MAX_RPC_VERSION_SUPPORTED)); manifest.setAllowAppConsumers(true); List<FunctionID> handledRPCs = new ArrayList<>(); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/util/MediaStreamingStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/util/MediaStreamingStatusTests.java index 13e0193f7..e4bf07a29 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/util/MediaStreamingStatusTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/util/MediaStreamingStatusTests.java @@ -9,10 +9,11 @@ import android.support.test.runner.AndroidJUnit4; import com.smartdevicelink.managers.SdlManager; import com.smartdevicelink.managers.SdlManagerListener; import com.smartdevicelink.proxy.rpc.enums.AppHMIType; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.transport.MultiplexTransportConfig; import org.junit.Before; +import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.invocation.InvocationOnMock; @@ -64,7 +65,7 @@ public class MediaStreamingStatusTests { } - @org.junit.Test + @Test public void testEmptyAudioDeviceInfoList(){ if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { assertNotNull(mockedContext); @@ -86,7 +87,7 @@ public class MediaStreamingStatusTests { } } - @org.junit.Test + @Test public void testNullAudioDeviceInfoList(){ if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { assertNotNull(mockedContext); @@ -103,13 +104,13 @@ public class MediaStreamingStatusTests { } - @org.junit.Test + @Test public void testSdlManagerMedia(){ - SdlManager.Builder builder = new SdlManager.Builder(getContext(), Test.GENERAL_FULL_APP_ID, Test.GENERAL_STRING, mock(SdlManagerListener.class)); + SdlManager.Builder builder = new SdlManager.Builder(getContext(), TestValues.GENERAL_FULL_APP_ID, TestValues.GENERAL_STRING, mock(SdlManagerListener.class)); Vector<AppHMIType> appType = new Vector<>(); appType.add(AppHMIType.MEDIA); builder.setAppTypes(appType); - MultiplexTransportConfig multiplexTransportConfig = new MultiplexTransportConfig(getContext(),Test.GENERAL_FULL_APP_ID); + MultiplexTransportConfig multiplexTransportConfig = new MultiplexTransportConfig(getContext(), TestValues.GENERAL_FULL_APP_ID); assertNull(multiplexTransportConfig.requiresAudioSupport()); builder.setTransportType(multiplexTransportConfig); @@ -121,13 +122,13 @@ public class MediaStreamingStatusTests { assertTrue(multiplexTransportConfig.requiresAudioSupport()); } - @org.junit.Test + @Test public void testSdlManagerNonMedia(){ - SdlManager.Builder builder = new SdlManager.Builder(getContext(), Test.GENERAL_FULL_APP_ID, Test.GENERAL_STRING, mock(SdlManagerListener.class)); + SdlManager.Builder builder = new SdlManager.Builder(getContext(), TestValues.GENERAL_FULL_APP_ID, TestValues.GENERAL_STRING, mock(SdlManagerListener.class)); Vector<AppHMIType> appType = new Vector<>(); appType.add(AppHMIType.DEFAULT); builder.setAppTypes(appType); - MultiplexTransportConfig multiplexTransportConfig = new MultiplexTransportConfig(getContext(),Test.GENERAL_FULL_APP_ID); + MultiplexTransportConfig multiplexTransportConfig = new MultiplexTransportConfig(getContext(), TestValues.GENERAL_FULL_APP_ID); assertNull(multiplexTransportConfig.requiresAudioSupport()); builder.setTransportType(multiplexTransportConfig); @@ -139,7 +140,7 @@ public class MediaStreamingStatusTests { assertFalse(multiplexTransportConfig.requiresAudioSupport()); } - @org.junit.Test + @Test public void testAcceptedBTDevices(){ MediaStreamingStatus mediaStreamingStatus = spy(new MediaStreamingStatus(getContext(), mock(MediaStreamingStatus.Callback.class))); @@ -154,7 +155,7 @@ public class MediaStreamingStatusTests { assertTrue(mediaStreamingStatus.isSupportedAudioDevice(AudioDeviceInfo.TYPE_BLUETOOTH_A2DP)); } - @org.junit.Test + @Test public void testAcceptedUSBDevices(){ MediaStreamingStatus mediaStreamingStatus = spy(new MediaStreamingStatus(getContext(), mock(MediaStreamingStatus.Callback.class))); @@ -172,7 +173,7 @@ public class MediaStreamingStatusTests { assertTrue(mediaStreamingStatus.isSupportedAudioDevice(AudioDeviceInfo.TYPE_DOCK)); } - @org.junit.Test + @Test public void testAcceptedLineDevices(){ assertTrue(defaultMediaStreamingStatus.isSupportedAudioDevice(AudioDeviceInfo.TYPE_LINE_ANALOG)); assertTrue(defaultMediaStreamingStatus.isSupportedAudioDevice(AudioDeviceInfo.TYPE_LINE_DIGITAL)); |