diff options
Diffstat (limited to 'android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMIPermissionsTests.java')
-rw-r--r-- | android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMIPermissionsTests.java | 34 |
1 files changed, 17 insertions, 17 deletions
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 98bf2f549..6c3279a6a 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 @@ -14,15 +14,15 @@ import java.util.Iterator; import java.util.List; /** - * This is a unit test class for the SmartDeviceLink library project class : + * This is a unit test class for the SmartDeviceLink library project class : * {@link com.smartdevicelink.proxy.rpc.HMIPermissions} */ -public class HMIPermissionsTests extends TestCase{ +public class HMIPermissionsTests extends TestCase { private HMIPermissions msg; @Override - public void setUp(){ + public void setUp() { msg = new HMIPermissions(); msg.setAllowed(TestValues.GENERAL_HMILEVEL_LIST); @@ -30,24 +30,24 @@ public class HMIPermissionsTests extends TestCase{ } /** - * Tests the expected values of the RPC message. - */ - public void testRpcValues () { - // Test Values + * Tests the expected values of the RPC message. + */ + public void testRpcValues() { + // Test Values List<HMILevel> allowed = msg.getAllowed(); List<HMILevel> disallowed = msg.getUserDisallowed(); // Valid Tests 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 < TestValues.GENERAL_HMILEVEL_LIST.size(); 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 < TestValues.GENERAL_HMILEVEL_LIST.size(); 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(TestValues.NOT_NULL, msg); @@ -56,10 +56,10 @@ public class HMIPermissionsTests extends TestCase{ assertNull(TestValues.NULL, msg.getUserDisallowed()); } - public void testJson(){ + public void testJson() { JSONObject reference = new JSONObject(); - try{ + try { reference.put(HMIPermissions.KEY_ALLOWED, TestValues.JSON_HMILEVELS); reference.put(HMIPermissions.KEY_USER_DISALLOWED, TestValues.JSON_HMILEVELS); @@ -67,18 +67,18 @@ public class HMIPermissionsTests extends TestCase{ assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); - while(iterator.hasNext()){ + while (iterator.hasNext()) { String key = (String) iterator.next(); List<String> referenceList = JsonUtils.readStringListFromJsonObject(reference, key); List<String> underTestList = JsonUtils.readStringListFromJsonObject(underTest, key); assertEquals(TestValues.MATCH, referenceList.size(), underTestList.size()); - for(int i = 0; i < referenceList.size(); i++){ + for (int i = 0; i < referenceList.size(); i++) { assertEquals(TestValues.MATCH, referenceList.get(i), underTestList.get(i)); } } - } catch(JSONException e){ - fail(TestValues.JSON_FAIL); + } catch (JSONException e) { + fail(TestValues.JSON_FAIL); } } }
\ No newline at end of file |