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 6ae40f7 commit 9bde573
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 30 deletions.
33 changes: 3 additions & 30 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,42 +118,15 @@

</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> -->
<!-- <sourceDirectory>${project.basedir}/src</sourceDirectory> -->
<!-- <resources> -->
<!-- <resource> -->
<!-- <directory>${project.basedir}/src</directory> -->
<!-- <excludes> -->
<!-- <exclude>**/*.java</exclude> -->
<!-- <exclude>**/package.html</exclude> -->
<!-- <exclude>**/*.properties</exclude> -->
<!-- </excludes> -->
<!-- </resource> -->
<!-- <resource> -->
<!-- <directory>${project.basedir}/src</directory> -->
<!-- <includes> -->
<!-- <include>**/*.properties</include> -->
<!-- </includes> -->
<!-- <filtering>true</filtering> -->
<!-- </resource> -->
<!-- <resource> -->
<!-- <directory>${project.basedir}</directory> -->
<!-- <includes> -->
<!-- <include>**/*.cpp</include> -->
<!-- </includes> -->
<!-- <filtering>true</filtering> -->
<!-- </resource> -->
<!-- </resources> -->

<!-- </build> -->
<build>
<sourceDirectory>${project.basedir}/src</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
5 changes: 5 additions & 0 deletions 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 @@ -460,6 +461,10 @@ 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);
}
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 9bde573

Please sign in to comment.