From d3e4c37363b74254b5bd6ec8d027057c39075785 Mon Sep 17 00:00:00 2001 From: Christian Tischer Date: Mon, 25 Nov 2024 10:59:44 +0100 Subject: [PATCH] Fix s3 credentials tests --- .../mobie/io/imagedata/N5ImageDataTest.java | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/test/java/org/embl/mobie/io/imagedata/N5ImageDataTest.java b/src/test/java/org/embl/mobie/io/imagedata/N5ImageDataTest.java index fcc8742..584570c 100644 --- a/src/test/java/org/embl/mobie/io/imagedata/N5ImageDataTest.java +++ b/src/test/java/org/embl/mobie/io/imagedata/N5ImageDataTest.java @@ -33,35 +33,35 @@ public void openOMEZarrFromEBIS3() assertNotNull( voxelDimensions ); } -// @Test -// public void openOMEZarrFromS3WithCredentialsWithN5ImageData() -// { -// System.out.println("openOMEZarrFromS3WithCredentials"); -// N5ImageData< ? > n5ImageData = new N5ImageData<>( -// "https://s3.embl.de/mobie-credentials-test/test/images/ome-zarr/8kmont5.ome.zarr", -// new String[]{ "4vJRUoUQZix2x7wPRlSy", "qtt7o93uv2PTvXSgYGMtoGtQkd3HsRqVH5XwitSf" }); -// VoxelDimensions voxelDimensions = n5ImageData.getSourcePair( 0 ).getB().getVoxelDimensions(); -// assertNotNull( voxelDimensions ); -// } -// -// @Test -// public void openOMEZarrFromS3WithCredentialsWithImageDataOpener() -// { -// // This test uses the ImageDataOpener ( instead of directly N5ImageData ) -// System.out.println("openOMEZarrFromS3WithCredentialsV2"); -// ImageDataFormat imageDataFormat = ImageDataFormat.OmeZarrS3; -// imageDataFormat.setS3SecretAndAccessKey( -// new String[]{ -// "4vJRUoUQZix2x7wPRlSy", -// "qtt7o93uv2PTvXSgYGMtoGtQkd3HsRqVH5XwitSf" -// } ); -// ImageData< ? > imageData = ImageDataOpener.open( -// "https://s3.embl.de/mobie-credentials-test/test/images/ome-zarr/8kmont5.ome.zarr", -// imageDataFormat, -// new SharedQueue( 1 ) ); -// VoxelDimensions voxelDimensions = imageData.getSourcePair( 0 ).getB().getVoxelDimensions(); -// assertNotNull( voxelDimensions ); -// } + @Test + public void openOMEZarrFromS3WithCredentialsWithN5ImageData() + { + System.out.println("openOMEZarrFromS3WithCredentials"); + N5ImageData< ? > n5ImageData = new N5ImageData<>( + "https://s3.embl.de/mobie-credentials-test/test/images/ome-zarr/8kmont5.ome.zarr", + new String[]{ "4vJRUoUQZix2x7wPRlSy", "qtt7o93uv2PTvXSgYGMtoGtQkd3HsRqVH5XwitSf" }); + VoxelDimensions voxelDimensions = n5ImageData.getSourcePair( 0 ).getB().getVoxelDimensions(); + assertNotNull( voxelDimensions ); + } + + @Test + public void openOMEZarrFromS3WithCredentialsWithImageDataOpener() + { + // This test uses the ImageDataOpener ( instead of directly N5ImageData ) + System.out.println("openOMEZarrFromS3WithCredentialsV2"); + ImageDataFormat imageDataFormat = ImageDataFormat.OmeZarrS3; + imageDataFormat.setS3SecretAndAccessKey( + new String[]{ + "MHLAyeu3fyBAx3egnzOE", + "Dj9SCkDr3XtWEohBKxCcWFZgU0YkpxRK7TndQYmm" + } ); + ImageData< ? > imageData = ImageDataOpener.open( + "https://s3.embl.de/mobie-credentials-test/test/images/ome-zarr/8kmont5.ome.zarr", + imageDataFormat, + new SharedQueue( 1 ) ); + VoxelDimensions voxelDimensions = imageData.getSourcePair( 0 ).getB().getVoxelDimensions(); + assertNotNull( voxelDimensions ); + } @Test public void openOMEZarrFromS3WithWrongCredentials()