X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fws%2Fjabaws%2FMinJabawsClientTests.java;h=61f82031f62d21f6223d02be348f6b6ce518205c;hb=93c35921f03bd89e0e2a3d3eeb5c4898cb317166;hp=b55e8ee552814e65ed05b4ae9ceeb15582c184a2;hpb=5002a0f587ac8f1c18117e29bb4be2754743afc2;p=jalview.git diff --git a/test/jalview/ws/jabaws/MinJabawsClientTests.java b/test/jalview/ws/jabaws/MinJabawsClientTests.java index b55e8ee..61f8203 100644 --- a/test/jalview/ws/jabaws/MinJabawsClientTests.java +++ b/test/jalview/ws/jabaws/MinJabawsClientTests.java @@ -1,12 +1,12 @@ package jalview.ws.jabaws; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.testng.AssertJUnit.assertEquals; import java.util.ArrayList; import java.util.List; -import org.junit.Test; +import org.testng.Assert; +import org.testng.annotations.Test; import compbio.data.msa.MsaWS; import compbio.data.msa.RegistryWS; @@ -15,14 +15,16 @@ 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 + @Test(groups = + { "Network" }) public void msaTest() throws Exception { String url; RegistryWS registry = Jws2Client @@ -39,7 +41,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"); @@ -50,29 +52,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()); - List seqList = msaservice.getResult(jobid).getSequences(); - for(FastaSequence fSeq : seqList){ - System.out.println(">"+fSeq.getId()); - System.out.println(fSeq.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() { + // @Override + // public void accept(FastaSequence t) { + // System.out.println(">"+t.getId()); + // System.out.println(t.getFormattedFasta()); + // } + // }); } }