X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Ffts%2Fservice%2Fpdb%2FPDBFTSRestClientTest.java;h=6edd86e23001b102e94aa3b14ecbd3e31c356ae0;hb=eb3e681d6e82ccdd5d312d1981dfb306e7f479f0;hp=355eae51635fed93e5313c24d6f859fd10f66cb6;hpb=5a352aa2f3330ae269d9b70c4a7374c2518bfb2e;p=jalview.git diff --git a/test/jalview/fts/service/pdb/PDBFTSRestClientTest.java b/test/jalview/fts/service/pdb/PDBFTSRestClientTest.java index 355eae5..6edd86e 100644 --- a/test/jalview/fts/service/pdb/PDBFTSRestClientTest.java +++ b/test/jalview/fts/service/pdb/PDBFTSRestClientTest.java @@ -732,15 +732,18 @@ public class PDBFTSRestClientTest try { - mocks.add( - new String[] - { readJsonStringFromFile( - "test/jalview/fts/threedbeacons/p01308_pdbfts_query.txt") - .trim(), - readJsonStringFromFile( - "test/jalview/fts/threedbeacons/p01308_pdbfts_resp.txt") - .trim() }); - for (int i = 1; i < 5; i++) + for (int i = 1; i < 3; i++) + { + mocks.add( + new String[] + { readJsonStringFromFile( + "test/jalview/fts/threedbeacons/p01308_pdbfts_query_pt" + + i + ".txt").trim(), + readJsonStringFromFile( + "test/jalview/fts/threedbeacons/p01308_pdbfts_query_pt" + + i + "_resp.txt").trim() }); + } + for (int i = 1; i < 6; i++) { mocks.add( @@ -752,11 +755,88 @@ public class PDBFTSRestClientTest "test/jalview/fts/threedbeacons/p0dtd1_pdbfts_fts_query_pt" + i + "_resp.txt").trim() }); } + // maize + mocks.add( + new String[] + { "https://www.ebi.ac.uk/pdbe/search/pdb/select?wt=json&fl=pdb_id,title,experimental_method,resolution&rows=500&start=0&q=(1gaq+OR+5h92+OR+3b2f+OR+3w5u+OR+5h8y+OR+3w5v)+AND+molecule_sequence:%5B''+TO+*%5D+AND+status:REL&sort=", + "{\n" + " \"responseHeader\":{\n" + " \"status\":0,\n" + + " \"QTime\":0,\n" + " \"params\":{\n" + + " \"q\":\"(1gaq OR 5h92 OR 3b2f OR 3w5u OR 5h8y OR 3w5v) AND molecule_sequence:['' TO *] AND status:REL\",\n" + + " \"fl\":\"pdb_id,title,experimental_method,resolution\",\n" + + " \"start\":\"0\",\n" + + " \"sort\":\"\",\n" + + " \"rows\":\"500\",\n" + + " \"wt\":\"json\"}},\n" + + " \"response\":{\"numFound\":11,\"start\":0,\"docs\":[\n" + + " {\n" + + " \"experimental_method\":[\"X-ray diffraction\"],\n" + + " \"pdb_id\":\"3b2f\",\n" + + " \"resolution\":1.7,\n" + + " \"title\":\"Maize Ferredoxin 1\"},\n" + + " {\n" + + " \"experimental_method\":[\"X-ray diffraction\"],\n" + + " \"pdb_id\":\"5h92\",\n" + + " \"resolution\":2.08,\n" + + " \"title\":\"Crystal structure of the complex between maize Sulfite Reductase and ferredoxin in the form-3 crystal\"},\n" + + " {\n" + + " \"experimental_method\":[\"X-ray diffraction\"],\n" + + " \"pdb_id\":\"5h8y\",\n" + + " \"resolution\":2.2,\n" + + " \"title\":\"Crystal structure of the complex between maize sulfite reductase and ferredoxin in the form-2 crystal\"},\n" + + " {\n" + + " \"experimental_method\":[\"X-ray diffraction\"],\n" + + " \"pdb_id\":\"1gaq\",\n" + + " \"resolution\":2.59,\n" + + " \"title\":\"CRYSTAL STRUCTURE OF THE COMPLEX BETWEEN FERREDOXIN AND FERREDOXIN-NADP+ REDUCTASE\"},\n" + + " {\n" + + " \"experimental_method\":[\"X-ray diffraction\"],\n" + + " \"pdb_id\":\"3w5u\",\n" + + " \"resolution\":2.7,\n" + + " \"title\":\"Cross-linked complex between Ferredoxin and Ferredoxin-NADP+ reductase\"},\n" + + " {\n" + + " \"experimental_method\":[\"X-ray diffraction\"],\n" + + " \"pdb_id\":\"3w5v\",\n" + + " \"resolution\":3.81,\n" + + " \"title\":\"Cross-linked complex between Ferredoxin and Ferredoxin-NADP+ reductase\"},\n" + + " {\n" + + " \"experimental_method\":[\"X-ray diffraction\"],\n" + + " \"pdb_id\":\"3w5u\",\n" + + " \"resolution\":2.7,\n" + + " \"title\":\"Cross-linked complex between Ferredoxin and Ferredoxin-NADP+ reductase\"},\n" + + " {\n" + + " \"experimental_method\":[\"X-ray diffraction\"],\n" + + " \"pdb_id\":\"3w5v\",\n" + + " \"resolution\":3.81,\n" + + " \"title\":\"Cross-linked complex between Ferredoxin and Ferredoxin-NADP+ reductase\"},\n" + + " {\n" + + " \"experimental_method\":[\"X-ray diffraction\"],\n" + + " \"pdb_id\":\"1gaq\",\n" + + " \"resolution\":2.59,\n" + + " \"title\":\"CRYSTAL STRUCTURE OF THE COMPLEX BETWEEN FERREDOXIN AND FERREDOXIN-NADP+ REDUCTASE\"},\n" + + " {\n" + + " \"experimental_method\":[\"X-ray diffraction\"],\n" + + " \"pdb_id\":\"5h92\",\n" + + " \"resolution\":2.08,\n" + + " \"title\":\"Crystal structure of the complex between maize Sulfite Reductase and ferredoxin in the form-3 crystal\"},\n" + + " {\n" + + " \"experimental_method\":[\"X-ray diffraction\"],\n" + + " \"pdb_id\":\"5h8y\",\n" + + " \"resolution\":2.2,\n" + + " \"title\":\"Crystal structure of the complex between maize sulfite reductase and ferredoxin in the form-2 crystal\"}]\n" + + " }}" }); + mocks.add( + new String[] + { "https://www.ebi.ac.uk/pdbe/search/pdb/select?wt=json&fl=pdb_id,title,experimental_method,resolution&rows=500&start=0&q=(4gs9+OR+6bvb+OR+8ck8+OR+8ck3+OR+6x3d+OR+8ck4+OR+6x28+OR+6i7r+OR+3h82+OR+6i7q+OR+6x21+OR+4xt2+OR+5kiz+OR+7q5v+OR+6x2h+OR+7q5x+OR+3f1n+OR+3f1o+OR+2a24+OR+3f1p+OR+1p97+OR+4ghi+OR+3h7w+OR+6d09+OR+6czw+OR+7ujv+OR+5tbm+OR+5ufp+OR+4pky+OR+6d0b+OR+6d0c+OR+6x37)+AND+molecule_sequence:%5B''+TO+*%5D+AND+status:REL&sort=", + readJsonStringFromFile( + "test/jalview/fts/threedbeacons/q99814_tdb_pdbfts_query_resp.txt") }); } catch (Throwable e) { Assert.fail("Couldn't read mock data.", e); } - + /* + * updating mocks for p0dtd1 require very long URLs to be queried + for i in test/jalview/fts/threedbeacons/p0dtd1_pdbfts_fts_query_pt?.txt; do wget -i $i -O ${i/.txt/_resp.txt}; done + */ FTSRestClient.createMockFTSRestClient( (FTSRestClient) PDBFTSRestClient.getInstance(), mocks.toArray(new String[0][2]));