<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <!-- classpathentry kind="src" path="test"/ -->
+ <classpathentry kind="src" path="test"/>
<classpathentry kind="src" path="src2"/>
<classpathentry kind="src" path="utils"/>
<classpathentry kind="lib" path="lib/activation.jar"/>
import jalview.datamodel.DBRefEntry;
import jalview.gui.JvOptionPane;
+import jalview.util.JSONUtils;
-import java.io.BufferedReader;
import java.io.IOException;
-import java.io.StringReader;
import java.net.URL;
import java.util.List;
+import org.json.simple.parser.ParseException;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
EnsemblXref testee = new EnsemblXref("http://rest.ensembl.org", dbName,
dbVers)
{
- @Override
- protected BufferedReader getHttpResponse(URL url, List<String> ids)
- throws IOException
- {
- return new BufferedReader(new StringReader(JSON));
- }
+ @SuppressWarnings("unchecked")
+ @Override
+ protected Object getJSON(URL url, List<String> ids, int msDelay, int mode, String mapKey) throws IOException, ParseException
+ {
+ return ((List<Object>)JSONUtils.parse(JSON)).iterator();
+ }
+
};
// synonyms and GO terms are not returned
@Test(groups = "Functional")
public void testArrayToList() throws JSONException
{
- assertNull(JSONUtils.arrayToList(null));
+ assertNull(JSONUtils.arrayToStringList(null));
JSONArray ja = new JSONArray();
- assertNull(JSONUtils.arrayToList(null));
+ assertNull(JSONUtils.arrayToStringList(null));
ja.add("hello");
- assertEquals(JSONUtils.arrayToList(ja), "hello");
+ assertEquals(JSONUtils.arrayToStringList(ja), "hello");
ja.add("world");
- assertEquals(JSONUtils.arrayToList(ja), "hello,world");
+ assertEquals(JSONUtils.arrayToStringList(ja), "hello,world");
}
}