OLD | NEW |
1 package org.adblockplus.libadblockplus.tests; | 1 package org.adblockplus.libadblockplus.tests; |
2 | 2 |
| 3 import android.test.InstrumentationTestCase; |
| 4 |
3 import org.adblockplus.libadblockplus.android.Utils; | 5 import org.adblockplus.libadblockplus.android.Utils; |
4 import org.junit.Test; | 6 import org.junit.Test; |
5 | 7 |
6 import java.util.Arrays; | 8 import java.util.Arrays; |
7 import java.util.LinkedList; | 9 import java.util.LinkedList; |
8 import java.util.List; | 10 import java.util.List; |
9 | 11 |
10 /** | 12 /** |
11 * Test for Utils | 13 * Test for Utils |
12 */ | 14 */ |
13 public class UtilsTest extends BaseJsTest | 15 public class UtilsTest extends InstrumentationTestCase |
14 { | 16 { |
15 @Test | 17 @Test |
16 public void testJson_null() | 18 public void testJson_null() |
17 { | 19 { |
18 final List<String> list = null; | 20 final List<String> list = null; |
19 String json = Utils.stringListToJsonArray(list); | 21 String json = Utils.stringListToJsonArray(list); |
20 assertEquals("[]", json); | 22 assertEquals("[]", json); |
21 } | 23 } |
22 | 24 |
23 @Test | 25 @Test |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 119 } |
118 | 120 |
119 @Test | 121 @Test |
120 public void testUrlWithoutParams_multipleQuestionMarks() | 122 public void testUrlWithoutParams_multipleQuestionMarks() |
121 { | 123 { |
122 String url = Utils.getUrlWithoutParams("https://www.google.com?q=123?t=123")
; // invalid URL | 124 String url = Utils.getUrlWithoutParams("https://www.google.com?q=123?t=123")
; // invalid URL |
123 assertNotNull(url); | 125 assertNotNull(url); |
124 assertEquals("https://www.google.com", url); | 126 assertEquals("https://www.google.com", url); |
125 } | 127 } |
126 } | 128 } |
OLD | NEW |