diff options
Diffstat (limited to 'android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceDataTests.java')
-rw-r--r-- | android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceDataTests.java | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceDataTests.java index 09c976538..3e3e26d95 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherServiceDataTests.java @@ -7,7 +7,7 @@ import com.smartdevicelink.proxy.rpc.WeatherAlert; import com.smartdevicelink.proxy.rpc.WeatherData; import com.smartdevicelink.proxy.rpc.WeatherServiceData; import com.smartdevicelink.test.JsonUtils; -import com.smartdevicelink.test.Test; +import com.smartdevicelink.test.TestValues; import com.smartdevicelink.test.Validator; import junit.framework.TestCase; @@ -33,12 +33,12 @@ public class WeatherServiceDataTests extends TestCase { public void setUp(){ msg = new WeatherServiceData(); - msg.setLocation(Test.GENERAL_LOCATIONDETAILS); - msg.setCurrentForecast(Test.GENERAL_WEATHERDATA); - msg.setMinuteForecast(Test.GENERAL_WEATHERDATA_LIST); - msg.setHourlyForecast(Test.GENERAL_WEATHERDATA_LIST); - msg.setMultidayForecast(Test.GENERAL_WEATHERDATA_LIST); - msg.setAlerts(Test.GENERAL_WEATHERALERT_LIST); + msg.setLocation(TestValues.GENERAL_LOCATIONDETAILS); + msg.setCurrentForecast(TestValues.GENERAL_WEATHERDATA); + msg.setMinuteForecast(TestValues.GENERAL_WEATHERDATA_LIST); + msg.setHourlyForecast(TestValues.GENERAL_WEATHERDATA_LIST); + msg.setMultidayForecast(TestValues.GENERAL_WEATHERDATA_LIST); + msg.setAlerts(TestValues.GENERAL_WEATHERALERT_LIST); } /** @@ -54,44 +54,44 @@ public class WeatherServiceDataTests extends TestCase { List<WeatherAlert> alerts = msg.getAlerts(); // Valid Tests - assertEquals(Test.GENERAL_LOCATIONDETAILS, location); - assertEquals(Test.GENERAL_WEATHERDATA, currentForecast); - assertEquals(Test.GENERAL_WEATHERDATA_LIST, minuteForecast); - assertEquals(Test.GENERAL_WEATHERDATA_LIST, hourlyForecast); - assertEquals(Test.GENERAL_WEATHERDATA_LIST, multidayForecast); - assertEquals(Test.GENERAL_WEATHERALERT_LIST, alerts); + assertEquals(TestValues.GENERAL_LOCATIONDETAILS, location); + assertEquals(TestValues.GENERAL_WEATHERDATA, currentForecast); + assertEquals(TestValues.GENERAL_WEATHERDATA_LIST, minuteForecast); + assertEquals(TestValues.GENERAL_WEATHERDATA_LIST, hourlyForecast); + assertEquals(TestValues.GENERAL_WEATHERDATA_LIST, multidayForecast); + assertEquals(TestValues.GENERAL_WEATHERALERT_LIST, alerts); // Invalid/Null Tests WeatherServiceData msg = new WeatherServiceData(); - assertNotNull(Test.NOT_NULL, msg); - - assertNull(Test.NULL, msg.getLocation()); - assertNull(Test.NULL, msg.getCurrentForecast()); - assertNull(Test.NULL, msg.getMinuteForecast()); - assertNull(Test.NULL, msg.getHourlyForecast()); - assertNull(Test.NULL, msg.getMultidayForecast()); - assertNull(Test.NULL, msg.getAlerts()); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getLocation()); + assertNull(TestValues.NULL, msg.getCurrentForecast()); + assertNull(TestValues.NULL, msg.getMinuteForecast()); + assertNull(TestValues.NULL, msg.getHourlyForecast()); + assertNull(TestValues.NULL, msg.getMultidayForecast()); + assertNull(TestValues.NULL, msg.getAlerts()); } public void testRequiredParamsConstructor(){ - msg = new WeatherServiceData(Test.GENERAL_LOCATIONDETAILS); + msg = new WeatherServiceData(TestValues.GENERAL_LOCATIONDETAILS); LocationDetails location = msg.getLocation(); - assertEquals(Test.GENERAL_LOCATIONDETAILS, location); + assertEquals(TestValues.GENERAL_LOCATIONDETAILS, location); } public void testJson(){ JSONObject reference = new JSONObject(); try{ - reference.put(WeatherServiceData.KEY_LOCATION, Test.GENERAL_LOCATIONDETAILS); - reference.put(WeatherServiceData.KEY_CURRENT_FORECAST, Test.GENERAL_WEATHERDATA); - reference.put(WeatherServiceData.KEY_MINUTE_FORECAST, Test.GENERAL_WEATHERDATA_LIST); - reference.put(WeatherServiceData.KEY_HOURLY_FORECAST, Test.GENERAL_WEATHERDATA_LIST); - reference.put(WeatherServiceData.KEY_MULTIDAY_FORECAST, Test.GENERAL_WEATHERDATA_LIST); - reference.put(WeatherServiceData.KEY_ALERTS, Test.GENERAL_WEATHERALERT_LIST); + reference.put(WeatherServiceData.KEY_LOCATION, TestValues.GENERAL_LOCATIONDETAILS); + reference.put(WeatherServiceData.KEY_CURRENT_FORECAST, TestValues.GENERAL_WEATHERDATA); + reference.put(WeatherServiceData.KEY_MINUTE_FORECAST, TestValues.GENERAL_WEATHERDATA_LIST); + reference.put(WeatherServiceData.KEY_HOURLY_FORECAST, TestValues.GENERAL_WEATHERDATA_LIST); + reference.put(WeatherServiceData.KEY_MULTIDAY_FORECAST, TestValues.GENERAL_WEATHERDATA_LIST); + reference.put(WeatherServiceData.KEY_ALERTS, TestValues.GENERAL_WEATHERALERT_LIST); JSONObject underTest = msg.serializeJSON(); - assertEquals(Test.MATCH, reference.length(), underTest.length()); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); Iterator<?> iterator = reference.keys(); while(iterator.hasNext()){ @@ -101,13 +101,13 @@ public class WeatherServiceDataTests extends TestCase { JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateLocationDetails( Test.GENERAL_LOCATIONDETAILS, new LocationDetails(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateLocationDetails( TestValues.GENERAL_LOCATIONDETAILS, new LocationDetails(hashTest))); } else if(key.equals(WeatherServiceData.KEY_CURRENT_FORECAST)){ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key); Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals); - assertTrue(Test.TRUE, Validator.validateWeatherData( Test.GENERAL_WEATHERDATA, new WeatherData(hashTest))); + assertTrue(TestValues.TRUE, Validator.validateWeatherData( TestValues.GENERAL_WEATHERDATA, new WeatherData(hashTest))); } else if(key.equals(WeatherServiceData.KEY_MINUTE_FORECAST) || key.equals(WeatherServiceData.KEY_HOURLY_FORECAST) || key.equals(WeatherServiceData.KEY_MULTIDAY_FORECAST)){ @@ -120,7 +120,7 @@ public class WeatherServiceDataTests extends TestCase { } assertTrue("JSON value didn't match expected value for key \"" + key + "\".", - Validator.validateWeatherDataList(Test.GENERAL_WEATHERDATA_LIST, weatherDataUnderTestList)); + Validator.validateWeatherDataList(TestValues.GENERAL_WEATHERDATA_LIST, weatherDataUnderTestList)); } else if(key.equals(WeatherServiceData.KEY_ALERTS)){ @@ -132,11 +132,11 @@ public class WeatherServiceDataTests extends TestCase { } assertTrue("JSON value didn't match expected value for key \"" + key + "\".", - Validator.validateWeatherAlertList(Test.GENERAL_WEATHERALERT_LIST, weatherAlertUnderTestList)); + Validator.validateWeatherAlertList(TestValues.GENERAL_WEATHERALERT_LIST, weatherAlertUnderTestList)); } } } catch(JSONException e){ - fail(Test.JSON_FAIL); + fail(TestValues.JSON_FAIL); } } } |