+ @Test(groups = "Functional")
+ public final void testGetSequenceProxy() throws Exception
+ {
+ String pathname = "test/jalview/ext/htsjdk/pgmB.fasta";
+ HtsContigDb db = new HtsContigDb("ADB", new File(pathname));
+
+ assertTrue(db.isValid());
+ assertTrue(db.isIndexed()); // htsjdk opens the .fai file
+
+ SequenceI sq = db.getSequenceProxy("Deminut");
+ assertNotNull(sq);
+ assertEquals(sq.getLength(), 606);
+
+ /*
+ * read a sequence earlier in the file
+ */
+ sq = db.getSequenceProxy("PPL_06716");
+ assertNotNull(sq);
+ assertEquals(sq.getLength(), 602);
+
+ // dict = db.getDictionary(f, truncate))
+ }
+
+ /**
+ * Trying to open a .fai file directly results in IllegalArgumentException -
+ * have to provide the unindexed file name instead
+ */
+ @Test(
+ groups = "Functional",
+ expectedExceptions = java.lang.IllegalArgumentException.class)
+ public final void testGetSequenceProxy_indexed()