JAL-2326 added setup method for JvOptionPane in all Jalveiw test classes to enable...
[jalview.git] / test / jalview / analysis / CrossRefTest.java
index 759f527..95be1ff 100644 (file)
@@ -37,6 +37,7 @@ import jalview.datamodel.Mapping;
 import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
+import jalview.gui.JvOptionPane;
 import jalview.util.DBRefUtils;
 import jalview.util.MapList;
 import jalview.ws.SequenceFetcher;
@@ -46,10 +47,19 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
 public class CrossRefTest
 {
+
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
   @Test(groups = { "Functional" })
   public void testFindXDbRefs()
   {
@@ -251,8 +261,7 @@ public class CrossRefTest
      */
     SequenceI dna1 = new Sequence("AF039662", "GGGGCAGCACAAGAAC");
     Mapping map = new Mapping(new Sequence("pep2", "MLAVSRG"), new MapList(
-            new int[] { 1, 21 }, new int[] {
-        1, 7 }, 3, 1));
+            new int[] { 1, 21 }, new int[] { 1, 7 }, 3, 1));
     DBRefEntry dbref = new DBRefEntry("UNIPROT", "0", "Q9ZTS2", map);
     dna1.addDBRef(dbref);
     dna1.addDBRef(new DBRefEntry("EMBL", "0", "AF039662"));
@@ -282,7 +291,7 @@ public class CrossRefTest
     dbref = new DBRefEntry("UNIPROT", "0", "Q9ZTS2");
     found = testee.searchDataset(!dna1.isProtein(), dna1, dbref, result,
             acf, false); // search dataset with a protein xref from a dna
-                          // sequence to locate the protein product
+                         // sequence to locate the protein product
     assertTrue(found);
     assertEquals(1, result.size());
     assertSame(pep1, result.get(0));
@@ -296,7 +305,7 @@ public class CrossRefTest
     dbref = new DBRefEntry("UNIPROT", "0", "Q9ZTS2");
     found = testee.searchDataset(!pep1.isProtein(), pep1, dbref, result,
             acf, false); // search dataset with a protein's direct dbref to
-                          // locate dna sequences with matching xref
+                         // locate dna sequences with matching xref
     assertTrue(found);
     assertEquals(1, result.size());
     assertSame(dna1, result.get(0));