Merge branch 'alpha/JAL-3362_Jalview_212_alpha' into alpha/merge_212_JalviewJS_2112
[jalview.git] / test / jalview / io / FormatAdapterTest.java
index 7aa5769..3812a09 100644 (file)
@@ -56,8 +56,17 @@ public class FormatAdapterTest
   {
     try
     {
-      AlignmentI al = new FormatAdapter().readFile("examples/uniref50.fa",
+      AlignmentI al;
+      if (format == FileFormat.HMMER3)
+      {
+        al = new FormatAdapter().readFile("examples/uniref50.hmm",
+                DataSourceType.FILE, FileFormat.HMMER3);
+      }
+      else
+      {
+        al = new FormatAdapter().readFile("examples/uniref50.fa",
               DataSourceType.FILE, FileFormat.Fasta);
+      }
 
       /*
        * 'gap' is the gap character used in the alignment data file here,
@@ -73,8 +82,9 @@ public class FormatAdapterTest
       AlignmentI reloaded = new FormatAdapter().readFile(formatted,
               DataSourceType.PASTE, format);
       List<SequenceI> reread = reloaded.getSequences();
-      assertEquals("Wrong number of reloaded sequences", seqs.length,
-              reread.size());
+        assertEquals("Wrong number of reloaded sequences", seqs.length,
+                reread.size());
+
 
       int i = 0;
       for (SequenceI seq : reread)
@@ -131,8 +141,8 @@ public class FormatAdapterTest
   @DataProvider(name = "formats")
   static Object[][] getFormats()
   {
-    List<FileFormatI> both = new ArrayList<FileFormatI>();
-    for (FileFormat format : FileFormat.values())
+    List<FileFormatI> both = new ArrayList<>();
+    for (FileFormatI format : FileFormats.getInstance().getFormats())
     {
       if (format.isReadable() && format.isWritable()
               && format.isTextFormat())