Search in sources :

Example 1 with DRPCOutputCollector

use of com.yahoo.bullet.storm.drpc.utils.DRPCOutputCollector in project bullet-storm by yahoo.

the class DRPCQuerySubscriberTest method setup.

@BeforeMethod
public void setup() {
    DRPCConfig config = new DRPCConfig("src/test/resources/test_drpc_config.yaml");
    // 1 task for the component named "foo" with task index 0
    CustomTopologyContext context = new CustomTopologyContext(Collections.singletonList(1), "foo", 0);
    config.set(DRPCConfig.STORM_CONTEXT, context);
    Map stormConfig = new Config("src/test/resources/test_storm_config.yaml").getAll(Optional.empty());
    config.set(DRPCConfig.STORM_CONFIG, stormConfig);
    subscriber = new DRPCQuerySubscriber(config, 5);
    DRPCOutputCollector collector = subscriber.getCollector();
    // Override the DRPCSpout with our own that emits using our collector.
    injectedMockSpout = new MockDRPCSpout("foo", collector);
    subscriber.setSpout(injectedMockSpout);
}
Also used : DRPCOutputCollector(com.yahoo.bullet.storm.drpc.utils.DRPCOutputCollector) Config(com.yahoo.bullet.common.Config) CustomTopologyContext(com.yahoo.bullet.storm.testing.CustomTopologyContext) Map(java.util.Map) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

Config (com.yahoo.bullet.common.Config)1 DRPCOutputCollector (com.yahoo.bullet.storm.drpc.utils.DRPCOutputCollector)1 CustomTopologyContext (com.yahoo.bullet.storm.testing.CustomTopologyContext)1 Map (java.util.Map)1 BeforeMethod (org.testng.annotations.BeforeMethod)1