@Test public void testDeclareOutputFieldsMultipleStreams() { Fields schema = new Fields("dummy"); OutputFieldsDeclarer declarer = mock(OutputFieldsDeclarer.class); String[] streamIds = new String[] {Utils.DEFAULT_STREAM_ID, "myStreamId"}; ForwardBolt bolt = new ForwardBolt(schema, streamIds); bolt.declareOutputFields(declarer); for(String stream : streamIds) { verify(declarer).declareStream(stream, schema); } verifyNoMoreInteractions(declarer); }
@Override public void declareOutputFields(OutputFieldsDeclarer declarer) { for(String streamId : this.outputStreams) { declarer.declareStream(streamId, this.tupleSchema); } }
ForwardBolt implements IRichBolt { @Override public void declareOutputFields(OutputFieldsDeclarer declarer) { for(String streamId : this.outputStreams) { declarer.declareStream(streamId, this.tupleSchema); } } }
ForwardBolt implements IRichBolt { @Override public void declareOutputFields(OutputFieldsDeclarer declarer) { for(String streamId : this.outputStreams) { declarer.declareStream(streamId, this.tupleSchema); } } ForwardBolt();  ForwardBolt(Fields schema);  ForwardBolt(Fields schema, String[] outputStreamIds); }
ForwardBolt implements IRichBolt { @Override public void declareOutputFields(OutputFieldsDeclarer declarer) { for(String streamId : this.outputStreams) { declarer.declareStream(streamId, this.tupleSchema); } } ForwardBolt();  ForwardBolt(Fields schema);  ForwardBolt(Fields schema, String[] outputStreamIds); @Override void prepare(@SuppressWarnings("rawtypes") Map stormConf, TopologyContext context, OutputCollector collector); @Override void execute(Tuple input); @Override void cleanup(); @Override void declareOutputFields(OutputFieldsDeclarer declarer); @Override Map<String, Object> getComponentConfiguration(); }
ForwardBolt implements IRichBolt { @Override public void declareOutputFields(OutputFieldsDeclarer declarer) { for(String streamId : this.outputStreams) { declarer.declareStream(streamId, this.tupleSchema); } } ForwardBolt();  ForwardBolt(Fields schema);  ForwardBolt(Fields schema, String[] outputStreamIds); @Override void prepare(@SuppressWarnings("rawtypes") Map stormConf, TopologyContext context, OutputCollector collector); @Override void execute(Tuple input); @Override void cleanup(); @Override void declareOutputFields(OutputFieldsDeclarer declarer); @Override Map<String, Object> getComponentConfiguration();  }