Skip to content

Commit 96bbea4

Browse files
committed
tests
1 parent 3066b5c commit 96bbea4

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/test/java/com/scalableminds/zarrjava/ZarrTest.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.nio.file.Files;
2222
import java.nio.file.Path;
2323
import java.nio.file.Paths;
24+
import java.util.Arrays;
2425
import java.util.Comparator;
2526
import java.util.HashMap;
2627
import java.util.stream.Stream;
@@ -44,7 +45,8 @@ public void clearTestoutputFolder() throws IOException {
4445

4546
@Test
4647
public void testStores() throws IOException, ZarrException {
47-
FilesystemStore fsStore = new FilesystemStore(TESTOUTPUT);
48+
FilesystemStore fsDataStore = new FilesystemStore(TESTDATA);
49+
FilesystemStore fsOutStore = new FilesystemStore(TESTOUTPUT);
4850
HttpStore httpStore = new HttpStore("https://static.webknossos.org/data/");
4951
S3Store s3Store = new S3Store(AmazonS3ClientBuilder.standard()
5052
.withRegion("eu-west-1")
@@ -54,24 +56,27 @@ public void testStores() throws IOException, ZarrException {
5456
ObjectMapper objectMapper = Node.makeObjectMapper();
5557

5658
GroupMetadata group = objectMapper.readValue(
57-
Files.readAllBytes(TESTDATA.resolve("l4_sample_no_sharding").resolve("zarr.json")),
59+
Files.readAllBytes(TESTDATA.resolve("l4_sample").resolve("zarr.json")),
5860
GroupMetadata.class
5961
);
6062

6163
System.out.println(group);
6264
System.out.println(objectMapper.writeValueAsString(group));
6365

6466
ArrayMetadata arrayMetadata = objectMapper.readValue(Files.readAllBytes(TESTDATA.resolve(
65-
"l4_sample_no_sharding").resolve("color").resolve("1").resolve("zarr.json")),
67+
"l4_sample").resolve("color").resolve("1").resolve("zarr.json")),
6668
ArrayMetadata.class);
6769

6870
System.out.println(arrayMetadata);
6971
System.out.println(objectMapper.writeValueAsString(arrayMetadata));
7072

7173
System.out.println(
72-
Array.open(new FilesystemStore(TESTDATA).resolve("l4_sample_no_sharding", "color", "1")));
73-
// System.out.println(new Group(fsStore, "l4_sample_no_sharding").list());
74-
// System.out.println(((Group) new Group(fsStore, "l4_sample_no_sharding").get("color")).list());
74+
Array.open(fsDataStore.resolve("l4_sample", "color", "1")));
75+
System.out.println(
76+
Arrays.toString(Group.open(fsDataStore.resolve("l4_sample")).list().toArray(Node[]::new)));
77+
System.out.println(
78+
Arrays.toString(((Group) Group.open(fsDataStore.resolve("l4_sample")).get("color")).list()
79+
.toArray(Node[]::new)));
7580

7681
System.out.println(
7782
com.scalableminds.zarrjava.v2.Array.open(httpStore.resolve("l4_sample", "color", "1")));
@@ -142,7 +147,8 @@ public void testV3Group() throws IOException, ZarrException {
142147
);
143148
array.write(new long[]{2, 2}, ucar.ma2.Array.factory(ucar.ma2.DataType.UBYTE, new int[]{8, 8}));
144149

145-
assertArrayEquals(((Array) ((Group) group.listAsArray()[0]).listAsArray()[0]).metadata.chunkShape(),
150+
assertArrayEquals(
151+
((Array) ((Group) group.listAsArray()[0]).listAsArray()[0]).metadata.chunkShape(),
146152
new int[]{5, 5});
147153
}
148154

0 commit comments

Comments
 (0)