diff options
author | Joey Grover <joeygrover@gmail.com> | 2016-06-28 11:41:39 -0400 |
---|---|---|
committer | Joey Grover <joeygrover@gmail.com> | 2016-06-28 11:41:39 -0400 |
commit | 58d54cb436bbbf4d91ec533e85a6f0e43fe12374 (patch) | |
tree | 77262a4f56c8b3ff5f3c15bf43691720e9e51610 | |
parent | 91f0ce9cdd7350f2bdb916f630d489a20b5910d7 (diff) | |
download | sdl_android-58d54cb436bbbf4d91ec533e85a6f0e43fe12374.tar.gz |
Fixed merge issues and added a helper class for null values
14 files changed, 35 insertions, 568 deletions
diff --git a/sdl_android_lib/src/com/smartdevicelink/protocol/heartbeat/HeartbeatMonitor.java b/sdl_android_lib/src/com/smartdevicelink/protocol/heartbeat/HeartbeatMonitor.java index e74fdf17e..0b7051c27 100644 --- a/sdl_android_lib/src/com/smartdevicelink/protocol/heartbeat/HeartbeatMonitor.java +++ b/sdl_android_lib/src/com/smartdevicelink/protocol/heartbeat/HeartbeatMonitor.java @@ -26,6 +26,11 @@ public class HeartbeatMonitor implements IHeartbeatMonitor { public HeartbeatMonitor() {
}
+ // Methods used to retrieve values for unit testing only.
+ // See com/smartdevicelink/tests/protocol/heartbeat/HeartbeatMonitorTests.
+ public Runnable getHeartbeatRunnable () { return heartbeatTimeoutRunnable; }
+ public boolean isHeartbeatReceived () { return isHeartbeatReceived; }
+
private Runnable heartbeatTimeoutRunnable = new Runnable() {
@Override
diff --git a/sdl_android_tests/src/com/smartdevicelink/test/NullValues.java b/sdl_android_tests/src/com/smartdevicelink/test/NullValues.java new file mode 100644 index 000000000..ce5972887 --- /dev/null +++ b/sdl_android_tests/src/com/smartdevicelink/test/NullValues.java @@ -0,0 +1,15 @@ +package com.smartdevicelink.test; + +/** + * This class is to help with ambiguous method signatures. + * @author Joey Grover + * + */ +public class NullValues { + + public static final String STRING = null; + public static final Integer INTEGER = null; + public static final Boolean BOOLEAN = null; + public static final Double DOUBLE = null; + +} diff --git a/sdl_android_tests/src/com/smartdevicelink/test/proxy/RPCRequestFactoryTests.java b/sdl_android_tests/src/com/smartdevicelink/test/proxy/RPCRequestFactoryTests.java index df821c203..cd254af56 100644 --- a/sdl_android_tests/src/com/smartdevicelink/test/proxy/RPCRequestFactoryTests.java +++ b/sdl_android_tests/src/com/smartdevicelink/test/proxy/RPCRequestFactoryTests.java @@ -3,6 +3,7 @@ package com.smartdevicelink.test.proxy; import java.util.Vector; import junit.framework.TestCase; +import android.telephony.TelephonyManager; import com.smartdevicelink.proxy.RPCRequestFactory; import com.smartdevicelink.proxy.TTSChunkFactory; @@ -16,6 +17,7 @@ import com.smartdevicelink.proxy.rpc.DeleteCommand; import com.smartdevicelink.proxy.rpc.DeleteFile; import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSet; import com.smartdevicelink.proxy.rpc.DeleteSubMenu; +import com.smartdevicelink.proxy.rpc.DeviceInfo; import com.smartdevicelink.proxy.rpc.EndAudioPassThru; import com.smartdevicelink.proxy.rpc.GetVehicleData; import com.smartdevicelink.proxy.rpc.Image; @@ -53,6 +55,7 @@ import com.smartdevicelink.proxy.rpc.enums.Language; 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.Validator; @@ -571,7 +574,7 @@ public class RPCRequestFactoryTests extends TestCase { assertEquals(Test.MATCH, testOffset, testPF.getOffset()); assertEquals(Test.MATCH, testLength, testPF.getLength()); - testPF = RPCRequestFactory.buildPutFile(null, null, null); + testPF = RPCRequestFactory.buildPutFile(NullValues.STRING, NullValues.INTEGER, NullValues.INTEGER); assertNull(Test.NULL, testPF.getSdlFileName()); assertNull(Test.NULL, testPF.getOffset()); assertNull(Test.NULL, testPF.getLength()); @@ -584,7 +587,7 @@ public class RPCRequestFactoryTests extends TestCase { assertTrue(Test.TRUE, testPF.getPersistentFile()); assertEquals(Test.MATCH, testSystemFile, testPF.getSystemFile()); - testPF = RPCRequestFactory.buildPutFile(null, null, null, null, null, null); + 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()); @@ -607,6 +610,7 @@ public class RPCRequestFactoryTests extends TestCase { Language testLang = Language.EN_US, testHMILang = Language.EN_GB; Vector<AppHMIType> testHMIType = new Vector<AppHMIType>(); testHMIType.add(AppHMIType.DEFAULT); + DeviceInfo testDI = RPCRequestFactory.BuildDeviceInfo(null); RegisterAppInterface testRAI; // Test -- buildRegisterAppInterface(String appName, String appID) @@ -616,7 +620,7 @@ public class RPCRequestFactoryTests extends TestCase { // ^ Calls another build method. // 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); + 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())); @@ -628,8 +632,10 @@ public class RPCRequestFactoryTests extends TestCase { 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()); + - testRAI = RPCRequestFactory.buildRegisterAppInterface(null, null, null, null, null, null, null, null, null, null, null); + 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()); @@ -642,6 +648,7 @@ public class RPCRequestFactoryTests extends TestCase { assertNotNull(Test.NOT_NULL, testRAI.getHmiDisplayLanguageDesired()); assertNull(Test.NULL, testRAI.getAppHMIType()); assertNull(Test.NULL, testRAI.getAppID()); + assertNull(Test.NULL, testRAI.getDeviceInfo()); } public void testBuildSetAppIcon () { diff --git a/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/GearShiftAdviceStatusTests.java b/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/GearShiftAdviceStatusTests.java deleted file mode 100644 index 38d5ac713..000000000 --- a/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/GearShiftAdviceStatusTests.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.smartdevicelink.test.rpc.enums; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import junit.framework.TestCase; - -import com.smartdevicelink.proxy.rpc.enums.GearShiftAdviceStatus; - -/** - * This is a unit test class for the SmartDeviceLink library project class : - * {@link com.smartdevicelink.rpc.enums.GearShiftAdviceStatus} - */ -public class GearShiftAdviceStatusTests extends TestCase { - - /** - * Verifies that the enum values are not null upon valid assignment. - */ - public void testValidEnums () { - String example = "NO_INDICATION"; - GearShiftAdviceStatus enumNoIndication = GearShiftAdviceStatus.valueForString(example); - example = "UPSHIFT_FUEL_ECONOMY"; - GearShiftAdviceStatus enumUpshiftFuelEconomy = GearShiftAdviceStatus.valueForString(example); - example = "UPSHIFT_PERFORMANCE"; - GearShiftAdviceStatus enumUpshiftPerformance = GearShiftAdviceStatus.valueForString(example); - example = "UPSHIFT_WARNING"; - GearShiftAdviceStatus enumUpshiftWarning = GearShiftAdviceStatus.valueForString(example); - example = "DOWNSHIFT_RECOMMENDATION"; - GearShiftAdviceStatus enumDownshiftRecommendation = GearShiftAdviceStatus.valueForString(example); - example = "SHIFT_TO_NEUTRAL"; - GearShiftAdviceStatus enumShiftToNeutral = GearShiftAdviceStatus.valueForString(example); - - assertNotNull("NO_INDICATION returned null", enumNoIndication); - assertNotNull("UPSHIFT_FUEL_ECONOMY returned null", enumUpshiftFuelEconomy); - assertNotNull("UPSHIFT_PERFORMANCE returned null", enumUpshiftPerformance); - assertNotNull("UPSHIFT_WARNING returned null", enumUpshiftWarning); - assertNotNull("DOWNSHIFT_RECOMMENDATION returned null", enumDownshiftRecommendation); - assertNotNull("SHIFT_TO_NEUTRAL returned null", enumShiftToNeutral); - } - - /** - * Verifies that an invalid assignment is null. - */ - public void testInvalidEnum () { - String example = "no_INdICaTIon"; - try { - GearShiftAdviceStatus temp = GearShiftAdviceStatus.valueForString(example); - assertNull("Result of valueForString should be null.", temp); - } - catch (IllegalArgumentException exception) { - fail("Invalid enum throws IllegalArgumentException."); - } - } - - /** - * Verifies that a null assignment is invalid. - */ - public void testNullEnum () { - String example = null; - try { - GearShiftAdviceStatus temp = GearShiftAdviceStatus.valueForString(example); - assertNull("Result of valueForString should be null.", temp); - } - catch (NullPointerException exception) { - fail("Null string throws NullPointerException."); - } - } - - - /** - * Verifies the possible enum values of GearShiftAdviceStatus. - */ - public void testListEnum() { - List<GearShiftAdviceStatus> enumValueList = Arrays.asList(GearShiftAdviceStatus.values()); - - List<GearShiftAdviceStatus> enumTestList = new ArrayList<GearShiftAdviceStatus>(); - enumTestList.add(GearShiftAdviceStatus.NO_INDICATION); - enumTestList.add(GearShiftAdviceStatus.UPSHIFT_FUEL_ECONOMY); - enumTestList.add(GearShiftAdviceStatus.UPSHIFT_PERFORMANCE); - enumTestList.add(GearShiftAdviceStatus.UPSHIFT_WARNING); - enumTestList.add(GearShiftAdviceStatus.DOWNSHIFT_RECOMMENDATION); - enumTestList.add(GearShiftAdviceStatus.SHIFT_TO_NEUTRAL); - - assertTrue("Enum value list does not match enum class list", - enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList)); - } -}
\ No newline at end of file diff --git a/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/LightSwitchStatusTests.java b/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/LightSwitchStatusTests.java deleted file mode 100644 index cb020b9da..000000000 --- a/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/LightSwitchStatusTests.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.smartdevicelink.test.rpc.enums; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import junit.framework.TestCase; - -import com.smartdevicelink.proxy.rpc.enums.LightSwitchStatus; - -/** - * This is a unit test class for the SmartDeviceLink library project class : - * {@link com.smartdevicelink.rpc.enums.LightSwitchStatus} - */ -public class LightSwitchStatusTests extends TestCase { - - /** - * Verifies that the enum values are not null upon valid assignment. - */ - public void testValidEnums () { - String example = "OFF"; - LightSwitchStatus enumOff = LightSwitchStatus.valueForString(example); - example = "PARKLAMP"; - LightSwitchStatus enumParklamp = LightSwitchStatus.valueForString(example); - example = "HEADLAMP"; - LightSwitchStatus enumHeadlamp = LightSwitchStatus.valueForString(example); - example = "AUTOLAMP"; - LightSwitchStatus enumAutolamp = LightSwitchStatus.valueForString(example); - - assertNotNull("OFF returned null", enumOff); - assertNotNull("PARKLAMP returned null", enumParklamp); - assertNotNull("HEADLAMP returned null", enumHeadlamp); - assertNotNull("AUTOLAMP returned null", enumAutolamp); - } - - /** - * Verifies that an invalid assignment is null. - */ - public void testInvalidEnum () { - String example = "oFf"; - try { - LightSwitchStatus temp = LightSwitchStatus.valueForString(example); - assertNull("Result of valueForString should be null.", temp); - } - catch (IllegalArgumentException exception) { - fail("Invalid enum throws IllegalArgumentException."); - } - } - - /** - * Verifies that a null assignment is invalid. - */ - public void testNullEnum () { - String example = null; - try { - LightSwitchStatus temp = LightSwitchStatus.valueForString(example); - assertNull("Result of valueForString should be null.", temp); - } - catch (NullPointerException exception) { - fail("Null string throws NullPointerException."); - } - } - - /** - * Verifies the possible enum values of LightSwitchStatus. - */ - public void testListEnum() { - List<LightSwitchStatus> enumValueList = Arrays.asList(LightSwitchStatus.values()); - - List<LightSwitchStatus> enumTestList = new ArrayList<LightSwitchStatus>(); - enumTestList.add(LightSwitchStatus.OFF); - enumTestList.add(LightSwitchStatus.PARKLAMP); - enumTestList.add(LightSwitchStatus.HEADLAMP); - enumTestList.add(LightSwitchStatus.AUTOLAMP); - - assertTrue("Enum value list does not match enum class list", - enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList)); - } -}
\ No newline at end of file diff --git a/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/MaintenanceModeStatusTests.java b/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/MaintenanceModeStatusTests.java deleted file mode 100644 index 6a63acaad..000000000 --- a/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/MaintenanceModeStatusTests.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.smartdevicelink.test.rpc.enums; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import junit.framework.TestCase; - -import com.smartdevicelink.proxy.rpc.enums.MaintenanceModeStatus; - -/** - * This is a unit test class for the SmartDeviceLink library project class : - * {@link com.smartdevicelink.rpc.enums.MaintenanceModeStatus} - */ -public class MaintenanceModeStatusTests extends TestCase { - - /** - * Verifies that the enum values are not null upon valid assignment. - */ - public void testValidEnums () { - String example = "NORMAL"; - MaintenanceModeStatus enumNormal = MaintenanceModeStatus.valueForString(example); - example = "NEAR"; - MaintenanceModeStatus enumNear = MaintenanceModeStatus.valueForString(example); - example = "ACTIVE"; - MaintenanceModeStatus enumActive = MaintenanceModeStatus.valueForString(example); - example = "FEATURE_NOT_PRESENT"; - MaintenanceModeStatus enumFeatureNotPresent = MaintenanceModeStatus.valueForString(example); - - assertNotNull("NORMAL returned null", enumNormal); - assertNotNull("NEAR returned null", enumNear); - assertNotNull("ACTIVE returned null", enumActive); - assertNotNull("FEATURE_NOT_PRESENT returned null", enumFeatureNotPresent); - } - - /** - * Verifies that an invalid assignment is null. - */ - public void testInvalidEnum () { - String example = "NorMal"; - try { - MaintenanceModeStatus temp = MaintenanceModeStatus.valueForString(example); - assertNull("Result of valueForString should be null.", temp); - } - catch (IllegalArgumentException exception) { - fail("Invalid enum throws IllegalArgumentException."); - } - } - - /** - * Verifies that a null assignment is invalid. - */ - public void testNullEnum () { - String example = null; - try { - MaintenanceModeStatus temp = MaintenanceModeStatus.valueForString(example); - assertNull("Result of valueForString should be null.", temp); - } - catch (NullPointerException exception) { - fail("Null string throws NullPointerException."); - } - } - - /** - * Verifies the possible enum values of MaintenanceMode. - */ - public void testListEnum() { - List<MaintenanceModeStatus> enumValueList = Arrays.asList(MaintenanceModeStatus.values()); - - List<MaintenanceModeStatus> enumTestList = new ArrayList<MaintenanceModeStatus>(); - enumTestList.add(MaintenanceModeStatus.NORMAL); - enumTestList.add(MaintenanceModeStatus.NEAR); - enumTestList.add(MaintenanceModeStatus.ACTIVE); - enumTestList.add(MaintenanceModeStatus.FEATURE_NOT_PRESENT); - - assertTrue("Enum value list does not match enum class list", - enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList)); - } -}
\ No newline at end of file diff --git a/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/MessageTypeTests.java b/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/MessageTypeTests.java deleted file mode 100644 index 45bdfd561..000000000 --- a/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/MessageTypeTests.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.smartdevicelink.test.rpc.enums; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import junit.framework.TestCase; - -import com.smartdevicelink.proxy.rpc.enums.MessageType; - -/** - * This is a unit test class for the SmartDeviceLink library project class : - * {@link com.smartdevicelink.rpc.enums.MessageType} - */ -public class MessageTypeTests extends TestCase { - - /** - * Verifies that the enum values are not null upon valid assignment. - */ - public void testValidEnums () { - String example = "request"; - MessageType enumRequest = MessageType.valueForString(example); - example = "response"; - MessageType enumResponse = MessageType.valueForString(example); - example = "notification"; - MessageType enumNotification = MessageType.valueForString(example); - - assertNotNull("request returned null", enumRequest); - assertNotNull("response returned null", enumResponse); - assertNotNull("notification returned null", enumNotification); - } - - /** - * Verifies that an invalid assignment is null. - */ - public void testInvalidEnum () { - String example = "reQuesT"; - try { - MessageType temp = MessageType.valueForString(example); - assertNull("Result of valueForString should be null.", temp); - } - catch (IllegalArgumentException exception) { - fail("Invalid enum throws IllegalArgumentException."); - } - } - - /** - * Verifies that a null assignment is invalid. - */ - public void testNullEnum () { - String example = null; - try { - MessageType temp = MessageType.valueForString(example); - assertNull("Result of valueForString should be null.", temp); - } - catch (NullPointerException exception) { - fail("Null string throws NullPointerException."); - } - } - - - /** - * Verifies the possible enum values of MessageType. - */ - public void testListEnum() { - List<MessageType> enumValueList = Arrays.asList(MessageType.values()); - - List<MessageType> enumTestList = new ArrayList<MessageType>(); - enumTestList.add(MessageType.request); - enumTestList.add(MessageType.response); - enumTestList.add(MessageType.notification); - - assertTrue("Enum value list does not match enum class list", - enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList)); - } -}
\ No newline at end of file diff --git a/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/PermissionStatusTests.java b/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/PermissionStatusTests.java deleted file mode 100644 index 2dc171c25..000000000 --- a/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/PermissionStatusTests.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.smartdevicelink.test.rpc.enums; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import junit.framework.TestCase; - -import com.smartdevicelink.proxy.rpc.enums.PermissionStatus; - -/** - * This is a unit test class for the SmartDeviceLink library project class : - * {@link com.smartdevicelink.rpc.enums.PermissionStatus} - */ -public class PermissionStatusTests extends TestCase { - - /** - * Verifies that the enum values are not null upon valid assignment. - */ - public void testValidEnums () { - String example = "ALLOWED"; - PermissionStatus enumAllowed = PermissionStatus.valueForString(example); - example = "DISALLOWED"; - PermissionStatus enumDisallowed = PermissionStatus.valueForString(example); - example = "USER_DISALLOWED"; - PermissionStatus enumUserDisallowed = PermissionStatus.valueForString(example); - example = "USER_CONSENT_PENDING"; - PermissionStatus enumUserConsentPending = PermissionStatus.valueForString(example); - - assertNotNull("ALLOWED returned null", enumAllowed); - assertNotNull("DISALLOWED returned null", enumDisallowed); - assertNotNull("USER_DISALLOWED returned null", enumUserDisallowed); - assertNotNull("USER_CONSENT_PENDING returned null", enumUserConsentPending); - } - - /** - * Verifies that an invalid assignment is null. - */ - public void testInvalidEnum () { - String example = "aLloWed"; - try { - PermissionStatus temp = PermissionStatus.valueForString(example); - assertNull("Result of valueForString should be null.", temp); - } - catch (IllegalArgumentException exception) { - fail("Invalid enum throws IllegalArgumentException."); - } - } - - /** - * Verifies that a null assignment is invalid. - */ - public void testNullEnum () { - String example = null; - try { - PermissionStatus temp = PermissionStatus.valueForString(example); - assertNull("Result of valueForString should be null.", temp); - } - catch (NullPointerException exception) { - fail("Null string throws NullPointerException."); - } - } - - /** - * Verifies the possible enum values of PermissionStatus. - */ - public void testListEnum() { - List<PermissionStatus> enumValueList = Arrays.asList(PermissionStatus.values()); - - List<PermissionStatus> enumTestList = new ArrayList<PermissionStatus>(); - enumTestList.add(PermissionStatus.ALLOWED); - enumTestList.add(PermissionStatus.DISALLOWED); - enumTestList.add(PermissionStatus.USER_DISALLOWED); - enumTestList.add(PermissionStatus.USER_CONSENT_PENDING); - - assertTrue("Enum value list does not match enum class list", - enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList)); - } -}
\ No newline at end of file diff --git a/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/TirePressureTellTaleTests.java b/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/TirePressureTellTaleTests.java deleted file mode 100644 index cc56dc63f..000000000 --- a/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/TirePressureTellTaleTests.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.smartdevicelink.test.rpc.enums; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import junit.framework.TestCase; - -import com.smartdevicelink.proxy.rpc.enums.TirePressureTellTale; - -/** - * This is a unit test class for the SmartDeviceLink library project class : - * {@link com.smartdevicelink.rpc.enums.TirePressureTellTale} - */ -public class TirePressureTellTaleTests extends TestCase { - - /** - * Verifies that the enum values are not null upon valid assignment. - */ - public void testValidEnums () { - String example = "OFF"; - TirePressureTellTale enumOff = TirePressureTellTale.valueForString(example); - example = "ON"; - TirePressureTellTale enumOn = TirePressureTellTale.valueForString(example); - example = "FLASH"; - TirePressureTellTale enumFlash = TirePressureTellTale.valueForString(example); - - assertNotNull("OFF returned null", enumOff); - assertNotNull("ON returned null", enumOn); - assertNotNull("FLASH returned null", enumFlash); - } - - /** - * Verifies that an invalid assignment is null. - */ - public void testInvalidEnum () { - String example = "oFf"; - try { - TirePressureTellTale temp = TirePressureTellTale.valueForString(example); - assertNull("Result of valueForString should be null.", temp); - } - catch (IllegalArgumentException exception) { - fail("Invalid enum throws IllegalArgumentException."); - } - } - - /** - * Verifies that a null assignment is invalid. - */ - public void testNullEnum () { - String example = null; - try { - TirePressureTellTale temp = TirePressureTellTale.valueForString(example); - assertNull("Result of valueForString should be null.", temp); - } - catch (NullPointerException exception) { - fail("Null string throws NullPointerException."); - } - } - - - /** - * Verifies the possible enum values of TirePressureTellTale. - */ - public void testListEnum() { - List<TirePressureTellTale> enumValueList = Arrays.asList(TirePressureTellTale.values()); - - List<TirePressureTellTale> enumTestList = new ArrayList<TirePressureTellTale>(); - enumTestList.add(TirePressureTellTale.OFF); - enumTestList.add(TirePressureTellTale.ON); - enumTestList.add(TirePressureTellTale.FLASH); - - assertTrue("Enum value list does not match enum class list", - enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList)); - } -}
\ No newline at end of file diff --git a/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/VehicleDataActiveStatusTests.java b/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/VehicleDataActiveStatusTests.java deleted file mode 100644 index ee4811c57..000000000 --- a/sdl_android_tests/src/com/smartdevicelink/test/rpc/enums/VehicleDataActiveStatusTests.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.smartdevicelink.test.rpc.enums; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import junit.framework.TestCase; - -import com.smartdevicelink.proxy.rpc.enums.VehicleDataActiveStatus; - -/** - * This is a unit test class for the SmartDeviceLink library project class : - * {@link com.smartdevicelink.rpc.enums.VehicleDataActiveStatus} - */ -public class VehicleDataActiveStatusTests extends TestCase { - - /** - * Verifies that the enum values are not null upon valid assignment. - */ - public void testValidEnums () { - String example = "INACTIVE_NOT_CONFIRMED"; - VehicleDataActiveStatus enumInactiveNotConfirmed = VehicleDataActiveStatus.valueForString(example); - example = "INACTIVE_CONFIRMED"; - VehicleDataActiveStatus enumInactiveConfirmed = VehicleDataActiveStatus.valueForString(example); - example = "ACTIVE_NOT_CONFIRMED"; - VehicleDataActiveStatus enumActiveNotConfirmed = VehicleDataActiveStatus.valueForString(example); - example = "ACTIVE_CONFIRMED"; - VehicleDataActiveStatus enumActiveConfirmed = VehicleDataActiveStatus.valueForString(example); - example = "FAULT"; - VehicleDataActiveStatus enumFault = VehicleDataActiveStatus.valueForString(example); - - assertNotNull("INACTIVE_NOT_CONFIRMED returned null", enumInactiveNotConfirmed); - assertNotNull("INACTIVE_CONFIRMED returned null", enumInactiveConfirmed); - assertNotNull("ACTIVE_NOT_CONFIRMED returned null", enumActiveNotConfirmed); - assertNotNull("ACTIVE_CONFIRMED returned null", enumActiveConfirmed); - assertNotNull("FAULT returned null", enumFault); - } - - /** - * Verifies that an invalid assignment is null. - */ - public void testInvalidEnum () { - String example = "InACtivE_NoT_ConFIRmED"; - try { - VehicleDataActiveStatus temp = VehicleDataActiveStatus.valueForString(example); - assertNull("Result of valueForString should be null.", temp); - } - catch (IllegalArgumentException exception) { - fail("Invalid enum throws IllegalArgumentException."); - } - } - - /** - * Verifies that a null assignment is invalid. - */ - public void testNullEnum () { - String example = null; - try { - VehicleDataActiveStatus temp = VehicleDataActiveStatus.valueForString(example); - assertNull("Result of valueForString should be null.", temp); - } - catch (NullPointerException exception) { - fail("Null string throws NullPointerException."); - } - } - - /** - * Verifies the possible enum values of VehicleDataActiveStatus. - */ - public void testListEnum() { - List<VehicleDataActiveStatus> enumValueList = Arrays.asList(VehicleDataActiveStatus.values()); - - List<VehicleDataActiveStatus> enumTestList = new ArrayList<VehicleDataActiveStatus>(); - enumTestList.add(VehicleDataActiveStatus.INACTIVE_NOT_CONFIRMED); - enumTestList.add(VehicleDataActiveStatus.INACTIVE_CONFIRMED); - enumTestList.add(VehicleDataActiveStatus.ACTIVE_NOT_CONFIRMED); - enumTestList.add(VehicleDataActiveStatus.ACTIVE_CONFIRMED); - enumTestList.add(VehicleDataActiveStatus.FAULT); - - assertTrue("Enum value list does not match enum class list", - enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList)); - } -}
\ No newline at end of file diff --git a/sdl_android_tests/src/com/smartdevicelink/test/transport/BTTransportConfigTests.java b/sdl_android_tests/src/com/smartdevicelink/test/transport/BTTransportConfigTests.java index 0aa08367a..11b6ab39f 100644 --- a/sdl_android_tests/src/com/smartdevicelink/test/transport/BTTransportConfigTests.java +++ b/sdl_android_tests/src/com/smartdevicelink/test/transport/BTTransportConfigTests.java @@ -4,7 +4,7 @@ import junit.framework.TestCase; import com.smartdevicelink.test.Test; import com.smartdevicelink.transport.BTTransportConfig; -import com.smartdevicelink.transport.TransportType; +import com.smartdevicelink.transport.enums.TransportType; /** * This is a unit test class for the SmartDeviceLink library project class : diff --git a/sdl_android_tests/src/com/smartdevicelink/test/transport/BaseTransportConfigTests.java b/sdl_android_tests/src/com/smartdevicelink/test/transport/BaseTransportConfigTests.java index ecd220aee..c23b820eb 100644 --- a/sdl_android_tests/src/com/smartdevicelink/test/transport/BaseTransportConfigTests.java +++ b/sdl_android_tests/src/com/smartdevicelink/test/transport/BaseTransportConfigTests.java @@ -4,7 +4,7 @@ import junit.framework.TestCase; import com.smartdevicelink.test.Test; import com.smartdevicelink.transport.BaseTransportConfig; -import com.smartdevicelink.transport.TransportType; +import com.smartdevicelink.transport.enums.TransportType; /** * This is a unit test class for the SmartDeviceLink library project class : diff --git a/sdl_android_tests/src/com/smartdevicelink/test/transport/TCPTransportConfigTests.java b/sdl_android_tests/src/com/smartdevicelink/test/transport/TCPTransportConfigTests.java index 20caae988..f08deea5a 100644 --- a/sdl_android_tests/src/com/smartdevicelink/test/transport/TCPTransportConfigTests.java +++ b/sdl_android_tests/src/com/smartdevicelink/test/transport/TCPTransportConfigTests.java @@ -2,7 +2,7 @@ package com.smartdevicelink.test.transport; import com.smartdevicelink.test.Test; import com.smartdevicelink.transport.TCPTransportConfig; -import com.smartdevicelink.transport.TransportType; +import com.smartdevicelink.transport.enums.TransportType; import junit.framework.TestCase; diff --git a/sdl_android_tests/src/com/smartdevicelink/test/transport/TransportTypeTests.java b/sdl_android_tests/src/com/smartdevicelink/test/transport/TransportTypeTests.java index 6fb4409a8..797705c4d 100644 --- a/sdl_android_tests/src/com/smartdevicelink/test/transport/TransportTypeTests.java +++ b/sdl_android_tests/src/com/smartdevicelink/test/transport/TransportTypeTests.java @@ -5,7 +5,7 @@ import java.util.Arrays; import java.util.List; import com.smartdevicelink.test.Test; -import com.smartdevicelink.transport.TransportType; +import com.smartdevicelink.transport.enums.TransportType; import junit.framework.TestCase; |