Skip to content

Commit

Permalink
Activate tests in maven
Browse files Browse the repository at this point in the history
By adding the testSourceDirectory, the `mvn test`
target can be used in intellij to run tests. This
detected an NPE on `axes` that I've fixed here
though it would be more appropriate for omegh-8.
  • Loading branch information
joshmoore committed Nov 26, 2021
1 parent c5aad70 commit 16706df
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@

</dependencies>

<properties>
<properties>
<project.rootdir>${basedir}/../..</project.rootdir>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<!-- <build> -->
Expand Down Expand Up @@ -154,6 +154,7 @@
<!-- </build> -->
<build>
<sourceDirectory>${project.basedir}/src</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
3 changes: 2 additions & 1 deletion src/loci/formats/in/ZarrReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.xml.parsers.ParserConfigurationException;
Expand Down Expand Up @@ -491,7 +492,7 @@ private void parseResolutionCount(String root, String key) throws IOException, F
list.add(key.isEmpty() ? scalePath : key + File.separator + scalePath);
resSeries.put(resCounts.size() - 1, list);
}
ArrayList<Object> multiscaleAxes = (ArrayList<Object>)datasets.get("axes");
List<String> multiscaleAxes = (List<String>)datasets.get("axes");
for (int i = 0; i < multiscaleAxes.size(); i++) {
String axis = (String) multiscaleAxes.get(i);
}
Expand Down
2 changes: 2 additions & 0 deletions src/test/loci/formats/utests/ZarrReaderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
Expand Down Expand Up @@ -64,6 +65,7 @@ public void setUp() throws Exception {
multiscalePaths.add(multiScale2);
multiscalePaths.add(multiScale3);
datasets.put("datasets", multiscalePaths);
datasets.put("axes", Arrays.asList("t", "c", "z", "y", "x"));
multiscales.add(datasets);
topLevelAttributes.put("multiscales", multiscales);

Expand Down

0 comments on commit 16706df

Please sign in to comment.