Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FastaStreamerTest tests failing on windows due to URL handling #1093

Merged
merged 2 commits into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import org.junit.Test;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
Expand All @@ -16,9 +18,9 @@
public class FastaStreamerTest {

@Test
public void stream() throws IOException {
String file = this.getClass().getResource("PF00104_small.fasta.gz").getFile();
Path path = Paths.get(file);
public void stream() throws IOException, URISyntaxException {
URI fileUri = this.getClass().getResource("PF00104_small.fasta.gz").toURI();
Path path = Paths.get(fileUri);
List<ProteinSequence> sequences;

sequences = FastaStreamer.from(path).stream().collect(Collectors.toList());
Expand All @@ -38,9 +40,9 @@ public void stream() throws IOException {
}

@Test
public void iterate() {
String file = this.getClass().getResource("PF00104_small.fasta.gz").getFile();
Path path = Paths.get(file);
public void iterate() throws URISyntaxException {
URI fileUri = this.getClass().getResource("PF00104_small.fasta.gz").toURI();
Path path = Paths.get(fileUri);
int count = 0;
for (ProteinSequence sequence : FastaStreamer.from(path).each()) {
count++;
Expand Down