mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-11-22 08:46:56 -06:00
Revert "Merge pull request #1933 from cognitree/invalid-driver"
This reverts commitd45b5c0ced
, reversing changes made to95a31ce73d
.
This commit is contained in:
parent
d45b5c0ced
commit
73824aa3c6
@ -16,10 +16,8 @@
|
||||
|
||||
package io.nosqlbench.engine.core.lifecycle.session;
|
||||
|
||||
import io.nosqlbench.adapter.diag.DriverAdapterLoader;
|
||||
import io.nosqlbench.engine.cmdstream.Cmd;
|
||||
import io.nosqlbench.engine.cmdstream.CmdArg;
|
||||
import io.nosqlbench.nb.annotations.ServiceSelector;
|
||||
import io.nosqlbench.nb.api.errors.BasicError;
|
||||
|
||||
import java.util.*;
|
||||
@ -77,14 +75,6 @@ public class CmdParser {
|
||||
if (params.containsKey(param.name())) {
|
||||
throw new BasicError("Duplicate occurrence of option: " + param.name());
|
||||
}
|
||||
if (Objects.equals(param.name(), "driver")) {
|
||||
String driverName = param.value();
|
||||
Optional<? extends DriverAdapterLoader> driverAdapter =
|
||||
ServiceSelector.of(driverName, ServiceLoader.load(DriverAdapterLoader.class)).get();
|
||||
if (driverAdapter.isEmpty()) {
|
||||
throw new BasicError("Unable to load default driver adapter '" + driverName + '\'');
|
||||
}
|
||||
}
|
||||
params.put(param.name(),CmdArg.of(cmd.name(),param.name(),param.op(),param.value()));
|
||||
}
|
||||
cmds.add(new Cmd(cmd.name(),params));
|
||||
|
@ -106,11 +106,4 @@ class CmdParserTest {
|
||||
.withMessageContaining("Duplicate occurrence of option: threads");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNonExistentDriverThrowsError() {
|
||||
assertThatExceptionOfType(BasicError.class)
|
||||
.isThrownBy(() -> CmdParser.parseArgvCommands(new LinkedList<>(List.of("run", "driver=nonexistant"))))
|
||||
.withMessageContaining("Unable to load default driver adapter 'nonexistant'");
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user