JAL-715 allow headless construction for testing
authorJim Procter <jprocter@compbio.dundee.ac.uk>
Fri, 7 Jun 2013 12:24:08 +0000 (13:24 +0100)
committerJim Procter <jprocter@compbio.dundee.ac.uk>
Fri, 7 Jun 2013 15:30:10 +0000 (16:30 +0100)
src/jalview/ws/rest/RestClient.java

index ba6dbeb..061a3fa 100644 (file)
@@ -76,9 +76,15 @@ public class RestClient extends WSClient implements WSClientI,
 
   public RestClient(RestServiceDescription service2, AlignFrame alignFrame)
   {
+    this(service2, alignFrame, false);
+  }
+  boolean headless = false;
+  public RestClient(RestServiceDescription service2, AlignFrame alignFrame, boolean nogui)
+  {
     service = service2;
     af = alignFrame;
     av = alignFrame.getViewport();
+    headless = nogui;
     constructJob();
   }
 
@@ -285,9 +291,11 @@ public class RestClient extends WSClient implements WSClientI,
 
     if (jobsthread.isValid())
     {
-      setWebserviceInfo(false);
-      wsInfo.setthisService(this);
-      jobsthread.setWebServiceInfo(wsInfo);
+      setWebserviceInfo(headless);
+      if (!headless) {
+        wsInfo.setthisService(this);
+        jobsthread.setWebServiceInfo(wsInfo);
+      }
       jobsthread.start();
     }
     else