@Test public void dataRequestProducesData() throws Exception { assertTrue(moduleManager.getDataFlows(true).isEmpty()); MarketDataRequest request = MarketDataRequestBuilder.newRequest().withSymbols("GOOG").create(); final DataFlowID flowID = moduleManager.createDataFlow( new DataRequest[] {new DataRequest(getInstanceURN(), request)}); // wait until some arbitrary number of ticks have been received AbstractMarketDataFeedTest.wait( new Callable<Boolean>() { @Override public Boolean call() throws Exception { return dataSink.getData(flowID).size() > 20; } }); // cancel the flow moduleManager.cancel(flowID); }
@Test @Ignore public void reconnect() throws Exception { MarketDataRequest request = MarketDataRequestBuilder.newRequest().withSymbols("GOOG").create(); final DataFlowID flowID = moduleManager.createDataFlow( new DataRequest[] {new DataRequest(getInstanceURN(), request)}); // wait until some arbitrary number of ticks have been received AbstractMarketDataFeedTest.wait( new Callable<Boolean>() { @Override public Boolean call() throws Exception { return dataSink.getData(flowID).size() > 20; } }); // reconnect and wait for more data // TODO - need to figure out how to make this magic incantation work ObjectName objectName = getInstanceURN().toObjectName(); MBeanServerConnection mMBeanServer = null; AbstractMarketDataModuleMXBean mMBeanProxy = JMX.newMXBeanProxy(mMBeanServer, objectName, AbstractMarketDataModuleMXBean.class, true); }