Search in sources :

Example 1 with DefaultJSONFormatDeserialize

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());
}
Also used : DefaultJSONFormatDeserialize(com.qlangtech.async.message.client.to.impl.DefaultJSONFormatDeserialize) RocketMQListenerFactory(com.qlangtech.async.message.client.consumer.RocketMQListenerFactory) MQListenerFactory(com.qlangtech.tis.async.message.client.consumer.impl.MQListenerFactory) RocketMQListenerFactory(com.qlangtech.async.message.client.consumer.RocketMQListenerFactory)

Example 2 with DefaultJSONFormatDeserialize

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);
    }
}
Also used : DefaultJSONFormatDeserialize(com.qlangtech.async.message.client.to.impl.DefaultJSONFormatDeserialize) RocketMQListenerFactory(com.qlangtech.async.message.client.consumer.RocketMQListenerFactory) MQListenerFactory(com.qlangtech.tis.async.message.client.consumer.impl.MQListenerFactory) RocketMQListenerFactory(com.qlangtech.async.message.client.consumer.RocketMQListenerFactory)

Aggregations

RocketMQListenerFactory (com.qlangtech.async.message.client.consumer.RocketMQListenerFactory)2 DefaultJSONFormatDeserialize (com.qlangtech.async.message.client.to.impl.DefaultJSONFormatDeserialize)2 MQListenerFactory (com.qlangtech.tis.async.message.client.consumer.impl.MQListenerFactory)2