Search in sources :

Example 6 with TestSupport

use of com.github.lindenb.jvarkit.tools.tests.TestSupport in project jvarkit by lindenb.

the class Biostar77828Test method test01.

@Test
public void test01() throws IOException {
    final TestSupport support = new TestSupport();
    try {
        Path bed = support.createTmpPath(".bed");
        PrintWriter pw = new PrintWriter(Files.newBufferedWriter(bed));
        for (int i = 0; i < 1000; i++) {
            int L = 1 + support.random.nextInt(1000);
            int p = support.random.nextInt(100000);
            pw.println("chr" + (i % 10) + "\t" + p + "\t" + (p + L));
        }
        pw.flush();
        pw.close();
        support.assertIsBed(bed);
        Path out = support.createTmpPath(".txt");
        Assert.assertEquals(new Biostar77828().instanceMain(new String[] { "-o", out.toString(), "--iter", "1000", bed.toString() }), 0);
        support.assertIsNotEmpty(out);
    } finally {
        support.removeTmpFiles();
    }
}
Also used : Path(java.nio.file.Path) TestSupport(com.github.lindenb.jvarkit.tools.tests.TestSupport) PrintWriter(java.io.PrintWriter) AlsoTest(com.github.lindenb.jvarkit.tests.AlsoTest) Test(org.testng.annotations.Test) LauncherTest(com.github.lindenb.jvarkit.util.jcommander.LauncherTest)

Aggregations

TestSupport (com.github.lindenb.jvarkit.tools.tests.TestSupport)6 Path (java.nio.file.Path)6 Test (org.testng.annotations.Test)6 AlsoTest (com.github.lindenb.jvarkit.tests.AlsoTest)5 VCFUtilsTest (com.github.lindenb.jvarkit.util.vcf.VCFUtilsTest)3 LauncherTest (com.github.lindenb.jvarkit.util.jcommander.LauncherTest)2 VCFUtils (com.github.lindenb.jvarkit.util.vcf.VCFUtils)1 VCFReaderFactory (com.github.lindenb.jvarkit.variant.vcf.VCFReaderFactory)1 GenotypeBuilder (htsjdk.variant.variantcontext.GenotypeBuilder)1 VariantContextBuilder (htsjdk.variant.variantcontext.VariantContextBuilder)1 VariantContextWriter (htsjdk.variant.variantcontext.writer.VariantContextWriter)1 VCFReader (htsjdk.variant.vcf.VCFReader)1 PrintWriter (java.io.PrintWriter)1 Paths (java.nio.file.Paths)1 Collectors (java.util.stream.Collectors)1 Assert (org.testng.Assert)1