Merge branch 'develop' into spike/JAL-4047/JAL-4048_columns_in_sequenceID
[jalview.git] / test / jalview / io / IdentifyFileTest.java
index 0a3ff94..68c099e 100644 (file)
@@ -25,12 +25,22 @@ import static org.testng.AssertJUnit.assertSame;
 import static org.testng.AssertJUnit.assertTrue;
 
 import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
+import jalview.gui.JvOptionPane;
+
 public class IdentifyFileTest
 {
 
+  @BeforeClass(alwaysRun = true)
+  public void setUpJvOptionPane()
+  {
+    JvOptionPane.setInteractiveMode(false);
+    JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+  }
+
   @Test(groups = { "Functional" }, dataProvider = "identifyFiles")
   public void testIdentify(String data, FileFormatI expectedFileType)
           throws FileFormatException
@@ -79,12 +89,11 @@ public class IdentifyFileTest
   @DataProvider(name = "identifyFiles")
   public Object[][] IdentifyFileDP()
   {
-    return new Object[][] {
-        { "examples/example.json", FileFormat.Json },
+    return new Object[][] { { "examples/example.json", FileFormat.Json },
         { "examples/plantfdx.fa", FileFormat.Fasta },
         { "examples/dna_interleaved.phy", FileFormat.Phylip },
         { "examples/2GIS.pdb", FileFormat.PDB },
-        { "examples/rf00031_folded.stk", FileFormat.Stockholm },
+        { "examples/RF00031_folded.stk", FileFormat.Stockholm },
         { "examples/testdata/test.rnaml", FileFormat.Rnaml },
         { "examples/testdata/test.aln", FileFormat.Clustal },
         { "examples/testdata/test.pfam", FileFormat.Pfam },
@@ -93,16 +102,18 @@ public class IdentifyFileTest
         { "examples/testdata/test.html", FileFormat.Html },
         { "examples/testdata/test.pileup", FileFormat.Pileup },
         { "examples/testdata/test.blc", FileFormat.BLC },
+        { "test/jalview/io/J03321.embl.txt", FileFormat.Embl },
+        { "test/jalview/io/J03321.gb", FileFormat.GenBank },
         { "examples/exampleFeatures.txt", FileFormat.Features },
         { "examples/testdata/simpleGff3.gff", FileFormat.Features },
         { "examples/testdata/test.jvp", FileFormat.Jalview },
         { "examples/testdata/test.cif", FileFormat.MMCif },
-        {
-            "examples/testdata/cullpdb_pc25_res3.0_R0.3_d150729_chains9361.fasta.15316",
+        { "examples/testdata/cullpdb_pc25_res3.0_R0.3_d150729_chains9361.fasta.15316",
             FileFormat.Fasta },
-
-    // { "examples/testdata/test.amsa", "AMSA" },
-    // { "examples/test.jnet", "JnetFile" },
+        { "resources/scoreModel/pam250.scm", FileFormat.ScoreMatrix },
+        { "resources/scoreModel/blosum80.scm", FileFormat.ScoreMatrix }
+        // { "examples/testdata/test.amsa", "AMSA" },
+        // { "examples/test.jnet", "JnetFile" },
     };
   }
 
@@ -115,8 +126,8 @@ public class IdentifyFileTest
     // too few columns:
     assertFalse(id.looksLikeFeatureData("1 \t 2 \t 3 \t 4 \t 5"));
     // GFF format:
-    assertTrue(id
-            .looksLikeFeatureData("Seq1\tlocal\tHelix\t2456\t2462\tss"));
+    assertTrue(
+            id.looksLikeFeatureData("Seq1\tlocal\tHelix\t2456\t2462\tss"));
     // Jalview format:
     assertTrue(id.looksLikeFeatureData("Helix\tSeq1\t-1\t2456\t2462\tss"));
     // non-numeric start column: