eclipse / ice

This project has moved to: https://gitlab.eclipse.org/eclipse/ice/ice
https://gitlab.eclipse.org/eclipse/ice/ice
Eclipse Public License 1.0
30 stars 55 forks source link

TestDataPathTest fails with path resolution error #469

Closed jayjaybillings closed 4 years ago

jayjaybillings commented 4 years ago

TestDataPathTest.testResolveWithOverridenDefault:74 expected: <\home\test\test_data\test> but was: <\home\test\test_data/test>

This looks like the test is hardwired to expect test_data/test with an actual / instead of separator. @dbluhm will you have a look to help confirm the problem?

Full error on Windows 10:

[INFO] Running org.eclipse.ice.tests.util.data.TestDataPathTest
[ERROR] Tests run: 17, Failures: 4, Errors: 0, Skipped: 0, Time elapsed: 0.021 s <<< FAILURE! - in org.eclipse.ice.tests.util.data.TestDataPathTest
[ERROR] testExistsPath  Time elapsed: 0.006 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
    at org.eclipse.ice.tests.util.data.TestDataPathTest.testExistsPath(TestDataPathTest.java:127)

[ERROR] testResolve  Time elapsed: 0.001 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <C:\Users\jayjaybillings\ICETests\test> but was: <C:\Users\jayjaybillings\ICETests/test>
    at org.eclipse.ice.tests.util.data.TestDataPathTest.testResolve(TestDataPathTest.java:62)

[ERROR] testExistsString  Time elapsed: 0.001 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
    at org.eclipse.ice.tests.util.data.TestDataPathTest.testExistsString(TestDataPathTest.java:117)

[ERROR] testResolveWithOverridenDefault  Time elapsed: 0.001 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <\home\test\test_data\test> but was: <\home\test\test_data/test>
    at org.eclipse.ice.tests.util.data.TestDataPathTest.testResolveWithOverridenDefault(TestDataPathTest.java:74)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   TestDataPathTest.testExistsPath:127 expected: <true> but was: <false>
[ERROR]   TestDataPathTest.testExistsString:117 expected: <true> but was: <false>
[ERROR]   TestDataPathTest.testResolve:62 expected: <C:\Users\jayjaybillings\ICETests\test> but was: <C:\Users\jayjaybillings\ICETests/test>
[ERROR]   TestDataPathTest.testResolveWithOverridenDefault:74 expected: <\home\test\test_data\test> but was: <\home\test\test_data/test>
[INFO] 
[ERROR] Tests run: 18, Failures: 4, Errors: 0, Skipped: 0
dbluhm commented 4 years ago

The slashes aren't hard wired but the tests are flawed. Basically had it checking paths resolved from the system default filesystem against an in memory filesystem that is configured to behave like a linux filesystem which obviously would not be equal to the system default filesystem when not on linux. I should be able to get that taken care of fairly quickly.

dbluhm commented 4 years ago

Let me know if the fixes in #470 take care of this issue. I removed all instances of mixing comparisons between a java.nio.Path on the default filesystem and a java.nio.Path on the in memory filesystem. Also just improved the tests in general so I think it should take care of everything.

jayjaybillings commented 4 years ago

That worked. Thanks! Closing...