Search in sources :

Example 21 with IntegrationTestSpec

use of org.broadinstitute.hellbender.utils.test.IntegrationTestSpec in project gatk by broadinstitute.

the class SelectVariantsIntegrationTest method testNotFileVcfException.

/**
     * Test with a VCF file that is not a file
     */
@Test
public void testNotFileVcfException() throws IOException {
    final String testFile = getToolTestDataDir();
    final IntegrationTestSpec spec = new IntegrationTestSpec(baseTestString("", testFile), 1, UserException.CouldNotReadInputFile.class);
    spec.executeTest("testNotFileVcfException--" + testFile, this);
}
Also used : IntegrationTestSpec(org.broadinstitute.hellbender.utils.test.IntegrationTestSpec) UserException(org.broadinstitute.hellbender.exceptions.UserException) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 22 with IntegrationTestSpec

use of org.broadinstitute.hellbender.utils.test.IntegrationTestSpec in project gatk by broadinstitute.

the class SelectVariantsIntegrationTest method testSampleSelection.

@Test
public void testSampleSelection() throws IOException {
    final String testFile = getToolTestDataDir() + "vcfexample2.vcf";
    final IntegrationTestSpec spec = new IntegrationTestSpec(" -R " + hg19MiniReference + " --variant " + testFile + " -sn NA11918 " + // suppress reference file path in output for test differencing
    " -sr " + " -O %s " + " --addOutputVCFCommandLine false", Collections.singletonList(getToolTestDataDir() + "expected/" + "testSelectVariants_SimpleSelection.vcf"));
    spec.executeTest("testSampleSelection--" + testFile, this);
}
Also used : IntegrationTestSpec(org.broadinstitute.hellbender.utils.test.IntegrationTestSpec) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 23 with IntegrationTestSpec

use of org.broadinstitute.hellbender.utils.test.IntegrationTestSpec in project gatk by broadinstitute.

the class SelectVariantsIntegrationTest method testNonExistentSampleFile.

@Test
public void testNonExistentSampleFile() throws IOException {
    final String testFile = getToolTestDataDir() + "vcfexample2.vcf";
    final File nonExistentFile = BaseTest.getSafeNonExistentFile("nonexistentSamples.list");
    final IntegrationTestSpec spec = new IntegrationTestSpec(baseTestString(" -sn A -sn Z -sn Q -sn " + nonExistentFile, testFile), 1, CommandLineException.class);
    spec.executeTest("testNonExistentSampleFile--" + testFile, this);
}
Also used : IntegrationTestSpec(org.broadinstitute.hellbender.utils.test.IntegrationTestSpec) File(java.io.File) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 24 with IntegrationTestSpec

use of org.broadinstitute.hellbender.utils.test.IntegrationTestSpec in project gatk by broadinstitute.

the class SelectVariantsIntegrationTest method testMaxNoCall0_5.

@Test
public void testMaxNoCall0_5() throws IOException {
    final String testFile = getToolTestDataDir() + "vcfexample.forNoCallFiltering.vcf";
    final IntegrationTestSpec spec = new IntegrationTestSpec(baseTestString(" --maxNOCALLfraction 0.5", testFile), Collections.singletonList(getToolTestDataDir() + "expected/" + "testSelectVariants_maxNOCALLnumber2.vcf"));
    spec.executeTest("testMaxNoCall0_5--" + testFile, this);
}
Also used : IntegrationTestSpec(org.broadinstitute.hellbender.utils.test.IntegrationTestSpec) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 25 with IntegrationTestSpec

use of org.broadinstitute.hellbender.utils.test.IntegrationTestSpec in project gatk by broadinstitute.

the class SelectVariantsIntegrationTest method testFileWithoutInfoLineInHeader.

private void testFileWithoutInfoLineInHeader(final String name, final Class<? extends Exception> expectedException) throws IOException {
    final String testFile = getToolTestDataDir() + "missingHeaderLine.vcf";
    final String outFile = getToolTestDataDir() + "expected/" + name + ".vcf";
    final String cmd = baseTestString(" -sn NA12892 " + (expectedException == null ? " --lenient" : ""), testFile);
    IntegrationTestSpec spec = expectedException != null ? new IntegrationTestSpec(cmd, 1, expectedException) : new IntegrationTestSpec(cmd, Collections.singletonList(outFile));
    spec.executeTest(name, this);
}
Also used : IntegrationTestSpec(org.broadinstitute.hellbender.utils.test.IntegrationTestSpec)

Aggregations

IntegrationTestSpec (org.broadinstitute.hellbender.utils.test.IntegrationTestSpec)201 CommandLineProgramTest (org.broadinstitute.hellbender.CommandLineProgramTest)200 Test (org.testng.annotations.Test)200 BaseTest (org.broadinstitute.hellbender.utils.test.BaseTest)80 UserException (org.broadinstitute.hellbender.exceptions.UserException)25 ArgumentsBuilder (org.broadinstitute.hellbender.utils.test.ArgumentsBuilder)14 File (java.io.File)10 Configuration (org.apache.hadoop.conf.Configuration)2 org.apache.hadoop.fs (org.apache.hadoop.fs)2 MiniDFSCluster (org.apache.hadoop.hdfs.MiniDFSCluster)2 SimpleInterval (org.broadinstitute.hellbender.utils.SimpleInterval)2 Path (org.apache.hadoop.fs.Path)1