Source:
public void testCollectJumpingLibraryMetrics() throws IOException { final File outfile = File.createTempFile("CollectJumpingLibraryMetricsTest", ".txt"); outfile.deleteOnExit(); final String[] args = new String[] { "INPUT=" + SAM_FILE.getAbsolutePath(), "OUTPUT=" + outfile.getAbsolutePath() }; CollectJumpingLibraryMetrics collectJumpingLibraryMetrics = new CollectJumpingLibraryMetrics(); Assert.assertEquals(collectJumpingLibraryMetrics.instanceMain(args), 0, "Can't process " + SAM_FILE.getAbsolutePath() + " correctly"); final MetricsFile<JumpingLibraryMetrics, Comparable<?>> output = new MetricsFile<>(); output.read(new FileReader(outfile)); for (final JumpingLibraryMetrics metrics : output.getMetrics()) { Assert.assertEquals(metrics.JUMP_PAIRS, 4); Assert.assertEquals(metrics.JUMP_DUPLICATE_PAIRS, 1); Assert.assertEquals(metrics.JUMP_DUPLICATE_PCT, 0.25); Assert.assertEquals(metrics.JUMP_LIBRARY_SIZE, 6); Assert.assertEquals((int)metrics.JUMP_MEAN_INSERT_SIZE, 176); Assert.assertEquals((int)metrics.JUMP_STDEV_INSERT_SIZE, 50); Assert.assertEquals(metrics.NONJUMP_PAIRS, 1); Assert.assertEquals(metrics.NONJUMP_DUPLICATE_PAIRS, 0); Assert.assertEquals((int)metrics.NONJUMP_DUPLICATE_PCT, 0); Assert.assertEquals(metrics.NONJUMP_LIBRARY_SIZE, 0); Assert.assertEquals((int)metrics.NONJUMP_MEAN_INSERT_SIZE, 96); Assert.assertEquals((int)metrics.NONJUMP_STDEV_INSERT_SIZE, 0); Assert.assertEquals(metrics.CHIMERIC_PAIRS, 0); Assert.assertEquals(metrics.FRAGMENTS, 1); Assert.assertEquals(metrics.PCT_JUMPS, 0.8); Assert.assertEquals(metrics.PCT_NONJUMPS, 0.2); Assert.assertEquals((int)metrics.PCT_CHIMERAS, 0); } }

Target:
public void testCollectJumpingLibraryMetrics() throws IOException { final File outfile = File.createTempFile("CollectJumpingLibraryMetricsTest", ".txt"); outfile.deleteOnExit(); final String[] args = new String[] { "INPUT=" + SAM_FILE.getAbsolutePath(), "OUTPUT=" + outfile.getAbsolutePath() }; CollectJumpingLibraryMetrics collectJumpingLibraryMetrics = new CollectJumpingLibraryMetrics(); Assert.assertEquals(collectJumpingLibraryMetrics.instanceMain(args), 0, "Can't process " + SAM_FILE.getAbsolutePath() + " correctly"); final MetricsFile<JumpingLibraryMetrics, Comparable<?>> output = new MetricsFile<>(); output.read(new FileReader(outfile)); for (final JumpingLibraryMetrics metrics : output.getMetrics()) { Assert.assertEquals(metrics.JUMP_PAIRS, 4); Assert.assertEquals(metrics.JUMP_DUPLICATE_PAIRS, 1); Assert.assertEquals(metrics.JUMP_DUPLICATE_PCT, 0.25); Assert.assertEquals(metrics.JUMP_LIBRARY_SIZE, 6); Assert.assertEquals(metrics.JUMP_MEAN_INSERT_SIZE, 176.0); Assert.assertEquals(metrics.JUMP_STDEV_INSERT_SIZE, 50.0); Assert.assertEquals(metrics.NONJUMP_PAIRS, 1); Assert.assertEquals(metrics.NONJUMP_DUPLICATE_PAIRS, 0); Assert.assertEquals(metrics.NONJUMP_DUPLICATE_PCT, 0.0); Assert.assertEquals(metrics.NONJUMP_LIBRARY_SIZE, 0); Assert.assertEquals(metrics.NONJUMP_MEAN_INSERT_SIZE, 96.0); Assert.assertEquals(metrics.NONJUMP_STDEV_INSERT_SIZE, Double.NaN); Assert.assertEquals(metrics.CHIMERIC_PAIRS, 0); Assert.assertEquals(metrics.FRAGMENTS, 1); Assert.assertEquals(metrics.PCT_JUMPS, 0.8); Assert.assertEquals(metrics.PCT_NONJUMPS, 0.2); Assert.assertEquals(metrics.PCT_CHIMERAS, 0.0); } }