Skip to content

Commit

Permalink
Fix unit test issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Dec 5, 2023
1 parent b7b2460 commit ea9d595
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/test/java/org/broad/igv/sam/reader/BAMHttpReaderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

public class BAMHttpReaderTest extends AbstractHeadlessTest {

private static final String BAM_URL_STRING = "http://1000genomes.s3.amazonaws.com/phase3/data/HG01879/exome_alignment/HG01879.mapped.ILLUMINA.bwa.ACB.exome.20120522.bam";
private static final String BAM_URL_STRING = "https://1000genomes.s3.amazonaws.com/phase3/data/HG01879/exome_alignment/HG01879.mapped.ILLUMINA.bwa.ACB.exome.20120522.bam";

BAMReader reader;

Expand All @@ -70,7 +70,7 @@ public void setUp() throws Exception {

@After
public void tearDown() throws Exception {
reader.close();
if (reader != null) reader.close();
reader = null;
}

Expand All @@ -84,7 +84,7 @@ public void testGetHeader() throws IOException {
@Test
public void testIterator() throws IOException {
CloseableIterator<SAMAlignment> iter = reader.iterator();
//This takes a long time. We just look for a minimum number
//This will iterate over the entire file, so we break and exit after a few iterations
int minnum = 10;
int actnum = 0;
while (iter.hasNext()) {
Expand All @@ -103,10 +103,11 @@ public void testIterator() throws IOException {

@Test
public void testQuery() throws Exception {
checkNumber("Y", 10000000 - 1, 10004000, 4);
}

private void checkNumber(String chr, int start, int end, int expected_count) throws IOException {
int expected_count = 4;
String chr = "Y";
int start = 10000000 - 1;
int end = 10004000;

CloseableIterator<SAMAlignment> iter = reader.query(chr, start, end, false);
int counted = 0;
while (iter.hasNext()) {
Expand All @@ -120,6 +121,4 @@ private void checkNumber(String chr, int start, int end, int expected_count) thr
}




}

0 comments on commit ea9d595

Please sign in to comment.