33import com .smartdevicelink .marshal .JsonRPCMarshaller ;
44import com .smartdevicelink .protocol .enums .FunctionID ;
55import com .smartdevicelink .proxy .RPCMessage ;
6+ import com .smartdevicelink .proxy .rpc .AppInfo ;
67import com .smartdevicelink .proxy .rpc .DeviceInfo ;
78import com .smartdevicelink .proxy .rpc .RegisterAppInterface ;
89import com .smartdevicelink .proxy .rpc .SdlMsgVersion ;
@@ -46,6 +47,7 @@ protected RPCMessage createMessage() {
4647 msg .setAppHMIType (Test .GENERAL_APPHMITYPE_LIST );
4748 msg .setIsMediaApplication (Test .GENERAL_BOOLEAN );
4849 msg .setDeviceInfo (Test .GENERAL_DEVICEINFO );
50+ msg .setAppInfo (Test .GENERAL_APPINFO );
4951 msg .setDayColorScheme (Test .GENERAL_DAYCOLORSCHEME );
5052 msg .setNightColorScheme (Test .GENERAL_NIGHTCOLORSCHEME );
5153
@@ -80,6 +82,7 @@ protected JSONObject getExpectedParameters(int sdlVersion) {
8082 result .put (RegisterAppInterface .KEY_APP_HMI_TYPE , JsonUtils .createJsonArrayOfJsonNames (Test .GENERAL_APPHMITYPE_LIST , SDL_VERSION_UNDER_TEST ));
8183 result .put (RegisterAppInterface .KEY_IS_MEDIA_APPLICATION , Test .GENERAL_BOOLEAN );
8284 result .put (RegisterAppInterface .KEY_DEVICE_INFO , Test .JSON_DEVICEINFO );
85+ result .put (RegisterAppInterface .KEY_APP_INFO , Test .JSON_APPINFO );
8386 result .put (RegisterAppInterface .KEY_DAY_COLOR_SCHEME , Test .JSON_DAYCOLORSCHEME );
8487 result .put (RegisterAppInterface .KEY_NIGHT_COLOR_SCHEME , Test .JSON_NIGHTCOLORSCHEME );
8588 } catch (JSONException e ) {
@@ -107,6 +110,7 @@ public void testRpcValues () {
107110 List <AppHMIType > testApps = ( (RegisterAppInterface ) msg ).getAppHMIType ();
108111 Boolean testMedia = ( (RegisterAppInterface ) msg ).getIsMediaApplication ();
109112 DeviceInfo testDeviceInfo = ( (RegisterAppInterface ) msg ).getDeviceInfo ();
113+ AppInfo testAppInfo = ( (RegisterAppInterface ) msg ).getAppInfo ();
110114 TemplateColorScheme testDayColorScheme = ( (RegisterAppInterface ) msg ).getDayColorScheme ();
111115 TemplateColorScheme testNightColorScheme = ( (RegisterAppInterface ) msg ).getNightColorScheme ();
112116
@@ -124,6 +128,7 @@ public void testRpcValues () {
124128 assertEquals (Test .MATCH , Test .GENERAL_APPHMITYPE_LIST , testApps );
125129 assertEquals (Test .MATCH , (Boolean ) Test .GENERAL_BOOLEAN , testMedia );
126130 assertTrue (Test .TRUE , Validator .validateDeviceInfo (Test .GENERAL_DEVICEINFO , testDeviceInfo ));
131+ assertTrue (Test .TRUE , Validator .validateAppInfo (Test .GENERAL_APPINFO , testAppInfo ));
127132 assertTrue (Test .TRUE , Validator .validateTemplateColorScheme (Test .GENERAL_DAYCOLORSCHEME , testDayColorScheme ));
128133 assertTrue (Test .TRUE , Validator .validateTemplateColorScheme (Test .GENERAL_NIGHTCOLORSCHEME , testNightColorScheme ));
129134
@@ -145,6 +150,7 @@ public void testRpcValues () {
145150 assertNull (Test .NULL , msg .getAppHMIType ());
146151 assertNull (Test .NULL , msg .getIsMediaApplication ());
147152 assertNull (Test .NULL , msg .getDeviceInfo ());
153+ assertNull (Test .NULL , msg .getAppInfo ());
148154 assertNull (Test .NULL , msg .getDayColorScheme ());
149155 assertNull (Test .NULL , msg .getNightColorScheme ());
150156 }
@@ -193,6 +199,10 @@ public void testJsonConstructor () {
193199 assertEquals (Test .MATCH , JsonUtils .readStringFromJsonObject (parameters , RegisterAppInterface .KEY_NGN_MEDIA_SCREEN_APP_NAME ), cmd .getNgnMediaScreenAppName ());
194200 assertEquals (Test .MATCH , JsonUtils .readBooleanFromJsonObject (parameters , RegisterAppInterface .KEY_IS_MEDIA_APPLICATION ), cmd .getIsMediaApplication ());
195201
202+ JSONObject appInfoObj = JsonUtils .readJsonObjectFromJsonObject (parameters , RegisterAppInterface .KEY_APP_INFO );
203+ AppInfo appInfo = new AppInfo (JsonRPCMarshaller .deserializeJSONObject (appInfoObj ));
204+ assertTrue (Test .TRUE , Validator .validateAppInfo (appInfo , cmd .getAppInfo ()));
205+
196206 List <String > vrSynonymsList = JsonUtils .readStringListFromJsonObject (parameters , RegisterAppInterface .KEY_VR_SYNONYMS );
197207 List <String > testSynonymsList = cmd .getVrSynonyms ();
198208 assertEquals (Test .MATCH , vrSynonymsList .size (), testSynonymsList .size ());
0 commit comments