antonovsergey93 commented on a change in pull request #6336: IGNITE-10896
URL: https://github.com/apache/ignite/pull/6336#discussion_r270811632
 
 

 ##########
 File path: 
modules/core/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
 ##########
 @@ -1365,6 +1365,136 @@ public void testCacheIdleVerifyDump() throws Exception 
{
             fail("Should be found both files");
     }
 
+    /**
+     * Common method for idle_verify tests with multiple options.
+     *
+     * @throws Exception if failed
+     */
+    @Test
+    public void testCacheIdleVerifyMultipleOptions()
+            throws Exception {
+        IgniteEx ignite = (IgniteEx)startGrids(2);
+
+        ignite.cluster().active(true);
+
+        ignite.createCache(new CacheConfiguration<>()
+                .setAffinity(new RendezvousAffinityFunction(false, 32))
+                .setGroupName("shared_grp")
+                .setBackups(1)
+                .setName(DEFAULT_CACHE_NAME));
+
+        ignite.createCache(new CacheConfiguration<>()
+                .setAffinity(new RendezvousAffinityFunction(false, 32))
+                .setGroupName("shared_grp")
+                .setBackups(1)
+                .setName(DEFAULT_CACHE_NAME + "_second"));
+
+        ignite.createCache(new CacheConfiguration<>()
+                .setAffinity(new RendezvousAffinityFunction(false, 64))
+                .setBackups(1)
+                .setName(DEFAULT_CACHE_NAME + "_third"));
+
+        ignite.createCache(new CacheConfiguration<>()
+                .setAffinity(new RendezvousAffinityFunction(false, 128))
+                .setBackups(1)
+                .setName("wrong_cache"));
+
+        injectTestSystemOut();
+
+        testCacheIdleVerifyMultipleRunWithDump(
+            true,
+            "idle_verify check has finished, found 100 partitions",
+            "idle_verify task args were following: --cache-filter SYSTEM 
--exclude-caches wrong.* ",
+            "--cache", "idle_verify", "--dump", "--cache-filter", "SYSTEM", 
"--exclude-caches", "wrong.*"
+        );
+        testCacheIdleVerifyMultipleRunWithDump(
+            true,
+            "idle_verify check has finished, found 96 partitions",
+            null,
+            "--cache", "idle_verify", "--dump", ".*", "--exclude-caches", 
"wrong.*"
+        );
+        testCacheIdleVerifyMultipleRunWithDump(
+            true,
+            "idle_verify check has finished, found 32 partitions",
+            null,
+            "--cache", "idle_verify", "--dump", "shared.*", "--cache-filter", 
"ALL"
+        );
+        testCacheIdleVerifyMultipleRunWithDump(
+            true,
+            "idle_verify check has finished, found 160 partitions",
+            null,
+            "--cache", "idle_verify", "--dump", "shared.*,wrong.*", 
"--cache-filter", "ALL"
+        );
+
+        testCacheIdleVerifyMultipleRunWithDump(
+            true,
+            "idle_verify check has finished, found 160 partitions",
+            null,
+            "--cache", "idle_verify", "--dump", "shared.*,wrong.*", 
"--cache-filter", "ALL"
+        );
+        testCacheIdleVerifyMultipleRunWithDump(
+            true,
+            "idle_verify check has finished, found 160 partitions",
+            null,
+            "--cache", "idle_verify", "--dump", "shared.*,wrong.*", 
"--cache-filter", "ALL"
+        );
+        testCacheIdleVerifyMultipleRunWithDump(
+            true,
+            "idle_verify failed on 2 nodes.",
+            null,
+            "--cache", "idle_verify", "--exclude-caches", ".*"
+        );
+        testCacheIdleVerifyMultipleRunWithDump(
+            false,
+            "idle_verify failed on 2 nodes.",
+            null,
+            "--cache", "idle_verify", "--dump", "--exclude-caches", "["
+        );
+        testCacheIdleVerifyMultipleRunWithDump(
+            true,
+            null,
+            null,
+            "--cache", "idle_verify", ".*", "--exclude-caches", "wrong-.*"
+        );
+    }
+
+    /**
+     * Runs idle_verify with specified arguments and checks the dump if dump 
option was present.
+     *
+     * @param exitOk whether CommandHandler should exit without errors
+     * @param outputExp expected dump output
+     * @param cmdExp expected command built from command line arguments
+     * @param args command handler arguments
+     * @throws IOException if some of file operations failed
+     */
+    private void testCacheIdleVerifyMultipleRunWithDump(
 
 Review comment:
   Method's name doesn't relates with logic. Please rename it. 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to