Skip to content

Commit

Permalink
wip: investigate windows macro test
Browse files Browse the repository at this point in the history
  • Loading branch information
bogovicj committed Apr 26, 2024
1 parent 08b369a commit eace7bc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 29 deletions.
26 changes: 15 additions & 11 deletions src/test/java/org/janelia/saalfeldlab/n5/ij/MacroTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,19 @@ protected String tempN5Location() throws URISyntaxException {
return new URI("file", null, basePath, null).toString();
}

// @Test
// public void testMacroContentPath() throws IOException {
// System.out.println("testMacroContentPath");
// testMacroContentHelper("url=%s/%s");
// }
//
// @Test
// public void testMacroContentUri() throws IOException {
// System.out.println("testMacroContentUri");
// testMacroContentHelper("url=%s?%s");
// }
@Test
public void testMacroContentPath() throws IOException {
System.out.println("testMacroContent Path style");
testMacroContentHelper("url=%s/%s");
}

@Test
public void testMacroContentUri() throws IOException {
System.out.println("testMacroContent URI style skip windows");
final String os = System.getProperty("os.name").toLowerCase();
if( !os.startsWith("windows"))
testMacroContentHelper("url=%s?%s");
}

public void testMacroContentHelper( String urlFormat ) throws IOException {

Expand Down Expand Up @@ -130,6 +132,8 @@ public void testMacroContentHelper( String urlFormat ) throws IOException {
@Test
public void testMacro() {

System.out.println("testMacro: " + n5rootF);

final N5Importer plugin = (N5Importer)IJ.runPlugIn("org.janelia.saalfeldlab.n5.ij.N5Importer",
String.format("url=%s?%s hide", n5rootF.getAbsolutePath(), "cosem" ));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,23 +219,6 @@ public void testXYCZT() throws IOException, InterruptedException, ExecutionExcep
remove(rootLocation);
}

@Test
public void testFormatParsing() throws IOException, InterruptedException, ExecutionException, URISyntaxException {

final int nc = 1;
final int nz = 3;
final int nt = 1;
final String dataset = "";
final ImagePlus imp = createImage(nc, nz, nt);
final String rootLocation = createDataset("xyz_fmtTest.zarr", dataset, imp);

final Pair<StorageFormat, URI> fmtUri = N5Factory.StorageFormat.parseUri(rootLocation);
System.out.println(fmtUri.getA());
System.out.println(fmtUri.getB());

remove(rootLocation);
}

private ImagePlus createImage(final int nc, final int nz, final int nt) {

final ImagePlus imp = NewImage.createImage("test", nx, ny, nc * nz * nt, 8, NewImage.FILL_NOISE);
Expand All @@ -256,7 +239,6 @@ private String createDataset(final String containerName, final String dataset, f
N5ScalePyramidExporter.DOWN_SAMPLE, N5Importer.MetadataOmeZarrKey, compression);
writer.run(); // run() closes the n5 writer

System.out.println("createDataset returned: " + rootLocation);
return rootLocation;
}

Expand Down

0 comments on commit eace7bc

Please sign in to comment.