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

khmarbaise pushed a commit to branch MSHARED-685
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git

commit 82a6ed7db6aadd7e23ec0aea1049f23d1f37cfc8
Author: Karl Heinz Marbaise <khmarba...@apache.org>
AuthorDate: Fri Feb 23 19:42:33 2018 +0100

    [MSHARED-685] - DirectoryScanner#checkSymlinkBehaviour() does not use
    assert*
     o Replaced System.out.* with real checkings.
---
 .../shared/utils/io/DirectoryScannerTest.java      | 32 ++++++++++++++++++++--
 .../maven/shared/utils/xml/XmlWriterUtilTest.java  |  1 -
 2 files changed, 29 insertions(+), 4 deletions(-)

diff --git 
a/src/test/java/org/apache/maven/shared/utils/io/DirectoryScannerTest.java 
b/src/test/java/org/apache/maven/shared/utils/io/DirectoryScannerTest.java
index e331db9..26b114a 100644
--- a/src/test/java/org/apache/maven/shared/utils/io/DirectoryScannerTest.java
+++ b/src/test/java/org/apache/maven/shared/utils/io/DirectoryScannerTest.java
@@ -33,6 +33,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
+import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assume.assumeFalse;
@@ -132,9 +133,34 @@ public class DirectoryScannerTest
         String[] includedDirectories = ds.getIncludedDirectories();
         String[] files = ds.getIncludedFiles();
         
-        //FIXME: This should be changed to some kind of assert...WhatEver()...
-        System.out.println( "files = " + files );
-
+        assertEquals( 9, files.length );
+        assertEquals( 5,  includedDirectories.length );
+        
+        //@formatter:off
+        String[] expectedFiles = { 
+            "aRegularDir/aRegularFile.txt", 
+            "fileR.txt", 
+            "fileW.txt", 
+            "fileX.txt", 
+            "symLinkToFileOnTheOutside",
+            "symR",
+            "symW",
+            "symX",
+            "targetDir/targetFile.txt",
+        };
+        //@formatter:on
+        assertArrayEquals( expectedFiles, files );
+
+        //@formatter:off
+        String[] expectedDirs = {
+            "",
+            "aRegularDir",
+            "symDir",
+            "symLinkToDirOnTheOutside",
+            "targetDir",
+        };
+        //@formatter:on
+        assertArrayEquals( expectedDirs, includedDirectories );
 
     }
 
diff --git 
a/src/test/java/org/apache/maven/shared/utils/xml/XmlWriterUtilTest.java 
b/src/test/java/org/apache/maven/shared/utils/xml/XmlWriterUtilTest.java
index 894774a..67a3283 100644
--- a/src/test/java/org/apache/maven/shared/utils/xml/XmlWriterUtilTest.java
+++ b/src/test/java/org/apache/maven/shared/utils/xml/XmlWriterUtilTest.java
@@ -72,7 +72,6 @@ public class XmlWriterUtilTest
     {
         XmlWriterUtil.writeLineBreak( xmlWriter );
         writer.close();
-        System.out.println( "output = " + output.toString() + "x");
         assertTrue( StringUtils.countMatches( output.toString(), 
XmlWriterUtil.LS ) == 1 );
     }
 

-- 
To stop receiving notification emails like this one, please contact
khmarba...@apache.org.

Reply via email to