Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.UUID;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
Expand Down Expand Up @@ -93,6 +94,8 @@
import org.apache.ignite.internal.util.typedef.T2;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.ListeningTestLogger;
import org.apache.ignite.testframework.LogListener;
import org.apache.ignite.testframework.junits.SystemPropertiesRule;
import org.apache.ignite.testframework.junits.WithSystemProperty;
import org.jetbrains.annotations.Nullable;
Expand All @@ -110,6 +113,7 @@
import static org.apache.ignite.internal.commandline.ArgumentParser.CMD_VERBOSE;
import static org.apache.ignite.internal.commandline.CommandHandler.DFLT_HOST;
import static org.apache.ignite.internal.commandline.CommandHandler.DFLT_PORT;
import static org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK;
import static org.apache.ignite.internal.management.api.CommandUtils.cmdText;
import static org.apache.ignite.internal.management.api.CommandUtils.executable;
import static org.apache.ignite.internal.management.api.CommandUtils.visitCommandParams;
Expand All @@ -130,6 +134,21 @@
*/
@WithSystemProperty(key = IGNITE_ENABLE_EXPERIMENTAL_COMMAND, value = "true")
public class CommandHandlerParsingTest {
/** */
@Test
public void testCacheListHelpDescribesRegexPattern() {
ListeningTestLogger testLog = new ListeningTestLogger();
LogListener regexDescription = LogListener.matches(Pattern.compile(
"regexPattern\\s+- Java regular expression for filtering cache, group, or sequence names.*" +
"'\\^account-\\.\\*' matches names starting with 'account-'"
)).build();

testLog.registerListener(regexDescription);

assertEquals(EXIT_CODE_OK, new CommandHandler(testLog).execute(asList("--cache", "help")));
assertTrue(regexDescription.check());
}

/** */
@ClassRule public static final TestRule classRule = new SystemPropertiesRule();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public class CacheListCommandArg extends IgniteDataTransferObject {
/** */
@Order(0)
@Positional
@Argument(example = "regexPattern")
@Argument(description = "Java regular expression for filtering cache, group, or sequence names. " +
"Examples: '.' matches all names, '^account-.*' matches names starting with 'account-'", example = "regexPattern")
String regex;

/** */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Arguments: --cache help --yes
control.(sh|bat) --cache list regexPattern [nodeId] [--config] [--output-format multi-line] [--groups|--seq]

Parameters:
regexPattern - Java regular expression for filtering cache, group, or sequence names. Examples: '.' matches all names, '^account-.*' matches names starting with 'account-'.
--config - print all configuration parameters for each cache.
--output-format multi-line - print configuration parameters per line. This option has effect only when used with --config and without [--groups|--seq].
--groups - print information about groups.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Arguments: --cache help --yes
control.(sh|bat) --cache list regexPattern [nodeId] [--config] [--output-format multi-line] [--groups|--seq]

Parameters:
regexPattern - Java regular expression for filtering cache, group, or sequence names. Examples: '.' matches all names, '^account-.*' matches names starting with 'account-'.
--config - print all configuration parameters for each cache.
--output-format multi-line - print configuration parameters per line. This option has effect only when used with --config and without [--groups|--seq].
--groups - print information about groups.
Expand Down