[med-svn] [htsjdk] 07/08: skip more network tests

Olivier Sallou osallou at debian.org
Tue Jan 5 15:44:11 UTC 2016


This is an automated email from the git hooks/post-receive script.

osallou pushed a commit to branch master
in repository htsjdk.

commit 3784ded7ae3e89bc4549477d5c33058cbee808a4
Author: Olivier Sallou <olivier.sallou at debian.org>
Date:   Tue Jan 5 14:46:01 2016 +0100

    skip more network tests
---
 debian/patches/13-skip_network_tests | 102 +++++++++++++++++++++++++++++++++++
 1 file changed, 102 insertions(+)

diff --git a/debian/patches/13-skip_network_tests b/debian/patches/13-skip_network_tests
index 09dfa60..6dacf9f 100644
--- a/debian/patches/13-skip_network_tests
+++ b/debian/patches/13-skip_network_tests
@@ -572,3 +572,105 @@ Last-Updated: 2015-01-06
 -        Assert.assertEquals(numberUnalignments, countUnalignments);
 -    }
  }
+--- a/src/tests/java/htsjdk/samtools/sra/SRAIndexTest.java
++++ b/src/tests/java/htsjdk/samtools/sra/SRAIndexTest.java
+@@ -52,99 +52,4 @@
+     private static final int LAST_BIN_LEVEL = GenomicIndexUtil.LEVEL_STARTS.length - 1;
+     private static final int SRA_BIN_OFFSET = GenomicIndexUtil.LEVEL_STARTS[LAST_BIN_LEVEL];
+ 
+-    @Test
+-    public void testLevelSize() {
+-        if (!SRAAccession.isSupported()) return;
+-
+-        SRAIndex index = getIndex(DEFAULT_ACCESSION);
+-        Assert.assertEquals(index.getLevelSize(0), GenomicIndexUtil.LEVEL_STARTS[1] - GenomicIndexUtil.LEVEL_STARTS[0]);
+-
+-        Assert.assertEquals(index.getLevelSize(LAST_BIN_LEVEL), GenomicIndexUtil.MAX_BINS - GenomicIndexUtil.LEVEL_STARTS[LAST_BIN_LEVEL] - 1);
+-    }
+-
+-    @Test
+-    public void testLevelForBin() {
+-        if (!SRAAccession.isSupported()) return;
+-
+-        SRAIndex index = getIndex(DEFAULT_ACCESSION);
+-        Bin bin = new Bin(0, SRA_BIN_OFFSET);
+-        Assert.assertEquals(index.getLevelForBin(bin), LAST_BIN_LEVEL);
+-    }
+-
+-    @DataProvider(name = "testBinLocuses")
+-    public Object[][] createDataForBinLocuses() {
+-        return new Object[][] {
+-                {DEFAULT_ACCESSION, 0, 0, 1, SRAIndex.SRA_BIN_SIZE},
+-                {DEFAULT_ACCESSION, 0, 1, SRAIndex.SRA_BIN_SIZE + 1, SRAIndex.SRA_BIN_SIZE * 2}
+-        };
+-    }
+-
+-    @Test(dataProvider = "testBinLocuses")
+-    public void testBinLocuses(SRAAccession acc, int reference, int binIndex, int firstLocus, int lastLocus) {
+-        if (!SRAAccession.isSupported()) return;
+-
+-        SRAIndex index = getIndex(acc);
+-        Bin bin = new Bin(reference, SRA_BIN_OFFSET + binIndex);
+-
+-        Assert.assertEquals(index.getFirstLocusInBin(bin), firstLocus);
+-        Assert.assertEquals(index.getLastLocusInBin(bin), lastLocus);
+-    }
+-
+-    @DataProvider(name = "testBinOverlappings")
+-    public Object[][] createDataForBinOverlappings() {
+-        return new Object[][] {
+-                {DEFAULT_ACCESSION, 0, 1, SRAIndex.SRA_BIN_SIZE, new HashSet<Integer>(Arrays.asList(0))},
+-                {DEFAULT_ACCESSION, 0, SRAIndex.SRA_BIN_SIZE + 1, SRAIndex.SRA_BIN_SIZE * 2, new HashSet<Integer>(Arrays.asList(1))},
+-                {DEFAULT_ACCESSION, 0, SRAIndex.SRA_BIN_SIZE + 1, SRAIndex.SRA_BIN_SIZE * 3, new HashSet<Integer>(Arrays.asList(1, 2))},
+-                {DEFAULT_ACCESSION, 0, SRAIndex.SRA_BIN_SIZE * 2, SRAIndex.SRA_BIN_SIZE * 2 + 1, new HashSet<Integer>(Arrays.asList(1, 2))}
+-        };
+-    }
+-
+-
+-    @Test(dataProvider = "testBinOverlappings")
+-    public void testBinOverlappings(SRAAccession acc, int reference, int firstLocus, int lastLocus, Set<Integer> binNumbers) {
+-        if (!SRAAccession.isSupported()) return;
+-
+-        SRAIndex index = getIndex(acc);
+-        Iterator<Bin> binIterator = index.getBinsOverlapping(reference, firstLocus, lastLocus).iterator();
+-        Set<Integer> binNumbersFromIndex = new HashSet<Integer>();
+-        while (binIterator.hasNext()) {
+-            Bin bin = binIterator.next();
+-            binNumbersFromIndex.add(bin.getBinNumber() - SRA_BIN_OFFSET);
+-        }
+-
+-        Assert.assertEquals(binNumbers, binNumbersFromIndex);
+-    }
+-
+-    @DataProvider(name = "testSpanOverlappings")
+-    public Object[][] createDataForSpanOverlappings() {
+-        return new Object[][] {
+-                {DEFAULT_ACCESSION, 0, 1, SRAIndex.SRA_BIN_SIZE, new long[] {0, SRAIndex.SRA_CHUNK_SIZE} },
+-                {DEFAULT_ACCESSION, 0, SRAIndex.SRA_BIN_SIZE * 2, SRAIndex.SRA_BIN_SIZE * 2 + 1, new long[]{0, SRAIndex.SRA_CHUNK_SIZE} },
+-                {DEFAULT_ACCESSION, 0, SRAIndex.SRA_CHUNK_SIZE, SRAIndex.SRA_CHUNK_SIZE + 1, new long[]{0, SRAIndex.SRA_CHUNK_SIZE, SRAIndex.SRA_CHUNK_SIZE, SRAIndex.SRA_CHUNK_SIZE * 2} },
+-        };
+-    }
+-
+-    @Test(dataProvider = "testSpanOverlappings")
+-    public void testSpanOverlappings(SRAAccession acc, int reference, int firstLocus, int lastLocus, long[] spanCoordinates) {
+-        if (!SRAAccession.isSupported()) return;
+-
+-        SRAIndex index = getIndex(acc);
+-        BAMFileSpan span = index.getSpanOverlapping(reference, firstLocus, lastLocus);
+-
+-        long[] coordinatesFromIndex = span.toCoordinateArray();
+-        List<Long> coordinatesListFromIndex = new ArrayList<Long>();
+-        for (long coordinate : coordinatesFromIndex) {
+-            coordinatesListFromIndex.add(coordinate);
+-        }
+-
+-        Assert.assertTrue(Arrays.equals(coordinatesFromIndex, spanCoordinates),
+-                "Coordinates mismatch. Expected: " + Arrays.toString(spanCoordinates) +
+-                " but was : " + Arrays.toString(coordinatesFromIndex));
+-    }
+-
+-    private SRAIndex getIndex(SRAAccession acc) {
+-        SRAFileReader reader = new SRAFileReader(acc);
+-        return (SRAIndex) reader.getIndex();
+-    }
+ }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/htsjdk.git



More information about the debian-med-commit mailing list