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
Describe the bug
When building GeoNetwork 4.2.11 and running the unit tests, the test XslUtilTest.testHtml2textSubstituteHtmlToTextLayoutElement fails only on Windows machines. The following error is given: [ERROR] Failures: [ERROR] XslUtilTest.testHtml2textSubstituteHtmlToTextLayoutElement:47 expected:<Sample text[ Sample text 2] Sample text 3> but was:<Sample text[ ]ample text 2 Sample text 3>
This unit test tries to substitute the following html <div><span>Sample text</span><br/><span>Sample text 2</span><br/><span>Sample text 3</span></div>, but before passing it to the html parser it replaces all <br/> elements with System.getProperty("line.separator"). On Unix machines this is \n, but on Windows it's \r\n. I'm not entirely sure how or why this causes problems further down the line, but it makes the unit test fail and halts the generation build process.
The function can be found here.
To Reproduce
Steps to reproduce the behavior:
Checkout tags/4.2.11 to your Windows machine.
Run mvn clean install -Penv-prod
Maven throws an error on the unit tests.
Expected behavior
All unit tests to pass and complete the build.
Screenshots
Desktop (please complete the following information):
OS: Windows 11
GeoNetwork Version: 4.2.11
Server Application: Java 8.
The text was updated successfully, but these errors were encountered:
Describe the bug
When building GeoNetwork 4.2.11 and running the unit tests, the test XslUtilTest.testHtml2textSubstituteHtmlToTextLayoutElement fails only on Windows machines. The following error is given:
[ERROR] Failures: [ERROR] XslUtilTest.testHtml2textSubstituteHtmlToTextLayoutElement:47 expected:<Sample text[ Sample text 2] Sample text 3> but was:<Sample text[ ]ample text 2 Sample text 3>
This unit test tries to substitute the following html
<div><span>Sample text</span><br/><span>Sample text 2</span><br/><span>Sample text 3</span></div>
, but before passing it to the html parser it replaces all<br/>
elements withSystem.getProperty("line.separator")
. On Unix machines this is\n
, but on Windows it's\r\n
. I'm not entirely sure how or why this causes problems further down the line, but it makes the unit test fail and halts the generation build process.The function can be found here.
To Reproduce
Steps to reproduce the behavior:
mvn clean install -Penv-prod
Expected behavior
All unit tests to pass and complete the build.
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: