Clover icon

Coverage Report

  1. Project Clover database Thu Aug 13 2020 12:04:21 BST
  2. Package jalview.util

File JSONUtilsTest.java

 

Code metrics

0
7
1
1
26
20
1
0.14
7
1
1

Classes

Class Line # Actions
JSONUtilsTest 10 7 1
1.0100%
 

Contributing tests

This file is covered by 1 test. .

Source view

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 toggle @Test(groups = "Functional")
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    }