Merge branch 'develop' into spike/JAL-4047/JAL-4048_columns_in_sequenceID
[jalview.git] / test / jalview / io / JalviewExportPropertiesTests.java
index 06d177d..59c5986 100644 (file)
@@ -22,14 +22,15 @@ package jalview.io;
 
 import static org.testng.AssertJUnit.assertTrue;
 
-import jalview.datamodel.SequenceGroup;
-import jalview.gui.AlignFrame;
-import jalview.gui.JvOptionPane;
-
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
+import jalview.datamodel.SequenceGroup;
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.gui.JvOptionPane;
+
 /**
  * tests which verify that properties and preferences are correctly interpreted
  * when exporting/importing data
@@ -53,8 +54,9 @@ public class JalviewExportPropertiesTests
   @BeforeClass(alwaysRun = true)
   public static void setUpBeforeClass() throws Exception
   {
-    jalview.bin.Jalview.main(new String[] { "-props",
-        "test/jalview/io/testProps.jvprops" });
+    jalview.bin.Jalview
+            .main(new String[]
+            { "-props", "test/jalview/io/testProps.jvprops" });
   }
 
   /**
@@ -63,7 +65,8 @@ public class JalviewExportPropertiesTests
   @AfterClass(alwaysRun = true)
   public static void tearDownAfterClass() throws Exception
   {
-    jalview.gui.Desktop.instance.closeAll_actionPerformed(null);
+    if (Desktop.instance != null)
+      Desktop.instance.closeAll_actionPerformed(null);
 
   }
 
@@ -85,8 +88,8 @@ public class JalviewExportPropertiesTests
     sg.setStartRes(1);
     sg.setEndRes(7);
     af.getViewport().setSelectionGroup(sg);
-    String fseqs = new FormatAdapter(af.alignPanel).formatSequences(
-            FileFormat.Fasta, af.alignPanel, true);
+    String fseqs = new FormatAdapter(af.alignPanel)
+            .formatSequences(FileFormat.Fasta, af.alignPanel, true);
     assertTrue("Couldn't find '.' in the exported region\n" + fseqs,
             fseqs.indexOf(".") > -1);
   }