@Override
public Class<?> getModelType() {
return Ex1.class;
}
});
JobflowInfo info = tester.compileFlow(new IdentityFlow<Ex1>(in, out));
BulkLoaderScript script = loadScript(info);
assertThat(script.getImportTargetTables().size(), is(1));
assertThat(script.getExportTargetTables().size(), is(1));
ImportTable itable = script.getImportTargetTables().get(0);
ExportTable etable = script.getExportTargetTables().get(0);
assertThat(etable.getSources().size(), is(1));
ModelOutput<Ex1> source = tester.openOutput(Ex1.class, itable.getDestination());
Ex1 ex1 = new Ex1();
ex1.setSid(200);
ex1.setValue(1);
source.write(ex1);
ex1.setSid(300);
ex1.setValue(2);
source.write(ex1);
ex1.setSid(100);
ex1.setValue(3);
source.write(ex1);
source.close();
assertThat(tester.runStages(info), is(true));
Location resultLocation = etable.getSources().get(0);
assertThat(resultLocation.isPrefix(), is(true));
List<Ex1> results = tester.getList(Ex1.class, resultLocation);
assertThat(results.size(), is(3));
assertThat(results.get(0).getValue(), is(3));
assertThat(results.get(1).getValue(), is(1));
assertThat(results.get(2).getValue(), is(2));
List<ExternalIoCommandProvider> commands = info.getCommandProviders();
ExternalIoCommandProvider provider = BulkLoaderIoProcessor.findRelated(commands);
assertThat(provider, not(nullValue()));
CommandContext context = new CommandContext("home", "id", "");
assertThat(provider.getImportCommand(context).size(), is(1));