This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 741505b3c7d8c68a89cc250241e59aa89b719da2
Author: juanpablo <juanpa...@apache.org>
AuthorDate: Mon Jul 2 00:11:50 2018 +0200

    ensure CommentedPropertiesTest runs ok whatever the EOL of test.properties
---
 .../src/test/java/org/apache/wiki/util/CommentedPropertiesTest.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/jspwiki-war/src/test/java/org/apache/wiki/util/CommentedPropertiesTest.java 
b/jspwiki-war/src/test/java/org/apache/wiki/util/CommentedPropertiesTest.java
index 9fabde4..f440818 100644
--- 
a/jspwiki-war/src/test/java/org/apache/wiki/util/CommentedPropertiesTest.java
+++ 
b/jspwiki-war/src/test/java/org/apache/wiki/util/CommentedPropertiesTest.java
@@ -46,8 +46,10 @@ public class CommentedPropertiesTest
     {
         InputStream in = 
CommentedPropertiesTest.class.getClassLoader().getResourceAsStream( 
"test.properties" );
         m_props.load( in );
-        File m_propFile = getFile( "test.properties" );
-        m_propFileSize = ( int )m_propFile.length();
+        // CommentedProperties always internally uses \n as EOL, as opposed to 
a File which uses, well, the given EOL of the File.  
+        // Thus, executing this test when test.properties has another EOL 
(like f.ex when git cloning having core.autocrlf=true on
+        // windows) using File.length() would fail this test. 
+        m_propFileSize = m_props.toString().length();
         in.close();
     }
 

Reply via email to