JAL-3070 jaba/slivka independent tests for disorder and AACon services
authorJim Procter <jprocter@issues.jalview.org>
Mon, 7 Oct 2019 08:03:56 +0000 (09:03 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Mon, 7 Oct 2019 08:03:56 +0000 (09:03 +0100)
test/jalview/ws/jabaws/AAConAnnotAndSettingsIO.java
test/jalview/ws/jabaws/DisorderAnnotExportImport.java

index 02d0d82..2a6c3d0 100644 (file)
@@ -162,7 +162,7 @@ public class AAConAnnotAndSettingsIO
     SeqAnnotationServiceCalcWorker aaconClient = new SeqAnnotationServiceCalcWorker(
             aacon, af, null,
             null);
-    long current = System.currentTimeMillis(), limit = 5;
+    long current = System.currentTimeMillis(), limit = 15;
     af.getViewport().getCalcManager().startWorker(aaconClient);
     do
     {
@@ -180,8 +180,12 @@ public class AAConAnnotAndSettingsIO
     } while (af.getViewport().getCalcManager().isWorking());
     AlignmentI orig_alig = af.getViewport().getAlignment();
     boolean foundShenkin = false;
-    for (AlignmentAnnotation aa : orig_alig
-            .findAnnotation(aacon.getAlignAnalysisUI().getCalcId()))
+    Iterable<AlignmentAnnotation> _aa=orig_alig
+            .findAnnotation(aacon.getAlignAnalysisUI().getCalcId());
+    assertTrue("No annotation from service",
+            _aa != null && _aa.iterator().hasNext());
+
+    for (AlignmentAnnotation aa : _aa)
     {
       assertTrue("AACon annotation not marked as autocalculated!",
               aa.autoCalculated);
index 025c913..8454e03 100644 (file)
@@ -35,6 +35,7 @@ import jalview.io.StockholmFileTest;
 import jalview.ws.api.ServiceWithParameters;
 import jalview.ws.jws2.Jws2Discoverer;
 import jalview.ws.jws2.SeqAnnotationServiceCalcWorker;
+import jalview.ws.slivkaws.SlivkaWSDiscoverer;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -81,11 +82,12 @@ public class DisorderAnnotExportImport
       // don't get services until discoverer has finished
       Thread.sleep(100);
     }
-
+    SlivkaWSDiscoverer disc2 = SlivkaWSDiscoverer.getInstance();
+    disc2.run();
     iupreds = new ArrayList<>();
-    for (ServiceWithParameters svc : disc.getServices())
+    for (ServiceWithParameters svc : disc2.getServices())
     {
-      if (svc.getNameURI().toLowerCase().contains("iupredws"))
+      if (svc.getNameURI().toLowerCase().contains("iupred"))
       {
         iupreds.add(svc);
       }