rishabhdaim commented on code in PR #2781:
URL: https://github.com/apache/jackrabbit-oak/pull/2781#discussion_r2885337732
##########
oak-run/src/test/java/org/apache/jackrabbit/oak/run/DataStoreCommandTest.java:
##########
@@ -901,12 +901,44 @@ private static void assertFileEquals(File dump, String
prefix, Set<String> blobs
private static void assertFileEquals(File dump, String prefix, Set<String>
blobsAdded, String dirPrefix)
throws IOException {
File file = (dirPrefix == null) ? filterFiles(dump, prefix) :
filterFiles(dump, dirPrefix, prefix);
- Assert.assertNotNull(file);
+ if (file == null || !file.exists()) {
+ logFilesInDump(dump, prefix);
+ }
+ Assert.assertNotNull("Expected file with prefix " + prefix + " in " +
dump.getAbsolutePath(), file);
Assert.assertTrue(file.exists());
assertEquals(blobsAdded,
FileIOUtils.readStringsAsSet(new FileInputStream(file), true));
}
+ private static void logFilesInDump(File dump, String prefix) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("Expected file with prefix \"").append(prefix).append("\"
not found in ")
+ .append(dump.getAbsolutePath()).append(". Contents:");
+ if (!dump.exists()) {
+ sb.append(" directory does not exist");
+ } else {
+ appendFilesWithSizes(sb, dump, "");
+ }
+ log.warn(sb.toString());
Review Comment:
Just a nit-pick.
```suggestion
log.warn("{}", sb);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]