Improve error reporting when the _SQUASH_TF_TESTCASE_PARAM_FILES points toward an incorrect file
(This issue is the transfer of https://project.squashtest.org/browse/SQUASH-4446.)
If the file defined by the _SQUASH_TF_TESTCASE_PARAM_FILES
environment variable does not exist, we have a crash:
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running squash.tfauto.ParameterTest
12:27:16.185 [main] ERROR org.opentestfactory.util.ParameterServiceImpl - ::ERROR:File loading error
java.io.FileNotFoundException: /media/kung/UNIX_DATA/gitprojects/quickfix/brlbrl (Aucun fichier ou dossier de ce type)
at java.base/java.io.FileInputStream.open0(Native Method) ~[?:?]
at java.base/java.io.FileInputStream.open(FileInputStream.java:219) ~[?:?]
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157) ~[?:?]
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112) ~[?:?]
at java.base/sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:86) ~[?:?]
at java.base/sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:184) ~[?:?]
at java.base/java.net.URL.openStream(URL.java:1165) ~[?:?]
at org.ini4j.spi.IniSource.<init>(IniSource.java:55) ~[ini4j-0.5.4.jar:?]
at org.ini4j.spi.AbstractParser.newIniSource(AbstractParser.java:68) ~[ini4j-0.5.4.jar:?]
at org.ini4j.spi.IniParser.parse(IniParser.java:67) ~[ini4j-0.5.4.jar:?]
at org.ini4j.Ini.load(Ini.java:119) ~[ini4j-0.5.4.jar:?]
at org.ini4j.Ini.load(Ini.java:114) ~[ini4j-0.5.4.jar:?]
at org.ini4j.Ini.load(Ini.java:99) ~[ini4j-0.5.4.jar:?]
at org.ini4j.Ini.<init>(Ini.java:69) ~[ini4j-0.5.4.jar:?]
at org.opentestfactory.util.ParameterServiceImpl.<init>(ParameterServiceImpl.java:48) ~[opentestfactory-java-param-library-1.0.1.jar:?]
at org.opentestfactory.util.ParameterServiceImpl.getInstance(ParameterServiceImpl.java:76) ~[opentestfactory-java-param-library-1.0.1.jar:?]
at org.opentestfactory.util.ParameterService.<clinit>(ParameterService.java:29) ~[opentestfactory-java-param-library-1.0.1.jar:?]
at squash.tfauto.ParameterTest.testScopePrem(ParameterTest.java:13) ~[test-classes/:?]
...
We could have an explicit error message.
This _SQUASH_TF_TESTCASE_PARAM_FILES
environment variable is not documented, this is an internal OTF mechanism. So such an error would indicate a problem with the execution environment or a bug in the Orchestrator.
So this improvement is a low priority.
Edited by Laurent Mazuré