-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip/test: experiments to test limits of gh actions failures
- Loading branch information
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
src/test/java/org/janelia/saalfeldlab/n5/exps/GithubActionsIssues.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package org.janelia.saalfeldlab.n5.exps; | ||
|
||
import static org.junit.Assert.assertNotNull; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
|
||
import org.janelia.saalfeldlab.n5.DataType; | ||
import org.janelia.saalfeldlab.n5.DatasetAttributes; | ||
import org.janelia.saalfeldlab.n5.N5FSReader; | ||
import org.janelia.saalfeldlab.n5.N5FSWriter; | ||
import org.janelia.saalfeldlab.n5.RawCompression; | ||
import org.junit.AfterClass; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
|
||
public class GithubActionsIssues { | ||
|
||
private static File baseDir; | ||
|
||
@BeforeClass | ||
public static void before() { | ||
|
||
try { | ||
baseDir = Files.createTempDirectory("n5-ij-tests-").toFile(); | ||
baseDir.deleteOnExit(); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
} | ||
|
||
@AfterClass | ||
public static void after() { | ||
|
||
baseDir.delete(); | ||
} | ||
|
||
@Test | ||
public void n5WriteRead() { | ||
|
||
try (final N5FSWriter n5w = new N5FSWriter(baseDir.getAbsolutePath())) { | ||
|
||
for (int i = 0; i < 50; i++) { | ||
|
||
final String dset = String.format("%04d", i); | ||
n5w.createDataset(dset, | ||
new DatasetAttributes(new long[]{6, 5, 4}, new int[]{6, 5, 4}, DataType.FLOAT32, new RawCompression())); | ||
|
||
try (final N5FSReader n5r = new N5FSReader(baseDir.getAbsolutePath())) { | ||
|
||
final DatasetAttributes attrs = n5r.getDatasetAttributes(dset); | ||
assertNotNull("null attrs for dataset: " + dset , attrs); | ||
n5r.close(); | ||
n5w.remove(dset); | ||
} | ||
} | ||
n5w.remove(); | ||
n5w.close(); | ||
} | ||
} | ||
|
||
} |