JAL-1816 fixed bug in identify file preventing it from identifying a Fasta file conta...
[jalview.git] / test / jalview / io / IdentifyFileTest.java
1 package jalview.io;
2
3 import org.testng.Assert;
4 import org.testng.annotations.DataProvider;
5 import org.testng.annotations.Test;
6
7 public class IdentifyFileTest {
8
9   @Test(groups =
10   { "Functional" }, dataProvider = "identifyFiles")
11   public void Identify(String data, String expectedFileType)
12   {
13     String protocol = AppletFormatAdapter.FILE;
14     IdentifyFile ider = new IdentifyFile();
15     String actualFiletype = ider.Identify(data, protocol);
16     Assert.assertEquals(actualFiletype, expectedFileType,
17             "File identification Failed!");
18   }
19
20   @DataProvider(name = "identifyFiles")
21   public Object[][] IdentifyFileDP()
22   {
23     return new Object[][]
24     {
25         { "examples/example.json", "JSON" },
26         { "examples/plantfdx.fa", "FASTA" },
27         { "examples/dna_interleaved.phy", "PHYLIP" },
28         { "examples/2GIS.pdb", "PDB" },
29         { "examples/rf00031_folded.stk", "STH" },
30         { "examples/testdata/test.rnaml", "RNAML" },
31         { "examples/testdata/test.aln", "CLUSTAL" },
32         { "examples/testdata/test.pfam", "PFAM" },
33         { "examples/testdata/test.msf", "MSF" },
34         { "examples/testdata/test.pir", "PIR" },
35         { "examples/testdata/test.html", "HTML" },
36         { "examples/testdata/test.pileup", "PileUp" },
37         { "examples/testdata/test.blc", "BLC" },
38         { "examples/testdata/simplegff3.gff", "GFF v2 or v3" },
39         { "examples/testdata/test.jvp", "Jalview" },
40         {
41             "examples/testdata/cullpdb_pc25_res3.0_R0.3_d150729_chains9361.fasta.15316",
42             "FASTA" },
43
44     // { "examples/testdata/test.amsa", "AMSA" },
45     // { "examples/test.jnet", "JnetFile" },
46     };
47   }
48
49 }