[med-svn] [htsjdk] 05/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 f4ad91db41d710aaa20dfa693eb97bc8894c0024
Author: Olivier Sallou <olivier.sallou at debian.org>
Date:   Tue Jan 5 14:14:54 2016 +0100

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

diff --git a/debian/patches/13-skip_network_tests b/debian/patches/13-skip_network_tests
index bc1bd4b..1bda984 100644
--- a/debian/patches/13-skip_network_tests
+++ b/debian/patches/13-skip_network_tests
@@ -86,3 +86,64 @@ Last-Updated: 2015-01-06
 -        }
 -    }
  }
+--- a/src/tests/java/htsjdk/samtools/seekablestream/SeekableBufferedStreamTest.java
++++ b/src/tests/java/htsjdk/samtools/seekablestream/SeekableBufferedStreamTest.java
+@@ -40,58 +40,7 @@
+     private final String BAM_URL_STRING = "http://broadinstitute.github.io/picard/testdata/index_test.bam";
+     private static File TestFile = new File("testdata/htsjdk/samtools/seekablestream/megabyteZeros.dat");
+ 
+-    /**
+-     * Test reading across a buffer boundary (buffer size is 512000).   The test first reads a range of
+-     * bytes using an unbuffered stream file stream,  then compares this to results from a buffered http stream.
+-     *
+-     * @throws IOException
+-     */
+-    @Test
+-    public void testRandomRead() throws IOException {
+-
+-        int startPosition = 500000;
+-        int length = 50000;
+-
+-        byte[] buffer1 = new byte[length];
+-        SeekableStream unBufferedStream = new SeekableFileStream(BAM_FILE);
+-        unBufferedStream.seek(startPosition);
+-        int bytesRead = unBufferedStream.read(buffer1, 0, length);
+-        assertEquals(length, bytesRead);
+-
+-        byte[] buffer2 = new byte[length];
+-        SeekableStream bufferedStream = new SeekableBufferedStream(new SeekableHTTPStream(new URL(BAM_URL_STRING)));
+-        bufferedStream.seek(startPosition);
+-        bytesRead = bufferedStream.read(buffer2, 0, length);
+-        assertEquals(length, bytesRead);
+-
+-        assertEquals(buffer1, buffer2);
+-    }
+-
+-    /**
+-     * Test an attempt to read past the end of the file.  The test file is 594,149 bytes in length.  The test
+-     * attempts to read a 1000 byte block starting at position 594000.  A correct result would return 149 bytes.
+-     *
+-     * @throws IOException
+-     */
+-    @Test
+-    public void testEOF() throws IOException {
+-
+-        int remainder = 149;
+-        long fileLength = BAM_FILE.length();
+-        long startPosition = fileLength - remainder;
+-        int length = 1000;
+-
+-
+-        byte[] buffer = new byte[length];
+-        SeekableStream bufferedStream = new SeekableBufferedStream(new SeekableHTTPStream(new URL(BAM_URL_STRING)));
+-        bufferedStream.seek(startPosition);
+-        int bytesRead = bufferedStream.read(buffer, 0, length);
+-        assertEquals(remainder, bytesRead);
+ 
+-        // Subsequent reads should return -1
+-        bytesRead = bufferedStream.read(buffer, 0, length);
+-        assertEquals(-1, bytesRead);
+-    }
+ 
+     @Test
+     public void testSkip() throws IOException {

-- 
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