Path is read from XML file, but after processing it by File object, it
is changed to system-dependent value.
So I added processing of string as filename and tests are now passing on
both Linux and Windows.
Regards,
Tom
On 28.5.2020 19:11, Jens Hofschröer wrote:
Hi
Why is the test using an absolute path anyway? shouldn't this fail on
all systems? Your test string should be system dependant. (At least the
base path and the File.separatorChar).
On Windows it is a bad idea to write directly to
"getProperty("java.home")" it is a better idea to write to
"getEnv("LOCALAPPDATA")". Also you can't "equal"-test a path on Windows.
The NTFS Filesystem does not care about case. You have to handle this.
Jens
Am 28.05.2020 um 19:00 schrieb Tomáš Procházka:
Hi,
what is correct way of fixing unit tests when they pass on Linux but
fail on Windows because of different file path?
Example
Test:
https://github.com/apache/netbeans/blob/master/php/php.codeception/test/unit/src/org/netbeans/modules/php/codeception/coverage/CodeceptionCoverageLogParserTest.java
Test data:
https://github.com/apache/netbeans/blob/master/php/php.codeception/test/unit/data/codeception-coverage.xml
Test data contain path
"/home/junichi11/NetBeansProjects/codeception/src/FizzBuzz.php".
Test asserts this path and on Linux test passes. On Widnows test fails
with message "junit.framework.ComparisonFailure:
expected:<[/home/junichi11/NetBeansProjects/codeception/src/]FizzBuzz.php>
but
was:<[C:\home\junichi11\NetBeansProjects\codeception\src\]FizzBuzz.php>"
Regards,
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
For additional commands, e-mail: dev-h...@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists