-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
334e6f8
commit f215a90
Showing
5 changed files
with
109 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,8 @@ | |
package org.monarchinitiative.exomiser.data.genome.model.archive; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.CsvSource; | ||
|
||
import java.nio.file.Path; | ||
|
||
|
@@ -30,29 +32,18 @@ | |
/** | ||
* @author Jules Jacobsen <[email protected]> | ||
*/ | ||
public class ArchiveFileReaderTest { | ||
|
||
@Test | ||
void readEmptyLines() { | ||
ArchiveFileReader instance = new SimpleArchiveFileReader(new TabixArchive(Path.of("src/test/resources/test_empty.vcf.gz"))); | ||
long lineCount = instance.lines().count(); | ||
assertThat(lineCount, equalTo(0L)); | ||
} | ||
|
||
@Test | ||
void readLines() { | ||
ArchiveFileReader instance = new SimpleArchiveFileReader(new TabixArchive(Path.of("src/test/resources/test_first_ten_dbsnp.vcf.gz"))); | ||
long lineCount = instance.lines().count(); | ||
// 57 header + 10 allele = 67 lines total in the file | ||
assertThat(lineCount, equalTo(67L)); | ||
} | ||
|
||
@Test | ||
void readLinesFromBgzip() { | ||
ArchiveFileReader instance = new SimpleArchiveFileReader(new TabixArchive(Path.of("src/test/resources/gnomad-test/chr1.vcf.bgz"))); | ||
class ArchiveFileReaderTest { | ||
|
||
@ParameterizedTest | ||
@CsvSource({ | ||
"src/test/resources/test_empty.vcf.gz, 0", // empty | ||
"src/test/resources/test_first_ten_dbsnp.vcf.gz, 79", // gzipped vcf | ||
"src/test/resources/gnomad-test/chr1.vcf.bgz, 62" // bgzipped vcf | ||
}) | ||
void readTabixArchive(Path archiveFile, long expectedLineCount) { | ||
ArchiveFileReader instance = new SimpleArchiveFileReader(new TabixArchive(archiveFile)); | ||
long lineCount = instance.lines().count(); | ||
// 57 header + 5 allele = 62 lines total in the file | ||
assertThat(lineCount, equalTo(62L)); | ||
assertThat(lineCount, equalTo(expectedLineCount)); | ||
} | ||
|
||
@Test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+455 Bytes
(120%)
exomiser-data-genome/src/test/resources/test_first_ten_dbsnp.vcf.gz
Binary file not shown.