Description: skipping tests that attempt to get files over the network
Author: Pierre Gruet <pgt@debian.org>
Forwarded: not-needed
Last-Update: 2022-03-26

--- a/src/test/java/org/broadinstitute/http/nio/GitHubResourcesIntegrationTest.java
+++ b/src/test/java/org/broadinstitute/http/nio/GitHubResourcesIntegrationTest.java
@@ -25,7 +25,7 @@
         };
     }
 
-    @Test(dataProvider = "getDocsFilesForTesting")
+    @Test(enabled = false, dataProvider = "getDocsFilesForTesting")
     public void testGitHubResourcesExists(final String fileName) throws Exception {
         final HttpURLConnection connection = (HttpURLConnection)
                 getGithubPagesFileUri(fileName).toURL().openConnection();
@@ -43,7 +43,7 @@
         Assert.assertTrue(Files.exists(getLocalDocsFilePath(fileName)));
     }
 
-    @Test(dataProvider = "getDocsFilesForTesting")
+    @Test(enabled = false, dataProvider = "getDocsFilesForTesting")
     public void testGithubAndDocsResourcesAreEqual(final String fileName) throws Exception {
         // 1. read the local file
         final byte[] local = Files.readAllBytes(getLocalDocsFilePath(fileName));
--- a/src/test/java/org/broadinstitute/http/nio/HttpAbstractFileSystemProviderUnitTest.java
+++ b/src/test/java/org/broadinstitute/http/nio/HttpAbstractFileSystemProviderUnitTest.java
@@ -146,14 +146,16 @@
         };
     }
 
-    @Test(dataProvider = "invalidArgsForByteChannel")
+    //Attempting to use the network
+    @Test(enabled = false, dataProvider = "invalidArgsForByteChannel")
     public void testInvalidByteChannels(final HttpAbstractFileSystemProvider provider, Path path,
             final Set<OpenOption> options,final Class<? extends Throwable> expectedException)
             throws Exception {
         Assert.assertThrows(expectedException, () -> provider.newByteChannel(path, options));
     }
 
-    @Test(dataProvider = "nonExistantPaths")
+    //Attempting to use the network
+    @Test(enabled = false, dataProvider = "nonExistantPaths")
     public void testOpenNonExistantUrl(Path path) throws Exception {
         try(final InputStream is = Files.newInputStream(path)){
             Assert.fail("Should have thrown");
@@ -170,14 +172,15 @@
         };
     }
 
-    @Test(dataProvider= "readOnly", expectedExceptions = UnsupportedOperationException.class)
+    //Attempting to use the network
+    @Test(enabled = false, dataProvider= "readOnly", expectedExceptions = UnsupportedOperationException.class)
     public void testReadOnly(final AccessMode deniedAcces) throws Exception {
         final HttpsFileSystemProvider https = new HttpsFileSystemProvider();
         final HttpPath path = https.getPath(getGithubPagesFileUri("file1.txt"));
         https.checkAccess(path, deniedAcces);
     }
 
-    @Test
+    @Test(enabled = false)
     public void testCheckAccessRead() throws Exception {
         final HttpsFileSystemProvider https = new HttpsFileSystemProvider();
         final HttpPath path = https.getPath(getGithubPagesFileUri("file1.txt"));
@@ -185,7 +188,8 @@
         https.checkAccess(path, AccessMode.READ);
     }
 
-    @Test(expectedExceptions = NoSuchFileException.class)
+    //Attempting to use the network
+    @Test(enabled = false, expectedExceptions = NoSuchFileException.class)
     public void testCheckAccessNoSuchFile() throws Exception {
         final HttpsFileSystemProvider https = new HttpsFileSystemProvider();
         final HttpPath path = https.getPath(getGithubPagesFileUri("no_exists.txt"));
--- a/src/test/java/org/broadinstitute/http/nio/HttpUtilsUnitTest.java
+++ b/src/test/java/org/broadinstitute/http/nio/HttpUtilsUnitTest.java
@@ -33,7 +33,7 @@
         };
     }
 
-    @Test(dataProvider = "getDocsFilesForTesting", dataProviderClass = GitHubResourcesIntegrationTest.class)
+    @Test(enabled = false, dataProvider = "getDocsFilesForTesting", dataProviderClass = GitHubResourcesIntegrationTest.class)
     public void testExistingUrls(final String fileName) throws IOException {
         Assert.assertTrue(HttpUtils.exists(getGithubPagesFileUri(fileName), HttpFileSystemProviderSettings.DEFAULT_SETTINGS));
     }
@@ -50,9 +50,10 @@
 
     // This tests fails when using verizon because they return 200 and a page with adds when you visit an unknown site
     // probably other home internet providers fail too
-    @Test(dataProvider = "nonExistantUrlStrings")
+    //Attempting to use the network
+    @Test(enabled = false, dataProvider = "nonExistantUrlStrings")
     public void testNonExistingUrl(final String urlString) throws IOException {
         final URI nonExistant = URI.create(urlString);
             Assert.assertFalse(HttpUtils.exists(nonExistant, HttpFileSystemProviderSettings.DEFAULT_SETTINGS));
     }
-}
\ No newline at end of file
+}
--- a/src/test/java/org/broadinstitute/http/nio/HttpSeekableByteChannelUnitTest.java
+++ b/src/test/java/org/broadinstitute/http/nio/HttpSeekableByteChannelUnitTest.java
@@ -31,12 +31,14 @@
         return new HttpSeekableByteChannel(uri);
     }
 
-    @Test(expectedExceptions = FileNotFoundException.class)
+    //Attempting to use the network
+    @Test(enabled = false, expectedExceptions = FileNotFoundException.class)
     public void testNonExistentUrl() throws Exception {
         getChannel(getGithubPagesFileUri("not_existent.txt"));
     }
 
-    @Test
+    //Attempting to use the network
+    @Test(enabled = false)
     public void testNonWritableChannelExceptions() throws Exception {
         try (final SeekableByteChannel channel = getChannel(getGithubPagesFileUri("file1.txt"))) {
             // cannot write
@@ -47,7 +49,8 @@
         }
     }
 
-    @Test(dataProvider = "getDocsFilesForTesting", dataProviderClass = GitHubResourcesIntegrationTest.class)
+    //Attempting to use the network
+    @Test(enabled = false, dataProvider = "getDocsFilesForTesting", dataProviderClass = GitHubResourcesIntegrationTest.class)
     public void testSize(final String fileName) throws Exception {
         final URI urlFile = getGithubPagesFileUri(fileName);
         final Path localFile = getLocalDocsFilePath(fileName);
@@ -57,7 +60,8 @@
         }
     }
 
-    @Test(dataProvider = "getDocsFilesForTesting", dataProviderClass = GitHubResourcesIntegrationTest.class)
+    //Attempting to use the network
+    @Test(enabled = false, dataProvider = "getDocsFilesForTesting", dataProviderClass = GitHubResourcesIntegrationTest.class)
     public void testSizeAfterRead(final String fileName) throws Exception {
         final URI urlFile = getGithubPagesFileUri(fileName);
         final Path localFile = getLocalDocsFilePath(fileName);
@@ -74,7 +78,8 @@
         }
     }
 
-    @Test(dataProvider = "getDocsFilesForTesting", dataProviderClass = GitHubResourcesIntegrationTest.class)
+    //Attempting to use the network
+    @Test(enabled = false, dataProvider = "getDocsFilesForTesting", dataProviderClass = GitHubResourcesIntegrationTest.class)
     public void testCachedSize(final String fileName) throws Exception {
         final URI urlFile = getGithubPagesFileUri(fileName);
         final Path localFile = getLocalDocsFilePath(fileName);
@@ -94,7 +99,8 @@
         }
     }
 
-    @Test
+    //Attempting to use the network
+    @Test(enabled = false)
     public void testGetPosition() throws Exception {
         // open channel
         try (final SeekableByteChannel channel = getChannel(getGithubPagesFileUri("file1.txt"))) {
@@ -110,7 +116,8 @@
         }
     }
 
-    @Test(expectedExceptions = IllegalArgumentException.class)
+    //Attempting to use the network
+    @Test(enabled = false, expectedExceptions = IllegalArgumentException.class)
     public void testIllegalPosition() throws Exception {
         try(SeekableByteChannel channel = getChannel(getGithubPagesFileUri("file1.txt"))) {
             channel.position(-1);
@@ -156,7 +163,8 @@
                         }).iterator();
     }
 
-    @Test(dataProvider = "seekData")
+    //Attempting to use the network
+    @Test(enabled = false, dataProvider = "seekData")
     public void testSeekBeforeRead(final URI testURI, final long position, final Path localFile)
             throws Exception {
         try (final SeekableByteChannel actual = getChannel(testURI);
@@ -167,7 +175,8 @@
         }
     }
 
-    @Test(dataProvider = "seekData")
+    //Attempting to use the network
+    @Test(enabled = false, dataProvider = "seekData")
     public void testSeekToBeginning(final URI testURI, final long position, final Path localFile)
             throws Exception {
         try (final SeekableByteChannel actual = getChannel(testURI);
@@ -179,7 +188,8 @@
         }
     }
 
-    @Test(dataProvider = "seekData")
+    //Attempting to use the network
+    @Test(enabled = false, dataProvider = "seekData")
     public void testSeekToSamePosition(final URI testURI, final long position, final Path localFile)
             throws Exception {
         try (final SeekableByteChannel actual = getChannel(testURI);
@@ -191,7 +201,8 @@
         }
     }
 
-    @Test(dataProvider = "seekData")
+    //Attempting to use the network
+    @Test(enabled = false, dataProvider = "seekData")
     public void testSeekShouldReopen(final URI testURI, final long position, final Path localFile)
             throws Exception {
         try (final SeekableByteChannel actual = getChannel(testURI);
@@ -203,7 +214,8 @@
         }
     }
 
-    @Test
+    //Attempting to use the network
+    @Test(enabled = false)
     public void testClose() throws Exception {
         // open channel
         final SeekableByteChannel channel = getChannel(getGithubPagesFileUri("file1.txt"));
@@ -222,7 +234,8 @@
         Assert.assertThrows(ClosedChannelException.class, () -> channel.read(ByteBuffer.allocate(1)));
     }
 
-    @Test
+    //Attempting to use the network
+    @Test(enabled = false)
     public void testPositionOnGoogleFile() throws IOException, URISyntaxException {
         URI URI = new URI(LARGE_FILE_ON_GOOGLE);
         try (SeekableByteChannel channel = getChannel(URI)) {
@@ -231,7 +244,8 @@
         }
     }
 
-    @Test(timeOut = 10_000L)
+    //Attempting to use the network
+    @Test(enabled = false, timeOut = 10_000L)
     //time out if it's taking over 10 seconds to read, that indicates we're probably not skipping correctly
     public void testReadAtEndOfLargeFileIsFast() throws IOException, URISyntaxException {
         URI URI = new URI(LARGE_FILE_ON_GOOGLE);
