summaryrefslogtreecommitdiff
path: root/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherAlertTests.java
diff options
context:
space:
mode:
Diffstat (limited to 'android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherAlertTests.java')
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherAlertTests.java70
1 files changed, 35 insertions, 35 deletions
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherAlertTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherAlertTests.java
index 4a8ade572..f3537a29b 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherAlertTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/WeatherAlertTests.java
@@ -4,7 +4,7 @@ import com.smartdevicelink.marshal.JsonRPCMarshaller;
import com.smartdevicelink.proxy.rpc.DateTime;
import com.smartdevicelink.proxy.rpc.WeatherAlert;
import com.smartdevicelink.test.JsonUtils;
-import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.TestValues;
import com.smartdevicelink.test.Validator;
import junit.framework.TestCase;
@@ -29,12 +29,12 @@ public class WeatherAlertTests extends TestCase {
public void setUp(){
msg = new WeatherAlert();
- msg.setExpires(Test.GENERAL_DATETIME);
- msg.setTimeIssued(Test.GENERAL_DATETIME);
- msg.setRegions(Test.GENERAL_STRING_LIST);
- msg.setSeverity(Test.GENERAL_STRING);
- msg.setSummary(Test.GENERAL_STRING);
- msg.setTitle(Test.GENERAL_STRING);
+ msg.setExpires(TestValues.GENERAL_DATETIME);
+ msg.setTimeIssued(TestValues.GENERAL_DATETIME);
+ msg.setRegions(TestValues.GENERAL_STRING_LIST);
+ msg.setSeverity(TestValues.GENERAL_STRING);
+ msg.setSummary(TestValues.GENERAL_STRING);
+ msg.setTitle(TestValues.GENERAL_STRING);
}
/**
@@ -50,44 +50,44 @@ public class WeatherAlertTests extends TestCase {
String title = msg.getTitle();
// Valid Tests
- assertEquals(Test.MATCH, expires, Test.GENERAL_DATETIME);
- assertEquals(Test.MATCH, issued, Test.GENERAL_DATETIME);
- assertEquals(Test.MATCH, regions, Test.GENERAL_STRING_LIST);
- assertEquals(Test.MATCH, severity, Test.GENERAL_STRING);
- assertEquals(Test.MATCH, summary, Test.GENERAL_STRING);
- assertEquals(Test.MATCH, title, Test.GENERAL_STRING);
+ assertEquals(TestValues.MATCH, expires, TestValues.GENERAL_DATETIME);
+ assertEquals(TestValues.MATCH, issued, TestValues.GENERAL_DATETIME);
+ assertEquals(TestValues.MATCH, regions, TestValues.GENERAL_STRING_LIST);
+ assertEquals(TestValues.MATCH, severity, TestValues.GENERAL_STRING);
+ assertEquals(TestValues.MATCH, summary, TestValues.GENERAL_STRING);
+ assertEquals(TestValues.MATCH, title, TestValues.GENERAL_STRING);
// Invalid/Null Tests
WeatherAlert msg = new WeatherAlert();
- assertNotNull(Test.NOT_NULL, msg);
-
- assertNull(Test.NULL, msg.getExpires());
- assertNull(Test.NULL, msg.getTimeIssued());
- assertNull(Test.NULL, msg.getRegions());
- assertNull(Test.NULL, msg.getSeverity());
- assertNull(Test.NULL, msg.getSummary());
- assertNull(Test.NULL, msg.getTitle());
+ assertNotNull(TestValues.NOT_NULL, msg);
+
+ assertNull(TestValues.NULL, msg.getExpires());
+ assertNull(TestValues.NULL, msg.getTimeIssued());
+ assertNull(TestValues.NULL, msg.getRegions());
+ assertNull(TestValues.NULL, msg.getSeverity());
+ assertNull(TestValues.NULL, msg.getSummary());
+ assertNull(TestValues.NULL, msg.getTitle());
}
public void testRequiredParamsConstructor(){
- msg = new WeatherAlert(Test.GENERAL_STRING_LIST);
+ msg = new WeatherAlert(TestValues.GENERAL_STRING_LIST);
List<String> regions = msg.getRegions();
- assertEquals(Test.MATCH, regions, Test.GENERAL_STRING_LIST);
+ assertEquals(TestValues.MATCH, regions, TestValues.GENERAL_STRING_LIST);
}
public void testJson(){
JSONObject reference = new JSONObject();
try{
- reference.put(WeatherAlert.KEY_EXPIRES, Test.GENERAL_DATETIME);
- reference.put(WeatherAlert.KEY_TIME_ISSUED, Test.GENERAL_DATETIME);
- reference.put(WeatherAlert.KEY_REGIONS, JsonUtils.createJsonArray(Test.GENERAL_STRING_LIST));
- reference.put(WeatherAlert.KEY_SEVERITY, Test.GENERAL_STRING);
- reference.put(WeatherAlert.KEY_SUMMARY, Test.GENERAL_STRING);
- reference.put(WeatherAlert.KEY_TITLE, Test.GENERAL_STRING);
+ reference.put(WeatherAlert.KEY_EXPIRES, TestValues.GENERAL_DATETIME);
+ reference.put(WeatherAlert.KEY_TIME_ISSUED, TestValues.GENERAL_DATETIME);
+ reference.put(WeatherAlert.KEY_REGIONS, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST));
+ reference.put(WeatherAlert.KEY_SEVERITY, TestValues.GENERAL_STRING);
+ reference.put(WeatherAlert.KEY_SUMMARY, TestValues.GENERAL_STRING);
+ reference.put(WeatherAlert.KEY_TITLE, TestValues.GENERAL_STRING);
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()) {
@@ -95,18 +95,18 @@ public class WeatherAlertTests extends TestCase {
if (key.equals(WeatherAlert.KEY_EXPIRES)||key.equals(WeatherAlert.KEY_TIME_ISSUED)){
JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
- assertTrue(Test.TRUE, Validator.validateDateTime(Test.GENERAL_DATETIME, new DateTime(hashTest)));
+ assertTrue(TestValues.TRUE, Validator.validateDateTime(TestValues.GENERAL_DATETIME, new DateTime(hashTest)));
} else if (key.equals(WeatherAlert.KEY_REGIONS)){
JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key);
JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
- assertEquals(Test.MATCH, referenceArray.length(), underTestArray.length());
- assertTrue(Test.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key)));
+ assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length());
+ assertTrue(TestValues.TRUE, Validator.validateStringList(JsonUtils.readStringListFromJsonObject(reference, key), JsonUtils.readStringListFromJsonObject(underTest, key)));
} else {
- assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
+ assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
}
}
} catch(JSONException e){
- fail(Test.JSON_FAIL);
+ fail(TestValues.JSON_FAIL);
}
}
} \ No newline at end of file