use of com.datastax.oss.dsbulk.runner.cli.CommandLineParser in project dsbulk by datastax.
the class DataStaxBulkLoaderTest method should_process_json_short_options.
@ParameterizedTest
@MethodSource
void should_process_json_short_options(String shortOptionName, String shortOptionValue, String setting, Object expected) throws Exception {
Config result = new CommandLineParser("load", "-c", "json", shortOptionName, shortOptionValue).parse().getConfig();
assertThat(result.getAnyRef(setting)).isEqualTo(expected);
}
use of com.datastax.oss.dsbulk.runner.cli.CommandLineParser in project dsbulk by datastax.
the class DataStaxBulkLoaderTest method should_accept_escaped_backslash.
@Test
void should_accept_escaped_backslash() throws Exception {
// backslashes should be provided escaped as valid HOCON
Config result = new CommandLineParser("load", "--connector.csv.url", "C:\\\\Users").parse().getConfig();
assertThat(result.getString("dsbulk.connector.csv.url")).isEqualTo("C:\\Users");
}
use of com.datastax.oss.dsbulk.runner.cli.CommandLineParser in project dsbulk by datastax.
the class DataStaxBulkLoaderTest method should_propagate_references.
@Test
void should_propagate_references() throws Exception {
Config result = new CommandLineParser("load", "--driver.basic.request.timeout", "10 minutes", "--driver.basic.request.page-size", "1234").parse().getConfig();
assertThat(result.getString("datastax-java-driver.basic.request.timeout")).isEqualTo("10 minutes");
assertThat(result.getString("datastax-java-driver.advanced.metadata.schema.request-timeout")).isEqualTo("10 minutes");
assertThat(result.getString("datastax-java-driver.basic.request.page-size")).isEqualTo("1234");
assertThat(result.getString("datastax-java-driver.advanced.metadata.schema.request-page-size")).isEqualTo("1234");
}
use of com.datastax.oss.dsbulk.runner.cli.CommandLineParser in project dsbulk by datastax.
the class DataStaxBulkLoaderTest method should_accept_escaped_control_char.
@Test
void should_accept_escaped_control_char() throws Exception {
// control chars should be provided escaped as valid HOCON
Config result = new CommandLineParser("load", "--connector.csv.delimiter", "\\t").parse().getConfig();
assertThat(result.getString("dsbulk.connector.csv.delimiter")).isEqualTo("\t");
}
Aggregations