JAL-3438 spotless for 2.11.2.0
[jalview.git] / test / jalview / io / JalviewExportPropertiesTests.java
index 9d2c8ad..1d138c0 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -24,6 +24,7 @@ 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;
@@ -39,14 +40,22 @@ import org.testng.annotations.Test;
 public class JalviewExportPropertiesTests
 {
 
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
   /**
    * @throws java.lang.Exception
    */
   @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" });
   }
 
   /**
@@ -66,7 +75,7 @@ public class JalviewExportPropertiesTests
     assertTrue("Couldn't set gap character to '.'",
             ".".equals("" + jalview.bin.Cache.getProperty("GAP_SYMBOL")));
     AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
-            "examples/uniref50.fa", FormatAdapter.FILE);
+            "examples/uniref50.fa", DataSourceType.FILE);
     assertTrue("Didn't read in the example file correctly.", af != null);
     assertTrue("Didn't set the gap character correctly", af.getViewport()
             .getAlignment().getSequenceAt(0).getCharAt(5) == '.');
@@ -77,8 +86,8 @@ public class JalviewExportPropertiesTests
     sg.setStartRes(1);
     sg.setEndRes(7);
     af.getViewport().setSelectionGroup(sg);
-    String fseqs = new FormatAdapter(af.alignPanel).formatSequences(
-            "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);
   }