Details
Description
In the following call to StringUtils.join(), "\n" is treated as an element, not as a separator:
assertEquals("listStatus on empty root-directory returned found: " + join("\n", rootListStatus), 0, rootListStatus.length);
Expected output:
[ERROR] Tests run: 9, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.711 s <<< FAILURE! - in org.apache.hadoop.fs.contract.hdfs.TestHDFSContractRootDirectory
[ERROR] testListEmptyRootDirectory(org.apache.hadoop.fs.contract.hdfs.TestHDFSContractRootDirectory) Time elapsed: 0.011 s <<< FAILURE!
java.lang.AssertionError: listStatus on empty root-directory returned found: HdfsLocatedFileStatus{path=hdfs://localhost:37225/test; isDirectory=true; ...} expected:<0> but was:<1>
at org.junit.Assert.fail(Assert.java:89)
at org.junit.Assert.failNotEquals(Assert.java:835)
at org.junit.Assert.assertEquals(Assert.java:647)
at org.apache.hadoop.fs.contract.AbstractContractRootDirectoryTest.testListEmptyRootDirectory(AbstractContractRootDirectoryTest.java:199)
Actual output:
[ERROR] Tests run: 9, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.708 s <<< FAILURE! - in org.apache.hadoop.fs.contract.hdfs.TestHDFSContractRootDirectory [ERROR] testListEmptyRootDirectory(org.apache.hadoop.fs.contract.hdfs.TestHDFSContractRootDirectory) Time elapsed: 0.011 s <<< FAILURE! java.lang.AssertionError: listStatus on empty root-directory returned found: [Lorg.apache.hadoop.fs.FileStatus;@73344c46 expected:<0> but was:<1> at org.junit.Assert.fail(Assert.java:89) at org.junit.Assert.failNotEquals(Assert.java:835) at org.junit.Assert.assertEquals(Assert.java:647) at org.apache.hadoop.fs.contract.AbstractContractRootDirectoryTest.testListEmptyRootDirectory(AbstractContractRootDirectoryTest.java:199)