X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fws%2Fjabaws%2FDisorderAnnotExportImport.java;h=629b6c3bd41b880a7222477ef0ec86560e3f7728;hb=4fb4ce058d2c40f990e99be102a54095d98fa87f;hp=3573f507ec2d10d6326da0ea2c1d74dfe5169f4a;hpb=483e7163b1fb8d4bcb9393014816c944befce328;p=jalview.git diff --git a/test/jalview/ws/jabaws/DisorderAnnotExportImport.java b/test/jalview/ws/jabaws/DisorderAnnotExportImport.java index 3573f50..629b6c3 100644 --- a/test/jalview/ws/jabaws/DisorderAnnotExportImport.java +++ b/test/jalview/ws/jabaws/DisorderAnnotExportImport.java @@ -20,10 +20,13 @@ */ package jalview.ws.jabaws; +import java.util.Locale; + import static org.testng.AssertJUnit.assertNotNull; import static org.testng.AssertJUnit.assertTrue; import jalview.bin.Cache; +import jalview.bin.Console; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.gui.JvOptionPane; @@ -44,7 +47,11 @@ import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -@Test(groups = { "External" }) +/* + * All methods in this class are set to the Network group because setUpBeforeClass will fail + * if there is no network. + */ +@Test(singleThreaded = true) public class DisorderAnnotExportImport { @@ -65,16 +72,24 @@ public class DisorderAnnotExportImport public static jalview.gui.AlignFrame af = null; - @BeforeClass(inheritGroups = true) + @BeforeClass(alwaysRun = true) public static void setUpBeforeClass() throws Exception { Cache.loadProperties("test/jalview/io/testProps.jvprops"); - Cache.initLogger(); + Console.initLogger(); disc = JalviewJabawsTestUtils.getJabawsDiscoverer(); + + while (disc.isRunning()) + { + // don't get services until discoverer has finished + Thread.sleep(100); + } + iupreds = new ArrayList(); for (Jws2Instance svc : disc.getServices()) { - if (svc.getServiceTypeURI().toLowerCase().contains("iupredws")) + if (svc.getServiceTypeURI().toLowerCase(Locale.ROOT) + .contains("iupredws")) { iupreds.add(svc); } @@ -82,7 +97,8 @@ public class DisorderAnnotExportImport assertTrue("Couldn't discover any IUPred services to use to test.", iupreds.size() > 0); jalview.io.FileLoader fl = new jalview.io.FileLoader(false); - af = fl.LoadFileWaitTillLoaded(testseqs, jalview.io.DataSourceType.FILE); + af = fl.LoadFileWaitTillLoaded(testseqs, + jalview.io.DataSourceType.FILE); assertNotNull("Couldn't load test data ('" + testseqs + "')", af); } @@ -100,7 +116,7 @@ public class DisorderAnnotExportImport /** * test for patches to JAL-1294 */ - @Test + @Test(groups = { "External", "Network" }) public void testDisorderAnnotExport() { disorderClient = new AADisorderClient(iupreds.get(0), af, null, null); @@ -138,42 +154,36 @@ public class DisorderAnnotExportImport { try { - String aligfileout = FileFormat.Pfam.getAlignmentFile().print( - al.getSequencesArray(), true); + String aligfileout = FileFormat.Pfam.getWriter(al) + .print(al.getSequencesArray(), true); String anfileout = new AnnotationFile() .printAnnotationsForAlignment(al); - assertTrue( - "Test " - + testname - + "\nAlignment annotation file was not regenerated. Null string", + assertTrue("Test " + testname + + "\nAlignment annotation file was not regenerated. Null string", anfileout != null); - assertTrue( - "Test " - + testname - + "\nAlignment annotation file was not regenerated. Empty string", + assertTrue("Test " + testname + + "\nAlignment annotation file was not regenerated. Empty string", anfileout.length() > "JALVIEW_ANNOTATION".length()); - System.out.println("Output annotation file:\n" + anfileout - + "\n<