use of com.qlangtech.tis.plugin.ds.IDataSourceFactoryGetter in project plugins by qlangtech.
the class TestDataXMongodbWriter method testDescriptorsJSONGenerate.
public void testDescriptorsJSONGenerate() {
DataxReader dataxReader = EasyMock.createMock("dataxReader", DataxReader.class);
List<ISelectedTab> selectedTabs = TestSelectedTabs.createSelectedTabs(1).stream().map((t) -> t).collect(Collectors.toList());
for (ISelectedTab tab : selectedTabs) {
for (ISelectedTab.ColMeta cm : tab.getCols()) {
cm.setType(DataXReaderColType.STRING.dataType);
}
}
EasyMock.expect(dataxReader.getSelectedTabs()).andReturn(selectedTabs).times(4);
DataxReader.dataxReaderThreadLocal.set(dataxReader);
EasyMock.replay(dataxReader);
DataXMongodbWriter writer = new DataXMongodbWriter();
assertTrue(writer instanceof IDataSourceFactoryGetter);
DescriptorsJSON descJson = new DescriptorsJSON(writer.getDescriptor());
JsonUtil.assertJSONEqual(DataXMongodbWriter.class, "mongdodb-datax-writer-descriptor.json", descJson.getDescriptorsJSON(), (m, e, a) -> {
assertEquals(m, e, a);
});
JsonUtil.assertJSONEqual(DataXMongodbWriter.class, "mongdodb-datax-writer-descriptor.json", descJson.getDescriptorsJSON(), (m, e, a) -> {
assertEquals(m, e, a);
});
EasyMock.verify(dataxReader);
}
Aggregations