SetupOutputFieldsDeclarer implements OutputFieldsDeclarer { @Override public void declare(final Fields fields) { this.declareStream(Utils.DEFAULT_STREAM_ID, false, fields); }  @Override void declare(final Fields fields); @Override void declare(final boolean direct, final Fields fields); @Override void declareStream(final String streamId, final Fields fields); @Override void declareStream(final String streamId, final boolean direct, final Fields fields);  }
@Test public void testDeclare() { final SetupOutputFieldsDeclarer declarer = new SetupOutputFieldsDeclarer(); int numberOfAttributes = this.r.nextInt(26); declarer.declare(createSchema(numberOfAttributes)); Assert.assertEquals(1, declarer.outputSchemas.size()); Assert.assertEquals(numberOfAttributes, declarer.outputSchemas.get(Utils.DEFAULT_STREAM_ID) .intValue()); final String sid = "streamId"; numberOfAttributes = this.r.nextInt(26); declarer.declareStream(sid, createSchema(numberOfAttributes)); Assert.assertEquals(2, declarer.outputSchemas.size()); Assert.assertEquals(numberOfAttributes, declarer.outputSchemas.get(sid).intValue()); }
@Test public void testDeclareDirect() { new SetupOutputFieldsDeclarer().declare(false, new Fields()); }
@Test(expected = UnsupportedOperationException.class) public void testDeclareDirectFail() { new SetupOutputFieldsDeclarer().declare(true, new Fields()); }