summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Grover <joeygrover@gmail.com>2016-07-27 14:16:16 -0400
committerJoey Grover <joeygrover@gmail.com>2016-07-27 14:16:16 -0400
commit4666c663b6383316aa250e7785396e8061b3ce34 (patch)
tree94a8109ca2c99cecf3dfd3bd91e3dbaca7d57963
parentba3472068fe3fb112a7a0187e86ecce871e46b2a (diff)
downloadsdl_android-4666c663b6383316aa250e7785396e8061b3ce34.tar.gz
Added more test to check proper storage of prefs/app list
-rw-r--r--sdl_android_tests/src/com/smartdevicelink/transport/RSVTestCase.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/sdl_android_tests/src/com/smartdevicelink/transport/RSVTestCase.java b/sdl_android_tests/src/com/smartdevicelink/transport/RSVTestCase.java
index 9a75593dc..8fda666e0 100644
--- a/sdl_android_tests/src/com/smartdevicelink/transport/RSVTestCase.java
+++ b/sdl_android_tests/src/com/smartdevicelink/transport/RSVTestCase.java
@@ -93,6 +93,32 @@ public class RSVTestCase extends AndroidTestCase {
assertFalse(RouterServiceValidator.setTrustedList(mContext,null));
assertFalse(RouterServiceValidator.setTrustedList(null,"test"));
assertTrue(RouterServiceValidator.setTrustedList(mContext,"test"));
+ String test= "{\"response\": {\"com.livio.sdl\" : { \"versionBlacklist\":[] }, \"com.lexus.tcapp\" : { \"versionBlacklist\":[] }, \"com.toyota.tcapp\" : { \"versionBlacklist\": [] } , \"com.sdl.router\":{\"versionBlacklist\": [] } }}";
+ assertTrue(RouterServiceValidator.setTrustedList(mContext,test));
+ assertTrue(RouterServiceValidator.setTrustedList(mContext,test+test+test+test+test));
+ StringBuilder builder = new StringBuilder();
+ for(int i = 0; i<1000; i++){
+ builder.append(test);
+ }
+ assertTrue(RouterServiceValidator.setTrustedList(mContext,builder.toString()));
+ }
+
+ public void testTrustedListSetAndGet(){
+ String test= "{\"response\": {\"com.livio.sdl\" : { \"versionBlacklist\":[] }, \"com.lexus.tcapp\" : { \"versionBlacklist\":[] }, \"com.toyota.tcapp\" : { \"versionBlacklist\": [] } , \"com.sdl.router\":{\"versionBlacklist\": [] } }}";
+ assertTrue(RouterServiceValidator.setTrustedList(mContext,test));
+ String retVal = RouterServiceValidator.getTrustedList(mContext);
+ assertNotNull(retVal);
+ assertTrue(test.equals(retVal));
+
+ retVal = null;
+ StringBuilder builder = new StringBuilder();
+ for(int i = 0; i<1000; i++){
+ builder.append(test);
+ }
+ assertTrue(RouterServiceValidator.setTrustedList(mContext,builder.toString()));
+ retVal = RouterServiceValidator.getTrustedList(mContext);
+ assertNotNull(retVal);
+ assertTrue(builder.toString().equals(retVal));
}
public void testInvalidationSequence(){