fixed last commit
authorArnaldo <arnaud.gucciardi@gmail.com>
Mon, 29 Mar 2021 12:39:38 +0000 (14:39 +0200)
committerArnaldo <arnaud.gucciardi@gmail.com>
Mon, 29 Mar 2021 12:39:38 +0000 (14:39 +0200)
src/jalview/fts/service/threedbeacons/TDBeaconsFTSRestClient.java
test/jalview/fts/threedbeacons/TDBeaconsFTSRestClientTest.java

index 884dced..655b960 100644 (file)
@@ -143,7 +143,6 @@ public class TDBeaconsFTSRestClient extends FTSRestClient
           Map<String, Object> jsonObj, FTSRestRequest tdbRestRequest)
   {
     FTSRestResponse searchResult = new FTSRestResponse();
-    //searchResult.setNumberOfItemsFound(1);
     List<FTSData> result = null;
     
     try
@@ -152,18 +151,18 @@ public class TDBeaconsFTSRestClient extends FTSRestClient
       {
         jsonObj = (Map<String, Object>) JSONUtils.parse(tdbJsonResponseString);
       }
-      System.out.println(jsonObj);
-      //Map<String, Object> tdbResponse = (Map<String, Object>) jsonObj.get("structures");
+      //System.out.println(jsonObj);
+      
+      Object uniprot_entry = jsonObj.get("uniprot_entry"); 
+      System.out.println(uniprot_entry);
       
-      //System.out.println((Map<String, Object>) jsonObj.get("uniprot_entry")); 
       Long seqLength = (Long) ((Map<String, Object>) jsonObj.get("uniprot_entry")).get("sequence_length");
-      System.out.println(seqLength);
+      System.out.println("seqLenght :" + seqLength);
+      
       result = new ArrayList<>();
       List<Object> structures = (List<Object>) 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<String, Object> tdbResponse = (Map<String, Object>) jsonObj.get("structures");
+      
       int numFound = 0;
       for (Iterator<Object> 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);
index f65fa84..94b6b63 100644 (file)
@@ -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());
   }