assertEquals("[TAB_1, TAB_2, TAB_3, TAB_4, TAB_5, TAB_6, TAB_7, TAB_8, TAB_9]", Arrays.toString(tableNames));
}
public void testFullScenario() throws Exception {
final OutputWriterScenarioHelper scenarioHelper = new OutputWriterScenarioHelper();
DatastoreCreationDelegate creationDelegate = new DatastoreCreationDelegate() {
@Override
public void createDatastore(Datastore datastore) {
_datastoreCreated = true;
assertEquals("my datastore", datastore.getName());
DataContextProvider dcp = datastore.getDataContextProvider();
DataContext dc = dcp.getDataContext();
Table table = dc.getDefaultSchema().getTables()[0];
Query q = dc.query().from(table).select(table.getColumns()).toQuery();
DataSet dataSet = dc.executeQuery(q);
scenarioHelper.performAssertions(dataSet, true);
dcp.close();
}
};
OutputWriter writer = DatastoreOutputWriterFactory.getWriter(outputDir, creationDelegate, "my datastore", "dataset",
scenarioHelper.getColumns().toArray(new InputColumn[0]));
scenarioHelper.writeExampleData(writer);
assertTrue(_datastoreCreated);
}