Skip to content

Commit 63f68c2

Browse files
author
Richard2 Adams
committed
make tests java8 compliant
2 parents f50c64c + 0f39120 commit 63f68c2

2 files changed

Lines changed: 10 additions & 13 deletions

File tree

biojava-core/src/test/java/org/biojava/nbio/core/util/CRC64ChecksumTest.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,7 @@ void allbyteRange (){
6464
}
6565
assertEquals(allBytesHex, crc64.toString());
6666
}
67-
68-
@Test
69-
void allRangeIsSameAsAllArray (){
70-
byte [] testBytes = new byte [] {1,2,3,4,5};
71-
crc64.update(testBytes, 0, testBytes.length);
72-
Long valueFromAllRange = crc64.getValue();
73-
crc64.reset();
74-
// crc64.update(testBytes);
75-
// assertEquals(valueFromAllRange, crc64.getValue());
76-
}
77-
67+
7868
@Test
7969
void partialByteRange (){
8070
byte [] testBytes = new byte [] {1,2,3,4,5};

biojava-core/src/test/java/org/biojava/nbio/core/util/FlatFileCacheTest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
import static org.junit.jupiter.api.Assertions.assertNull;
66

77
import java.io.File;
8+
import java.io.FileOutputStream;
89
import java.io.IOException;
910
import java.io.InputStream;
11+
import java.nio.charset.StandardCharsets;
1012
import java.nio.file.Files;
1113
import java.nio.file.Path;
1214

@@ -25,10 +27,15 @@ void before(){
2527

2628
File createSmallTmpFile() throws IOException{
2729
File f = File.createTempFile("flatFile","txt");
28-
Files.writeString(Path.of(f.getAbsolutePath()), aDNA);
30+
writeToFile( aDNA, f);
2931
return f;
3032
}
3133

34+
private void writeToFile(String aDNA, File f) throws IOException {
35+
FileOutputStream fos = new FileOutputStream(f);
36+
fos.write(aDNA.getBytes(StandardCharsets.UTF_8));
37+
}
38+
3239
@Test
3340
void flatFileRetrieve () throws IOException {
3441
File aDNAFile = createSmallTmpFile();
@@ -66,7 +73,7 @@ void fileCanBeModifiedButCachedValueIsUnchanged() throws IOException{
6673
long originalLength = aDNAFile.length();
6774

6875
// write new content to original file
69-
Files.writeString(Path.of(aDNAFile.getAbsolutePath()), aProtein);
76+
writeToFile( aProtein , aDNAFile);
7077

7178
// retrieve from cache, is unchanged
7279
InputStream is = FlatFileCache.getInputStream("key");

0 commit comments

Comments
 (0)