simplemagic
simplemagic copied to clipboard
System language dependant test failure
Current version is system language dependant for test execution so that having an spanish language, for example, decimal numbers are splitted by comma. Therefore a test failure is thrown with following logs:
Failed tests: testFloat(com.j256.simplemagic.entries.FormatterTest): expected:<1[.]2> but was:<1[,]2>
testFloatScientific(com.j256.simplemagic.entries.FormatterTest): expected:<1[.]2E0> but was:<1[,]2E0>
testFloatMixed(com.j256.simplemagic.entries.FormatterTest): expected:<1[.]2> but was:<1[,]2>
testFiles(com.j256.simplemagic.ContentInfoUtilTest): bad message for /files/x.nuv expected:<...progressive,aspect:1[.00,fps:29.]97> but was:<...progressive,aspect:1[,00,fps:29,]97>
testPerformanceRun(com.j256.simplemagic.ContentInfoUtilTest): bad message for /files/x.nuv expected:<...progressive,aspect:1[.00,fps:29.]97> but was:<...progressive,aspect:1[,00,fps:29,]97>
Tests run: 250, Failures: 5, Errors: 0, Skipped: 2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.280 s
[INFO] Finished at: 2018-02-05T14:54:27Z
[INFO] Final Memory: 25M/265M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project simplemagic: There are test failures.
[ERROR]
[ERROR] Please refer to /home/simplemagic/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
In short, if you have your system language/maven language/java language in Spanish,
mvn install
command will fail.
My system settings are:
Apache Maven 3.5.0
Maven home: /usr/share/maven
Java version: 1.8.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: es_ES, platform encoding: UTF-8
OS name: "linux", version: "4.13.0-32-generic", arch: "amd64", family: "unix"
Good point. I'll take a look.
in fact such kind of errors may occur even on upgrade of JDK: the number formats was changed in JDK9 and JDK11 and will be changed in future