use of com.alibaba.otter.shared.etl.model.DbBatch in project otter by alibaba.
the class FreedomExtractorTest method test_oracle.
@Test
public void test_oracle() {
final Pipeline pipeline = new Pipeline();
pipeline.setId(100L);
int start = RandomUtils.nextInt();
int count = 10;
List<DataMediaPair> pairs = getDataMediaPairForOracle(start, count);
pipeline.setPairs(pairs);
new NonStrictExpectations() {
{
configClientService.findPipeline(100L);
returns(pipeline);
}
};
// 构造数据
RowBatch rowBatch = new RowBatch();
rowBatch.setIdentity(identity);
for (int tableId = start; tableId < start + count; tableId++) {
for (int i = start; i < start + count; i++) {
EventData eventData = getEventData(tableId, i);
eventData.setSchemaName("retl");
eventData.setTableName("retl_buffer");
rowBatch.merge(eventData);
}
}
DbBatch dbBatch = new DbBatch(rowBatch);
freedomExtractor.extract(dbBatch);
want.collection(dbBatch.getRowBatch().getDatas()).sizeEq(count * count);
}
Aggregations