$ mvn -Djava.awt.headless=true -Dtest=StringToImagePlusConverterTest test
...
[INFO] Running net.imagej.legacy.convert.StringToImagePlusConverterTest
[ERROR] Tests run: 6, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 3.698 s <<< FAILURE! - in net.imagej.legacy.convert.StringToImagePlusConverterTest
[ERROR] testCanConvert2(net.imagej.legacy.convert.StringToImagePlusConverterTest) Time elapsed: 3.428 s <<< ERROR!
java.awt.HeadlessException
at net.imagej.legacy.convert.StringToImagePlusConverterTest.setUp(StringToImagePlusConverterTest.java:77)
[ERROR] testCanConvertId(net.imagej.legacy.convert.StringToImagePlusConverterTest) Time elapsed: 0.046 s <<< ERROR!
java.awt.HeadlessException
at net.imagej.legacy.convert.StringToImagePlusConverterTest.setUp(StringToImagePlusConverterTest.java:77)
[ERROR] testCanConvertTitle(net.imagej.legacy.convert.StringToImagePlusConverterTest) Time elapsed: 0.04 s <<< ERROR!
java.awt.HeadlessException
at net.imagej.legacy.convert.StringToImagePlusConverterTest.setUp(StringToImagePlusConverterTest.java:77)
[ERROR] testConvertId(net.imagej.legacy.convert.StringToImagePlusConverterTest) Time elapsed: 0.034 s <<< ERROR!
java.awt.HeadlessException
at net.imagej.legacy.convert.StringToImagePlusConverterTest.setUp(StringToImagePlusConverterTest.java:77)
[ERROR] testNonImageTitle(net.imagej.legacy.convert.StringToImagePlusConverterTest) Time elapsed: 0.034 s <<< ERROR!
java.awt.HeadlessException
at net.imagej.legacy.convert.StringToImagePlusConverterTest.setUp(StringToImagePlusConverterTest.java:77)
[ERROR] testConvertTitle(net.imagej.legacy.convert.StringToImagePlusConverterTest) Time elapsed: 0.028 s <<< ERROR!
java.awt.HeadlessException
at net.imagej.legacy.convert.StringToImagePlusConverterTest.setUp(StringToImagePlusConverterTest.java:77)
The PyImageJ project has been working around this bug for a while now, using the following trick:
# HACK: Work around ImagePlus#show() failure if no ImagePlus objects are already registered.
if ij.WindowManager.getIDList() is None:
ij.py.run_macro('newImage("dummy", "8-bit", 1, 1, 1);
But we need to fix this in here in imagej-legacy (or upstream in ij1-patcher, as appropriate), so that imagej-legacy headless unit tests pass reliably, e.g. in the pom-scijava mega-melt.
The PyImageJ project has been working around this bug for a while now, using the following trick:
But we need to fix this in here in imagej-legacy (or upstream in ij1-patcher, as appropriate), so that imagej-legacy headless unit tests pass reliably, e.g. in the pom-scijava mega-melt.