Skip to content

Commit

Permalink
re #VFS-834: pushed the test case as far as I could and denoted the
Browse files Browse the repository at this point in the history
reason why additional step could not be taken
  • Loading branch information
ivakegg committed Apr 30, 2023
1 parent 5daf68f commit 7923cac
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,14 @@ public void testLoadResource() throws Exception {

// VFS-834: testing that getting the resource again does not close out the previous input stream.
final URL resource2 = loader.getResource("read-tests/file1.txt");
assertNotNull(resource2);
final URLConnection urlCon2 = resource2.openConnection();

assertSameURLContent(FILE1_CONTENT, instr1, urlCon1);

assertNotNull(resource2);
final URLConnection urlCon2 = resource2.openConnection();
final InputStream instr2 = urlCon1.getInputStream();
// For tar files, getting the second input stream will reset the input (see TarFileSystem.resetTarFile())
// hence we need to actually get the input stream after asserting the contents of the first one.
final InputStream instr2 = urlCon2.getInputStream();

assertSameURLContent(FILE1_CONTENT, instr2, urlCon2);
}
Expand Down

0 comments on commit 7923cac

Please sign in to comment.