JAL-3438 spotless for 2.11.2.0
[jalview.git] / test / jalview / ws / jabaws / DisorderAnnotExportImport.java
index 9b1dc19..629b6c3 100644 (file)
  */
 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;
@@ -69,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<Jws2Instance>();
     for (Jws2Instance svc : disc.getServices())
     {
-      if (svc.getServiceTypeURI().toLowerCase().contains("iupredws"))
+      if (svc.getServiceTypeURI().toLowerCase(Locale.ROOT)
+              .contains("iupredws"))
       {
         iupreds.add(svc);
       }
@@ -86,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);
   }
 
@@ -142,42 +154,36 @@ public class DisorderAnnotExportImport
   {
     try
     {
-      String aligfileout = FileFormat.Pfam.getWriter(al).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<<EOF\n");
+      System.out.println(
+              "Output annotation file:\n" + anfileout + "\n<<EOF\n");
 
       AlignmentI al_new = new FormatAdapter().readFile(aligfileout,
               DataSourceType.PASTE, FileFormat.Pfam);
-      assertTrue(
-              "Test "
-                      + testname
-                      + "\nregenerated annotation file did not annotate alignment.",
+      assertTrue("Test " + testname
+              + "\nregenerated annotation file did not annotate alignment.",
               new AnnotationFile().readAnnotationFile(al_new, anfileout,
                       DataSourceType.PASTE));
 
       // test for consistency in io
-      StockholmFileTest.testAlignmentEquivalence(al, al_new, true);
+      StockholmFileTest.testAlignmentEquivalence(al, al_new, true, false,
+              false);
       return;
     } catch (Exception e)
     {
       e.printStackTrace();
     }
-    Assert.fail("Test "
-            + testname
+    Assert.fail("Test " + testname
             + "\nCouldn't complete Annotation file roundtrip input/output/input test.");
   }