use of com.datastax.oss.dsbulk.runner.cli.CommandLineParser in project dsbulk by datastax.
the class DataStaxBulkLoaderTest method should_not_add_quote_if_already_quoted.
@Test
void should_not_add_quote_if_already_quoted() throws Exception {
// double quotes 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");
}
use of com.datastax.oss.dsbulk.runner.cli.CommandLineParser in project dsbulk by datastax.
the class DataStaxBulkLoaderTest method should_not_accept_parse_error.
@Test
void should_not_accept_parse_error() {
ParseException error = catchThrowableOfType(() -> new CommandLineParser("load", "--codec.booleanStrings", "[a,b").parse(), ParseException.class);
assertThat(error).hasMessageContaining("Invalid value for dsbulk.codec.booleanStrings, expecting LIST, got: '[a,b'").hasCauseInstanceOf(IllegalArgumentException.class);
assertThat(error.getCause()).hasMessageContaining("h");
}
use of com.datastax.oss.dsbulk.runner.cli.CommandLineParser in project dsbulk by datastax.
the class DataStaxBulkLoaderTest method should_process_csv_short_options.
@ParameterizedTest
@MethodSource
void should_process_csv_short_options(String shortOptionName, String shortOptionValue, String setting, Object expected) throws Exception {
Config result = new CommandLineParser("load", 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_process_short_options.
@ParameterizedTest
@MethodSource
void should_process_short_options(String shortOptionName, String shortOptionValue, String setting, Object expected) throws Exception {
Config result = new CommandLineParser("load", 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_process_long_options.
@ParameterizedTest
@MethodSource
void should_process_long_options(String settingName, String settingValue, Object expected) throws Exception {
Config result = new CommandLineParser("load", "--" + settingName, settingValue).parse().getConfig();
assertThat(result.getAnyRef(settingName)).isEqualTo(expected);
}
Aggregations