[java] There was 1 failure: [java] 1) resizeToFitTextXSLF(org.apache.poi.sl.TestFonts) [java] java.lang.AssertionError: 391 wasn't within the expected sizes: [304, 306, 311, 312, 313, 318, 348, 362, 372, 377, 398, 399, 406] [java] at org.junit.Assert.fail(Assert.java:88) [java] at org.junit.Assert.assertTrue(Assert.java:41) [java] at org.apache.poi.sl.TestFonts.resizeToFitText(TestFonts.java:143) [java] at org.apache.poi.sl.TestFonts.resizeToFitTextXSLF(TestFonts.java:106) ... [java] at org.apache.poi.util.OOXMLLite.build(OOXMLLite.java:149) [java] at org.apache.poi.util.OOXMLLite.main(OOXMLLite.java:94) [java] [java] FAILURES!!! [java] Tests run: 2354, Failures: 1 [java] [java] Exception in thread "main" java.lang.RuntimeException: Tests did not succeed, cannot build ooxml-lite jar [java] at org.apache.poi.util.OOXMLLite.build(OOXMLLite.java:151) [java] at org.apache.poi.util.OOXMLLite.main(OOXMLLite.java:94) BUILD FAILED /Users/wf/Documents/workspace/poi/build.xml:1519: Java returned: 1
Which JDK are you using, and on what platform?
same as for the gradle build This is on High Sierra Mac Os 10.13.2 javac 1.8.0_152 Additionally I do not have a workaround at this time. I'd love to build without running the tests. I tried ant jar -Dooxml.lite.test.notRequired=true but then get /Users/wf/Documents/workspace/poi/build.xml:1811: The following error occurred while executing this line: /Users/wf/Documents/workspace/poi/build.xml:1798: /Users/wf/Documents/workspace/poi/build/ooxml-lite-classes does not exist.
echo "testok" > build/ooxml-lite-testokfile.txt;ant jar also does not work - the build logic seems to be forcing the tests even if the corresponding flag is set to not to do this.
You are the lucky owner of a new OS. Please open a pull request adding the value `391` to the list of accepted sizes in `org.apache.poi.sl.TestFonts`.
Actually we probably should simply skip those platform dependent test on Mac OS ...
MacOS is contributing only 3, now 4 of these magic values, out of 14. Or would the test only support one version of some arbitrary OS? And then all developers should run the tests in a container on their machine? What about variations on the continuous integration infrastructure? At least we should document the workaround for devs wanting to run locally with reduced overhead.
When I've initially written the test, I hoped that there are only minimal differences on the various platforms. I wanted to have something simple to validate if the line-breaks, the font loading/rendering and other issues work, therefore I've used the textbox height. Furthermore the fixed list (opposed to a range of e.g. 300-450) would fail faster if something in the rendering changes. But when you look at the list of values now, we have a spread from 304 to 406 so that's not really validating anything of the above and eventually also lead to failing tests, especially with the interesting font handling on Mac OS [1] So currently I think using the range 300-450 would be a compromise and hopefully minimize failing builds ... or the other solution would be to skip the assert on Mac OS, in the assumption that the font selection is mysterious there and more users are using Linux/Windows and might have already complaint [1] https://stackoverflow.com/questions/26063828
I added 391 and now get [java] java.lang.AssertionError: 391 wasn't within the expected sizes: [304, 306, 311, 312, 313, 318, 348, 362, 372, 377, 398, 391, 399, 406] so I now have to fix the source again since obviously there is an assumption that the values are in ascending order ...
with 391 in the correct place the compile works. I'd now like to use the created jar file in my maven projects. There seem to be three build options: - ant - gradle - maven which of these will get me to make the new poi-4.0.0-SNAPSHOT.jar available locally?
Hi Wolfgang, The poi build is not very newbie friendly. I would suggest the easiest thing to do is to use `ant jar` to build the jars and if you need to access them from another local project, most build tools facilitate this. For example, gradle has support like this: https://stackoverflow.com/a/20956456/987959 compile files('/path/to/poi-4.0.0-SNAPSHOT.jar') You will need to explicitly reference all the poi snapshot jars that your build depends on.
I've added the 391 now to TestFonts via r1831948 On the next font size complaint, I'll change the assert to a range check. If you have further problems with failing tests on the Mac, please reopen this issue. For further assistance on the build, please use the dev mailing list.