JAL-1270 test suits import order refactor
[jalview.git] / test / jalview / ws / jabaws / MinJabawsClientTests.java
index 5c9a192..0a50e47 100644 (file)
@@ -1,18 +1,13 @@
 package jalview.ws.jabaws;
 
-import static org.junit.Assert.*;
+import static org.testng.AssertJUnit.assertEquals;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.function.Consumer;
 
-import jalview.ws.jws2.jabaws2.Jws2Instance;
-import jalview.ws.jws2.jabaws2.Jws2InstanceFactory;
+import org.testng.Assert;
+import org.testng.annotations.Test;
 
-import org.junit.Test;
-
-import compbio.data.msa.Category;
-import compbio.data.msa.JABAService;
 import compbio.data.msa.MsaWS;
 import compbio.data.msa.RegistryWS;
 import compbio.data.sequence.FastaSequence;
@@ -20,8 +15,13 @@ import compbio.metadata.JobStatus;
 import compbio.ws.client.Jws2Client;
 import compbio.ws.client.Services;
 
-public class MinJabawsClientTests {
+public class MinJabawsClientTests
+{
 
+       /**
+        * simple test for the benefit of JAL-1338
+        * @throws Exception
+        */
        @SuppressWarnings("rawtypes")
        @Test
        public void msaTest() throws Exception {
@@ -40,7 +40,7 @@ public class MinJabawsClientTests {
                                }
                        }
                        if (msaservice == null) {
-                               fail("couldn't find a clustalO service on the public registry");
+                               Assert.fail("couldn't find a clustalO service on the public registry");
                        }
                        FastaSequence fsq = new FastaSequence("seqA",
                                        "SESESESESESESESSESESSESESESESESESESESESEEEEEESSESESESESSSSESESESESESESE");
@@ -51,32 +51,40 @@ public class MinJabawsClientTests {
                        }
 
                        String jobid = msaservice.align(iseqs);
-                       if (jobid != null) {
-                               JobStatus js = null;
-                               do {
-                                       try {
-                                               Thread.sleep(500);
-                                       } catch (InterruptedException q) {
-                                       }
-                                       ;
-                                       js = msaservice.getJobStatus(jobid);
-                               } while (!js.equals(JobStatus.FAILED)
-                                               && !js.equals(JobStatus.CANCELLED)
-                                               && !js.equals(JobStatus.FINISHED));
-                               assertEquals("Trial alignment failed. State was " + js.name(),
-                                               js, JobStatus.FINISHED);
-                               assertEquals(
-                                               "Mismatch in number of input and result sequences - assume alignment service wasn't interacted with correctly",
-                                               msaservice.getResult(jobid).getSequences().size(),
-                                               iseqs.size());
-                               msaservice.getResult(jobid).getSequences()
-                                               .forEach(new Consumer<FastaSequence>() {
-                                                       @Override
-                                                       public void accept(FastaSequence t) {
-                                                               System.out.println(">"+t.getId());
-                                                               System.out.println(t.getFormattedFasta());
-                                                       }
-                                               });
+      if (jobid != null)
+      {
+        JobStatus js = null;
+        do
+        {
+          try
+          {
+            Thread.sleep(500);
+          } catch (InterruptedException q)
+          {
+          }
+          ;
+          js = msaservice.getJobStatus(jobid);
+        } while (!js.equals(JobStatus.FAILED)
+                && !js.equals(JobStatus.CANCELLED)
+                && !js.equals(JobStatus.FINISHED));
+        assertEquals("Trial alignment failed. State was " + js.name(), js,
+                JobStatus.FINISHED);
+        assertEquals(
+                "Mismatch in number of input and result sequences - assume alignment service wasn't interacted with correctly",
+                msaservice.getResult(jobid).getSequences().size(),
+                iseqs.size());
+        for (FastaSequence t : msaservice.getResult(jobid).getSequences())
+        {
+          System.out.println(">" + t.getId());
+          System.out.println(t.getFormattedFasta());
+        }
+        // .forEach(new Consumer<FastaSequence>() {
+        // @Override
+        // public void accept(FastaSequence t) {
+        // System.out.println(">"+t.getId());
+        // System.out.println(t.getFormattedFasta());
+        // }
+        // });
                        }
 
                }