- HtsContigDb remmadb = new HtsContigDb("REEMADB", new File(
- "test/jalview/ext/htsjdk/pgmb.fasta"));
+ File fasta = new File("test/jalview/ext/htsjdk/pgmB.fasta");
+
+ /*
+ * create .fai with no overwrite fails if it exists
+ */
+ try
+ {
+ HtsContigDb.createFastaSequenceIndex(fasta.toPath(), false);
+ fail("Expected exception");
+ } catch (IOException e)
+ {
+ // we expect an IO Exception because the pgmB.fasta.fai exists, since it
+ // was checked it in.
+ }
+
+ /*
+ * create a copy of the .fasta (as a temp file)
+ */
+ File copyFasta = File.createTempFile("copyFasta", ".fasta");
+ copyFasta.deleteOnExit();
+ assertTrue(copyFasta.exists());
+ Files.copy(fasta.toPath(), copyFasta.toPath(),
+ StandardCopyOption.REPLACE_EXISTING);