JAL-3438 spotless for 2.11.2.0
[jalview.git] / test / jalview / analysis / AlignmentAnnotationUtilsTest.java
index 7ba09e9..cdb950e 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.analysis;
 
 import static org.testng.AssertJUnit.assertEquals;
@@ -8,7 +28,9 @@ import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.Annotation;
 import jalview.datamodel.SequenceI;
-import jalview.io.AppletFormatAdapter;
+import jalview.gui.JvOptionPane;
+import jalview.io.DataSourceType;
+import jalview.io.FileFormat;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -18,11 +40,20 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
 public class AlignmentAnnotationUtilsTest
 {
+
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
   // 4 sequences x 13 positions
   final static String EOL = "\n";
 
@@ -122,7 +153,7 @@ public class AlignmentAnnotationUtilsTest
   public void setUp() throws IOException
   {
     alignment = new jalview.io.FormatAdapter().readFile(TEST_DATA,
-            AppletFormatAdapter.PASTE, "FASTA");
+            DataSourceType.PASTE, FileFormat.Fasta);
 
     AlignmentAnnotation[] anns = new AlignmentAnnotation[SEQ_ANN_COUNT];
     for (int i = 0; i < anns.length; i++)
@@ -378,9 +409,8 @@ public class AlignmentAnnotationUtilsTest
     anns[4].graphGroup = -1;
     anns[4].visible = true;
 
-    BitSet result = AlignmentAnnotationUtils
-            .getVisibleLineGraphGroups(AlignmentAnnotationUtils
-                    .asList(anns));
+    BitSet result = AlignmentAnnotationUtils.getVisibleLineGraphGroups(
+            AlignmentAnnotationUtils.asList(anns));
     assertTrue(result.get(5));
     assertFalse(result.get(0));
     assertFalse(result.get(1));