Merge branch 'develop' into trialMerge
[jalview.git] / test / jalview / io / gff / GffTests.java
index 77da8fa..393f2ce 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.io.gff;
 
 import static org.testng.AssertJUnit.assertEquals;
@@ -13,11 +33,13 @@ import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceDummy;
 import jalview.datamodel.SequenceI;
 import jalview.gui.AlignFrame;
+import jalview.gui.JvOptionPane;
+import jalview.io.DataSourceType;
 import jalview.io.FileLoader;
-import jalview.io.FormatAdapter;
 
 import java.util.List;
 
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
 /**
@@ -27,6 +49,14 @@ import org.testng.annotations.Test;
  */
 public class GffTests
 {
+
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
   /**
    * Test the case where we load a protein ('query') sequence, then exonerateGff
    * describing its mapping to cDNA, and then a DNA sequence including the
@@ -37,7 +67,7 @@ public class GffTests
   {
     String proteinSeq = ">prot1/10-16\nYCWRSGA";
     AlignFrame af = new FileLoader(false).LoadFileWaitTillLoaded(
-            proteinSeq, FormatAdapter.PASTE);
+            proteinSeq, DataSourceType.PASTE);
 
     /*
      * exonerate GFF output mapping residues 11-15 (CWRSG) 
@@ -45,7 +75,7 @@ public class GffTests
      */
     String exonerateGff = "##gff-version 2\n"
             + "prot1\tprotein2genome\tsimilarity\t11\t15\t99\t-\t.\talignment_id 0 ; Target dna1 ; Align 11 24 5";
-    af.loadJalviewDataFile(exonerateGff, FormatAdapter.PASTE, null, null);
+    af.loadJalviewDataFile(exonerateGff, DataSourceType.PASTE, null, null);
 
     /*
      * check we have a mapping from prot1 to SequenceDummy 'dna1'
@@ -69,8 +99,6 @@ public class GffTests
     mappedRegion = mapList[0].getMap().locateInFrom(15, 15);
     assertArrayEquals(new int[] { 12, 10 }, mappedRegion);
 
-    // so far so good; TODO: programmatically add mapped sequences
-    // and verify the mappings are 'realised'
     SequenceI dna1 = new Sequence("dna1", "AAACCCGGGTTTAAACCCGGGTTT");
     AlignmentI al = new Alignment(new SequenceI[] { dna1 });
     al.setDataset(null);