@@ -185,7 +185,7 @@ public static void writeDataset(FileSystem fs,
185
185
public static void writeDataset (FileSystem fs , Path path , byte [] src ,
186
186
int len , int buffersize , boolean overwrite , boolean useBuilder )
187
187
throws IOException {
188
- assertTrue (src .length >= len ,
188
+ assertTrue (src .length >= len ,
189
189
"Not enough data in source array to write " + len + " bytes" );
190
190
FSDataOutputStream out ;
191
191
if (useBuilder ) {
@@ -340,7 +340,7 @@ public static void verifyRead(FSDataInputStream stm, byte[] fileContents,
340
340
public static void compareByteArrays (byte [] original ,
341
341
byte [] received ,
342
342
int len ) {
343
- assertEquals (len , received .length ,
343
+ assertEquals (len , received .length ,
344
344
"Number of bytes read != number written" );
345
345
int errors = 0 ;
346
346
int firstErrorByte = -1 ;
@@ -485,7 +485,7 @@ public static boolean rm(FileSystem fileSystem,
485
485
public static void rename (FileSystem fileSystem , Path src , Path dst )
486
486
throws IOException {
487
487
rejectRootOperation (src , false );
488
- assertTrue (fileSystem .rename (src , dst ),
488
+ assertTrue (fileSystem .rename (src , dst ),
489
489
"rename(" + src + ", " + dst + ") failed" );
490
490
assertPathDoesNotExist (fileSystem , "renamed source dir" , src );
491
491
}
@@ -613,7 +613,7 @@ public static Object fail(String text, Throwable thrown) {
613
613
public static void assertFileHasLength (FileSystem fs , Path path ,
614
614
int expected ) throws IOException {
615
615
FileStatus status = fs .getFileStatus (path );
616
- assertEquals (expected , status .getLen (),
616
+ assertEquals (expected , status .getLen (),
617
617
"Wrong file length of file " + path + " status: " + status );
618
618
}
619
619
@@ -635,7 +635,7 @@ public static void assertIsDirectory(FileSystem fs,
635
635
* @param fileStatus stats to check
636
636
*/
637
637
public static void assertIsDirectory (FileStatus fileStatus ) {
638
- assertTrue (fileStatus .isDirectory (),
638
+ assertTrue (fileStatus .isDirectory (),
639
639
"Should be a directory -but isn't: " + fileStatus );
640
640
}
641
641
@@ -662,7 +662,7 @@ public static void assertErasureCoded(final FileSystem fs, final Path path)
662
662
public static void assertNotErasureCoded (final FileSystem fs ,
663
663
final Path path ) throws IOException {
664
664
FileStatus fileStatus = fs .getFileStatus (path );
665
- assertFalse (fileStatus .isErasureCoded (),
665
+ assertFalse (fileStatus .isErasureCoded (),
666
666
path + " should not be erasure coded!" );
667
667
}
668
668
@@ -962,9 +962,9 @@ public static void assertIsFile(FileContext fileContext, Path filename)
962
962
*/
963
963
public static void assertIsFile (Path filename , FileStatus status ) {
964
964
String fileInfo = filename + " " + status ;
965
- assertFalse (status .isDirectory (),
965
+ assertFalse (status .isDirectory (),
966
966
"File claims to be a directory " + fileInfo );
967
- assertFalse (status .isSymlink (),
967
+ assertFalse (status .isSymlink (),
968
968
"File claims to be a symlink " + fileInfo );
969
969
}
970
970
@@ -1130,7 +1130,7 @@ public static void assertListStatusFinds(FileSystem fs,
1130
1130
found = true ;
1131
1131
}
1132
1132
}
1133
- assertTrue (found ,
1133
+ assertTrue (found ,
1134
1134
"Path " + subdir + " not found in directory " + dir + ":" + builder );
1135
1135
}
1136
1136
@@ -1174,7 +1174,7 @@ public static void validateFileContent(byte[] concat, byte[][] bytes) {
1174
1174
break ;
1175
1175
}
1176
1176
}
1177
- assertFalse (mismatch ,
1177
+ assertFalse (mismatch ,
1178
1178
"File content of file is not as expected at offset " + idx );
1179
1179
}
1180
1180
@@ -1710,21 +1710,21 @@ public static List<LocatedFileStatus> toListThroughNextCallsAlone(
1710
1710
public static void assertCapabilities (
1711
1711
Object stream , String [] shouldHaveCapabilities ,
1712
1712
String [] shouldNotHaveCapabilities ) {
1713
- assertTrue (stream instanceof StreamCapabilities ,
1713
+ assertTrue (stream instanceof StreamCapabilities ,
1714
1714
"Stream should be instanceof StreamCapabilities" );
1715
1715
1716
1716
StreamCapabilities source = (StreamCapabilities ) stream ;
1717
1717
if (shouldHaveCapabilities != null ) {
1718
1718
for (String shouldHaveCapability : shouldHaveCapabilities ) {
1719
- assertTrue (source .hasCapability (shouldHaveCapability ),
1719
+ assertTrue (source .hasCapability (shouldHaveCapability ),
1720
1720
"Should have capability: " + shouldHaveCapability
1721
1721
+ " in " + source );
1722
1722
}
1723
1723
}
1724
1724
1725
1725
if (shouldNotHaveCapabilities != null ) {
1726
1726
for (String shouldNotHaveCapability : shouldNotHaveCapabilities ) {
1727
- assertFalse (source .hasCapability (shouldNotHaveCapability ),
1727
+ assertFalse (source .hasCapability (shouldNotHaveCapability ),
1728
1728
"Should not have capability: " + shouldNotHaveCapability
1729
1729
+ " in " + source );
1730
1730
}
@@ -1772,7 +1772,7 @@ public static void assertHasPathCapabilities(
1772
1772
final String ...capabilities ) throws IOException {
1773
1773
1774
1774
for (String shouldHaveCapability : capabilities ) {
1775
- assertTrue (source .hasPathCapability (path , shouldHaveCapability ),
1775
+ assertTrue (source .hasPathCapability (path , shouldHaveCapability ),
1776
1776
"Should have capability: " + shouldHaveCapability
1777
1777
+ " under " + path
1778
1778
+ " in " + source );
@@ -1793,7 +1793,7 @@ public static void assertLacksPathCapabilities(
1793
1793
final String ...capabilities ) throws IOException {
1794
1794
1795
1795
for (String shouldHaveCapability : capabilities ) {
1796
- assertFalse (source .hasPathCapability (path , shouldHaveCapability ),
1796
+ assertFalse (source .hasPathCapability (path , shouldHaveCapability ),
1797
1797
"Path must not support capability: " + shouldHaveCapability
1798
1798
+ " under " + path );
1799
1799
}
@@ -2019,11 +2019,11 @@ public int hashCode() {
2019
2019
*/
2020
2020
public void assertSizeEquals (String text , long f , long d , long o ) {
2021
2021
String self = dump ();
2022
- assertEquals (f , getFileCount (),
2022
+ assertEquals (f , getFileCount (),
2023
2023
text + ": file count in " + self );
2024
- assertEquals (d , getDirCount (),
2024
+ assertEquals (d , getDirCount (),
2025
2025
text + ": directory count in " + self );
2026
- assertEquals (o , getOtherCount (),
2026
+ assertEquals (o , getOtherCount (),
2027
2027
text + ": 'other' count in " + self );
2028
2028
}
2029
2029
0 commit comments