@Test public void BIM_getEntries() throws Exception { assertEquals(1, bimfd.getEntries(0, 1).size()); assertEquals(1, bimfd.getEntries(1, 2).size()); assertEquals(2, bimfd.getEntries(0, 2).size()); assertEquals(2, bimfd.getAllEntries().size()); assertEquals("snp1", bimfd.getEntries(0, 1).get(0).getSNP()); assertEquals('A', bimfd.getEntries(0, 1).get(0).getBiallele().getAllele1()); assertEquals(0.0, bimfd.getEntries(1, 2).get(0).getcM()); assertEquals("1", bimfd.getEntries(1, 2).get(0).getChromosome()); assertEquals('C', bimfd.getAllEntries().get(0).getBiallele().getAllele2()); assertEquals('T', bimfd.getAllEntries().get(1).getBiallele().getAllele2()); assertEquals(1, bimfd.getAllEntries().get(0).getBpPos()); assertEquals(2, bimfd.getAllEntries().get(1).getBpPos()); assertEquals("snp2", bimfd.getAllEntries().get(1).getSNP()); }
@Test public void BIM_writer() throws Exception { File newBim = new File(testBim.getAbsolutePath().replace(testBim.getName(), "new.bim")); BimFileWriter w = new BimFileWriter(newBim); try { w.writeAll(bimfd.getAllEntries()); boolean filesAreEqual = DirectoryCompare.compareFileContent(testBim, newBim); assertTrue(filesAreEqual); } finally { w.close(); } }