Erixonich commented on a change in pull request #9023:
URL: https://github.com/apache/ignite/pull/9023#discussion_r621502685
##########
File path:
modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexForceRebuildTest.java
##########
@@ -476,40 +507,79 @@ public void testCorruptedIndexRebuild() throws Exception {
}
/**
- * Validated control.sh utility output for {@link #testCacheNamesArg()}.
+ * Validates control.sh output when caches by name not found.
+ *
+ * @param outputStr control.sh output.
+ * @param cacheGroupsToNames maping cache groups to non-existing cache
names.
*/
- private void validateTestCacheNamesArgOutput() {
- String outputStr = testOut.toString();
-
- assertTrue(outputStr.contains("WARNING: These caches were not
found:\n" +
- " " + CACHE_NAME_NON_EXISTING));
+ private void validateOutputCacheNamesNotFound(String outputStr,
Multimap<String, String> cacheGroupsToNames) {
+ String cacheNames = INDENT + String.join(INDENT,
cacheGroupsToNames.values());
- assertTrue(outputStr.contains("WARNING: These caches have indexes
rebuilding in progress:\n" +
- " groupName=" + GRP_NAME_2 + ", cacheName=" + CACHE_NAME_2_1));
+ assertContains(
+ log,
+ outputStr,
+ "WARNING: These caches were not found:\n" + cacheNames
+ );
+ }
- assertTrue(outputStr.contains("Indexes rebuild was started for these
caches:\n" +
- " groupName=" + GRP_NAME_1 + ", cacheName=" + CACHE_NAME_1_1));
+ /**
+ * Validates control.sh output when caches by group not found.
+ *
+ * @param outputStr control.sh output.
+ * @param cacheGroupsToNames maping cache groups to non-existing cache
names.
+ */
+ private void validateOutputCacheGroupsNotFound(String outputStr,
Multimap<String, String> cacheGroupsToNames) {
+ String cacheNames = INDENT + String.join(INDENT,
cacheGroupsToNames.keys());
- assertEquals("Unexpected number of lines in output.", 19,
outputStr.split("\n").length);
+ assertContains(
+ log,
+ outputStr,
+ "WARNING: These cache groups were not found:\n" + cacheNames
+ );
}
/**
- * Validated control.sh utility output for {@link #testGroupNamesArg()}.
+ * Makes formatted text for given caches.
+ *
+ * @param cacheGroputToNames Cache groups mapping to non-existing cache
names.
+ * @return text for CLI print output for given caches.
*/
- private void validateTestCacheGroupArgOutput() {
- String outputStr = testOut.toString();
+ private String makeStringListForCacheGroupsAndNames(Multimap<String,
String> cacheGroputToNames) {
Review comment:
Substitution with Map<String, List<String>> makes body of method
complicated. I think removing Multimap to simplify method makes it more
complicated
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]