diff --git a/src/test/java/org/broad/igv/feature/genome/fasta/FastaIndexedSequenceTest.java b/src/test/java/org/broad/igv/feature/genome/fasta/FastaIndexedSequenceTest.java index b91f2a7fc5..6110c6f3e1 100644 --- a/src/test/java/org/broad/igv/feature/genome/fasta/FastaIndexedSequenceTest.java +++ b/src/test/java/org/broad/igv/feature/genome/fasta/FastaIndexedSequenceTest.java @@ -52,39 +52,15 @@ public class FastaIndexedSequenceTest { @BeforeClass public static void setup() throws IOException { - String path = "http://data.broadinstitute.org/igvdata/test/fasta/ci2_test.fa"; + String path = "https://s3.amazonaws.com/igv.org.test/data/ci2_test.fa"; fastaSequence = new FastaIndexedSequence(path); } - /** - * Compare a direct read of sequence from a file vs a read from and indexed fasta for the same interval. - * - * @throws Exception - */ - @Test - public void testReadSequence() throws Exception { - - String chr02qSeqPath = "http://data.broadinstitute.org/igvdata/test/fasta/"; - - String chr = "chr02q"; - int start = 3531385; - int end = 3531425; - - - // TAATTTTTACGTCTTATTTAAACACATATAATGAATAGGT; - Sequence igvSequence = new IGVSequence(chr02qSeqPath); - byte[] expectedBytes = igvSequence.getSequence(chr, start, end, true); - String expectedSequence = new String(expectedBytes); - - byte[] bytes = fastaSequence.getSequence(chr, start, end, true); - String seq = new String(bytes); - assertEquals(expectedSequence, seq); - } @Test public void testReadEnd() throws Exception { - String path = "http://data.broadinstitute.org/igvdata/test/fasta/ci2_test.fa"; + String path = "https://s3.amazonaws.com/igv.org.test/data/ci2_test.fa"; String chr = "chr02q"; int chrLen = 8059593; diff --git a/src/test/java/org/broad/igv/tdf/TDFRegressionTests.java b/src/test/java/org/broad/igv/tdf/TDFRegressionTests.java index d60e1f260d..9e8c038262 100644 --- a/src/test/java/org/broad/igv/tdf/TDFRegressionTests.java +++ b/src/test/java/org/broad/igv/tdf/TDFRegressionTests.java @@ -68,12 +68,6 @@ public void test_IGV1417() { assertEquals(1, reader.getVersion()); } - @Test - public void test_v3() { - String tdfFile = "http://data.broadinstitute.org/igvdata/test/tdf/NA12878.pilot2.454.bam.tdf"; - TDFReader reader = TDFReader.getReader(tdfFile); - assertEquals(3, reader.getVersion()); - } String[] dm3posChromos = new String[]{"chr2RHet", "chr4", "chrU"}; String[] dm3emptyChromos = new String[]{"chrUextra"}; diff --git a/src/test/java/org/broad/igv/util/IGVHttpClientUtilsTest.java b/src/test/java/org/broad/igv/util/IGVHttpClientUtilsTest.java index cfa45f3662..ebabbd4ae0 100644 --- a/src/test/java/org/broad/igv/util/IGVHttpClientUtilsTest.java +++ b/src/test/java/org/broad/igv/util/IGVHttpClientUtilsTest.java @@ -25,15 +25,9 @@ package org.broad.igv.util; -import org.broad.igv.exceptions.HttpResponseException; -import org.broad.igv.prefs.Constants; -import org.broad.igv.prefs.IGVPreferences; -import org.broad.igv.prefs.PreferencesManager; -import org.junit.Ignore; import org.junit.Test; import java.io.IOException; -import java.net.URL; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; @@ -46,20 +40,19 @@ public class IGVHttpClientUtilsTest { - private static String hg18URL = "http://data.broadinstitute.org/igvdata/test/hg18.unittest.genome"; - private static int hg18bytes = 3617644; + String url = "https://s3.amazonaws.com/igv.org.test/csi_test/chr10p.bam.csi"; + int byteCount = 105063; @Test public void testGetContentLength() throws IOException { - String url = hg18URL; - assertEquals(hg18bytes, HttpUtils.getInstance().getContentLength(HttpUtils.createURL(url))); + assertEquals(byteCount, HttpUtils.getInstance().getContentLength(HttpUtils.createURL(url))); } @Test public void testExists() throws IOException { - String url = hg18URL; - assertTrue("Resource unexpectedly does not exist", HttpUtils.getInstance().resourceAvailable(hg18URL)); + + assertTrue("Resource unexpectedly does not exist", HttpUtils.getInstance().resourceAvailable(url)); url = "http://nosuchserver/genomes/hg18.genome"; assertFalse("Resource unexpectedly found", HttpUtils.getInstance().resourceAvailable(url)); @@ -68,46 +61,4 @@ public void testExists() throws IOException { assertFalse(HttpUtils.getInstance().resourceAvailable(url)); } - /** - * This test will only work if on the Broad intranet, as that's where the test proxy server is. - * - * @throws IOException - */ - @Ignore - @Test - public void testProxy() throws IOException { - - final URL testURL = HttpUtils.createURL(hg18URL); - - IGVPreferences mgr = PreferencesManager.getPreferences(); - mgr.override(Constants.PROXY_HOST, "igvdev01.broadinstitute.org"); - mgr.override(Constants.PROXY_PORT, "3128"); - mgr.override(Constants.PROXY_USER, "proxytest"); - String enc_pword = Utilities.base64Encode("test@123"); - mgr.override(Constants.PROXY_PW, enc_pword); - mgr.override(Constants.USE_PROXY, "true"); - mgr.override(Constants.PROXY_AUTHENTICATE, "true"); - HttpUtils.getInstance().updateProxySettings(); - - long contentLength = 0; - try { - contentLength = HttpUtils.getInstance().getContentLength(testURL); - assertEquals(hg18bytes, contentLength); - } catch (IOException e) { - System.out.println("Proxy unreachable. Skipping proxy test"); - return; - } - - // Now try to get a file not on the squid "allowed" domains to verify requests are going through the proxy - // This should fail and return -1 for the content length - try { - contentLength = HttpUtils.getInstance().getContentLength(HttpUtils.createURL("http://www.boston.com")); - junit.framework.Assert.fail("Proxy test is apparently bypassing proxy"); - } catch (HttpResponseException e) { - // This is expected - assertEquals(403, e.getStatusCode()); - } - - - } } diff --git a/src/test/java/org/broad/igv/util/stream/IGVSeekableBufferedStreamTest.java b/src/test/java/org/broad/igv/util/stream/IGVSeekableBufferedStreamTest.java index a079371a81..1568e410ce 100644 --- a/src/test/java/org/broad/igv/util/stream/IGVSeekableBufferedStreamTest.java +++ b/src/test/java/org/broad/igv/util/stream/IGVSeekableBufferedStreamTest.java @@ -50,7 +50,7 @@ public class IGVSeekableBufferedStreamTest extends AbstractHeadlessTest{ // private final File BAM_INDEX_FILE = new File("testdata/net/sf/samtools/BAMFileIndexTest/index_test.bam.bai"); private final File BAM_FILE = new File(TestUtils.DATA_DIR + "/samtools/index_test.bam"); - private final String BAM_URL_STRING = "http://data.broadinstitute.org/igvdata/test/data/bam/index_test.bam"; + private final String BAM_URL_STRING = "https://s3.amazonaws.com/igv.org.test/data/index_test.bam"; private static File megabyteZerosFile = new File(TestUtils.DATA_DIR + "/samtools/megabyteZeros.dat"); static int expectedFileSize = 20000;