StandardTest st = new StandardTest(connection);
test.initSpace(StandardTest.PRIM_AND_SEC_SPACE, 0);
test.initSecondaryKey(StandardTest.PRIM_AND_SEC_SPACE, 1, false, 1, 2);
test.initSpace(StandardTest.COMPOSITE_SPACE, 0, 1);
test.initSpace(StandardTest.CALL_SPACE, 0, 0);
test.initProc("box.delete", new CallStub() {
@Override
public List<Tuple> call(InMemoryTarantoolImpl impl, String procName, int flags, Tuple args) {
Tuple pk = impl.copyExcept(args, 0);
int space = Integer.parseInt(args.getString(0, "UTF-8"));
Tuple deleted = impl.delete(space, pk);
return deleted == null ? new ArrayList<Tuple>() : Arrays.asList(deleted);
}
});
test.initProc("box.insert", new CallStub() {
@Override
public List<Tuple> call(InMemoryTarantoolImpl impl, String procName, int flags, Tuple args) {
Tuple tuple = impl.copyExcept(args, 0);
int space = Integer.parseInt(args.getString(0, "UTF-8"));
Tuple put = impl.put(space, tuple, true, false);
return Arrays.asList(put);
}
});
test.initProc("box.select_range", new CallStub() {
@Override
public List<Tuple> call(InMemoryTarantoolImpl impl, String procName, int flags, Tuple args) {
int spaceNo = Integer.parseInt(args.getString(0, "UTF-8"));
int indexNo = Integer.parseInt(args.getString(1, "UTF-8"));