Skip to content

Commit

Permalink
Add explicit failure message for "Use SCIFIO"
Browse files Browse the repository at this point in the history
If the local system has an ImageJ2 installation with Edit > Options >
ImageJ2 > Use SCIFIO enabled, this test will fail. This was documented
in the code but having an explicit message in this failure case will
hopefully mitigate future confusion.

Closes #260
  • Loading branch information
hinerm committed Dec 17, 2020
1 parent 5d66b53 commit a30ddd7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/java/net/imagej/legacy/LegacyOpenerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.net.URL;

import net.imagej.patcher.LegacyInjector;
Expand Down Expand Up @@ -85,6 +87,13 @@ public void testPaulsMacro() throws Exception {
// it is because you have enabled the "Use SCIFIO when opening files"
// option in Edit > Options > ImageJ2. On fresh systems, this option
// is off; the value returned by ImageJ 1.x's built-in behavior is 3.
if (numResults == 10) {
// NB: We have the ImageJ2Options plugin.. could we disable scifio for
// the scope of this test?
fail(
"Return value (10) suggests SCIFIO was used instead of ImageJ 1.x. " +
"Please disable \"Use SCIFIO when opening files\" in Edit > Options > ImageJ2");
}
assertEquals(3, (int) numResults);
}
finally {
Expand Down

0 comments on commit a30ddd7

Please sign in to comment.