JAL-2850 JAL-1766 option to load contig sequence referenced by VCF
[jalview.git] / test / jalview / ext / htsjdk / TestHtsContigDb.java
index 29303d0..28c5cf0 100644 (file)
@@ -78,6 +78,17 @@ public class TestHtsContigDb
     fail("Expected exception opening .fai file");
   }
 
+  /**
+   * Tests that exercise
+   * <ul>
+   * <li>opening an unindexed fasta file</li>
+   * <li>creating a .fai index</li>
+   * <li>opening the fasta file, now using the index</li>
+   * <li>error on creating index if overwrite not allowed</li>
+   * </ul>
+   * 
+   * @throws IOException
+   */
   @Test(groups = "Functional")
   public void testCreateFastaSequenceIndex() throws IOException
   {
@@ -120,4 +131,18 @@ public class TestHtsContigDb
     assertTrue(db.isIndexed());
     db.close();
   }
+
+  /**
+   * A convenience 'test' that may be run to create a .fai file for any given
+   * fasta file
+   * 
+   * @throws IOException
+   */
+  @Test(enabled = false)
+  public void testCreateIndex() throws IOException
+  {
+
+    File fasta = new File("test/jalview/io/vcf/contigs.fasta");
+    HtsContigDb.createFastaSequenceIndex(fasta.toPath(), true);
+  }
 }