Merge branch 'develop' into merged_2_11_2_0_to_2_12
[jalview.git] / test / jalview / ws / jabaws / RNAStructExportImport.java
index 7fe645c..d1f4609 100644 (file)
@@ -25,6 +25,7 @@ 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;
@@ -89,7 +90,7 @@ public class RNAStructExportImport
   public static void setUpBeforeClass() throws Exception
   {
     Cache.loadProperties("test/jalview/io/testProps.jvprops");
-    Cache.initLogger();
+    Console.initLogger();
     disc = JalviewJabawsTestUtils.getJabawsDiscoverer(false);
 
     while (disc.isRunning())
@@ -101,7 +102,8 @@ public class RNAStructExportImport
     for (ServiceWithParameters svc : disc.getServices())
     {
 
-      if (svc.getServiceTypeURI().toLowerCase(Locale.ROOT).contains("rnaalifoldws"))
+      if (svc.getNameURI().toLowerCase(Locale.ROOT)
+              .contains("rnaalifoldws"))
       {
         rnaalifoldws = (Jws2Instance) svc;
       }
@@ -116,7 +118,8 @@ public class RNAStructExportImport
 
     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);
 
@@ -219,32 +222,26 @@ public class RNAStructExportImport
     try
     {
       // what format would be appropriate for RNAalifold annotations?
-      String aligfileout = FileFormat.Pfam.getWriter(null).print(
-              al.getSequencesArray(), true);
+      String aligfileout = FileFormat.Pfam.getWriter(null)
+              .print(al.getSequencesArray(), true);
 
       String anfileout = new AnnotationFile()
               .printAnnotationsForAlignment(al);
-      assertNotNull(
-              "Test "
-                      + testname
-                      + "\nAlignment annotation file was not regenerated. Null string",
+      assertNotNull("Test " + testname
+              + "\nAlignment annotation file was not regenerated. Null string",
               anfileout);
-      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");
 
       // again what format would be appropriate?
       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));
 
@@ -256,8 +253,7 @@ public class RNAStructExportImport
     {
       e.printStackTrace();
     }
-    Assert.fail("Test "
-            + testname
+    Assert.fail("Test " + testname
             + "\nCouldn't complete Annotation file roundtrip input/output/input test.");
   }
 
@@ -300,20 +296,20 @@ public class RNAStructExportImport
       }
       ;
     } while (af.getViewport().getCalcManager().isWorking());
-    AutoCalcSetting oldacs = af.getViewport().getCalcIdSettingsFor(
-            alifoldClient.getCalcId());
+    AutoCalcSetting oldacs = af.getViewport()
+            .getCalcIdSettingsFor(alifoldClient.getCalcId());
     String oldsettings = oldacs.getWsParamFile();
     // write out parameters
     jalview.gui.AlignFrame nalf = null;
-    assertTrue("Couldn't write out the Jar file",
-            new Jalview2XML(false).saveAlignment(af, JAR_FILE_NAME,
-                    "trial parameter writeout"));
-    assertTrue("Couldn't read back the Jar file", (nalf = new Jalview2XML(
-            false).loadJalviewAlign(JAR_FILE_NAME)) != null);
+    assertTrue("Couldn't write out the Jar file", new Jalview2XML(false)
+            .saveAlignment(af, JAR_FILE_NAME, "trial parameter writeout"));
+    assertTrue("Couldn't read back the Jar file",
+            (nalf = new Jalview2XML(false)
+                    .loadJalviewAlign(JAR_FILE_NAME)) != null);
     if (nalf != null)
     {
-      AutoCalcSetting acs = af.getViewport().getCalcIdSettingsFor(
-              alifoldClient.getCalcId());
+      AutoCalcSetting acs = af.getViewport()
+              .getCalcIdSettingsFor(alifoldClient.getCalcId());
       assertTrue("Calc ID settings not recovered from viewport stash",
               acs.equals(oldacs));
       assertTrue(
@@ -347,8 +343,8 @@ public class RNAStructExportImport
         }
         ;
       }
-      AutoCalcSetting acs2 = af.getViewport().getCalcIdSettingsFor(
-              alifoldClient.getCalcId());
+      AutoCalcSetting acs2 = af.getViewport()
+              .getCalcIdSettingsFor(alifoldClient.getCalcId());
       assertTrue(
               "Calc ID settings after recalculation has not been recovered.",
               acs2.getWsParamFile().equals(oldsettings));