use of com.qlangtech.tis.async.message.client.consumer.impl.MQListenerFactory in project plugins by qlangtech.
the class CUDCDCTestSuit method startTest.
public void startTest(MQListenerFactory cdcFactory, String tabName) throws Exception {
BasicDataXRdbmsReader dataxReader = createDataxReader(dataxName, tabName);
// replay();
List<SelectedTab> selectedTabs = dataxReader.getSelectedTabs();
Optional<SelectedTab> firstSelectedTab = selectedTabs.stream().filter((t) -> tabName.equals(t.name)).findFirst();
Assert.assertTrue("firstSelectedTab:" + tabName + " must be present", firstSelectedTab.isPresent());
ISelectedTab tab = firstSelectedTab.get();
this.cols = Lists.newArrayList();
HdfsColMeta cMeta = null;
for (ISelectedTab.ColMeta c : tab.getCols()) {
cMeta = new HdfsColMeta(c.getName(), c.isNullable(), c.isPk(), c.getType());
cols.add(cMeta);
}
IResultRows consumerHandle = getTestBasicFlinkSourceHandle(tabName);
cdcFactory.setConsumerHandle(consumerHandle.getConsumerHandle());
IMQListener<JobExecutionResult> imqListener = cdcFactory.create();
this.verfiyTableCrudProcess(tabName, dataxReader, tab, consumerHandle, imqListener);
consumerHandle.cancel();
}
use of com.qlangtech.tis.async.message.client.consumer.impl.MQListenerFactory in project plugins by qlangtech.
the class TestPlugin method testSaveAndLoad.
public void testSaveAndLoad() throws IOException {
// FileUtils.forceMkdir(tmpDir);
try {
// IncrComponent incrComponent = createIncrComponent();
// TIS.get().saveComponent(collection, incrComponent);
// incrComponent = TIS.get().loadIncrComponent(collection);
IPluginStore<MQListenerFactory> pluginStore = TIS.getPluginStore(collection, MQListenerFactory.class);
// incrComponent.getMqListenerFactory();
List<MQListenerFactory> mqListenerFactory = pluginStore.getPlugins();
assertEquals(1, mqListenerFactory.size());
RocketMQListenerFactory rocketMQListenerFactory = (RocketMQListenerFactory) mqListenerFactory.get(0);
// assertEquals(collection, incrComponent.getCollection());
assertEquals(consumeId, rocketMQListenerFactory.consumeName);
assertEquals(MQ_TOPIC, rocketMQListenerFactory.getMqTopic());
assertEquals(NamesrvAddr, rocketMQListenerFactory.getNamesrvAddr());
assertNotNull(rocketMQListenerFactory.getDeserialize());
assertTrue(rocketMQListenerFactory.getDeserialize() instanceof DefaultJSONFormatDeserialize);
} finally {
// FileUtils.forceDelete(tmpDir);
}
}
Aggregations