Flaugh24 commented on code in PR #1502:
URL: https://github.com/apache/ignite-3/pull/1502#discussion_r1072406356
##########
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/core/repl/executor/ItIgnitePicocliCommandsTest.java:
##########
@@ -356,6 +359,76 @@ void startStopNodeWhenCompleteNodeName() {
await().until(() -> complete(givenParsedLine),
containsInAnyOrder(allNodeNames().toArray()));
}
+ @Test
+ @DisplayName("jdbc url suggested after --jdbc-url option")
+ void suggestedJdbcUrl() {
+ // Given
+ connected();
+ // And the first update is fetched
+ await().until(() -> jdbcUrlRegistry.jdbcUrls(), not(empty()));
+
+ // Then
+ List<String> completions = complete(words("sql", "--jdbc-url", ""));
+ assertThat(completions,
containsInAnyOrder(jdbcUrlRegistry.jdbcUrls().toArray()));
+ }
+
+ private Stream<Arguments> clusterUrlSource() {
+ return Stream.of(
+ words("cluster", "config", "show", "--cluster-endpoint-url",
""),
+ words("cluster", "config", "update", "--cluster-endpoint-url",
""),
+ words("cluster", "status", "--cluster-endpoint-url", ""),
+ words("cluster", "init", "--cluster-endpoint-url", "")
+ ).map(this::named).map(Arguments::of);
+ }
+
+ @ParameterizedTest
+ @MethodSource("clusterUrlSource")
+ @DisplayName("cluster url suggested after --cluster-endpoint-url option")
+ void suggestedClusterUrl(ParsedLine parsedLine) {
+ // Given
+ connected();
+ // And the first update is fetched
+ await().until(() -> nodeNameRegistry.urls(), not(empty()));
+
+ // Then
+ String[] expectedUrls =
nodeNameRegistry.urls().stream().map(URL::toString).toArray(String[]::new);
+ assertThat("For given parsed words: " + parsedLine.words(),
+ complete(parsedLine),
+ containsInAnyOrder(expectedUrls));
+ }
+
+ @Test
+ @DisplayName("files suggested after -script-file option")
+ void suggestedScriptFile() {
+
Review Comment:
done
--
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]