diff options
author | Joey Grover <joeygrover@gmail.com> | 2018-07-17 10:32:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-17 10:32:40 -0400 |
commit | ef10c5e39bc228e9f9a1dd45e8c59eed9121afb4 (patch) | |
tree | 41f456077c9564c61b9a1c8d2edcb0eaa5a91622 | |
parent | 3f2a124356e468d23a4705c6b1cb36e3d9c72934 (diff) | |
parent | a0e82b3775b6d6646c51763bb666c11eab203365 (diff) | |
download | sdl_android-ef10c5e39bc228e9f9a1dd45e8c59eed9121afb4.tar.gz |
Merge pull request #711 from mrapitis/feature/issue_651
Feature/issue 651- Remote Control - Seat
29 files changed, 2744 insertions, 414 deletions
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java index 7be0f805c..b971341fc 100644 --- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java @@ -20,10 +20,12 @@ import com.smartdevicelink.proxy.rpc.ImageField; import com.smartdevicelink.proxy.rpc.ImageResolution; import com.smartdevicelink.proxy.rpc.KeyboardProperties; import com.smartdevicelink.proxy.rpc.LocationDetails; +import com.smartdevicelink.proxy.rpc.MassageCushionFirmness; +import com.smartdevicelink.proxy.rpc.MassageModeData; import com.smartdevicelink.proxy.rpc.MenuParams; +import com.smartdevicelink.proxy.rpc.MetadataTags; import com.smartdevicelink.proxy.rpc.ModuleData; import com.smartdevicelink.proxy.rpc.NavigationCapability; -import com.smartdevicelink.proxy.rpc.MetadataTags; import com.smartdevicelink.proxy.rpc.OasisAddress; import com.smartdevicelink.proxy.rpc.ParameterPermissions; import com.smartdevicelink.proxy.rpc.PermissionItem; @@ -33,10 +35,13 @@ import com.smartdevicelink.proxy.rpc.RGBColor; import com.smartdevicelink.proxy.rpc.RadioControlCapabilities; import com.smartdevicelink.proxy.rpc.RadioControlData; import com.smartdevicelink.proxy.rpc.RdsData; -import com.smartdevicelink.proxy.rpc.RemoteControlCapabilities; import com.smartdevicelink.proxy.rpc.Rectangle; +import com.smartdevicelink.proxy.rpc.RemoteControlCapabilities; import com.smartdevicelink.proxy.rpc.ScreenParams; import com.smartdevicelink.proxy.rpc.SdlMsgVersion; +import com.smartdevicelink.proxy.rpc.SeatControlCapabilities; +import com.smartdevicelink.proxy.rpc.SeatControlData; +import com.smartdevicelink.proxy.rpc.SeatMemoryAction; import com.smartdevicelink.proxy.rpc.SingleTireStatus; import com.smartdevicelink.proxy.rpc.SoftButton; import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities; @@ -92,7 +97,11 @@ import com.smartdevicelink.proxy.rpc.enums.KeypressMode; import com.smartdevicelink.proxy.rpc.enums.Language; import com.smartdevicelink.proxy.rpc.enums.LayoutMode; import com.smartdevicelink.proxy.rpc.enums.LockScreenStatus; +import com.smartdevicelink.proxy.rpc.enums.MassageCushion; +import com.smartdevicelink.proxy.rpc.enums.MassageMode; +import com.smartdevicelink.proxy.rpc.enums.MassageZone; import com.smartdevicelink.proxy.rpc.enums.MediaClockFormat; +import com.smartdevicelink.proxy.rpc.enums.MetadataType; import com.smartdevicelink.proxy.rpc.enums.ModuleType; import com.smartdevicelink.proxy.rpc.enums.PowerModeQualificationStatus; import com.smartdevicelink.proxy.rpc.enums.PowerModeStatus; @@ -103,8 +112,10 @@ import com.smartdevicelink.proxy.rpc.enums.RadioState; import com.smartdevicelink.proxy.rpc.enums.RequestType; import com.smartdevicelink.proxy.rpc.enums.Result; import com.smartdevicelink.proxy.rpc.enums.SamplingRate; +import com.smartdevicelink.proxy.rpc.enums.SeatMemoryActionType; import com.smartdevicelink.proxy.rpc.enums.SoftButtonType; import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities; +import com.smartdevicelink.proxy.rpc.enums.SupportedSeat; import com.smartdevicelink.proxy.rpc.enums.SystemAction; import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType; import com.smartdevicelink.proxy.rpc.enums.SystemContext; @@ -113,7 +124,6 @@ import com.smartdevicelink.proxy.rpc.enums.TPMS; import com.smartdevicelink.proxy.rpc.enums.TemperatureUnit; import com.smartdevicelink.proxy.rpc.enums.TextAlignment; import com.smartdevicelink.proxy.rpc.enums.TextFieldName; -import com.smartdevicelink.proxy.rpc.enums.MetadataType; import com.smartdevicelink.proxy.rpc.enums.TouchType; import com.smartdevicelink.proxy.rpc.enums.TriggerSource; import com.smartdevicelink.proxy.rpc.enums.UpdateMode; @@ -139,7 +149,7 @@ import java.util.Arrays; import java.util.List; public class Test { - + // Test Failure Messages public static final String NULL = "Value should be null."; public static final String MATCH = "Values should match."; @@ -148,14 +158,14 @@ public class Test { public static final String FALSE = "Value should be false."; public static final String NOT_NULL = "Value should not be null."; public static final String JSON_FAIL = "Json testing failed."; - + // RPC Request/Response/Notification/Datatype Test Values public static final int GENERAL_INT = 100; public static final Integer GENERAL_INTEGER = 100; public static final Long GENERAL_LONG = 100L; public static final Turn GENERAL_TURN = new Turn(); public static final Float GENERAL_FLOAT = 100f; - public static final Image GENERAL_IMAGE = new Image(); + public static final Image GENERAL_IMAGE = new Image(); public static final Choice GENERAL_CHOICE = new Choice(); public static final String GENERAL_STRING = "test"; public static final Double GENERAL_DOUBLE = 10.01; @@ -186,9 +196,11 @@ public class Test { public static final ButtonName GENERAL_BUTTONNAME = ButtonName.OK; public static final UpdateMode GENERAL_UPDATEMODE = UpdateMode.RESUME; public static final TouchCoord GENERAL_TOUCHCOORD = new TouchCoord(); + public static final MassageModeData GENERAL_MASSAGEMODEDATA = new MassageModeData(); + public static final MassageCushionFirmness GENERAL_MASSAGECUSHIONFIRMNESS = new MassageCushionFirmness(); public static final DisplayType GENERAL_DISPLAYTYPE = DisplayType.CID; public static final VehicleType GENERAL_VEHICLETYPE = new VehicleType(); - public static final RequestType GENERAL_REQUESTTYPE = RequestType.AUTH_REQUEST; + public static final RequestType GENERAL_REQUESTTYPE = RequestType.AUTH_REQUEST; public static final SystemAction GENERAL_SYSTEMACTION = SystemAction.DEFAULT_ACTION; public static final CharacterSet GENERAL_CHARACTERSET = CharacterSet.CID1SET; public static final SamplingRate GENERAL_SAMPLINGRATE = SamplingRate._8KHZ; @@ -204,6 +216,11 @@ public class Test { public static final SdlMsgVersion GENERAL_SDLMSGVERSION = new SdlMsgVersion(); public static final PermissionItem GENERAL_PERMISSIONITEM = new PermissionItem(); public static final SoftButtonType GENERAL_SOFTBUTTONTYPE = SoftButtonType.SBT_BOTH; + public static final MassageZone GENERAL_MASSAGEZONE = MassageZone.LUMBAR; + public static final MassageMode GENERAL_MASSAGEMODE = MassageMode.HIGH; + public static final MassageCushion GENERAL_MASSAGECUSHION = MassageCushion.BACK_BOLSTERS; + public static final SeatMemoryActionType GENERAL_SEATMEMORYACTIONTYPE = SeatMemoryActionType.SAVE; + public static final SupportedSeat GENERAL_SUPPORTEDSEAT = SupportedSeat.DRIVER; public static final KeyboardLayout GENERAL_KEYBOARDLAYOUT = KeyboardLayout.QWERTY; public static final ImageFieldName GENERAL_IMAGEFIELDNAME = ImageFieldName.graphic; public static final HMIPermissions GENERAL_HMIPERMISSIONS = new HMIPermissions(); @@ -213,7 +230,7 @@ public class Test { public static final PowerModeStatus GENERAL_POWERMODESTATUS = PowerModeStatus.RUNNING_2; public static final VehicleDataType GENERAL_VEHICLEDATATYPE = VehicleDataType.VEHICLEDATA_BRAKING; public static final InteractionMode GENERAL_INTERACTIONMODE = InteractionMode.BOTH; - public static final ImageResolution GENERAL_IMAGERESOLUTION = new ImageResolution(); + public static final ImageResolution GENERAL_IMAGERESOLUTION = new ImageResolution(); public static final FuelCutoffStatus GENERAL_FUELCUTOFFSTATUS = FuelCutoffStatus.NORMAL_OPERATION; public static final CompassDirection GENERAL_COMPASSDIRECTION = CompassDirection.EAST; public static final LockScreenStatus GENERAL_LOCKSCREENSTATUS = LockScreenStatus.REQUIRED; @@ -221,24 +238,25 @@ public class Test { public static final DeviceLevelStatus GENERAL_DEVICELEVELSTATUS = DeviceLevelStatus.FOUR_LEVEL_BARS; public static final ButtonCapabilities GENERAL_BUTTONCAPABILITIES = new ButtonCapabilities(); public static final EmergencyEventType GENERAL_EMERGENCYEVENTTYPE = EmergencyEventType.FAULT; - public static final AmbientLightStatus GENERAL_AMBIENTLIGHTSTATUS = AmbientLightStatus.NIGHT; + public static final AmbientLightStatus GENERAL_AMBIENTLIGHTSTATUS = AmbientLightStatus.NIGHT; public static final SpeechCapabilities GENERAL_SPEECHCAPABILITIES = SpeechCapabilities.TEXT; public static final WarningLightStatus GENERAL_WARNINGLIGHTSTATUS = WarningLightStatus.OFF; - public static final KeyboardProperties GENERAL_KEYBOARDPROPERTIES = new KeyboardProperties(); + public static final KeyboardProperties GENERAL_KEYBOARDPROPERTIES = new KeyboardProperties(); public static final PrimaryAudioSource GENERAL_PRIMARYAUDIOSOURCE = PrimaryAudioSource.BLUETOOTH_STEREO_BTST; public static final AudioStreamingState GENERAL_AUDIOSTREAMINGSTATE = AudioStreamingState.AUDIBLE; public static final VideoStreamingState GENERAL_VIDEOSTREAMINGSTATE = VideoStreamingState.STREAMABLE; public static final DisplayCapabilities GENERAL_DISPLAYCAPABILITIES = new DisplayCapabilities(); - public static final ParameterPermissions GENERAL_PARAMETERPERMISSIONS = new ParameterPermissions(); - public static final IgnitionStableStatus GENERAL_IGNITIONSTABLESTATUS = IgnitionStableStatus.IGNITION_SWITCH_STABLE; + public static final ParameterPermissions GENERAL_PARAMETERPERMISSIONS = new ParameterPermissions(); + public static final IgnitionStableStatus GENERAL_IGNITIONSTABLESTATUS = IgnitionStableStatus.IGNITION_SWITCH_STABLE; public static final VehicleDataResultCode GENERAL_VEHICLEDATARESULTCODE = VehicleDataResultCode.IGNORED; public static final ComponentVolumeStatus GENERAL_COMPONENTVOLUMESTATUS = ComponentVolumeStatus.LOW; public static final PresetBankCapabilities GENERAL_PRESETBANKCAPABILITIES = new PresetBankCapabilities(); public static final VehicleDataEventStatus GENERAL_VEHCILEDATAEVENTSTATUS = VehicleDataEventStatus.YES; public static final VehicleDataEventStatus GENERAL_VEHICLEDATAEVENTSTATUS = VehicleDataEventStatus.YES; public static final TouchEventCapabilities GENERAL_TOUCHEVENTCAPABILITIES = new TouchEventCapabilities(); + public static final SeatMemoryAction GENERAL_SEATMEMORYACTION = new SeatMemoryAction(); public static final SoftButtonCapabilities GENERAL_SOFTBUTTONCAPABILITIES = new SoftButtonCapabilities(); - public static final ECallConfirmationStatus GENERAL_ECALLCONFIRMATIONSTATUS = ECallConfirmationStatus.CALL_IN_PROGRESS; + public static final ECallConfirmationStatus GENERAL_ECALLCONFIRMATIONSTATUS = ECallConfirmationStatus.CALL_IN_PROGRESS; public static final AudioPassThruCapabilities GENERAL_AUDIOPASSTHRUCAPABILITIES = new AudioPassThruCapabilities(); public static final PowerModeQualificationStatus GENERAL_POWERMODEQUALIFICATIONSTATUS = PowerModeQualificationStatus.POWER_MODE_OK; public static final VehicleDataNotificationStatus GENERAL_VEHICLEDATANOTIFICATIONSTATUS = VehicleDataNotificationStatus.NORMAL; @@ -269,12 +287,14 @@ public class Test { public static final VentilationMode GENERAL_VENTILATIONMODE = VentilationMode.BOTH; public static final RadioBand GENERAL_RADIOBAND = RadioBand.AM; public static final ClimateControlData GENERAL_CLIMATECONTROLDATA = new ClimateControlData(); + public static final SeatControlData GENERAL_SEATCONTROLDATA = new SeatControlData(); public static final RdsData GENERAL_RDSDATA = new RdsData(); public static final RadioState GENERAL_RADIOSTATE = RadioState.ACQUIRED; public static final RadioControlData GENERAL_RADIOCONTROLDATA = new RadioControlData(); public static final ModuleData GENERAL_MODULEDATA = new ModuleData(); public static final ClimateControlCapabilities GENERAL_CLIMATECONTROLCAPABILITIES = new ClimateControlCapabilities(); public static final RadioControlCapabilities GENERAL_RADIOCONTROLCAPABILITIES = new RadioControlCapabilities(); + public static final SeatControlCapabilities GENERAL_SEATCONTROLCAPABILITIES = new SeatControlCapabilities(); public static final HMICapabilities GENERAL_HMICAPABILITIES = new HMICapabilities(); @@ -294,6 +314,8 @@ public class Test { public static final List<TextField> GENERAL_TEXTFIELD_LIST = new ArrayList<TextField>(1); public static final List<DIDResult> GENERAL_DIDRESULT_LIST = new ArrayList<DIDResult>(1); public static final List<TouchCoord> GENERAL_TOUCHCOORD_LIST = new ArrayList<TouchCoord>(1); + public static final List<MassageModeData> GENERAL_MASSAGEMODEDATA_LIST = new ArrayList<MassageModeData>(1); + public static final List<MassageCushionFirmness> GENERAL_MASSAGECUSHIONFIRMNESS_LIST = new ArrayList<MassageCushionFirmness>(1); public static final List<AppHMIType> GENERAL_APPHMITYPE_LIST = new ArrayList<AppHMIType>(2); public static final List<VrHelpItem> GENERAL_VRHELPITEM_LIST = new ArrayList<VrHelpItem>(2); public static final List<SoftButton> GENERAL_SOFTBUTTON_LIST = new ArrayList<SoftButton>(1); @@ -315,16 +337,17 @@ public class Test { public static final List<VentilationMode> GENERAL_VENTILATIONMODE_LIST = Arrays.asList(new VentilationMode[]{VentilationMode.LOWER, VentilationMode.UPPER}); public static final List<ClimateControlCapabilities> GENERAL_CLIMATECONTROLCAPABILITIES_LIST = new ArrayList<ClimateControlCapabilities>(1); public static final List<RadioControlCapabilities> GENERAL_RADIOCONTROLCAPABILITIES_LIST = new ArrayList<RadioControlCapabilities>(1); + public static final List<SeatControlCapabilities> GENERAL_SEATCONTROLCAPABILITIES_LIST = new ArrayList<SeatControlCapabilities>(1); public static final JSONArray JSON_TURNS = new JSONArray(); - public static final JSONArray JSON_CHOICES = new JSONArray(); + public static final JSONArray JSON_CHOICES = new JSONArray(); public static final JSONArray JSON_HMILEVELS = new JSONArray(); public static final JSONArray JSON_TTSCHUNKS = new JSONArray(); public static final JSONArray JSON_DIDRESULTS = new JSONArray(); public static final JSONArray JSON_TEXTFIELDS = new JSONArray(); public static final JSONArray JSON_TOUCHCOORDS = new JSONArray(); public static final JSONArray JSON_VRHELPITEMS = new JSONArray(); - public static final JSONArray JSON_SOFTBUTTONS = new JSONArray(); + public static final JSONArray JSON_SOFTBUTTONS = new JSONArray(); public static final JSONArray JSON_IMAGEFIELDS = new JSONArray(); public static final JSONArray JSON_TOUCHEVENTS = new JSONArray(); public static final JSONArray JSON_PERMISSIONITEMS = new JSONArray(); @@ -347,11 +370,11 @@ public class Test { public static final JSONObject JSON_MENUPARAMS = new JSONObject(); public static final JSONObject JSON_DEVICEINFO = new JSONObject(); public static final JSONObject JSON_VRHELPITEM = new JSONObject(); - public static final JSONObject JSON_SCREENPARAMS = new JSONObject(); + public static final JSONObject JSON_SCREENPARAMS = new JSONObject(); public static final JSONObject JSON_SDLMSGVERSION = new JSONObject(); public static final JSONObject JSON_PERMISSIONITEM = new JSONObject(); public static final JSONObject JSON_HMIPERMISSIONS = new JSONObject(); - public static final JSONObject JSON_IMAGERESOLUTION = new JSONObject(); + public static final JSONObject JSON_IMAGERESOLUTION = new JSONObject(); public static final JSONObject JSON_KEYBOARDPROPERTIES = new JSONObject(); public static final JSONObject JSON_DISPLAYCAPABILITIES = new JSONObject(); public static final JSONObject JSON_PARAMETERPERMISSIONS = new JSONObject(); @@ -366,7 +389,11 @@ public class Test { GENERAL_TOUCHEVENTCAPABILITIES.setDoublePressAvailable(GENERAL_BOOLEAN); GENERAL_TOUCHEVENTCAPABILITIES.setMultiTouchAvailable(GENERAL_BOOLEAN); GENERAL_TOUCHEVENTCAPABILITIES.setPressAvailable(GENERAL_BOOLEAN); - + + GENERAL_SEATMEMORYACTION.setAction(GENERAL_SEATMEMORYACTIONTYPE); + GENERAL_SEATMEMORYACTION.setLabel(GENERAL_STRING); + GENERAL_SEATMEMORYACTION.setId(GENERAL_INT); + GENERAL_IMAGERESOLUTION.setResolutionHeight(GENERAL_INT); GENERAL_IMAGERESOLUTION.setResolutionWidth(GENERAL_INT); @@ -384,6 +411,23 @@ public class Test { GENERAL_CLIMATECONTROLDATA.setDefrostZone(GENERAL_DEFROSTZONE); GENERAL_CLIMATECONTROLDATA.setVentilationMode(GENERAL_VENTILATIONMODE); + GENERAL_SEATCONTROLDATA.setMemory(GENERAL_SEATMEMORYACTION); + GENERAL_SEATCONTROLDATA.setMassageCushionFirmness(GENERAL_MASSAGECUSHIONFIRMNESS_LIST); + GENERAL_SEATCONTROLDATA.setMassageMode(GENERAL_MASSAGEMODEDATA_LIST); + GENERAL_SEATCONTROLDATA.setMassageEnabled(GENERAL_BOOLEAN); + GENERAL_SEATCONTROLDATA.setHeadSupportHorizontalPosition(GENERAL_INT); + GENERAL_SEATCONTROLDATA.setHeadSupportVerticalPosition(GENERAL_INT); + GENERAL_SEATCONTROLDATA.setBackTiltAngle(GENERAL_INT); + GENERAL_SEATCONTROLDATA.setBackVerticalPosition(GENERAL_INT); + GENERAL_SEATCONTROLDATA.setFrontVerticalPosition(GENERAL_INT); + GENERAL_SEATCONTROLDATA.setVerticalPosition(GENERAL_INT); + GENERAL_SEATCONTROLDATA.setHorizontalPosition(GENERAL_INT); + GENERAL_SEATCONTROLDATA.setCoolingLevel(GENERAL_INT); + GENERAL_SEATCONTROLDATA.setHeatingLevel(GENERAL_INT); + GENERAL_SEATCONTROLDATA.setHeatingEnabled(GENERAL_BOOLEAN); + GENERAL_SEATCONTROLDATA.setCoolingEnabled(GENERAL_BOOLEAN); + GENERAL_SEATCONTROLDATA.setId(GENERAL_SUPPORTEDSEAT); + GENERAL_RDSDATA.setProgramService(GENERAL_STRING); GENERAL_RDSDATA.setRadioText(GENERAL_STRING); GENERAL_RDSDATA.setClockText(GENERAL_STRING); @@ -414,16 +458,24 @@ public class Test { GENERAL_CHOICE.setImage(GENERAL_IMAGE); GENERAL_CHOICE.setSecondaryImage(GENERAL_IMAGE); GENERAL_CHOICE.setVrCommands(GENERAL_STRING_LIST); - + + GENERAL_MASSAGEMODEDATA.setMassageMode(GENERAL_MASSAGEMODE); + GENERAL_MASSAGEMODEDATA.setMassageZone(GENERAL_MASSAGEZONE); + GENERAL_MASSAGEMODEDATA_LIST.add(GENERAL_MASSAGEMODEDATA); + + GENERAL_MASSAGECUSHIONFIRMNESS.setCushion(GENERAL_MASSAGECUSHION); + GENERAL_MASSAGECUSHIONFIRMNESS.setFirmness(GENERAL_INT); + GENERAL_MASSAGECUSHIONFIRMNESS_LIST.add(GENERAL_MASSAGECUSHIONFIRMNESS); + GENERAL_TOUCHCOORD.setX(GENERAL_INT); - GENERAL_TOUCHCOORD.setY(GENERAL_INT); + GENERAL_TOUCHCOORD.setY(GENERAL_INT); GENERAL_TOUCHCOORD_LIST.add(GENERAL_TOUCHCOORD); - + GENERAL_TOUCHEVENT.setId(GENERAL_INT); GENERAL_TOUCHEVENT.setTs(GENERAL_LONG_LIST); - GENERAL_TOUCHEVENT.setC(GENERAL_TOUCHCOORD_LIST); + GENERAL_TOUCHEVENT.setC(GENERAL_TOUCHCOORD_LIST); GENERAL_TOUCHEVENT_LIST.add(GENERAL_TOUCHEVENT); - + GENERAL_TEXTFIELD.setName(GENERAL_TEXTFIELDNAME); GENERAL_TEXTFIELD.setRows(GENERAL_INT); GENERAL_TEXTFIELD.setWidth(GENERAL_INT); @@ -450,24 +502,24 @@ public class Test { GENERAL_LOCATIONDETAILS.setLocationName(GENERAL_STRING); GENERAL_LOCATIONDETAILS.setSearchAddress(GENERAL_OASISADDRESS); GENERAL_LOCATIONDETAILS.setPhoneNumber(GENERAL_STRING); - + GENERAL_FILETYPE_LIST.add(GENERAL_FILETYPE); - + GENERAL_IMAGEFIELD.setImageResolution(GENERAL_IMAGERESOLUTION); GENERAL_IMAGEFIELD.setName(GENERAL_IMAGEFIELDNAME); GENERAL_IMAGEFIELD.setImageTypeSupported(GENERAL_FILETYPE_LIST); GENERAL_IMAGEFIELD_LIST.add(GENERAL_IMAGEFIELD); - + GENERAL_SCREENPARAMS.setImageResolution(GENERAL_IMAGERESOLUTION); GENERAL_SCREENPARAMS.setTouchEventAvailable(GENERAL_TOUCHEVENTCAPABILITIES); - + GENERAL_MEDIACLOCKFORMAT_LIST.add(MediaClockFormat.CLOCK1); GENERAL_MEDIACLOCKFORMAT_LIST.add(MediaClockFormat.CLOCK2); - + GENERAL_IMAGE.setValue(GENERAL_STRING); GENERAL_IMAGE.setImageType(GENERAL_IMAGETYPE); GENERAL_IMAGE.setIsTemplate(GENERAL_BOOLEAN); - + GENERAL_SOFTBUTTON.setIsHighlighted(GENERAL_BOOLEAN); GENERAL_SOFTBUTTON.setSoftButtonID(GENERAL_INT); GENERAL_SOFTBUTTON.setSystemAction(SystemAction.STEAL_FOCUS); @@ -475,63 +527,63 @@ public class Test { GENERAL_SOFTBUTTON.setType(SoftButtonType.SBT_TEXT); GENERAL_SOFTBUTTON.setImage(GENERAL_IMAGE); GENERAL_SOFTBUTTON_LIST.add(GENERAL_SOFTBUTTON); - + GENERAL_TURN.setNavigationText(GENERAL_STRING); GENERAL_TURN.setTurnIcon(GENERAL_IMAGE); GENERAL_TURN_LIST.add(GENERAL_TURN); - + GENERAL_MENUPARAMS.setMenuName(GENERAL_STRING); GENERAL_MENUPARAMS.setParentID(GENERAL_INT); GENERAL_MENUPARAMS.setPosition(GENERAL_INT); - + GENERAL_VRHELPITEM.setText(GENERAL_STRING); GENERAL_VRHELPITEM.setImage(GENERAL_IMAGE); - GENERAL_VRHELPITEM.setPosition(100); + GENERAL_VRHELPITEM.setPosition(100); GENERAL_VRHELPITEM_LIST.add(GENERAL_VRHELPITEM); - + GENERAL_TTSCHUNK_LIST.add(TTSChunkFactory.createChunk(SpeechCapabilities.TEXT, "Welcome to the jungle")); GENERAL_TTSCHUNK_LIST.add(TTSChunkFactory.createChunk(SpeechCapabilities.TEXT, "Say a command")); - + GENERAL_KEYBOARDPROPERTIES.setAutoCompleteText(GENERAL_STRING); 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_STARTTIME.setHours(GENERAL_INT); GENERAL_STARTTIME.setMinutes(GENERAL_INT); GENERAL_STARTTIME.setSeconds(GENERAL_INT); - + GENERAL_CHOICE_LIST.add(GENERAL_CHOICE); - + GENERAL_DEVICEINFO.setCarrier(GENERAL_STRING); GENERAL_DEVICEINFO.setFirmwareRev(GENERAL_STRING); GENERAL_DEVICEINFO.setHardware(GENERAL_STRING); GENERAL_DEVICEINFO.setMaxNumberRFCOMMPorts(GENERAL_INT); GENERAL_DEVICEINFO.setOs(GENERAL_STRING); GENERAL_DEVICEINFO.setOsVersion(GENERAL_STRING); - + GENERAL_SDLMSGVERSION.setMajorVersion(GENERAL_INT); GENERAL_SDLMSGVERSION.setMinorVersion(GENERAL_INT); - + GENERAL_APPHMITYPE_LIST.add(AppHMIType.BACKGROUND_PROCESS); GENERAL_APPHMITYPE_LIST.add(AppHMIType.COMMUNICATION); - + GENERAL_GLOBALPROPERTY_LIST.add(GlobalProperty.HELPPROMPT); GENERAL_GLOBALPROPERTY_LIST.add(GlobalProperty.MENUICON); - + for (VehicleDataType data : VehicleDataType.values()) { VehicleDataResult result = new VehicleDataResult(); result.setResultCode(VehicleDataResultCode.SUCCESS); result.setDataType(data); GENERAL_VEHICLEDATARESULT_LIST.add(result); } - + GENERAL_DIDRESULT.setData(GENERAL_STRING); GENERAL_DIDRESULT.setDidLocation(GENERAL_INT); GENERAL_DIDRESULT.setResultCode(VehicleDataResultCode.SUCCESS); GENERAL_DIDRESULT_LIST.add(GENERAL_DIDRESULT); - + GENERAL_DISPLAYCAPABILITIES.setDisplayType(GENERAL_DISPLAYTYPE); GENERAL_DISPLAYCAPABILITIES.setDisplayName(GENERAL_STRING); GENERAL_DISPLAYCAPABILITIES.setGraphicSupported(GENERAL_BOOLEAN); @@ -541,48 +593,48 @@ public class Test { GENERAL_DISPLAYCAPABILITIES.setScreenParams(GENERAL_SCREENPARAMS); GENERAL_DISPLAYCAPABILITIES.setTemplatesAvailable(GENERAL_STRING_LIST); GENERAL_DISPLAYCAPABILITIES.setTextFields(GENERAL_TEXTFIELD_LIST); - + GENERAL_PRESETBANKCAPABILITIES.setOnScreenPresetsAvailable(GENERAL_BOOLEAN); - + GENERAL_BUTTONCAPABILITIES.setLongPressAvailable(false); GENERAL_BUTTONCAPABILITIES.setShortPressAvailable(true); GENERAL_BUTTONCAPABILITIES.setUpDownAvailable(true); - GENERAL_BUTTONCAPABILITIES.setName(ButtonName.SEEKRIGHT); + GENERAL_BUTTONCAPABILITIES.setName(ButtonName.SEEKRIGHT); GENERAL_BUTTONCAPABILITIES_LIST.add(GENERAL_BUTTONCAPABILITIES); - + GENERAL_SOFTBUTTONCAPABILITIES.setLongPressAvailable(GENERAL_BOOLEAN); GENERAL_SOFTBUTTONCAPABILITIES.setShortPressAvailable(GENERAL_BOOLEAN); GENERAL_SOFTBUTTONCAPABILITIES.setUpDownAvailable(GENERAL_BOOLEAN); GENERAL_SOFTBUTTONCAPABILITIES.setImageSupported(GENERAL_BOOLEAN); - GENERAL_SOFTBUTTONCAPABILITIES_LIST.add(GENERAL_SOFTBUTTONCAPABILITIES); - + GENERAL_SOFTBUTTONCAPABILITIES_LIST.add(GENERAL_SOFTBUTTONCAPABILITIES); + GENERAL_VEHICLETYPE.setMake(GENERAL_STRING); GENERAL_VEHICLETYPE.setModel(GENERAL_STRING); GENERAL_VEHICLETYPE.setModelYear(GENERAL_STRING); GENERAL_VEHICLETYPE.setTrim(GENERAL_STRING); - + GENERAL_AUDIOPASSTHRUCAPABILITIES.setAudioType(GENERAL_AUDIOTYPE); GENERAL_AUDIOPASSTHRUCAPABILITIES.setBitsPerSample(GENERAL_BITSPERSAMPLE); GENERAL_AUDIOPASSTHRUCAPABILITIES.setSamplingRate(GENERAL_SAMPLINGRATE); GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST.add(GENERAL_AUDIOPASSTHRUCAPABILITIES); - + GENERAL_PRERECORDEDSPEECH_LIST.add(PrerecordedSpeech.HELP_JINGLE); GENERAL_PRERECORDEDSPEECH_LIST.add(PrerecordedSpeech.INITIAL_JINGLE); - + GENERAL_HMIZONECAPABILITIES_LIST.add(HmiZoneCapabilities.BACK); GENERAL_HMIZONECAPABILITIES_LIST.add(HmiZoneCapabilities.FRONT); - + GENERAL_SPEECHCAPABILITIES_LIST.add(SpeechCapabilities.SILENCE); GENERAL_SPEECHCAPABILITIES_LIST.add(SpeechCapabilities.TEXT); - + GENERAL_VRCAPABILITIES_LIST.add(VrCapabilities.TEXT); - + GENERAL_HMIPERMISSIONS.setAllowed(GENERAL_HMILEVEL_LIST); GENERAL_HMIPERMISSIONS.setUserDisallowed(GENERAL_HMILEVEL_LIST); - + GENERAL_PARAMETERPERMISSIONS.setAllowed(GENERAL_STRING_LIST); GENERAL_PARAMETERPERMISSIONS.setUserDisallowed(GENERAL_STRING_LIST); - + GENERAL_PERMISSIONITEM.setRpcName(GENERAL_STRING); GENERAL_PERMISSIONITEM.setHMIPermissions(GENERAL_HMIPERMISSIONS); GENERAL_PERMISSIONITEM.setParameterPermissions(GENERAL_PARAMETERPERMISSIONS); @@ -631,6 +683,24 @@ public class Test { GENERAL_RADIOCONTROLCAPABILITIES.setSignalChangeThresholdAvailable(GENERAL_BOOLEAN); GENERAL_RADIOCONTROLCAPABILITIES_LIST.add(GENERAL_RADIOCONTROLCAPABILITIES); + GENERAL_SEATCONTROLCAPABILITIES.setMemoryAvailable(GENERAL_BOOLEAN); + GENERAL_SEATCONTROLCAPABILITIES.setMassageCushionFirmnessAvailable(GENERAL_BOOLEAN); + GENERAL_SEATCONTROLCAPABILITIES.setMassageModeAvailable(GENERAL_BOOLEAN); + GENERAL_SEATCONTROLCAPABILITIES.setMassageEnabledAvailable(GENERAL_BOOLEAN); + GENERAL_SEATCONTROLCAPABILITIES.setHeadSupportVerticalPositionAvailable(GENERAL_BOOLEAN); + GENERAL_SEATCONTROLCAPABILITIES.setHeadSupportHorizontalPositionAvailable(GENERAL_BOOLEAN); + GENERAL_SEATCONTROLCAPABILITIES.setBackTiltAngleAvailable(GENERAL_BOOLEAN); + GENERAL_SEATCONTROLCAPABILITIES.setBackVerticalPositionAvailable(GENERAL_BOOLEAN); + GENERAL_SEATCONTROLCAPABILITIES.setFrontVerticalPositionAvailable(GENERAL_BOOLEAN); + GENERAL_SEATCONTROLCAPABILITIES.setVerticalPositionAvailable(GENERAL_BOOLEAN); + GENERAL_SEATCONTROLCAPABILITIES.setHorizontalPositionAvailable(GENERAL_BOOLEAN); + GENERAL_SEATCONTROLCAPABILITIES.setCoolingLevelAvailable(GENERAL_BOOLEAN); + GENERAL_SEATCONTROLCAPABILITIES.setHeatingLevelAvailable(GENERAL_BOOLEAN); + GENERAL_SEATCONTROLCAPABILITIES.setCoolingEnabledAvailable(GENERAL_BOOLEAN); + GENERAL_SEATCONTROLCAPABILITIES.setHeatingEnabledAvailable(GENERAL_BOOLEAN); + GENERAL_SEATCONTROLCAPABILITIES.setModuleName(GENERAL_STRING); + GENERAL_SEATCONTROLCAPABILITIES_LIST.add(GENERAL_SEATCONTROLCAPABILITIES); + GENERAL_REMOTECONTROLCAPABILITIES.setButtonCapabilities(GENERAL_BUTTONCAPABILITIES_LIST); GENERAL_REMOTECONTROLCAPABILITIES.setClimateControlCapabilities(GENERAL_CLIMATECONTROLCAPABILITIES_LIST); GENERAL_REMOTECONTROLCAPABILITIES.setRadioControlCapabilities(GENERAL_RADIOCONTROLCAPABILITIES_LIST); @@ -669,7 +739,7 @@ public class Test { GENERAL_DAYCOLORSCHEME.setSecondaryColor(GENERAL_RGBCOLOR); GENERAL_DAYCOLORSCHEME.setBackgroundColor(GENERAL_RGBCOLOR); - + try { JSON_HMIPERMISSIONS.put(HMIPermissions.KEY_ALLOWED, GENERAL_HMILEVEL_LIST); JSON_HMIPERMISSIONS.put(HMIPermissions.KEY_USER_DISALLOWED, GENERAL_HMILEVEL_LIST); @@ -677,14 +747,14 @@ public class Test { JSON_PCMSTREAMCAPABILITIES.put(AudioPassThruCapabilities.KEY_AUDIO_TYPE, GENERAL_AUDIOTYPE); JSON_PCMSTREAMCAPABILITIES.put(AudioPassThruCapabilities.KEY_BITS_PER_SAMPLE, GENERAL_BITSPERSAMPLE); JSON_PCMSTREAMCAPABILITIES.put(AudioPassThruCapabilities.KEY_SAMPLING_RATE, GENERAL_SAMPLINGRATE); - + JSON_TOUCHEVENTCAPABILITIES.put(TouchEventCapabilities.KEY_DOUBLE_PRESS_AVAILABLE, GENERAL_BOOLEAN); JSON_TOUCHEVENTCAPABILITIES.put(TouchEventCapabilities.KEY_MULTI_TOUCH_AVAILABLE, GENERAL_BOOLEAN); JSON_TOUCHEVENTCAPABILITIES.put(TouchEventCapabilities.KEY_PRESS_AVAILABLE, GENERAL_BOOLEAN); - + JSON_IMAGERESOLUTION.put(ImageResolution.KEY_RESOLUTION_HEIGHT, GENERAL_INT); JSON_IMAGERESOLUTION.put(ImageResolution.KEY_RESOLUTION_WIDTH, GENERAL_INT); - + JSON_CHOICE.put(Choice.KEY_MENU_NAME, GENERAL_STRING); JSON_CHOICE.put(Choice.KEY_SECONDARY_TEXT, GENERAL_STRING); JSON_CHOICE.put(Choice.KEY_TERTIARY_TEXT, GENERAL_STRING); @@ -692,25 +762,25 @@ public class Test { JSON_CHOICE.put(Choice.KEY_IMAGE, JSON_IMAGE); JSON_CHOICE.put(Choice.KEY_SECONDARY_IMAGE, JSON_IMAGE); JSON_CHOICE.put(Choice.KEY_VR_COMMANDS, JsonUtils.createJsonArray(GENERAL_STRING_LIST)); - + JSON_HMILEVELS.put(HMILevel.HMI_FULL); JSON_HMILEVELS.put(HMILevel.HMI_BACKGROUND); - + JSON_HMIPERMISSIONS.put(HMIPermissions.KEY_ALLOWED, JSON_HMILEVELS); JSON_HMIPERMISSIONS.put(HMIPermissions.KEY_USER_DISALLOWED, JSON_HMILEVELS); - + JSON_PARAMETERPERMISSIONS.put(ParameterPermissions.KEY_ALLOWED, JsonUtils.createJsonArray(GENERAL_STRING_LIST)); JSON_PARAMETERPERMISSIONS.put(ParameterPermissions.KEY_USER_DISALLOWED, JsonUtils.createJsonArray(GENERAL_STRING_LIST)); - + JSON_PERMISSIONITEM.put(PermissionItem.KEY_HMI_PERMISSIONS, JSON_HMIPERMISSIONS); JSON_PERMISSIONITEM.put(PermissionItem.KEY_PARAMETER_PERMISSIONS, JSON_PARAMETERPERMISSIONS); JSON_PERMISSIONITEM.put(PermissionItem.KEY_RPC_NAME, GENERAL_STRING); JSON_PERMISSIONITEMS.put(JSON_PERMISSIONITEM); - + JSON_IMAGE.put(Image.KEY_IMAGE_TYPE, GENERAL_IMAGETYPE); JSON_IMAGE.put(Image.KEY_VALUE, GENERAL_STRING); JSON_IMAGE.put(Image.KEY_IS_TEMPLATE, GENERAL_BOOLEAN); - + JSON_SOFTBUTTON.put(SoftButton.KEY_IS_HIGHLIGHTED , GENERAL_BOOLEAN); JSON_SOFTBUTTON.put(SoftButton.KEY_SOFT_BUTTON_ID, GENERAL_INT); JSON_SOFTBUTTON.put(SoftButton.KEY_SYSTEM_ACTION, SystemAction.STEAL_FOCUS); @@ -718,20 +788,20 @@ public class Test { JSON_SOFTBUTTON.put(SoftButton.KEY_TYPE, SoftButtonType.SBT_TEXT); JSON_SOFTBUTTON.put(SoftButton.KEY_IMAGE, GENERAL_IMAGE.serializeJSON()); JSON_SOFTBUTTONS.put(JSON_SOFTBUTTON); - + JSON_TURN.put(Turn.KEY_NAVIGATION_TEXT, GENERAL_STRING); JSON_TURN.put(Turn.KEY_TURN_IMAGE, GENERAL_IMAGE.serializeJSON()); JSON_TURNS.put(JSON_TURN); - + JSON_MENUPARAMS.put(MenuParams.KEY_MENU_NAME, GENERAL_STRING); JSON_MENUPARAMS.put(MenuParams.KEY_PARENT_ID, GENERAL_INT); JSON_MENUPARAMS.put(MenuParams.KEY_POSITION, GENERAL_INT); - + JSON_VRHELPITEM.put(VrHelpItem.KEY_TEXT, GENERAL_STRING); JSON_VRHELPITEM.put(VrHelpItem.KEY_IMAGE, JSON_IMAGE); JSON_VRHELPITEM.put(VrHelpItem.KEY_POSITION, GENERAL_INT); JSON_VRHELPITEMS.put(JSON_VRHELPITEM); - + JSONObject jsonTtsChunk = new JSONObject(); jsonTtsChunk.put(TTSChunk.KEY_TEXT, "Welcome to the jungle"); jsonTtsChunk.put(TTSChunk.KEY_TYPE, SpeechCapabilities.TEXT); @@ -740,19 +810,19 @@ public class Test { jsonTtsChunk.put(TTSChunk.KEY_TEXT, "Say a command"); jsonTtsChunk.put(TTSChunk.KEY_TYPE, SpeechCapabilities.TEXT); JSON_TTSCHUNKS.put(jsonTtsChunk); - + JSON_KEYBOARDPROPERTIES.put(KeyboardProperties.KEY_AUTO_COMPLETE_TEXT, GENERAL_STRING); JSON_KEYBOARDPROPERTIES.put(KeyboardProperties.KEY_KEYPRESS_MODE, KeypressMode.SINGLE_KEYPRESS); JSON_KEYBOARDPROPERTIES.put(KeyboardProperties.KEY_KEYBOARD_LAYOUT, KeyboardLayout.QWERTY); JSON_KEYBOARDPROPERTIES.put(KeyboardProperties.KEY_LANGUAGE, Language.EN_US); JSON_KEYBOARDPROPERTIES.put(KeyboardProperties.KEY_LIMITED_CHARACTER_LIST, JsonUtils.createJsonArray(GENERAL_STRING_LIST)); - + JSON_STARTTIME.put(StartTime.KEY_HOURS, GENERAL_STARTTIME.getHours()); JSON_STARTTIME.put(StartTime.KEY_MINUTES, GENERAL_STARTTIME.getMinutes()); JSON_STARTTIME.put(StartTime.KEY_SECONDS, GENERAL_STARTTIME.getSeconds()); - + JSON_CHOICES.put(JSON_CHOICE); - + JSON_DEVICEINFO.put(DeviceInfo.KEY_CARRIER, GENERAL_STRING); JSON_DEVICEINFO.put(DeviceInfo.KEY_FIRMWARE_REV, GENERAL_STRING); JSON_DEVICEINFO.put(DeviceInfo.KEY_HARDWARE, GENERAL_STRING); @@ -771,17 +841,17 @@ public class Test { JSON_NIGHTCOLORSCHEME.put(TemplateColorScheme.KEY_PRIMARY_COLOR, JSON_RGBCOLOR); JSON_NIGHTCOLORSCHEME.put(TemplateColorScheme.KEY_SECONDARY_COLOR, JSON_RGBCOLOR); JSON_NIGHTCOLORSCHEME.put(TemplateColorScheme.KEY_BACKGROUND_COLOR, JSON_RGBCOLOR); - + JSON_SDLMSGVERSION.put(SdlMsgVersion.KEY_MAJOR_VERSION, GENERAL_INT); - JSON_SDLMSGVERSION.put(SdlMsgVersion.KEY_MINOR_VERSION, GENERAL_INT); - + JSON_SDLMSGVERSION.put(SdlMsgVersion.KEY_MINOR_VERSION, GENERAL_INT); + JSON_DIDRESULT.put(DIDResult.KEY_DATA, GENERAL_STRING); JSON_DIDRESULT.put(DIDResult.KEY_DID_LOCATION, GENERAL_INT); JSON_DIDRESULT.put(DIDResult.KEY_RESULT_CODE, VehicleDataResultCode.SUCCESS); JSON_DIDRESULTS.put(JSON_DIDRESULT); - + JSON_PRESETBANKCAPABILITIES.put(PresetBankCapabilities.KEY_ON_SCREEN_PRESETS_AVAILABLE, GENERAL_BOOLEAN); - + JSONObject jsonButton = new JSONObject(); jsonButton.put(ButtonCapabilities.KEY_LONG_PRESS_AVAILABLE, false); jsonButton.put(ButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE, GENERAL_BOOLEAN); @@ -823,32 +893,32 @@ public class Test { jsonButton.put(SoftButtonCapabilities.KEY_UP_DOWN_AVAILABLE, GENERAL_BOOLEAN); jsonButton.put(SoftButtonCapabilities.KEY_IMAGE_SUPPORTED, GENERAL_BOOLEAN); JSON_SOFTBUTTONCAPABILITIES.put(jsonButton); - + jsonButton = new JSONObject(); jsonButton.put(AudioPassThruCapabilities.KEY_AUDIO_TYPE, GENERAL_AUDIOTYPE); jsonButton.put(AudioPassThruCapabilities.KEY_BITS_PER_SAMPLE, GENERAL_BITSPERSAMPLE); jsonButton.put(AudioPassThruCapabilities.KEY_SAMPLING_RATE, GENERAL_SAMPLINGRATE); JSON_AUDIOPASSTHRUCAPABILITIES.put(jsonButton); - + JSON_TEXTFIELD.put(TextField.KEY_CHARACTER_SET, CharacterSet.CID1SET); JSON_TEXTFIELD.put(TextField.KEY_NAME, TextFieldName.ETA); JSON_TEXTFIELD.put(TextField.KEY_ROWS, GENERAL_INT); JSON_TEXTFIELD.put(TextField.KEY_WIDTH, GENERAL_INT); 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_NAME, ImageFieldName.graphic); JSON_IMAGEFIELDS.put(JSON_IMAGEFIELD); - + JSONObject jsonTEC = new JSONObject(); jsonTEC.put(TouchEventCapabilities.KEY_DOUBLE_PRESS_AVAILABLE, GENERAL_BOOLEAN); jsonTEC.put(TouchEventCapabilities.KEY_MULTI_TOUCH_AVAILABLE, GENERAL_BOOLEAN); jsonTEC.put(TouchEventCapabilities.KEY_PRESS_AVAILABLE, GENERAL_BOOLEAN); - + JSON_SCREENPARAMS.put(ScreenParams.KEY_RESOLUTION, JSON_IMAGERESOLUTION); JSON_SCREENPARAMS.put(ScreenParams.KEY_TOUCH_EVENT_AVAILABLE, jsonTEC); - + JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_DISPLAY_TYPE, GENERAL_DISPLAYTYPE); JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_DISPLAY_NAME, GENERAL_STRING); JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_GRAPHIC_SUPPORTED, GENERAL_BOOLEAN); @@ -858,11 +928,11 @@ public class Test { JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_SCREEN_PARAMS, JSON_SCREENPARAMS); JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_TEMPLATES_AVAILABLE, JsonUtils.createJsonArray(GENERAL_STRING_LIST)); JSON_DISPLAYCAPABILITIES.put(DisplayCapabilities.KEY_TEXT_FIELDS, JSON_TEXTFIELDS); - + JSON_TOUCHCOORD.put(TouchCoord.KEY_X, GENERAL_INT); JSON_TOUCHCOORD.put(TouchCoord.KEY_Y, GENERAL_INT); JSON_TOUCHCOORDS.put(JSON_TOUCHCOORD); - + JSON_TOUCHEVENT.put(TouchEvent.KEY_C, JSON_TOUCHCOORDS); JSON_TOUCHEVENT.put(TouchEvent.KEY_ID, GENERAL_INT); JSON_TOUCHEVENT.put(TouchEvent.KEY_TS, JsonUtils.createJsonArray(GENERAL_LONG_LIST)); @@ -871,9 +941,9 @@ public class Test { JSON_TEXTFIELDTYPES.put(MetadataType.CURRENT_TEMPERATURE); JSON_TEXTFIELDTYPES.put(MetadataType.MEDIA_ALBUM); JSON_TEXTFIELDTYPES.put(MetadataType.MEDIA_ARTIST); - + } catch (JSONException e) { Log.e("Test", "Static Json Construction Failed.", e); } - } + } } diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java index ec3add129..3786f0ca6 100644 --- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java @@ -1,8 +1,5 @@ package com.smartdevicelink.test; -import java.util.Iterator; -import java.util.List; - import com.smartdevicelink.protocol.enums.FrameData; import com.smartdevicelink.protocol.enums.FrameDataControlFrameType; import com.smartdevicelink.protocol.enums.FrameType; @@ -33,6 +30,8 @@ import com.smartdevicelink.proxy.rpc.Image; import com.smartdevicelink.proxy.rpc.ImageField; import com.smartdevicelink.proxy.rpc.ImageResolution; import com.smartdevicelink.proxy.rpc.KeyboardProperties; +import com.smartdevicelink.proxy.rpc.MassageCushionFirmness; +import com.smartdevicelink.proxy.rpc.MassageModeData; import com.smartdevicelink.proxy.rpc.MenuParams; import com.smartdevicelink.proxy.rpc.ModuleData; import com.smartdevicelink.proxy.rpc.MyKey; @@ -46,10 +45,13 @@ import com.smartdevicelink.proxy.rpc.RGBColor; import com.smartdevicelink.proxy.rpc.RadioControlCapabilities; import com.smartdevicelink.proxy.rpc.RadioControlData; import com.smartdevicelink.proxy.rpc.RdsData; -import com.smartdevicelink.proxy.rpc.RemoteControlCapabilities; import com.smartdevicelink.proxy.rpc.Rectangle; +import com.smartdevicelink.proxy.rpc.RemoteControlCapabilities; import com.smartdevicelink.proxy.rpc.ScreenParams; import com.smartdevicelink.proxy.rpc.SdlMsgVersion; +import com.smartdevicelink.proxy.rpc.SeatControlCapabilities; +import com.smartdevicelink.proxy.rpc.SeatControlData; +import com.smartdevicelink.proxy.rpc.SeatMemoryAction; import com.smartdevicelink.proxy.rpc.SingleTireStatus; import com.smartdevicelink.proxy.rpc.SoftButton; import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities; @@ -71,9 +73,12 @@ import com.smartdevicelink.proxy.rpc.VrHelpItem; import com.smartdevicelink.proxy.rpc.enums.DefrostZone; import com.smartdevicelink.proxy.rpc.enums.FileType; import com.smartdevicelink.proxy.rpc.enums.HMILevel; -import com.smartdevicelink.proxy.rpc.enums.VentilationMode; import com.smartdevicelink.proxy.rpc.enums.HmiZoneCapabilities; import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities; +import com.smartdevicelink.proxy.rpc.enums.VentilationMode; + +import java.util.Iterator; +import java.util.List; public class Validator{ @@ -708,6 +713,62 @@ public class Validator{ return true; } + public static boolean validateSeatControlData(SeatControlData seatControlData1, SeatControlData seatControlData2) { + if (seatControlData1 == null) { + return (seatControlData2 == null); + } + if (seatControlData2 == null) { + return (seatControlData1 == null); + } + + if (seatControlData1.getCoolingEnabled() != seatControlData2.getCoolingEnabled()) { + return false; + } + if (seatControlData1.getHeatingEnabled() != seatControlData2.getHeatingEnabled()) { + return false; + } + if (seatControlData1.getMassageEnabled() != seatControlData2.getMassageEnabled()) { + return false; + } + if (seatControlData1.getBackTiltAngle() != seatControlData2.getBackTiltAngle()) { + return false; + } + if (seatControlData1.getBackVerticalPosition() != seatControlData2.getBackVerticalPosition()) { + return false; + } + if (seatControlData1.getCoolingLevel() != seatControlData2.getCoolingLevel()) { + return false; + } + if (seatControlData1.getFrontVerticalPosition() != seatControlData2.getFrontVerticalPosition()) { + return false; + } + if (seatControlData1.getHeadSupportHorizontalPosition() != seatControlData2.getHeadSupportHorizontalPosition()) { + return false; + } + if (seatControlData1.getHeadSupportVerticalPosition() != seatControlData2.getHeadSupportVerticalPosition()) { + return false; + } + if (seatControlData1.getHeatingLevel() != seatControlData2.getHeatingLevel()) { + return false; + } + if (seatControlData1.getHorizontalPosition() != seatControlData2.getHorizontalPosition()) { + return false; + } + if (seatControlData1.getId() != seatControlData2.getId()) { + return false; + } + + if (!(validateSeatMemoryAction(seatControlData1.getMemory(), seatControlData2.getMemory()))) { + return false; + } + + if (!(validateSeatMemoryAction(seatControlData1.getMemory(), seatControlData2.getMemory()))) { + return false; + } + + return true; + } + public static boolean validateModuleData(ModuleData moduleData1, ModuleData moduleData2){ if(moduleData1 == null){ return ( moduleData2 == null ); @@ -906,6 +967,33 @@ public class Validator{ return true; } + public static boolean validateSeatMemoryAction(SeatMemoryAction item1, SeatMemoryAction item2) { + if (item1 == null) { + return (item2 == null); + } + if (item2 == null) { + return (item1 == null); + } + + if (item1.getAction() == null) { + return (item2.getAction() == null); + } + + if (item1.getAction() != item2.getAction()) { + return false; + } + + if (item1.getId() != item2.getId()) { + return false; + } + + if (item1.getLabel() != item2.getLabel()) { + return false; + } + + return true; + } + public static boolean validateTextFields(TextField item1, TextField item2){ if(item1 == null){ return ( item2 == null ); @@ -1541,6 +1629,86 @@ public class Validator{ return true; } + public static boolean validateMassageModeData(MassageModeData item1, MassageModeData item2) { + if (item1 == null) { + return (item2 == null); + } + if (item2 == null) { + return (item1 == null); + } + + if (item1.getMassageMode() != item2.getMassageMode()) { + return false; + } + + if (item1.getMassageZone() != item2.getMassageZone()) { + return false; + } + + return true; + } + + public static boolean validateMassageModeDataList(List<MassageModeData> item1, List<MassageModeData> item2) { + if (item1 == null) { + return (item2 == null); + } + if (item2 == null) { + return (item1 == null); + } + + if (item1.size() != item2.size()) { + return false; + } + + for (int i = 0; i < item1.size(); i++) { + if (!validateMassageModeData(item1.get(i), item2.get(i))) { + return false; + } + } + + return true; + } + + public static boolean validateMassageCushionFirmness(MassageCushionFirmness item1, MassageCushionFirmness item2) { + if (item1 == null) { + return (item2 == null); + } + if (item2 == null) { + return (item1 == null); + } + + if (item1.getCushion() != item2.getCushion()) { + return false; + } + + if (item1.getFirmness() != item2.getFirmness()) { + return false; + } + + return true; + } + + public static boolean validateMassageCushionFirmnessList(List<MassageCushionFirmness> item1, List<MassageCushionFirmness> item2) { + if (item1 == null) { + return (item2 == null); + } + if (item2 == null) { + return (item1 == null); + } + + if (item1.size() != item2.size()) { + return false; + } + + for (int i = 0; i < item1.size(); i++) { + if (!validateMassageCushionFirmness(item1.get(i), item2.get(i))) { + return false; + } + } + + return true; + } + public static void log(String tag, String msg){ Logger.log(tag, msg); } @@ -1634,7 +1802,7 @@ public class Validator{ return true; } - + public static boolean validateDisplayCapabilities (DisplayCapabilities item1, DisplayCapabilities item2) { if (item1 == null) { return ( item2 == null ); @@ -1896,6 +2064,87 @@ public class Validator{ return true; } + public static boolean validateSeatControlCapabilities(SeatControlCapabilities item1, SeatControlCapabilities item2) { + if (item1 == null) { + return (item2 == null); + } + if (item2 == null) { + return (item1 == null); + } + + if (item1.getModuleName() != item2.getModuleName()) { + return false; + } + if (item1.getHeatingEnabledAvailable() != item2.getHeatingEnabledAvailable()) { + return false; + } + if (item1.getCoolingEnabledAvailable() != item2.getCoolingEnabledAvailable()) { + return false; + } + if (item1.getHeatingLevelAvailable() != item2.getHeatingLevelAvailable()) { + return false; + } + if (item1.getCoolingLevelAvailable() != item2.getCoolingLevelAvailable()) { + return false; + } + if (item1.getHorizontalPositionAvailable() != item2.getHorizontalPositionAvailable()) { + return false; + } + if (item1.getVerticalPositionAvailable() != item2.getVerticalPositionAvailable()) { + return false; + } + if (item1.getFrontVerticalPositionAvailable() != item2.getFrontVerticalPositionAvailable()) { + return false; + } + if (item1.getBackVerticalPositionAvailable() != item2.getBackVerticalPositionAvailable()) { + return false; + } + if (item1.getBackTiltAngleAvailable() != item2.getBackTiltAngleAvailable()) { + return false; + } + if (item1.getHeadSupportVerticalPositionAvailable() != item2.getHeadSupportVerticalPositionAvailable()) { + return false; + } + if (item1.getHeadSupportHorizontalPositionAvailable() != item2.getHeadSupportHorizontalPositionAvailable()) { + return false; + } + if (item1.getMassageEnabledAvailable() != item2.getMassageEnabledAvailable()) { + return false; + } + if (item1.getMassageModeAvailable() != item2.getMassageModeAvailable()) { + return false; + } + if (item1.getMassageCushionFirmnessAvailable() != item2.getMassageCushionFirmnessAvailable()) { + return false; + } + if (item1.getMemoryAvailable() != item2.getMemoryAvailable()) { + return false; + } + + return true; + } + + public static boolean validateSeatControlCapabilitiesList(List<SeatControlCapabilities> item1, List<SeatControlCapabilities> item2) { + if (item1 == null) { + return (item2 == null); + } + if (item2 == null) { + return (item1 == null); + } + + if (item1.size() != item2.size()) { + return false; + } + + for (int i = 0; i < item1.size(); i++) { + if (!validateSeatControlCapabilities(item1.get(i), item2.get(i))) { + return false; + } + } + + return true; + } + public static boolean validateDefrostZones (List<DefrostZone> item1, List<DefrostZone> item2) { if (item1 == null) { return ( item2 == null ); diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java new file mode 100644 index 000000000..da8a7cbfe --- /dev/null +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageCushionFirmnessTest.java @@ -0,0 +1,71 @@ +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 junit.framework.TestCase; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.Iterator; + +/** + * This is a unit test class for the SmartDeviceLink library project class : + * {@link com.smartdevicelink.rpc.MassageCushionFirmness} + */ +public class MassageCushionFirmnessTest extends TestCase { + + private MassageCushionFirmness msg; + + @Override + public void setUp() { + msg = new MassageCushionFirmness(); + + msg.setCushion(Test.GENERAL_MASSAGECUSHION); + msg.setFirmness(Test.GENERAL_INT); + } + + /** + * Tests the expected values of the RPC message. + */ + public void testRpcValues() { + // Test Values + MassageCushion cushion = msg.getCushion(); + Integer firmness = msg.getFirmness(); + + // Valid Tests + assertEquals(Test.MATCH, Test.GENERAL_MASSAGECUSHION, cushion); + assertEquals(Test.MATCH, (Integer) Test.GENERAL_INT, firmness); + + // Invalid/Null Tests + MassageCushionFirmness msg = new MassageCushionFirmness(); + assertNotNull(Test.NOT_NULL, msg); + + assertNull(Test.NULL, msg.getCushion()); + assertNull(Test.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); + + JSONObject underTest = msg.serializeJSON(); + assertEquals(Test.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)); + } + } catch (JSONException e) { + fail(Test.JSON_FAIL); + } + } +}
\ No newline at end of file diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageModeDataTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageModeDataTest.java new file mode 100644 index 000000000..958de9fa2 --- /dev/null +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MassageModeDataTest.java @@ -0,0 +1,74 @@ +package com.smartdevicelink.test.rpc.datatypes; + +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 junit.framework.TestCase; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.Iterator; + +/** + * This is a unit test class for the SmartDeviceLink library project class : + * {@link com.smartdevicelink.rpc.MassageModeData} + */ +public class MassageModeDataTest extends TestCase { + + private MassageModeData msg; + + @Override + public void setUp() { + msg = new MassageModeData(); + + msg.setMassageZone(Test.GENERAL_MASSAGEZONE); + msg.setMassageMode(Test.GENERAL_MASSAGEMODE); + } + + /** + * Tests the expected values of the RPC message. + */ + public void testRpcValues() { + // Test Values + MassageZone massageZone = msg.getMassageZone(); + MassageMode massageMode = msg.getMassageMode(); + + // Valid Tests + assertEquals(Test.MATCH, Test.GENERAL_MASSAGEZONE, massageZone); + assertEquals(Test.MATCH, Test.GENERAL_MASSAGEMODE, massageMode); + + + // Invalid/Null Tests + MassageModeData msg = new MassageModeData(); + assertNotNull(Test.NOT_NULL, msg); + + assertNull(Test.NULL, msg.getMassageMode()); + assertNull(Test.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); + + JSONObject underTest = msg.serializeJSON(); + assertEquals(Test.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)); + + } + } catch (JSONException e) { + fail(Test.JSON_FAIL); + } + } +}
\ No newline at end of file diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java index ea71dfc8a..067216169 100644 --- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java @@ -4,6 +4,7 @@ import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.rpc.ClimateControlData; import com.smartdevicelink.proxy.rpc.ModuleData; 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; @@ -18,78 +19,89 @@ import java.util.Hashtable; import java.util.Iterator; /** - * 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.rpc.ModuleData} */ -public class ModuleDataTests extends TestCase{ - - private ModuleData msg; +public class ModuleDataTests extends TestCase { - @Override - public void setUp(){ - msg = new ModuleData(); + private ModuleData msg; - msg.setModuleType(Test.GENERAL_MODULETYPE); - msg.setRadioControlData(Test.GENERAL_RADIOCONTROLDATA); - msg.setClimateControlData(Test.GENERAL_CLIMATECONTROLDATA); - } + @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); + } + + /** * Tests the expected values of the RPC message. */ - public void testRpcValues () { - // Test Values - ModuleType moduleType = msg.getModuleType(); - RadioControlData radioControlData = msg.getRadioControlData(); - ClimateControlData climateControlData = msg.getClimateControlData(); - - // 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)); - - // 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()); - } - - 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())); - - JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); - - Iterator<?> iterator = reference.keys(); - while(iterator.hasNext()){ - String key = (String) iterator.next(); - - if(key.equals(ModuleData.KEY_RADIO_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.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))); - } else{ - assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); - } - } - } catch(JSONException e){ - fail(Test.JSON_FAIL); - } - } + public void testRpcValues() { + // Test Values + ModuleType moduleType = msg.getModuleType(); + RadioControlData radioControlData = msg.getRadioControlData(); + ClimateControlData climateControlData = msg.getClimateControlData(); + SeatControlData seatControlData = msg.getSeatControlData(); + + // 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)); + + // 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()); + } + + 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())); + + JSONObject underTest = msg.serializeJSON(); + assertEquals(Test.MATCH, reference.length(), underTest.length()); + + Iterator<?> iterator = reference.keys(); + while (iterator.hasNext()) { + String key = (String) iterator.next(); + + if (key.equals(ModuleData.KEY_RADIO_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.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))); + } 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))); + } else { + assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + } + } + } catch (JSONException e) { + fail(Test.JSON_FAIL); + } + } }
\ No newline at end of file diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java index a15179b8f..6e29f01a3 100644 --- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java @@ -5,6 +5,7 @@ import com.smartdevicelink.proxy.rpc.ButtonCapabilities; import com.smartdevicelink.proxy.rpc.ClimateControlCapabilities; 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.Validator; @@ -21,111 +22,125 @@ 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.rpc.RemoteControlCapabilities} */ -public class RemoteControlCapabilitiesTests extends TestCase{ - - private RemoteControlCapabilities msg; +public class RemoteControlCapabilitiesTests extends TestCase { - @Override - public void setUp(){ - msg = new RemoteControlCapabilities(); + private RemoteControlCapabilities msg; - msg.setButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST); - msg.setRadioControlCapabilities(Test.GENERAL_RADIOCONTROLCAPABILITIES_LIST); - msg.setClimateControlCapabilities(Test.GENERAL_CLIMATECONTROLCAPABILITIES_LIST); - } + @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); + } + + /** * Tests the expected values of the RPC message. */ - public void testRpcValues () { - // Test Values - List<ButtonCapabilities> buttonCapabilities = msg.getButtonCapabilities(); - List<RadioControlCapabilities> radioControlCapabilities = msg.getRadioControlCapabilities(); - List<ClimateControlCapabilities> climateControlCapabilities = msg.getClimateControlCapabilities(); - - // 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()); - - 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)); - - // 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()); - - } - - 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); - - JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); - - Iterator<?> iterator = reference.keys(); - while(iterator.hasNext()){ - String key = (String) iterator.next(); - - 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()); - - List<ButtonCapabilities> referenceList = new ArrayList<ButtonCapabilities>(); - List<ButtonCapabilities> testList = new ArrayList<ButtonCapabilities>(); - for(int i = 0; i < referenceArray.length(); i++){ - Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i)); - referenceList.add(new ButtonCapabilities(hashReference)); - Hashtable<String, Object> hashTest= JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); - testList.add(new ButtonCapabilities(hashTest)); - } - assertTrue(Test.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()); - - List<RadioControlCapabilities> referenceList = new ArrayList<RadioControlCapabilities>(); - List<RadioControlCapabilities> testList = new ArrayList<RadioControlCapabilities>(); - for(int i = 0; i < referenceArray.length(); i++){ - Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i)); - referenceList.add(new RadioControlCapabilities(hashReference)); - Hashtable<String, Object> hashTest= JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); - testList.add(new RadioControlCapabilities(hashTest)); - } - assertTrue(Test.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()); - - List<ClimateControlCapabilities> referenceList = new ArrayList<ClimateControlCapabilities>(); - List<ClimateControlCapabilities> testList = new ArrayList<ClimateControlCapabilities>(); - for(int i = 0; i < referenceArray.length(); i++){ - Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i)); - referenceList.add(new ClimateControlCapabilities(hashReference)); - Hashtable<String, Object> hashTest= JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); - testList.add(new ClimateControlCapabilities(hashTest)); - } - assertTrue(Test.TRUE, Validator.validateClimateControlCapabilities(referenceList, testList)); - } - } - } catch(JSONException e){ - fail(Test.JSON_FAIL); - } - } + public void testRpcValues() { + // Test Values + List<ButtonCapabilities> buttonCapabilities = msg.getButtonCapabilities(); + List<RadioControlCapabilities> radioControlCapabilities = msg.getRadioControlCapabilities(); + List<ClimateControlCapabilities> climateControlCapabilities = msg.getClimateControlCapabilities(); + List<SeatControlCapabilities> seatControlCapabilities = msg.getSeatControlCapabilities(); + + // 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)); + + // 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()); + + } + + 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); + + JSONObject underTest = msg.serializeJSON(); + assertEquals(Test.MATCH, reference.length(), underTest.length()); + + Iterator<?> iterator = reference.keys(); + while (iterator.hasNext()) { + String key = (String) iterator.next(); + + 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()); + + List<ButtonCapabilities> referenceList = new ArrayList<ButtonCapabilities>(); + List<ButtonCapabilities> testList = new ArrayList<ButtonCapabilities>(); + for (int i = 0; i < referenceArray.length(); i++) { + Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i)); + referenceList.add(new ButtonCapabilities(hashReference)); + Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); + testList.add(new ButtonCapabilities(hashTest)); + } + assertTrue(Test.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()); + + List<RadioControlCapabilities> referenceList = new ArrayList<RadioControlCapabilities>(); + List<RadioControlCapabilities> testList = new ArrayList<RadioControlCapabilities>(); + for (int i = 0; i < referenceArray.length(); i++) { + Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i)); + referenceList.add(new RadioControlCapabilities(hashReference)); + Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); + testList.add(new RadioControlCapabilities(hashTest)); + } + assertTrue(Test.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()); + + List<ClimateControlCapabilities> referenceList = new ArrayList<ClimateControlCapabilities>(); + List<ClimateControlCapabilities> testList = new ArrayList<ClimateControlCapabilities>(); + for (int i = 0; i < referenceArray.length(); i++) { + Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i)); + referenceList.add(new ClimateControlCapabilities(hashReference)); + Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); + testList.add(new ClimateControlCapabilities(hashTest)); + } + assertTrue(Test.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); + int i = 0; + for (SeatControlCapabilities scc : sccReference) { + assertTrue(Validator.validateSeatControlCapabilities(scc, new SeatControlCapabilities(JsonRPCMarshaller.deserializeJSONObject(sccArray.getJSONObject(i++))))); + } + } + } + } catch (JSONException e) { + fail(Test.JSON_FAIL); + } + } }
\ No newline at end of file diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlCapabilitiesTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlCapabilitiesTest.java new file mode 100644 index 000000000..d988fa991 --- /dev/null +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlCapabilitiesTest.java @@ -0,0 +1,141 @@ +package com.smartdevicelink.test.rpc.datatypes; + +import com.smartdevicelink.proxy.rpc.SeatControlCapabilities; +import com.smartdevicelink.test.JsonUtils; +import com.smartdevicelink.test.Test; + +import junit.framework.TestCase; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.Iterator; + +/** + * This is a unit test class for the SmartDeviceLink library project class : + * {@link com.smartdevicelink.rpc.SeatControlCapabilities} + */ +public class SeatControlCapabilitiesTest extends TestCase { + + private SeatControlCapabilities msg; + + @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); + } + + /** + * Tests the expected values of the RPC message. + */ + public void testRpcValues() { + // Test Values + String moduleName = msg.getModuleName(); + Boolean heatingEnabledAvailable = msg.getHeatingEnabledAvailable(); + Boolean coolingEnabledAvailable = msg.getCoolingEnabledAvailable(); + Boolean heatingLevelAvailable = msg.getHeatingLevelAvailable(); + Boolean coolingLevelAvailable = msg.getCoolingLevelAvailable(); + Boolean horizontalPositionAvailable = msg.getHorizontalPositionAvailable(); + Boolean verticalPositionAvailable = msg.getVerticalPositionAvailable(); + Boolean frontVerticalPositionAvailable = msg.getFrontVerticalPositionAvailable(); + Boolean backVerticalPositionAvailable = msg.getBackVerticalPositionAvailable(); + Boolean backTiltAngleAvailable = msg.getBackTiltAngleAvailable(); + Boolean headSupportHorizontalPositionAvailable = msg.getHeadSupportHorizontalPositionAvailable(); + Boolean headSupportVerticalPositionAvailable = msg.getHeadSupportVerticalPositionAvailable(); + Boolean massageEnabledAvailable = msg.getMassageEnabledAvailable(); + Boolean massageModeAvailable = msg.getMassageModeAvailable(); + Boolean massageCushionFirmnessAvailable = msg.getMassageCushionFirmnessAvailable(); + + 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); + + // 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()); + } + + 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); + + JSONObject underTest = msg.serializeJSON(); + assertEquals(Test.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)); + } + } catch (JSONException e) { + fail(Test.JSON_FAIL); + } + } +}
\ No newline at end of file diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlDataTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlDataTest.java new file mode 100644 index 000000000..535e7cf3e --- /dev/null +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatControlDataTest.java @@ -0,0 +1,173 @@ +package com.smartdevicelink.test.rpc.datatypes; + +import com.smartdevicelink.marshal.JsonRPCMarshaller; +import com.smartdevicelink.proxy.rpc.MassageCushionFirmness; +import com.smartdevicelink.proxy.rpc.MassageModeData; +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.Validator; + +import junit.framework.TestCase; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; + +/** + * This is a unit test class for the SmartDeviceLink library project class : + * {@link com.smartdevicelink.rpc.SeatControlData} + */ +public class SeatControlDataTest extends TestCase { + + private SeatControlData msg; + + @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); + } + + /** + * Tests the expected values of the RPC message. + */ + public void testRpcValues() { + // Test Values + SupportedSeat id = msg.getId(); + Boolean heatingEnabled = msg.getHeatingEnabled(); + Boolean coolingEnabled = msg.getCoolingEnabled(); + Integer heatingLevel = msg.getHeatingLevel(); + Integer coolingLevel = msg.getCoolingLevel(); + Integer horizontalPosition = msg.getHorizontalPosition(); + Integer verticalPosition = msg.getVerticalPosition(); + Integer frontVerticalPosition = msg.getFrontVerticalPosition(); + Integer backVerticalPosition = msg.getBackVerticalPosition(); + Integer backTiltAngle = msg.getBackTiltAngle(); + Integer headSupportHorizontalPosition = msg.getHeadSupportHorizontalPosition(); + Integer headSupportVerticalPosition = msg.getHeadSupportVerticalPosition(); + Boolean massageEnabled = msg.getMassageEnabled(); + + List<MassageModeData> massageMode = msg.getMassageMode(); + List<MassageCushionFirmness> massageCushionFirmness = msg.getMassageCushionFirmness(); + 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)); + + // 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()); + } + + 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); + + JSONObject underTest = msg.serializeJSON(); + assertEquals(Test.MATCH, reference.length(), underTest.length()); + + Iterator<?> iterator = reference.keys(); + while (iterator.hasNext()) { + String key = (String) iterator.next(); + + if (key.equals(SeatControlData.KEY_MASSAGE_MODE)) { + List<MassageModeData> mmdReference = (List<MassageModeData>) JsonUtils.readObjectFromJsonObject(reference, key); + JSONArray mmdArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); + int i = 0; + for (MassageModeData mmd : mmdReference) { + assertTrue(Validator.validateMassageModeData(mmd, new MassageModeData(JsonRPCMarshaller.deserializeJSONObject(mmdArray.getJSONObject(i++))))); + } + } else if (key.equals(SeatControlData.KEY_MASSAGE_CUSHION_FIRMNESS)) { + List<MassageCushionFirmness> mcfReference = (List<MassageCushionFirmness>) JsonUtils.readObjectFromJsonObject(reference, key); + JSONArray mcfArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); + int i = 0; + for (MassageCushionFirmness mcf : mcfReference) { + assertTrue(Validator.validateMassageCushionFirmness(mcf, new MassageCushionFirmness(JsonRPCMarshaller.deserializeJSONObject(mcfArray.getJSONObject(i++))))); + } + } else if (key.equals(SeatControlData.KEY_MEMORY)) { + SeatMemoryAction mReference = (SeatMemoryAction) JsonUtils.readObjectFromJsonObject(reference, key); + 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)); + } + } + } catch (JSONException e) { + fail(Test.JSON_FAIL); + } + } +}
\ No newline at end of file diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatMemoryActionTest.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatMemoryActionTest.java new file mode 100644 index 000000000..a8c17cee3 --- /dev/null +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatMemoryActionTest.java @@ -0,0 +1,75 @@ +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 junit.framework.TestCase; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.Iterator; + +/** + * This is a unit test class for the SmartDeviceLink library project class : + * {@link com.smartdevicelink.rpc.SeatMemoryAction} + */ +public class SeatMemoryActionTest extends TestCase { + + private SeatMemoryAction msg; + + @Override + public void setUp() { + msg = new SeatMemoryAction(); + + msg.setId(Test.GENERAL_INT); + msg.setLabel(Test.GENERAL_STRING); + msg.setAction(Test.GENERAL_SEATMEMORYACTIONTYPE); + } + + /** + * Tests the expected values of the RPC message. + */ + public void testRpcValues() { + // Test Values + Integer id = msg.getId(); + String label = msg.getLabel(); + 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); + + // Invalid/Null Tests + SeatMemoryAction msg = new SeatMemoryAction(); + assertNotNull(Test.NOT_NULL, msg); + + assertNull(Test.NULL, msg.getId()); + assertNull(Test.NULL, msg.getLabel()); + assertNull(Test.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); + + JSONObject underTest = msg.serializeJSON(); + assertEquals(Test.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)); + } + } catch (JSONException e) { + fail(Test.JSON_FAIL); + } + } +}
\ No newline at end of file diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageCushionTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageCushionTests.java new file mode 100644 index 000000000..e1f58ffef --- /dev/null +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageCushionTests.java @@ -0,0 +1,81 @@ +package com.smartdevicelink.test.rpc.enums; + +import com.smartdevicelink.proxy.rpc.enums.MassageCushion; + +import junit.framework.TestCase; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * This is a unit test class for the SmartDeviceLink library project class : + * {@link com.smartdevicelink.rpc.enums.MassageCushion} + */ +public class MassageCushionTests extends TestCase { + + /** + * Verifies that the enum values are not null upon valid assignment. + */ + public void testValidEnums() { + String example = "TOP_LUMBAR"; + MassageCushion enumTopLumbar = MassageCushion.valueForString(example); + example = "MIDDLE_LUMBAR"; + MassageCushion enumMiddleLumbar = MassageCushion.valueForString(example); + example = "BOTTOM_LUMBAR"; + MassageCushion enumBottomLumbar = MassageCushion.valueForString(example); + example = "BACK_BOLSTERS"; + MassageCushion enumBackBolsters = MassageCushion.valueForString(example); + example = "SEAT_BOLSTERS"; + MassageCushion enumSeatBolsters = MassageCushion.valueForString(example); + + assertNotNull("TOP_LUMBAR returned null", enumTopLumbar); + assertNotNull("MIDDLE_LUMBAR returned null", enumMiddleLumbar); + assertNotNull("BOTTOM_LUMBAR returned null", enumBottomLumbar); + assertNotNull("BACK_BOLSTERS returned null", enumBackBolsters); + assertNotNull("SEAT_BOLSTERS returned null", enumSeatBolsters); + } + + /** + * Verifies that an invalid assignment is null. + */ + public void testInvalidEnum() { + String example = "tOP_LUMBAR"; + try { + MassageCushion temp = MassageCushion.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 { + MassageCushion temp = MassageCushion.valueForString(example); + assertNull("Result of valueForString should be null.", temp); + } catch (NullPointerException exception) { + fail("Null string throws NullPointerException."); + } + } + + /** + * Verifies the possible enum values of MassageCushion. + */ + public void testListEnum() { + List<MassageCushion> enumValueList = Arrays.asList(MassageCushion.values()); + + List<MassageCushion> enumTestList = new ArrayList<MassageCushion>(); + enumTestList.add(MassageCushion.TOP_LUMBAR); + enumTestList.add(MassageCushion.MIDDLE_LUMBAR); + enumTestList.add(MassageCushion.BOTTOM_LUMBAR); + enumTestList.add(MassageCushion.BACK_BOLSTERS); + enumTestList.add(MassageCushion.SEAT_BOLSTERS); + + 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/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageModeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageModeTests.java new file mode 100644 index 000000000..55e82ac21 --- /dev/null +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageModeTests.java @@ -0,0 +1,73 @@ +package com.smartdevicelink.test.rpc.enums; + +import com.smartdevicelink.proxy.rpc.enums.MassageMode; + +import junit.framework.TestCase; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * This is a unit test class for the SmartDeviceLink library project class : + * {@link com.smartdevicelink.rpc.enums.MassageMode} + */ +public class MassageModeTests extends TestCase { + + /** + * Verifies that the enum values are not null upon valid assignment. + */ + public void testValidEnums() { + String example = "OFF"; + MassageMode enumOff = MassageMode.valueForString(example); + example = "LOW"; + MassageMode enumLow = MassageMode.valueForString(example); + example = "HIGH"; + MassageMode enumHigh = MassageMode.valueForString(example); + + assertNotNull("OFF returned null", enumOff); + assertNotNull("LOW returned null", enumLow); + assertNotNull("HIGH returned null", enumHigh); + } + + /** + * Verifies that an invalid assignment is null. + */ + public void testInvalidEnum() { + String example = "oFF"; + try { + MassageMode temp = MassageMode.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 { + MassageMode temp = MassageMode.valueForString(example); + assertNull("Result of valueForString should be null.", temp); + } catch (NullPointerException exception) { + fail("Null string throws NullPointerException."); + } + } + + /** + * Verifies the possible enum values of MassageMode. + */ + public void testListEnum() { + List<MassageMode> enumValueList = Arrays.asList(MassageMode.values()); + + List<MassageMode> enumTestList = new ArrayList<MassageMode>(); + enumTestList.add(MassageMode.OFF); + enumTestList.add(MassageMode.LOW); + enumTestList.add(MassageMode.HIGH); + + 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/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageZoneTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageZoneTests.java new file mode 100644 index 000000000..bbd543d4e --- /dev/null +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MassageZoneTests.java @@ -0,0 +1,69 @@ +package com.smartdevicelink.test.rpc.enums; + +import com.smartdevicelink.proxy.rpc.enums.MassageZone; + +import junit.framework.TestCase; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * This is a unit test class for the SmartDeviceLink library project class : + * {@link com.smartdevicelink.rpc.enums.MassageZone} + */ +public class MassageZoneTests extends TestCase { + + /** + * Verifies that the enum values are not null upon valid assignment. + */ + public void testValidEnums() { + String example = "LUMBAR"; + MassageZone enumLumbar = MassageZone.valueForString(example); + example = "SEAT_CUSHION"; + MassageZone enumSeatCushion = MassageZone.valueForString(example); + + assertNotNull("LUMBAR returned null", enumLumbar); + assertNotNull("SEAT_CUSHION returned null", enumSeatCushion); + } + + /** + * Verifies that an invalid assignment is null. + */ + public void testInvalidEnum() { + String example = "lUMBAR"; + try { + MassageZone temp = MassageZone.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 { + MassageZone temp = MassageZone.valueForString(example); + assertNull("Result of valueForString should be null.", temp); + } catch (NullPointerException exception) { + fail("Null string throws NullPointerException."); + } + } + + /** + * Verifies the possible enum values of MassageZone. + */ + public void testListEnum() { + List<MassageZone> enumValueList = Arrays.asList(MassageZone.values()); + + List<MassageZone> enumTestList = new ArrayList<MassageZone>(); + enumTestList.add(MassageZone.LUMBAR); + enumTestList.add(MassageZone.SEAT_CUSHION); + + 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/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MetadataTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MetadataTypeTests.java index c1aff1bdd..c381dfff3 100644 --- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MetadataTypeTests.java +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/MetadataTypeTests.java @@ -14,12 +14,12 @@ import java.util.List; * {@link com.smartdevicelink.proxy.rpc.MetadataTags} */ -public class MetadataTypeTests extends TestCase{ +public class MetadataTypeTests extends TestCase { /** * Verifies that the enum values are not null upon valid assignment. */ - public void testValidEnums () { + public void testValidEnums() { String example = "mediaTitle"; MetadataType enumMediaTitle = MetadataType.valueForString(example); example = "mediaArtist"; @@ -63,13 +63,12 @@ public class MetadataTypeTests extends TestCase{ /** * Verifies that an invalid assignment is null. */ - public void testInvalidEnum () { + public void testInvalidEnum() { String example = "MEDIA_TITLEZ"; try { MetadataType temp = MetadataType.valueForString(example); assertNull("Result of valueForString should be null.", temp); - } - catch (IllegalArgumentException exception) { + } catch (IllegalArgumentException exception) { fail("Invalid enum throws IllegalArgumentException."); } } @@ -77,13 +76,12 @@ public class MetadataTypeTests extends TestCase{ /** * Verifies that a null assignment is invalid. */ - public void testNullEnum () { + public void testNullEnum() { String example = null; try { MetadataType temp = MetadataType.valueForString(example); assertNull("Result of valueForString should be null.", temp); - } - catch (NullPointerException exception) { + } catch (NullPointerException exception) { fail("Null string throws NullPointerException."); } } diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ModuleTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ModuleTypeTests.java index 18a47b79d..9af8b4867 100644 --- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ModuleTypeTests.java +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ModuleTypeTests.java @@ -22,9 +22,12 @@ public class ModuleTypeTests extends TestCase { ModuleType enumClimate = ModuleType.valueForString(example); example = "RADIO"; ModuleType enumRadio = ModuleType.valueForString(example); + example = "SEAT"; + ModuleType enumSeat = ModuleType.valueForString(example); assertNotNull("CLIMATE returned null", enumClimate); assertNotNull("RADIO returned null", enumRadio); + assertNotNull("SEAT returned null", enumSeat); } /** @@ -64,6 +67,7 @@ public class ModuleTypeTests extends TestCase { List<ModuleType> enumTestList = new ArrayList<ModuleType>(); enumTestList.add(ModuleType.CLIMATE); enumTestList.add(ModuleType.RADIO); + enumTestList.add(ModuleType.SEAT); assertTrue("Enum value list does not match enum class list", enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList)); diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SeatMemoryActionTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SeatMemoryActionTypeTests.java new file mode 100644 index 000000000..2642e35d3 --- /dev/null +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SeatMemoryActionTypeTests.java @@ -0,0 +1,73 @@ +package com.smartdevicelink.test.rpc.enums; + +import com.smartdevicelink.proxy.rpc.enums.SeatMemoryActionType; + +import junit.framework.TestCase; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * This is a unit test class for the SmartDeviceLink library project class : + * {@link com.smartdevicelink.rpc.enums.SeatMemoryActionType} + */ +public class SeatMemoryActionTypeTests extends TestCase { + + /** + * Verifies that the enum values are not null upon valid assignment. + */ + public void testValidEnums() { + String example = "SAVE"; + SeatMemoryActionType enumSave = SeatMemoryActionType.valueForString(example); + example = "RESTORE"; + SeatMemoryActionType enumRestore = SeatMemoryActionType.valueForString(example); + example = "NONE"; + SeatMemoryActionType enumNone = SeatMemoryActionType.valueForString(example); + + assertNotNull("SAVE returned null", enumSave); + assertNotNull("RESTORE returned null", enumRestore); + assertNotNull("NONE returned null", enumNone); + } + + /** + * Verifies that an invalid assignment is null. + */ + public void testInvalidEnum() { + String example = "sAVE"; + try { + SeatMemoryActionType temp = SeatMemoryActionType.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 { + SeatMemoryActionType temp = SeatMemoryActionType.valueForString(example); + assertNull("Result of valueForString should be null.", temp); + } catch (NullPointerException exception) { + fail("Null string throws NullPointerException."); + } + } + + /** + * Verifies the possible enum values of SeatMemoryActionType. + */ + public void testListEnum() { + List<SeatMemoryActionType> enumValueList = Arrays.asList(SeatMemoryActionType.values()); + + List<SeatMemoryActionType> enumTestList = new ArrayList<SeatMemoryActionType>(); + enumTestList.add(SeatMemoryActionType.SAVE); + enumTestList.add(SeatMemoryActionType.RESTORE); + enumTestList.add(SeatMemoryActionType.NONE); + + 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/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SupportedSeatTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SupportedSeatTests.java new file mode 100644 index 000000000..6a2dbd18f --- /dev/null +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/SupportedSeatTests.java @@ -0,0 +1,69 @@ +package com.smartdevicelink.test.rpc.enums; + +import com.smartdevicelink.proxy.rpc.enums.SupportedSeat; + +import junit.framework.TestCase; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * This is a unit test class for the SmartDeviceLink library project class : + * {@link com.smartdevicelink.rpc.enums.SupportedSeat} + */ +public class SupportedSeatTests extends TestCase { + + /** + * Verifies that the enum values are not null upon valid assignment. + */ + public void testValidEnums() { + String example = "DRIVER"; + SupportedSeat enumDriver = SupportedSeat.valueForString(example); + example = "FRONT_PASSENGER"; + SupportedSeat enumFrontPassenger = SupportedSeat.valueForString(example); + + assertNotNull("DRIVER returned null", enumDriver); + assertNotNull("FRONT_PASSENGER returned null", enumFrontPassenger); + } + + /** + * Verifies that an invalid assignment is null. + */ + public void testInvalidEnum() { + String example = "dRIVER"; + try { + SupportedSeat temp = SupportedSeat.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 { + SupportedSeat temp = SupportedSeat.valueForString(example); + assertNull("Result of valueForString should be null.", temp); + } catch (NullPointerException exception) { + fail("Null string throws NullPointerException."); + } + } + + /** + * Verifies the possible enum values of SupportedSeat. + */ + public void testListEnum() { + List<SupportedSeat> enumValueList = Arrays.asList(SupportedSeat.values()); + + List<SupportedSeat> enumTestList = new ArrayList<SupportedSeat>(); + enumTestList.add(SupportedSeat.DRIVER); + enumTestList.add(SupportedSeat.FRONT_PASSENGER); + + 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/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java new file mode 100644 index 000000000..8e87eff7d --- /dev/null +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java @@ -0,0 +1,79 @@ +package com.smartdevicelink.proxy.rpc; + +import android.support.annotation.NonNull; + +import com.smartdevicelink.proxy.RPCStruct; +import com.smartdevicelink.proxy.rpc.enums.MassageCushion; + +import java.util.Hashtable; + +/** + * The intensity or firmness of a cushion. + */ +public class MassageCushionFirmness extends RPCStruct { + public static final String KEY_CUSHION = "cushion"; + public static final String KEY_FIRMNESS = "firmness"; + + /** + * Constructs a new MassageCushionFirmness object + */ + public MassageCushionFirmness() { + } + + /** + * <p>Constructs a new MassageCushionFirmness object indicated by the Hashtable parameter + * </p> + * + * @param hash The Hashtable to use + */ + public MassageCushionFirmness(Hashtable<String, Object> hash) { + super(hash); + } + + /** + * Constructs a newly allocated MassageCushionFirmness object + * @param cushion type of MassageCushion for multi-contour massage seat + * @param firmness Min: 0 Max: 100 + */ + public MassageCushionFirmness(@NonNull MassageCushion cushion, @NonNull Integer firmness) { + this(); + setCushion(cushion); + setFirmness(firmness); + } + + /** + * Sets the cushion portion of the MassageCushionFirmness class + * + * @param cushion + */ + public void setCushion(@NonNull MassageCushion cushion) { + setValue(KEY_CUSHION, cushion); + } + + /** + * Gets the cushion portion of the MassageCushionFirmness class + * + * @return MassageCushion. + */ + public MassageCushion getCushion() { + return (MassageCushion) getObject(MassageCushion.class, KEY_CUSHION); + } + + /** + * Sets the firmness portion of the MassageCushionFirmness class + * + * @param firmness + */ + public void setFirmness(@NonNull Integer firmness) { + setValue(KEY_FIRMNESS, firmness); + } + + /** + * Gets the firmness portion of the MassageCushionFirmness class + * + * @return Integer + */ + public Integer getFirmness() { + return getInteger(KEY_FIRMNESS); + } +} diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java new file mode 100644 index 000000000..857d4dc7c --- /dev/null +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java @@ -0,0 +1,80 @@ +package com.smartdevicelink.proxy.rpc; + +import android.support.annotation.NonNull; + +import com.smartdevicelink.proxy.RPCStruct; +import com.smartdevicelink.proxy.rpc.enums.MassageMode; +import com.smartdevicelink.proxy.rpc.enums.MassageZone; + +import java.util.Hashtable; + +/** + * Specify the mode of a massage zone. + */ +public class MassageModeData extends RPCStruct { + public static final String KEY_MASSAGE_ZONE = "massageZone"; + public static final String KEY_MASSAGE_MODE = "massageMode"; + + /** + * Constructs a new MassageModeData object + */ + public MassageModeData() { + } + + /** + * <p>Constructs a new MassageModeData object indicated by the Hashtable parameter + * </p> + * + * @param hash The Hashtable to use + */ + public MassageModeData(Hashtable<String, Object> hash) { + super(hash); + } + + /** + * Constructs a newly allocated MassageModeData object + * @param massageZone type of MassageZone for multi-contour massage seat + * @param massageMode mode of massage zone. + */ + public MassageModeData(@NonNull MassageZone massageZone, @NonNull MassageMode massageMode) { + this(); + setMassageZone(massageZone); + setMassageMode(massageMode); + } + + /** + * Sets the massageZone portion of the MassageModeData class + * + * @param massageZone + */ + public void setMassageZone(@NonNull MassageZone massageZone) { + setValue(KEY_MASSAGE_ZONE, massageZone); + } + + /** + * Gets the massageZone portion of the MassageModeData class + * + * @return MassageZone. + */ + public MassageZone getMassageZone() { + return (MassageZone) getObject(MassageZone.class, KEY_MASSAGE_ZONE); + } + + /** + * Gets the massageMode portion of the MassageModeData class + * + * @return MassageMode + */ + public MassageMode getMassageMode() { + return (MassageMode) getObject(MassageMode.class, KEY_MASSAGE_MODE); + } + + /** + * Sets the massageMode portion of the MassageModeData class + * + * @param massageMode + */ + public void setMassageMode(@NonNull MassageMode massageMode) { + setValue(KEY_MASSAGE_MODE, massageMode); + } +} diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java index 9ae3f7fd3..b21c60be2 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java @@ -4,81 +4,98 @@ import android.support.annotation.NonNull; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.ModuleType; -import com.smartdevicelink.proxy.rpc.enums.Result; import java.util.Hashtable; -public class ModuleData extends RPCStruct{ - public static final String KEY_MODULE_TYPE= "moduleType"; - public static final String KEY_RADIO_CONTROL_DATA = "radioControlData"; - public static final String KEY_CLIMATE_CONTROL_DATA = "climateControlData"; +public class ModuleData extends RPCStruct { + public static final String KEY_MODULE_TYPE = "moduleType"; + public static final String KEY_RADIO_CONTROL_DATA = "radioControlData"; + public static final String KEY_CLIMATE_CONTROL_DATA = "climateControlData"; + public static final String KEY_SEAT_CONTROL_DATA = "seatControlData"; - public ModuleData() { - } + public ModuleData() { + } - public ModuleData(Hashtable<String, Object> hash) { - super(hash); - } + public ModuleData(Hashtable<String, Object> hash) { + super(hash); + } - public ModuleData(@NonNull ModuleType moduleType) { - this(); - setModuleType(moduleType); - } + public ModuleData(@NonNull ModuleType moduleType) { + this(); + setModuleType(moduleType); + } - /** - * Sets the moduleType portion of the ModuleData class - * - * @param moduleType - * The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. - * For example, if the moduleType is CLIMATE then a "climateControlData" should exist - */ - public void setModuleType(@NonNull ModuleType moduleType) { - setValue(KEY_MODULE_TYPE, moduleType); - } + /** + * Sets the moduleType portion of the ModuleData class + * + * @param moduleType The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. + * For example, if the moduleType is CLIMATE then a "climateControlData" should exist + */ + public void setModuleType(@NonNull ModuleType moduleType) { + setValue(KEY_MODULE_TYPE, moduleType); + } - /** - * Gets the moduleType portion of the ModuleData class - * - * @return ModuleType - The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. - * For example, if the moduleType is CLIMATE then a "climateControlData" should exist. - */ - public ModuleType getModuleType() { - return (ModuleType) getObject(ModuleType.class, KEY_MODULE_TYPE); - } + /** + * Gets the moduleType portion of the ModuleData class + * + * @return ModuleType - The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. + * For example, if the moduleType is CLIMATE then a "climateControlData" should exist. + */ + public ModuleType getModuleType() { + return (ModuleType) getObject(ModuleType.class, KEY_MODULE_TYPE); + } - /** - * Sets the radioControlData portion of the ModuleData class - * - * @param radioControlData - */ - public void setRadioControlData(RadioControlData radioControlData) { - setValue(KEY_RADIO_CONTROL_DATA, radioControlData); - } + /** + * Sets the radioControlData portion of the ModuleData class + * + * @param radioControlData + */ + public void setRadioControlData(RadioControlData radioControlData) { + setValue(KEY_RADIO_CONTROL_DATA, radioControlData); + } - /** - * Gets the radioControlData portion of the ModuleData class - * - * @return RadioControlData - */ - public RadioControlData getRadioControlData() { - return (RadioControlData) getObject(RadioControlData.class, KEY_RADIO_CONTROL_DATA); - } + /** + * Gets the radioControlData portion of the ModuleData class + * + * @return RadioControlData + */ + public RadioControlData getRadioControlData() { + return (RadioControlData) getObject(RadioControlData.class, KEY_RADIO_CONTROL_DATA); + } - /** - * Sets the climateControlData portion of the ModuleData class - * - * @param climateControlData - */ - public void setClimateControlData(ClimateControlData climateControlData) { - setValue(KEY_CLIMATE_CONTROL_DATA, climateControlData); - } + /** + * Sets the climateControlData portion of the ModuleData class + * + * @param climateControlData + */ + public void setClimateControlData(ClimateControlData climateControlData) { + setValue(KEY_CLIMATE_CONTROL_DATA, climateControlData); + } - /** - * Gets the climateControlData portion of the ModuleData class - * - * @return ClimateControlData - */ - public ClimateControlData getClimateControlData() { - return (ClimateControlData) getObject(ClimateControlData.class, KEY_CLIMATE_CONTROL_DATA); - } + /** + * Gets the climateControlData portion of the ModuleData class + * + * @return ClimateControlData + */ + public ClimateControlData getClimateControlData() { + return (ClimateControlData) getObject(ClimateControlData.class, KEY_CLIMATE_CONTROL_DATA); + } + + /** + * Sets the seatControlData portion of the ModuleData class + * + * @param seatControlData + */ + public void setSeatControlData(SeatControlData seatControlData) { + setValue(KEY_SEAT_CONTROL_DATA, seatControlData); + } + + /** + * Gets the seatControlData portion of the ModuleData class + * + * @return SeatControlData + */ + public SeatControlData getSeatControlData() { + return (SeatControlData) getObject(SeatControlData.class, KEY_SEAT_CONTROL_DATA); + } } diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java index ec51aa633..8a2106f6e 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java @@ -1,82 +1,100 @@ package com.smartdevicelink.proxy.rpc; import com.smartdevicelink.proxy.RPCStruct; + import java.util.Hashtable; import java.util.List; -public class RemoteControlCapabilities extends RPCStruct{ - public static final String KEY_CLIMATE_CONTROL_CAPABILITIES= "climateControlCapabilities"; - public static final String KEY_RADIO_CONTROL_CAPABILITIES = "radioControlCapabilities"; - public static final String KEY_BUTTON_CAPABILITIES = "buttonCapabilities"; +public class RemoteControlCapabilities extends RPCStruct { + public static final String KEY_CLIMATE_CONTROL_CAPABILITIES = "climateControlCapabilities"; + public static final String KEY_RADIO_CONTROL_CAPABILITIES = "radioControlCapabilities"; + public static final String KEY_BUTTON_CAPABILITIES = "buttonCapabilities"; + public static final String KEY_SEAT_CONTROL_CAPABILITIES = "seatControlCapabilities"; + + public RemoteControlCapabilities() { + } + + public RemoteControlCapabilities(Hashtable<String, Object> hash) { + super(hash); + } - public RemoteControlCapabilities() { - } + /** + * Sets the climateControlCapabilities portion of the RemoteControlCapabilities class + * + * @param climateControlCapabilities If included, the platform supports RC climate controls. + * For this baseline version, maxsize=1. i.e. only one climate control module is supported. + */ + public void setClimateControlCapabilities(List<ClimateControlCapabilities> climateControlCapabilities) { + setValue(KEY_CLIMATE_CONTROL_CAPABILITIES, climateControlCapabilities); + } - public RemoteControlCapabilities(Hashtable<String, Object> hash) { - super(hash); - } + /** + * Gets the climateControlCapabilities portion of the RemoteControlCapabilities class + * + * @return List<ClimateControlCapabilities> + * If included, the platform supports RC climate controls. + * For this baseline version, maxsize=1. i.e. only one climate control module is supported. + */ + public List<ClimateControlCapabilities> getClimateControlCapabilities() { + return (List<ClimateControlCapabilities>) getObject(ClimateControlCapabilities.class, KEY_CLIMATE_CONTROL_CAPABILITIES); + } - /** - * Sets the climateControlCapabilities portion of the RemoteControlCapabilities class - * - * @param climateControlCapabilities - * If included, the platform supports RC climate controls. - * For this baseline version, maxsize=1. i.e. only one climate control module is supported. - */ - public void setClimateControlCapabilities(List<ClimateControlCapabilities> climateControlCapabilities) { - setValue(KEY_CLIMATE_CONTROL_CAPABILITIES, climateControlCapabilities); - } + /** + * Sets the radioControlCapabilities portion of the RemoteControlCapabilities class + * + * @param radioControlCapabilities If included, the platform supports RC climate controls. + * For this baseline version, maxsize=1. i.e. only one radio control module is supported. + */ + public void setRadioControlCapabilities(List<RadioControlCapabilities> radioControlCapabilities) { + setValue(KEY_RADIO_CONTROL_CAPABILITIES, radioControlCapabilities); + } - /** - * Gets the climateControlCapabilities portion of the RemoteControlCapabilities class - * - * @return List<ClimateControlCapabilities> - * If included, the platform supports RC climate controls. - * For this baseline version, maxsize=1. i.e. only one climate control module is supported. - */ - public List<ClimateControlCapabilities> getClimateControlCapabilities() { - return (List<ClimateControlCapabilities>) getObject(ClimateControlCapabilities.class, KEY_CLIMATE_CONTROL_CAPABILITIES); - } + /** + * Gets the radioControlCapabilities portion of the RemoteControlCapabilities class + * + * @return List<RadioControlCapabilities> + * If included, the platform supports RC climate controls. + * For this baseline version, maxsize=1. i.e. only one radio control module is supported. + */ + public List<RadioControlCapabilities> getRadioControlCapabilities() { + return (List<RadioControlCapabilities>) getObject(RadioControlCapabilities.class, KEY_RADIO_CONTROL_CAPABILITIES); + } - /** - * Sets the radioControlCapabilities portion of the RemoteControlCapabilities class - * - * @param radioControlCapabilities - * If included, the platform supports RC climate controls. - * For this baseline version, maxsize=1. i.e. only one radio control module is supported. - */ - public void setRadioControlCapabilities(List<RadioControlCapabilities> radioControlCapabilities) { - setValue(KEY_RADIO_CONTROL_CAPABILITIES, radioControlCapabilities); - } + /** + * Sets the buttonCapabilities portion of the RemoteControlCapabilities class + * + * @param buttonCapabilities If included, the platform supports RC button controls with the included button names. + */ + public void setButtonCapabilities(List<ButtonCapabilities> buttonCapabilities) { + setValue(KEY_BUTTON_CAPABILITIES, buttonCapabilities); + } - /** - * Gets the radioControlCapabilities portion of the RemoteControlCapabilities class - * - * @return List<RadioControlCapabilities> - * If included, the platform supports RC climate controls. - * For this baseline version, maxsize=1. i.e. only one radio control module is supported. - */ - public List<RadioControlCapabilities> getRadioControlCapabilities() { - return (List<RadioControlCapabilities>) getObject(RadioControlCapabilities.class, KEY_RADIO_CONTROL_CAPABILITIES); - } + /** + * Gets the buttonCapabilities portion of the RemoteControlCapabilities class + * + * @return List<ButtonCapabilities> + * If included, the platform supports RC button controls with the included button names. + */ + public List<ButtonCapabilities> getButtonCapabilities() { + return (List<ButtonCapabilities>) getObject(ButtonCapabilities.class, KEY_BUTTON_CAPABILITIES); + } - /** - * Sets the buttonCapabilities portion of the RemoteControlCapabilities class - * - * @param buttonCapabilities - * If included, the platform supports RC button controls with the included button names. - */ - public void setButtonCapabilities(List<ButtonCapabilities> buttonCapabilities) { - setValue(KEY_BUTTON_CAPABILITIES, buttonCapabilities); - } + /** + * Sets the seatControlCapabilities portion of the RemoteControlCapabilities class + * + * @param seatControlCapabilities If included, the platform supports seat controls. + */ + public void setSeatControlCapabilities(List<SeatControlCapabilities> seatControlCapabilities) { + setValue(KEY_SEAT_CONTROL_CAPABILITIES, seatControlCapabilities); + } - /** - * Gets the buttonCapabilities portion of the RemoteControlCapabilities class - * - * @return List<ButtonCapabilities> - * If included, the platform supports RC button controls with the included button names. - */ - public List<ButtonCapabilities> getButtonCapabilities() { - return (List<ButtonCapabilities>) getObject(ButtonCapabilities.class, KEY_BUTTON_CAPABILITIES); - } + /** + * Gets the seatControlCapabilities portion of the RemoteControlCapabilities class + * + * @return List<SeatControlCapabilities> + * If included, the platform supports seat controls. + */ + public List<SeatControlCapabilities> getSeatControlCapabilities() { + return (List<SeatControlCapabilities>) getObject(SeatControlCapabilities.class, KEY_SEAT_CONTROL_CAPABILITIES); + } } diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java new file mode 100644 index 000000000..e1d488cb5 --- /dev/null +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java @@ -0,0 +1,339 @@ +package com.smartdevicelink.proxy.rpc; + +import android.support.annotation.NonNull; + +import com.smartdevicelink.proxy.RPCStruct; + +import java.util.Hashtable; + +public class SeatControlCapabilities extends RPCStruct { + public static final String KEY_MODULE_NAME = "moduleName"; + public static final String KEY_HEATING_ENABLED_AVAILABLE = "heatingEnabledAvailable"; + public static final String KEY_COOLING_ENABLED_AVAILABLE = "coolingEnabledAvailable"; + public static final String KEY_HEATING_LEVEL_AVAILABLE = "heatingLevelAvailable"; + public static final String KEY_COOLING_LEVEL_AVAILABLE = "coolingLevelAvailable"; + public static final String KEY_HORIZONTAL_POSITION_AVAILABLE = "horizontalPositionAvailable"; + public static final String KEY_VERTICAL_POSITION_AVAILABLE = "verticalPositionAvailable"; + public static final String KEY_FRONT_VERTICAL_POSITION_AVAILABLE = "frontVerticalPositionAvailable"; + public static final String KEY_BACK_VERTICAL_POSITION_AVAILABLE = "backVerticalPositionAvailable"; + public static final String KEY_BACK_TILT_ANGLE_AVAILABLE = "backTiltAngleAvailable"; + public static final String KEY_HEAD_SUPPORT_HORIZONTAL_POSITION_AVAILABLE = "headSupportHorizontalPositionAvailable"; + public static final String KEY_HEAD_SUPPORT_VERTICAL_POSITION_AVAILABLE = "headSupportVerticalPositionAvailable"; + public static final String KEY_MASSAGE_ENABLED_AVAILABLE = "massageEnabledAvailable"; + public static final String KEY_MASSAGE_MODE_AVAILABLE = "massageModeAvailable"; + public static final String KEY_MASSAGE_CUSHION_FIRMNESS_AVAILABLE = "massageCushionFirmnessAvailable"; + public static final String KEY_MEMORY_AVAILABLE = "memoryAvailable"; + + /** + * Constructs a new SeatControlCapabilities object + */ + public SeatControlCapabilities() { + } + + /** + * <p>Constructs a new SeatControlCapabilities object indicated by the Hashtable parameter + * </p> + * + * @param hash The Hashtable to use + */ + public SeatControlCapabilities(Hashtable<String, Object> hash) { + super(hash); + } + + /** + * Constructs a newly allocated SeatControlCapabilities object + * @param moduleName short friendly name of the light control module. + */ + public SeatControlCapabilities(@NonNull String moduleName) { + this(); + setModuleName(moduleName); + } + + /** + * Get the moduleName portion of the SeatControlCapabilities class + * + * @return String + */ + public String getModuleName() { + return getString(KEY_MODULE_NAME); + } + + /** + * Sets the moduleName portion of the SeatControlCapabilities class + * + * @param moduleName - The short friendly name of the light control module. It should not be used to identify a module by mobile application. + */ + public void setModuleName(@NonNull String moduleName) { + setValue(KEY_MODULE_NAME, moduleName); + } + + /** + * Sets the heatingEnabledAvailable portion of the SeatControlCapabilities class + * + * @param heatingEnabledAvailable + */ + public void setHeatingEnabledAvailable(Boolean heatingEnabledAvailable) { + setValue(KEY_HEATING_ENABLED_AVAILABLE, heatingEnabledAvailable); + } + + /** + * Gets the heatingEnabledAvailable portion of the SeatControlCapabilities class + * + * @return Boolean. + */ + public Boolean getHeatingEnabledAvailable() { + return getBoolean(KEY_HEATING_ENABLED_AVAILABLE); + } + + /** + * Sets the coolingEnabledAvailable portion of the SeatControlCapabilities class + * + * @param coolingEnabledAvailable + */ + public void setCoolingEnabledAvailable(Boolean coolingEnabledAvailable) { + setValue(KEY_COOLING_ENABLED_AVAILABLE, coolingEnabledAvailable); + } + + /** + * Gets the coolingEnabledAvailable portion of the SeatControlCapabilities class + * + * @return Boolean. + */ + public Boolean getCoolingEnabledAvailable() { + return getBoolean(KEY_COOLING_ENABLED_AVAILABLE); + } + + /** + * Sets the heatingLevelAvailable portion of the SeatControlCapabilities class + * + * @param heatingLevelAvailable + */ + public void setHeatingLevelAvailable(Boolean heatingLevelAvailable) { + setValue(KEY_HEATING_LEVEL_AVAILABLE, heatingLevelAvailable); + } + + /** + * Gets the heatingLevelAvailable portion of the SeatControlCapabilities class + * + * @return Boolean. + */ + public Boolean getHeatingLevelAvailable() { + return getBoolean(KEY_HEATING_LEVEL_AVAILABLE); + } + + /** + * Sets the coolingLevelAvailable portion of the SeatControlCapabilities class + * + * @param coolingLevelAvailable + */ + public void setCoolingLevelAvailable(Boolean coolingLevelAvailable) { + setValue(KEY_COOLING_LEVEL_AVAILABLE, coolingLevelAvailable); + } + + /** + * Gets the coolingLevelAvailable portion of the SeatControlCapabilities class + * + * @return Boolean. + */ + public Boolean getCoolingLevelAvailable() { + return getBoolean(KEY_COOLING_LEVEL_AVAILABLE); + } + + /** + * Sets the horizontalPositionAvailable portion of the SeatControlCapabilities class + * + * @param horizontalPositionAvailable + */ + public void setHorizontalPositionAvailable(Boolean horizontalPositionAvailable) { + setValue(KEY_HORIZONTAL_POSITION_AVAILABLE, horizontalPositionAvailable); + } + + /** + * Gets the horizontalPositionAvailable portion of the SeatControlCapabilities class + * + * @return Boolean. + */ + public Boolean getHorizontalPositionAvailable() { + return getBoolean(KEY_HORIZONTAL_POSITION_AVAILABLE); + } + + /** + * Sets the verticalPositionAvailable portion of the SeatControlCapabilities class + * + * @param verticalPositionAvailable + */ + public void setVerticalPositionAvailable(Boolean verticalPositionAvailable) { + setValue(KEY_VERTICAL_POSITION_AVAILABLE, verticalPositionAvailable); + } + + /** + * Gets the verticalPositionAvailable portion of the SeatControlCapabilities class + * + * @return Boolean. + */ + public Boolean getVerticalPositionAvailable() { + return getBoolean(KEY_VERTICAL_POSITION_AVAILABLE); + } + + /** + * Sets the frontVerticalPositionAvailable portion of the SeatControlCapabilities class + * + * @param frontVerticalPositionAvailable + */ + public void setFrontVerticalPositionAvailable(Boolean frontVerticalPositionAvailable) { + setValue(KEY_FRONT_VERTICAL_POSITION_AVAILABLE, frontVerticalPositionAvailable); + } + + /** + * Gets the frontVerticalPositionAvailable portion of the SeatControlCapabilities class + * + * @return Boolean. + */ + public Boolean getFrontVerticalPositionAvailable() { + return getBoolean(KEY_FRONT_VERTICAL_POSITION_AVAILABLE); + } + + /** + * Sets the backVerticalPositionAvailable portion of the SeatControlCapabilities class + * + * @param backVerticalPositionAvailable + */ + public void setBackVerticalPositionAvailable(Boolean backVerticalPositionAvailable) { + setValue(KEY_BACK_VERTICAL_POSITION_AVAILABLE, backVerticalPositionAvailable); + } + + /** + * Gets the backVerticalPositionAvailable portion of the SeatControlCapabilities class + * + * @return Boolean. + */ + public Boolean getBackVerticalPositionAvailable() { + return getBoolean(KEY_BACK_VERTICAL_POSITION_AVAILABLE); + } + + /** + * Sets the backTiltAngleAvailable portion of the SeatControlCapabilities class + * + * @param backTiltAngleAvailable + */ + public void setBackTiltAngleAvailable(Boolean backTiltAngleAvailable) { + setValue(KEY_BACK_TILT_ANGLE_AVAILABLE, backTiltAngleAvailable); + } + + /** + * Gets the backTiltAngleAvailable portion of the SeatControlCapabilities class + * + * @return Boolean. + */ + public Boolean getBackTiltAngleAvailable() { + return getBoolean(KEY_BACK_TILT_ANGLE_AVAILABLE); + } + + /** + * Sets the headSupportHorizontalPositionAvailable portion of the SeatControlCapabilities class + * + * @param headSupportHorizontalPositionAvailable + */ + public void setHeadSupportHorizontalPositionAvailable(Boolean headSupportHorizontalPositionAvailable) { + setValue(KEY_HEAD_SUPPORT_HORIZONTAL_POSITION_AVAILABLE, headSupportHorizontalPositionAvailable); + } + + /** + * Gets the headSupportHorizontalPositionAvailable portion of the SeatControlCapabilities class + * + * @return Boolean. + */ + public Boolean getHeadSupportHorizontalPositionAvailable() { + return getBoolean(KEY_HEAD_SUPPORT_HORIZONTAL_POSITION_AVAILABLE); + } + + /** + * Sets the headSupportVerticalPositionAvailable portion of the SeatControlCapabilities class + * + * @param headSupportVerticalPositionAvailable + */ + public void setHeadSupportVerticalPositionAvailable(Boolean headSupportVerticalPositionAvailable) { + setValue(KEY_HEAD_SUPPORT_VERTICAL_POSITION_AVAILABLE, headSupportVerticalPositionAvailable); + } + + /** + * Gets the headSupportVerticalPositionAvailable portion of the SeatControlCapabilities class + * + * @return Boolean. + */ + public Boolean getHeadSupportVerticalPositionAvailable() { + return getBoolean(KEY_HEAD_SUPPORT_VERTICAL_POSITION_AVAILABLE); + } + + /** + * Sets the massageEnabledAvailable portion of the SeatControlCapabilities class + * + * @param massageEnabledAvailable + */ + public void setMassageEnabledAvailable(Boolean massageEnabledAvailable) { + setValue(KEY_MASSAGE_ENABLED_AVAILABLE, massageEnabledAvailable); + } + + /** + * Gets the massageEnabledAvailable portion of the SeatControlCapabilities class + * + * @return Boolean. + */ + public Boolean getMassageEnabledAvailable() { + return getBoolean(KEY_MASSAGE_ENABLED_AVAILABLE); + } + + /** + * Sets the massageModeAvailable portion of the SeatControlCapabilities class + * + * @param massageModeAvailable + */ + public void setMassageModeAvailable(Boolean massageModeAvailable) { + setValue(KEY_MASSAGE_MODE_AVAILABLE, massageModeAvailable); + } + + /** + * Gets the massageModeAvailable portion of the SeatControlCapabilities class + * + * @return Boolean. + */ + public Boolean getMassageModeAvailable() { + return getBoolean(KEY_MASSAGE_MODE_AVAILABLE); + } + + /** + * Sets the massageCushionFirmnessAvailable portion of the SeatControlCapabilities class + * + * @param massageCushionFirmnessAvailable + */ + public void setMassageCushionFirmnessAvailable(Boolean massageCushionFirmnessAvailable) { + setValue(KEY_MASSAGE_CUSHION_FIRMNESS_AVAILABLE, massageCushionFirmnessAvailable); + } + + /** + * Gets the massageCushionFirmnessAvailable portion of the SeatControlCapabilities class + * + * @return Boolean. + */ + public Boolean getMassageCushionFirmnessAvailable() { + return getBoolean(KEY_MASSAGE_CUSHION_FIRMNESS_AVAILABLE); + } + + /** + * Sets the memoryAvailable portion of the SeatControlCapabilities class + * + * @param memoryAvailable + */ + public void setMemoryAvailable(Boolean memoryAvailable) { + setValue(KEY_MEMORY_AVAILABLE, memoryAvailable); + } + + /** + * Gets the memoryAvailable portion of the SeatControlCapabilities class + * + * @return Boolean. + */ + public Boolean getMemoryAvailable() { + return getBoolean(KEY_MEMORY_AVAILABLE); + } +} diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java new file mode 100644 index 000000000..26d52d713 --- /dev/null +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java @@ -0,0 +1,347 @@ +package com.smartdevicelink.proxy.rpc; + +import android.support.annotation.NonNull; + +import com.smartdevicelink.proxy.RPCStruct; +import com.smartdevicelink.proxy.rpc.enums.SupportedSeat; + +import java.util.Hashtable; +import java.util.List; + +/** + * Seat control data corresponds to "SEAT" ModuleType. + */ +public class SeatControlData extends RPCStruct { + public static final String KEY_ID = "id"; + public static final String KEY_HEATING_ENABLED = "heatingEnabled"; + public static final String KEY_COOLING_ENABLED = "coolingEnabled"; + public static final String KEY_HEATING_LEVEL = "heatingLevel"; + public static final String KEY_COOLING_LEVEL = "coolingLevel"; + public static final String KEY_HORIZONTAL_POSITION = "horizontalPosition"; + public static final String KEY_VERTICAL_POSITION = "verticalPosition"; + public static final String KEY_FRONT_VERTICAL_POSITION = "frontVerticalPosition"; + public static final String KEY_BACK_VERTICAL_POSITION = "backVerticalPosition"; + public static final String KEY_BACK_TILT_ANGLE = "backTiltAngle"; + public static final String KEY_HEAD_SUPPORT_HORIZONTAL_POSITION = "headSupportHorizontalPosition"; + public static final String KEY_HEAD_SUPPORT_VERTICAL_POSITION = "headSupportVerticalPosition"; + public static final String KEY_MASSAGE_ENABLED = "massageEnabled"; + public static final String KEY_MASSAGE_MODE = "massageMode"; + public static final String KEY_MASSAGE_CUSHION_FIRMNESS = "massageCushionFirmness"; + public static final String KEY_MEMORY = "memory"; + + /** + * Constructs a new SeatControlData object + */ + public SeatControlData() { + } + + /** + * <p>Constructs a new SeatControlData object indicated by the Hashtable parameter + * </p> + * + * @param hash The Hashtable to use + */ + public SeatControlData(Hashtable<String, Object> hash) { + super(hash); + } + + /** + * Constructs a newly allocated SeatControlData object + * @param id type of SupportedSeat. + */ + public SeatControlData(@NonNull SupportedSeat id) { + this(); + setId(id); + } + + /** + * Sets the id portion of the SeatControlData class + * + * @param id + */ + public void setId(@NonNull SupportedSeat id) { + setValue(KEY_ID, id); + } + + /** + * Gets the id portion of the SeatControlData class + * + * @return SupportedSeat. + */ + public SupportedSeat getId() { + return (SupportedSeat) getObject(SupportedSeat.class, KEY_ID); + } + + /** + * Sets the heatingEnabled portion of the SeatControlData class + * + * @param heatingEnabled + */ + public void setHeatingEnabled(Boolean heatingEnabled) { + setValue(KEY_HEATING_ENABLED, heatingEnabled); + } + + /** + * Gets the heatingEnabled portion of the SeatControlData class + * + * @return Boolean. + */ + public Boolean getHeatingEnabled() { + return getBoolean(KEY_HEATING_ENABLED); + } + + /** + * Sets the coolingEnabled portion of the SeatControlData class + * + * @param coolingEnabled + */ + public void setCoolingEnabled(Boolean coolingEnabled) { + setValue(KEY_COOLING_ENABLED, coolingEnabled); + } + + /** + * Gets the coolingEnabled portion of the SeatControlData class + * + * @return Boolean. + */ + public Boolean getCoolingEnabled() { + return getBoolean(KEY_COOLING_ENABLED); + } + + /** + * Sets the heatingLevel portion of the SeatControlData class + * + * @param heatingLevel + */ + public void setHeatingLevel(Integer heatingLevel) { + setValue(KEY_HEATING_LEVEL, heatingLevel); + } + + /** + * Gets the heatingLevel portion of the SeatControlData class + * + * @return Integer + */ + public Integer getHeatingLevel() { + return getInteger(KEY_HEATING_LEVEL); + } + + /** + * Sets the coolingLevel portion of the SeatControlData class + * + * @param coolingLevel + */ + public void setCoolingLevel(Integer coolingLevel) { + setValue(KEY_COOLING_LEVEL, coolingLevel); + } + + /** + * Gets the coolingLevel portion of the SeatControlData class + * + * @return Integer + */ + public Integer getCoolingLevel() { + return getInteger(KEY_COOLING_LEVEL); + } + + /** + * Sets the horizontalPosition portion of the SeatControlData class + * + * @param horizontalPosition + */ + public void setHorizontalPosition(Integer horizontalPosition) { + setValue(KEY_HORIZONTAL_POSITION, horizontalPosition); + } + + /** + * Gets the horizontalPosition portion of the SeatControlData class + * + * @return Integer + */ + public Integer getHorizontalPosition() { + return getInteger(KEY_HORIZONTAL_POSITION); + } + + /** + * Sets the verticalPosition portion of the SeatControlData class + * + * @param verticalPosition + */ + public void setVerticalPosition(Integer verticalPosition) { + setValue(KEY_VERTICAL_POSITION, verticalPosition); + } + + /** + * Gets the verticalPosition portion of the SeatControlData class + * + * @return Integer + */ + public Integer getVerticalPosition() { + return getInteger(KEY_VERTICAL_POSITION); + } + + /** + * Sets the frontVerticalPosition portion of the SeatControlData class + * + * @param frontVerticalPosition + */ + public void setFrontVerticalPosition(Integer frontVerticalPosition) { + setValue(KEY_FRONT_VERTICAL_POSITION, frontVerticalPosition); + } + + /** + * Gets the frontVerticalPosition portion of the SeatControlData class + * + * @return Integer + */ + public Integer getFrontVerticalPosition() { + return getInteger(KEY_FRONT_VERTICAL_POSITION); + } + + /** + * Sets the backVerticalPosition portion of the SeatControlData class + * + * @param backVerticalPosition + */ + public void setBackVerticalPosition(Integer backVerticalPosition) { + setValue(KEY_BACK_VERTICAL_POSITION, backVerticalPosition); + } + + /** + * Gets the backVerticalPosition portion of the SeatControlData class + * + * @return Integer + */ + public Integer getBackVerticalPosition() { + return getInteger(KEY_BACK_VERTICAL_POSITION); + } + + /** + * Sets the backTiltAngle portion of the SeatControlData class + * + * @param backTiltAngle + */ + public void setBackTiltAngle(Integer backTiltAngle) { + setValue(KEY_BACK_TILT_ANGLE, backTiltAngle); + } + + /** + * Gets the backTiltAngle portion of the SeatControlData class + * + * @return Integer + */ + public Integer getBackTiltAngle() { + return getInteger(KEY_BACK_TILT_ANGLE); + } + + /** + * Sets the headSupportHorizontalPosition portion of the SeatControlData class + * + * @param headSupportHorizontalPosition + */ + public void setHeadSupportHorizontalPosition(Integer headSupportHorizontalPosition) { + setValue(KEY_HEAD_SUPPORT_HORIZONTAL_POSITION, headSupportHorizontalPosition); + } + + /** + * Gets the headSupportHorizontalPosition portion of the SeatControlData class + * + * @return Integer + */ + public Integer getHeadSupportHorizontalPosition() { + return getInteger(KEY_HEAD_SUPPORT_HORIZONTAL_POSITION); + } + + /** + * Sets the headSupportVerticalPosition portion of the SeatControlData class + * + * @param headSupportVerticalPosition + */ + public void setHeadSupportVerticalPosition(Integer headSupportVerticalPosition) { + setValue(KEY_HEAD_SUPPORT_VERTICAL_POSITION, headSupportVerticalPosition); + } + + /** + * Gets the headSupportVerticalPosition portion of the SeatControlData class + * + * @return Integer + */ + public Integer getHeadSupportVerticalPosition() { + return getInteger(KEY_HEAD_SUPPORT_VERTICAL_POSITION); + } + + /** + * Sets the massageEnabled portion of the SeatControlData class + * + * @param massageEnabled + */ + public void setMassageEnabled(Boolean massageEnabled) { + setValue(KEY_MASSAGE_ENABLED, massageEnabled); + } + + /** + * Gets the massageEnabled portion of the SeatControlData class + * + * @return Boolean. + */ + public Boolean getMassageEnabled() { + return getBoolean(KEY_MASSAGE_ENABLED); + } + + /** + * Gets the List<MassageModeData> portion of the SeatControlData class + * + * @return List<MassageModeData>. + */ + @SuppressWarnings("unchecked") + public List<MassageModeData> getMassageMode() { + return (List<MassageModeData>) getObject(MassageModeData.class, KEY_MASSAGE_MODE); + } + + /** + * Sets the massageMode portion of the SeatControlData class + * + * @param massageMode + */ + public void setMassageMode(List<MassageModeData> massageMode) { + setValue(KEY_MASSAGE_MODE, massageMode); + } + + /** + * Gets the List<MassageCushionFirmness> portion of the SeatControlData class + * + * @return List<MassageCushionFirmness>. + */ + @SuppressWarnings("unchecked") + public List<MassageCushionFirmness> getMassageCushionFirmness() { + return (List<MassageCushionFirmness>) getObject(MassageCushionFirmness.class, KEY_MASSAGE_CUSHION_FIRMNESS); + } + + /** + * Sets the massageCushionFirmness portion of the SeatControlData class + * + * @param massageCushionFirmness + */ + public void setMassageCushionFirmness(List<MassageCushionFirmness> massageCushionFirmness) { + setValue(KEY_MASSAGE_CUSHION_FIRMNESS, massageCushionFirmness); + } + + /** + * Sets the memory portion of the SeatControlData class + * + * @param memory + */ + public void setMemory(SeatMemoryAction memory) { + setValue(KEY_MEMORY, memory); + } + + /** + * Gets the memory portion of the SeatControlData class + * + * @return SeatMemoryAction. + */ + @SuppressWarnings("unchecked") + public SeatMemoryAction getMemory() { + return (SeatMemoryAction) getObject(SeatMemoryAction.class, KEY_MEMORY); + } +} diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java new file mode 100644 index 000000000..a8673a9eb --- /dev/null +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java @@ -0,0 +1,95 @@ +package com.smartdevicelink.proxy.rpc; + +import android.support.annotation.NonNull; + +import com.smartdevicelink.proxy.RPCStruct; +import com.smartdevicelink.proxy.rpc.enums.SeatMemoryActionType; + +import java.util.Hashtable; + +public class SeatMemoryAction extends RPCStruct { + public static final String KEY_ID = "id"; + public static final String KEY_LABEL = "label"; + public static final String KEY_ACTION = "action"; + + /** + * Constructs a new SeatMemoryAction object + */ + public SeatMemoryAction() { + } + + /** + * <p>Constructs a new SeatMemoryAction object indicated by the Hashtable parameter + * </p> + * + * @param hash The Hashtable to use + */ + public SeatMemoryAction(Hashtable<String, Object> hash) { + super(hash); + } + + /** + * Constructs a newly allocated SeatMemoryAction object + * @param id Min: 0 Max: 10 + * @param action type of SeatMemoryActionType. + */ + public SeatMemoryAction(@NonNull Integer id, @NonNull SeatMemoryActionType action) { + this(); + setId(id); + setAction(action); + } + + /** + * Sets the id portion of the SeatMemoryAction class + * + * @param id + */ + public void setId(@NonNull Integer id) { + setValue(KEY_ID, id); + } + + /** + * Gets the id portion of the SeatMemoryAction class + * + * @return Integer + */ + public Integer getId() { + return getInteger(KEY_ID); + } + + /** + * Sets the label portion of the SeatMemoryAction class + * + * @param label + */ + public void setLabel(String label) { + setValue(KEY_LABEL, label); + } + + /** + * Gets the label portion of the SeatMemoryAction class + * + * @return String + */ + public String getLabel() { + return getString(KEY_LABEL); + } + + /** + * Sets the action portion of the SeatMemoryAction class + * + * @param action + */ + public void setAction(@NonNull SeatMemoryActionType action) { + setValue(KEY_ACTION, action); + } + + /** + * Gets the action portion of the SeatMemoryAction class + * + * @return SeatMemoryActionType. + */ + public SeatMemoryActionType getAction() { + return (SeatMemoryActionType) getObject(SeatMemoryActionType.class, KEY_ACTION); + } +} diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageCushion.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageCushion.java new file mode 100644 index 000000000..ed23b4899 --- /dev/null +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageCushion.java @@ -0,0 +1,21 @@ +package com.smartdevicelink.proxy.rpc.enums; + +/** + * List possible cushions of a multi-contour massage seat. + */ +public enum MassageCushion { + TOP_LUMBAR, + MIDDLE_LUMBAR, + BOTTOM_LUMBAR, + BACK_BOLSTERS, + SEAT_BOLSTERS, + ; + + public static MassageCushion valueForString(String value) { + try { + return valueOf(value); + } catch (Exception e) { + return null; + } + } +} diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageMode.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageMode.java new file mode 100644 index 000000000..59a200bdb --- /dev/null +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageMode.java @@ -0,0 +1,19 @@ +package com.smartdevicelink.proxy.rpc.enums; + +/** + * List possible modes of a massage zone. + */ +public enum MassageMode { + OFF, + LOW, + HIGH, + ; + + public static MassageMode valueForString(String value) { + try { + return valueOf(value); + } catch (Exception e) { + return null; + } + } +} diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageZone.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageZone.java new file mode 100644 index 000000000..9f0e23ffe --- /dev/null +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/MassageZone.java @@ -0,0 +1,24 @@ +package com.smartdevicelink.proxy.rpc.enums; + +/** + * List possible zones of a multi-contour massage seat. + */ +public enum MassageZone { + /** + * The back of a multi-contour massage seat. or SEAT_BACK + */ + LUMBAR, + /** + * The bottom a multi-contour massage seat. or SEAT_BOTTOM + */ + SEAT_CUSHION, + ; + + public static MassageZone valueForString(String value) { + try { + return valueOf(value); + } catch (Exception e) { + return null; + } + } +} diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ModuleType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ModuleType.java index faef92d36..5eaf6366e 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ModuleType.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ModuleType.java @@ -1,15 +1,16 @@ package com.smartdevicelink.proxy.rpc.enums; public enum ModuleType { - CLIMATE, - RADIO, - ; + CLIMATE, + RADIO, + SEAT, + ; - public static ModuleType valueForString(String value) { - try{ - return valueOf(value); - }catch(Exception e){ - return null; - } - } + public static ModuleType valueForString(String value) { + try { + return valueOf(value); + } catch (Exception e) { + return null; + } + } } diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SeatMemoryActionType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SeatMemoryActionType.java new file mode 100644 index 000000000..e81b2694a --- /dev/null +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SeatMemoryActionType.java @@ -0,0 +1,25 @@ +package com.smartdevicelink.proxy.rpc.enums; + +public enum SeatMemoryActionType { + /** + * Save current seat positions and settings to seat memory. + */ + SAVE, + /** + * Restore / apply the seat memory settings to the current seat. + */ + RESTORE, + /** + * No action to be performed. + */ + NONE, + ; + + public static SeatMemoryActionType valueForString(String value) { + try { + return valueOf(value); + } catch (Exception e) { + return null; + } + } +} diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SupportedSeat.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SupportedSeat.java new file mode 100644 index 000000000..c68f2e79d --- /dev/null +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/SupportedSeat.java @@ -0,0 +1,18 @@ +package com.smartdevicelink.proxy.rpc.enums; + +/** + * List possible seats that is a remote controllable seat. + */ +public enum SupportedSeat { + DRIVER, + FRONT_PASSENGER, + ; + + public static SupportedSeat valueForString(String value) { + try { + return valueOf(value); + } catch (Exception e) { + return null; + } + } +} |