Class | Line # | Actions | |||
---|---|---|---|---|---|
JSONUtilsTest | 10 | 7 | 1 |
1 | package jalview.util; | |
2 | ||
3 | import static org.testng.Assert.assertEquals; | |
4 | import static org.testng.Assert.assertNull; | |
5 | ||
6 | import org.json.JSONException; | |
7 | import org.json.simple.JSONArray; | |
8 | import org.testng.annotations.Test; | |
9 | ||
10 | public class JSONUtilsTest | |
11 | { | |
12 | 1 | ![]() |
13 | public void testArrayToList() throws JSONException | |
14 | { | |
15 | 1 | assertNull(JSONUtils.arrayToStringList(null)); |
16 | ||
17 | 1 | JSONArray ja = new JSONArray(); |
18 | 1 | assertNull(JSONUtils.arrayToStringList(null)); |
19 | ||
20 | 1 | ja.add("hello"); |
21 | 1 | assertEquals(JSONUtils.arrayToStringList(ja), "hello"); |
22 | ||
23 | 1 | ja.add("world"); |
24 | 1 | assertEquals(JSONUtils.arrayToStringList(ja), "hello,world"); |
25 | } | |
26 | } |