From: gmungoc Date: Tue, 26 Mar 2019 15:18:48 +0000 (+0000) Subject: JAL-3026 reinstate test to classpath, fix compilation errors therein X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FJalview-JS%2Fdemo;p=jalview.git JAL-3026 reinstate test to classpath, fix compilation errors therein --- diff --git a/.classpath b/.classpath index 1cca7ba..bd4f831 100644 --- a/.classpath +++ b/.classpath @@ -1,7 +1,7 @@ - + diff --git a/test/jalview/ext/ensembl/EnsemblXrefTest.java b/test/jalview/ext/ensembl/EnsemblXrefTest.java index 9cc6627..07f8892 100644 --- a/test/jalview/ext/ensembl/EnsemblXrefTest.java +++ b/test/jalview/ext/ensembl/EnsemblXrefTest.java @@ -25,13 +25,13 @@ import static org.testng.AssertJUnit.assertFalse; 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; @@ -61,12 +61,13 @@ public class EnsemblXrefTest EnsemblXref testee = new EnsemblXref("http://rest.ensembl.org", dbName, dbVers) { - @Override - protected BufferedReader getHttpResponse(URL url, List ids) - throws IOException - { - return new BufferedReader(new StringReader(JSON)); - } + @SuppressWarnings("unchecked") + @Override + protected Object getJSON(URL url, List ids, int msDelay, int mode, String mapKey) throws IOException, ParseException + { + return ((List)JSONUtils.parse(JSON)).iterator(); + } + }; // synonyms and GO terms are not returned diff --git a/test/jalview/util/JSONUtilsTest.java b/test/jalview/util/JSONUtilsTest.java index 45f1c48..d898a88 100644 --- a/test/jalview/util/JSONUtilsTest.java +++ b/test/jalview/util/JSONUtilsTest.java @@ -12,15 +12,15 @@ public class JSONUtilsTest @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"); } }