mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
refinements to stmtdef op structure
This commit is contained in:
parent
b950e0f307
commit
843cbcbf44
@ -301,7 +301,7 @@ public class UniformWorkloadSpecificationTest {
|
||||
}.getType();
|
||||
List<Map<String, Object>> expectedList = gson.fromJson(json, type);
|
||||
|
||||
StmtsDocList stmtsDocs = StatementsLoader.loadString(yaml);
|
||||
StmtsDocList stmtsDocs = StatementsLoader.loadString(yaml, Map.of());
|
||||
List<OpTemplate> stmts = stmtsDocs.getStmts();
|
||||
List<Map<String, Object>> stmt_objs = stmts.stream().map(OpTemplate::asData).collect(Collectors.toList());
|
||||
|
||||
@ -340,7 +340,7 @@ public class UniformWorkloadSpecificationTest {
|
||||
|
||||
try {
|
||||
List<Map<String, Object>> docmaps = new RawYamlLoader().loadString(logger, yaml);
|
||||
JsonElement elem = parser.parse(json);
|
||||
JsonElement elem = JsonParser.parseString(json);
|
||||
if (elem.isJsonArray()) {
|
||||
Type type = new TypeToken<List<Map<String, Object>>>() {
|
||||
}.getType();
|
||||
|
@ -7,6 +7,8 @@ import io.nosqlbench.engine.api.activityconfig.yaml.OpTemplate;
|
||||
import io.nosqlbench.engine.api.activityconfig.yaml.StmtsDocList;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class CommandTemplateTest {
|
||||
@ -15,7 +17,8 @@ public class CommandTemplateTest {
|
||||
public void testCommandTemplate() {
|
||||
StmtsDocList stmtsDocs = StatementsLoader.loadString("" +
|
||||
"statements:\n" +
|
||||
" - s1: test1=foo test2=bar");
|
||||
" - s1: test1=foo test2=bar",
|
||||
Map.of());
|
||||
OpTemplate optpl = stmtsDocs.getStmts().get(0);
|
||||
CommandTemplate ct = new CommandTemplate(optpl);
|
||||
assertThat(ct.isStatic()).isTrue();
|
||||
@ -28,7 +31,9 @@ public class CommandTemplateTest {
|
||||
"statements:\n" +
|
||||
" - s1: test1=foo test2={bar}\n" +
|
||||
" bindings:\n" +
|
||||
" bar: NumberNameToString();\n");
|
||||
" bar: NumberNameToString();\n",
|
||||
Map.of()
|
||||
);
|
||||
OpTemplate optpl = stmtsDocs.getStmts().get(0);
|
||||
CommandTemplate ct = new CommandTemplate(optpl);
|
||||
String format = gson.toJson(ct);
|
||||
|
Loading…
Reference in New Issue
Block a user