From ee6eeba9f46c5c157e37fff869d23a6dbfce3b00 Mon Sep 17 00:00:00 2001 From: Arnaldo Date: Mon, 29 Mar 2021 14:39:38 +0200 Subject: [PATCH] fixed last commit --- .../threedbeacons/TDBeaconsFTSRestClient.java | 19 +++++++++---------- .../threedbeacons/TDBeaconsFTSRestClientTest.java | 4 ++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/jalview/fts/service/threedbeacons/TDBeaconsFTSRestClient.java b/src/jalview/fts/service/threedbeacons/TDBeaconsFTSRestClient.java index 884dced..655b960 100644 --- a/src/jalview/fts/service/threedbeacons/TDBeaconsFTSRestClient.java +++ b/src/jalview/fts/service/threedbeacons/TDBeaconsFTSRestClient.java @@ -143,7 +143,6 @@ public class TDBeaconsFTSRestClient extends FTSRestClient Map jsonObj, FTSRestRequest tdbRestRequest) { FTSRestResponse searchResult = new FTSRestResponse(); - //searchResult.setNumberOfItemsFound(1); List result = null; try @@ -152,18 +151,18 @@ public class TDBeaconsFTSRestClient extends FTSRestClient { jsonObj = (Map) JSONUtils.parse(tdbJsonResponseString); } - System.out.println(jsonObj); - //Map tdbResponse = (Map) jsonObj.get("structures"); + //System.out.println(jsonObj); + + Object uniprot_entry = jsonObj.get("uniprot_entry"); + System.out.println(uniprot_entry); - //System.out.println((Map) jsonObj.get("uniprot_entry")); Long seqLength = (Long) ((Map) jsonObj.get("uniprot_entry")).get("sequence_length"); - System.out.println(seqLength); + System.out.println("seqLenght :" + seqLength); + result = new ArrayList<>(); List structures = (List) jsonObj.get("structures"); - //System.out.println(jsonObj.get("structures")); - //System.out.println(structures); - System.out.println("ZERO : " + structures.get(0)); - System.out.println("1 : " + structures.get(1)); + //Map tdbResponse = (Map) jsonObj.get("structures"); + int numFound = 0; for (Iterator strucIter = structures.iterator(); strucIter .hasNext();) @@ -173,7 +172,7 @@ public class TDBeaconsFTSRestClient extends FTSRestClient numFound++; //System.out.println(structure); } - //System.out.println(structures); + System.out.println("1 : " + structures.get(1)); searchResult.setNumberOfItemsFound(numFound); searchResult.setSearchSummary(result); diff --git a/test/jalview/fts/threedbeacons/TDBeaconsFTSRestClientTest.java b/test/jalview/fts/threedbeacons/TDBeaconsFTSRestClientTest.java index f65fa84..94b6b63 100644 --- a/test/jalview/fts/threedbeacons/TDBeaconsFTSRestClientTest.java +++ b/test/jalview/fts/threedbeacons/TDBeaconsFTSRestClientTest.java @@ -292,7 +292,7 @@ public class TDBeaconsFTSRestClientTest request.setSearchTerm("01308.json"); request.setWantedFields(wantedFields); System.out.println("request : " + request.getFieldToSearchBy()); - System.out.println(request.toString()); + //System.out.println(request.toString()); FTSRestResponse response; try @@ -305,7 +305,7 @@ public class TDBeaconsFTSRestClientTest return; } assertTrue(response.getSearchSummary() != null); - assertTrue(response.getNumberOfItemsFound() > 99); + assertTrue(response.getNumberOfItemsFound() > 3); System.out.println(response.getSearchSummary()); System.out.println(response.getSearchSummary().size()); } -- 1.7.10.2