use of org.apache.storm.sql.runtime.ISqlStreamsDataSource in project storm by apache.
the class TestMongoDataSourcesProvider method testMongoSink.
@SuppressWarnings("unchecked")
@Test
public void testMongoSink() throws Exception {
ISqlStreamsDataSource ds = DataSourcesRegistry.constructStreamsDataSource(URI.create("mongodb://127.0.0.1:27017/test"), null, null, TBL_PROPERTIES, FIELDS);
Assert.assertNotNull(ds);
IRichBolt consumer = ds.getConsumer();
Assert.assertEquals(MongoInsertBolt.class, consumer.getClass());
}
use of org.apache.storm.sql.runtime.ISqlStreamsDataSource in project storm by apache.
the class TestRedisDataSourcesProvider method testRedisSink.
@SuppressWarnings("unchecked")
@Test
public void testRedisSink() throws Exception {
ISqlStreamsDataSource ds = DataSourcesRegistry.constructStreamsDataSource(URI.create("redis://:foobared@localhost:6380/2"), null, null, TBL_PROPERTIES, FIELDS);
Assert.assertNotNull(ds);
IRichBolt consumer = ds.getConsumer();
Assert.assertEquals(RedisStoreBolt.class, consumer.getClass());
}
use of org.apache.storm.sql.runtime.ISqlStreamsDataSource in project storm by apache.
the class TestRedisDataSourcesProvider method testRedisClusterSink.
@SuppressWarnings("unchecked")
@Test
public void testRedisClusterSink() throws Exception {
ISqlStreamsDataSource ds = DataSourcesRegistry.constructStreamsDataSource(URI.create("redis://localhost:6380"), null, null, CLUSTER_TBL_PROPERTIES, FIELDS);
Assert.assertNotNull(ds);
IRichBolt consumer = ds.getConsumer();
Assert.assertEquals(RedisStoreBolt.class, consumer.getClass());
}
Aggregations