Skip to content

Commit

Permalink
Merge pull request #1093 from cometbroom/issue-1092-windows-tests
Browse files Browse the repository at this point in the history
Fix FastaStreamerTest tests failing on windows due to URL handling
  • Loading branch information
josemduarte committed Apr 26, 2024
2 parents 4fcb3b1 + d96cae4 commit b33d74c
Showing 1 changed file with 8 additions and 6 deletions.
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

0 comments on commit b33d74c

Please sign in to comment.