use of com.qlangtech.async.message.client.to.impl.DefaultJSONFormatDeserialize in project plugins by qlangtech.
the class TestIncrComponent method testLoad.
public void testLoad() {
// IncrComponent incrComponent = TIS.get().loadIncrComponent(collection);
IPluginStore<MQListenerFactory> pluginStore = TIS.getPluginStore(collection, MQListenerFactory.class);
// assertNotNull(incrComponent);
// incrComponent.getMqListenerFactory();
List<MQListenerFactory> mqListenerFactoryList = pluginStore.getPlugins();
assertEquals(1, mqListenerFactoryList.size());
MQListenerFactory mqListenerFactory = mqListenerFactoryList.stream().findFirst().get();
assertTrue(mqListenerFactory instanceof RocketMQListenerFactory);
RocketMQListenerFactory rmFactory = (RocketMQListenerFactory) mqListenerFactory;
assertEquals("c_otter_binlogorder_solr", rmFactory.getConsumeName());
assertEquals("otter_binlogorder", rmFactory.getMqTopic());
assertEquals("10.1.21.148:9876", rmFactory.getNamesrvAddr());
assertTrue(rmFactory.getDeserialize() instanceof DefaultJSONFormatDeserialize);
// assertEquals(collection, incrComponent.getCollection());
}
use of com.qlangtech.async.message.client.to.impl.DefaultJSONFormatDeserialize 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