You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building on Windows some of the unit tests fail, I have previously mentioned this in a different issue, but have not had the time to create a fix for it. (See: #3408). Now I was returning to the Eclipse project and found that the build still failed on some unit tests. Mostly due to line ending issues. On Windows line endings do not have to be \r\n but can often times also be just \n. Often it depends on how you clone, or which editor you use. So the System.lineSeperator method will not be enough. Instead I would suggest using the Java \R linebreak matcher (See: https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/regex/Pattern.html#any_unicode_linebreak) as it matches all Unicode linebreak sequences.
I also found that the ClasspathReader method: classpathFor was called without modules, which caused the output to be the gradle default output. Adding a check catching for empty modules and exiting early, fixed this issue. Also windows paths can cause issues, but this is fixed by using: Paths.get(URI).toString() instead of URI.getPath().
Possible Implementation
I have attached the diff file of the changes I have made to resolve this issue, if you want I can create a pull request for it, else feel free to use it.
Change path handling to correctly handle Windows pathnames.
Change line ending handling from using `System.lineSeparator` to using
the regex \R to treat all unicode line ending character sequences as the
line endings.
Change unit tests that compared certificates read from file, to ignore
the line ending characters, so differences in line ending did not break
the test.
Refs: eclipse-edc#4484
Change path handling to correctly handle Windows pathnames.
Change line ending handling from using `System.lineSeparator` to using
the regex \R to treat all unicode line ending character sequences as the
line endings.
Change unit tests that compared certificates read from file, to ignore
the line ending characters, so differences in line ending did not break
the test.
Refs: #4484
Bug Report
When building on Windows some of the unit tests fail, I have previously mentioned this in a different issue, but have not had the time to create a fix for it. (See: #3408). Now I was returning to the Eclipse project and found that the build still failed on some unit tests. Mostly due to line ending issues. On Windows line endings do not have to be
\r\n
but can often times also be just\n
. Often it depends on how you clone, or which editor you use. So theSystem.lineSeperator
method will not be enough. Instead I would suggest using the Java\R
linebreak matcher (See: https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/regex/Pattern.html#any_unicode_linebreak) as it matches all Unicode linebreak sequences.I also found that the
ClasspathReader
method:classpathFor
was called without modules, which caused the output to be the gradle default output. Adding a check catching for empty modules and exiting early, fixed this issue. Also windows paths can cause issues, but this is fixed by using:Paths.get(URI).toString()
instead ofURI.getPath()
.Possible Implementation
I have attached the diff file of the changes I have made to resolve this issue, if you want I can create a pull request for it, else feel free to use it.
diff.patch:
The text was updated successfully, but these errors were encountered: