io.vertx.core.cli.annotations.Description Java Examples

The following examples show how to use io.vertx.core.cli.annotations.Description. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OauthAuthorizationST.java    From strimzi-kafka-operator with Apache License 2.0 6 votes vote down vote up
@Disabled("Will be fixed in the new PR.")
@Description("As a member of team A, I can write to topics starting with 'x-' and " +
        "as a member of team B can read from topics starting with 'x-'")
@Test
@Order(5)
void testTeamAWriteToTopicStartingWithXAndTeamBReadFromTopicStartingWithX() {
    // only write means that Team A can not create new topic 'x-.*'
    String topicName = TOPIC_X + "-example";

    KafkaTopicResource.topic(CLUSTER_NAME, topicName).done();

    teamAOauthKafkaClient.setTopicName(topicName);

    assertThat(teamAOauthKafkaClient.sendMessagesTls(), is(MESSAGE_COUNT));

    teamBOauthKafkaClient.setTopicName(topicName);
    teamBOauthKafkaClient.setConsumerGroup("x_consumer_group_b");

    assertThat(teamBOauthKafkaClient.receiveMessagesTls(), is(MESSAGE_COUNT));
}
 
Example #2
Source File: OauthAuthorizationST.java    From strimzi-kafka-operator with Apache License 2.0 6 votes vote down vote up
@Description("As a member of team B, I should be able to write and read from topics that starts with b-")
@Test
@Order(4)
void testTeamBWriteToTopic() {
    LOGGER.info("Sending {} messages to broker with topic name {}", MESSAGE_COUNT, TOPIC_NAME);

    // Producer will not produce messages because authorization topic will failed. Team A can write only to topic starting with 'x-'
    assertThrows(WaitException.class, () -> teamBOauthKafkaClient.sendMessagesTls(Constants.GLOBAL_CLIENTS_EXCEPT_ERROR_TIMEOUT));

    LOGGER.info("Sending {} messages to broker with topic name {}", MESSAGE_COUNT, TOPIC_B);
    teamBOauthKafkaClient.setTopicName(TOPIC_B);

    teamBOauthKafkaClient.verifyProducedAndConsumedMessages(
        teamBOauthKafkaClient.sendMessagesTls(),
        teamBOauthKafkaClient.receiveMessagesTls()
    );
}
 
Example #3
Source File: ConfigCommand.java    From konduit-serving with Apache License 2.0 6 votes vote down vote up
@Option(longName = "output", shortName = "o", argName = "output-file")
@Description("Optional: If set, the generated json will be saved here. Otherwise, it's printed on the console.")
public void setOutputFile(String output) {
    outputFile = new File(output);
    if(outputFile.exists()) {
        if(!outputFile.isFile()) {
            log.error("'{}' is not a valid file location", outputFile);
        }
    } else {
        try {
            if(!outputFile.createNewFile()) {
                log.error("'{}' is not a valid file location", outputFile);
            }
        } catch (Exception exception) {
            log.error("Error while creating file: '{}'", outputFile, exception);
        }
    }
}
 
Example #4
Source File: ConfigCommand.java    From konduit-serving with Apache License 2.0 6 votes vote down vote up
@Option(longName = "pipeline", shortName = "p", argName = "config", required = true)
@Description("A comma-separated list of sequence/graph pipeline steps to create boilerplate configuration from. " +
        "For sequences, allowed values are: " +
        "[crop_grid, crop_fixed_grid, dl4j, draw_bounding_box, draw_fixed_grid, draw_grid, " +
        "draw_segmentation, extract_bounding_box, camera_frame_capture, video_frame_capture" +
        "image_to_ndarray, logging, ssd_to_bounding_box, samediff, show_image, tensorflow]. " +
        "For graphs, the list item should be in the format '<output>=<type>(<inputs>)' or " +
        "'[outputs]=switch(<inputs>)' for switches. The pre-defined root input is named, 'input'. " +
        "Examples are ==> " +
        "Pipeline step: 'a=tensorflow(input),b=dl4j(input)' " +
        "Merge Step: 'c=merge(a,b)' " +
        "Switch Step (int): '[d1,d2,d3]=switch(int,select,input)' " +
        "Switch Step (string): '[d1,d2,d3]=switch(string,select,x:1,y:2,z:3,input)'" +
        "Any Step: 'e=any(d1,d2,d3)' " +
        "See the examples above for more usage information.")
public void setPipeline(String pipelineString) {
    this.pipelineString = pipelineString;
}
 
Example #5
Source File: ConfigCommand.java    From konduit-serving with Apache License 2.0 6 votes vote down vote up
@Option(longName = "output", shortName = "o", argName = "output-file")
@Description("Optional: If set, the generated json/yaml will be saved here. Otherwise, it's printed on the console.")
public void setOutputFile(String output) {
    outputFile = new File(output);
    if(outputFile.exists()) {
        if(!outputFile.isFile()) {
            System.out.format("'%s' is not a valid file location%n", outputFile);
            System.exit(1);
        }
    } else {
        try {
            if(!outputFile.createNewFile()) {
                System.out.format("'%s' is not a valid file location%n", outputFile);
                System.exit(1);
            }
        } catch (Exception exception) {
            System.out.format("Error while creating file: '%s'%n", outputFile);
            exception.printStackTrace();
            System.exit(1);
        }
    }
}
 
Example #6
Source File: BusPublish.java    From vertx-shell with Apache License 2.0 5 votes vote down vote up
@Option(longName = "header", acceptMultipleValues = true)
@Description("add an header formatted as header_name:header_value")
public void setHeaders(List<String> headers) {
  for (String header : headers) {
    Matcher matcher = HEADER_PATTERN.matcher(header);
    if (!matcher.matches()) {
      throw new IllegalArgumentException("Invalid header value, use: --header foo:bar");
    }
    options.addHeader(matcher.group(1), matcher.group(2));
  }
}
 
Example #7
Source File: OauthPlainST.java    From strimzi-kafka-operator with Apache License 2.0 5 votes vote down vote up
@Description(
        "As an oauth producer, I should be able to produce messages to the kafka broker\n" +
        "As an oauth consumer, I should be able to consumer messages from the kafka broker.")
@Test
void testProducerConsumer() {
    oauthExternalKafkaClient.setClusterName(CLUSTER_NAME);

    oauthExternalKafkaClient.verifyProducedAndConsumedMessages(
        oauthExternalKafkaClient.sendMessagesPlain(),
        oauthExternalKafkaClient.receiveMessagesPlain()
    );
}
 
Example #8
Source File: OauthAuthorizationST.java    From strimzi-kafka-operator with Apache License 2.0 5 votes vote down vote up
@Description("As a member of team A, I should be able to read and write to all topics starting with a-")
@Test
@Order(1)
void smokeTestForClients() {
    teamAOauthKafkaClient.verifyProducedAndConsumedMessages(
        teamAOauthKafkaClient.sendMessagesTls(),
        teamAOauthKafkaClient.receiveMessagesTls()
    );
}
 
Example #9
Source File: OauthTlsST.java    From strimzi-kafka-operator with Apache License 2.0 5 votes vote down vote up
@Description(
        "As an oauth producer, I am able to produce messages to the kafka broker\n" +
        "As an oauth consumer, I am able to consumer messages from the kafka broker using encrypted communication")
@Test
void testProducerConsumer() {
    oauthExternalKafkaClientTls.verifyProducedAndConsumedMessages(
        oauthExternalKafkaClientTls.sendMessagesTls(),
        oauthExternalKafkaClientTls.receiveMessagesTls()
    );
}
 
Example #10
Source File: ConfigCommand.java    From konduit-serving with Apache License 2.0 5 votes vote down vote up
@Option(longName = "protocol", shortName = "pr")
@Description("Protocol to use with the server. Allowed values are [http, grpc, mqtt]")
public void setYaml(String protocol) {
    try {
        this.protocol = ServerProtocol.valueOf(protocol.toUpperCase());
    } catch (Exception exception) {
        System.out.format("Protocol can only be one of %s. Given %s%n",
                Arrays.toString(ServerProtocol.values()), protocol);
        exception.printStackTrace();
        System.exit(1);
    }
}
 
Example #11
Source File: BusSend.java    From vertx-shell with Apache License 2.0 4 votes vote down vote up
@Option(longName = "timeout")
@Description("the send timeout")
public void setTimeout(long timeout) {
  options.setSendTimeout(timeout);
}
 
Example #12
Source File: LocalMapRm.java    From vertx-shell with Apache License 2.0 4 votes vote down vote up
@Argument(index = 1, argName = "keys")
@Description("the keys to get")
public void setKeys(List<String> keys) {
  this.keys = keys;
}
 
Example #13
Source File: BusSend.java    From vertx-shell with Apache License 2.0 4 votes vote down vote up
@Option(longName = "reply", flag = true)
@Description("wait for a reply and print it on the console")
public void setReply(boolean reply) {
  this.reply = reply;
}
 
Example #14
Source File: FileSystemCd.java    From vertx-shell with Apache License 2.0 4 votes vote down vote up
@Argument(index = 0, argName = "dir", required = false)
@Description("the new working dir")
public void setDir(String dir) {
  this.dir = dir;
}
 
Example #15
Source File: LocalMapRm.java    From vertx-shell with Apache License 2.0 4 votes vote down vote up
@Argument(index = 0, argName = "map", required = false)
@Description("the name of the map to get from")
public void setMap(String map) {
  this.map = map;
}
 
Example #16
Source File: VerticleUndeploy.java    From vertx-shell with Apache License 2.0 4 votes vote down vote up
@Argument(index = 0, argName = "id")
@Description("the verticle id")
public void setId(String id) {
  this.id = id;
}
 
Example #17
Source File: FileSystemLs.java    From vertx-shell with Apache License 2.0 4 votes vote down vote up
@Option(shortName = "l", flag = true)
@Description("list in long format")
public void setEll(boolean ell) {
  this.ell = ell;
}
 
Example #18
Source File: BusPublish.java    From vertx-shell with Apache License 2.0 4 votes vote down vote up
@Option(longName = "type")
@Description("the object type")
public void setType(ObjectType type) {
  this.type = type;
}
 
Example #19
Source File: BusPublish.java    From vertx-shell with Apache License 2.0 4 votes vote down vote up
@Option(longName = "verbose", flag = true)
@Description("verbose output")
public void setVerbose(boolean verbose) {
  this.verbose = verbose;
}
 
Example #20
Source File: FileSystemLs.java    From vertx-shell with Apache License 2.0 4 votes vote down vote up
@Argument(index = 0, argName = "file", required = false)
@Description("the file to list")
@DefaultValue(".")
public void setFile(String file) {
  this.file = file;
}
 
Example #21
Source File: LocalMapGet.java    From vertx-shell with Apache License 2.0 4 votes vote down vote up
@Argument(index = 1, argName = "keys", required = false)
@Description("the keys to get")
public void setKeys(List<String> keys) {
  this.keys = keys;
}
 
Example #22
Source File: FileSystemLs.java    From vertx-shell with Apache License 2.0 4 votes vote down vote up
@Option(longName = "all", shortName = "a", required = false)
@Description("include files that begins with .")
public void setAll(boolean all) {
  this.all = all;
}
 
Example #23
Source File: LocalMapGet.java    From vertx-shell with Apache License 2.0 4 votes vote down vote up
@Argument(index = 0, argName = "map")
@Description("the name of the map to get from")
public void setMap(String map) {
  this.map = map;
}
 
Example #24
Source File: LocalMapPut.java    From vertx-shell with Apache License 2.0 4 votes vote down vote up
@Argument(index = 1, argName = "key", required = false)
@Description("the key to put")
public void setKey(String key) {
  this.key = key;
}
 
Example #25
Source File: BusTail.java    From vertx-shell with Apache License 2.0 4 votes vote down vote up
@Argument(index =  0, argName = "address")
@Description("the bus address destination")
public void setAddresses(List<String> addresses) {
  this.addresses = addresses;
}
 
Example #26
Source File: BusTail.java    From vertx-shell with Apache License 2.0 4 votes vote down vote up
@Option(longName = "verbose", flag = true)
@Description("verbose output")
public void setVerbose(boolean verbose) {
  this.verbose = verbose;
}
 
Example #27
Source File: BusTail.java    From vertx-shell with Apache License 2.0 4 votes vote down vote up
@Option(longName = "local", flag = true)
@Description("subscribe to a local address")
public void setLocal(boolean local) {
  this.local = local;
}
 
Example #28
Source File: TestCommand.java    From vertx-unit with Apache License 2.0 4 votes vote down vote up
@Option(longName = "test", argName = "test")
@Description("Select one or several tests to run")
public void setTest(String test) {
  this.test = test;
}
 
Example #29
Source File: TestCommand.java    From vertx-unit with Apache License 2.0 4 votes vote down vote up
@Option(longName = "report", argName = "report")
@Description("Report the execution to a file in JUnit XML format")
public void setReport(boolean report) {
  // Todo report dir ????
  this.report = report;
}
 
Example #30
Source File: TestCommand.java    From vertx-unit with Apache License 2.0 4 votes vote down vote up
@Option(longName = "timeout", argName = "timeout")
@Description("Set the test suite timeout in millis")
public void setTimeout(long timeout) {
  this.timeout = timeout;
}