DataPipe { public DataConsumer getDataConsumer() { return this.dataConsumer; } DataPipe();  DataPipe(final DataConsumer dataConsumer);  DataPipe(final long maxNumberOfLines, final AtomicBoolean flag); DataConsumer getDataConsumer(); Map<String, String> getDataMap(); String getPipeDelimited(String[] outTemplate); String getDelimited(String[] outTemplate, String separator);  }
@Test public void testDefaultDataConsumerAccess() { DataPipe thePipe = new DataPipe(); DataConsumer dc = thePipe.getDataConsumer(); dc.setExitFlag(new AtomicBoolean(false)); Assert.assertNotNull(dc); Assert.assertNotNull(dc.getExitFlag()); Assert.assertEquals(10000, dc.getMaxNumberOfLines()); }
@Test public void testCustomDataConsumerAccess() { DataConsumer dc = new DataConsumer(); DataPipe thePipe = new DataPipe(dc); dc.setReportingHost("localhost:8080"); dc.setMaxNumberOfLines(100000); Assert.assertEquals("localhost:8080", thePipe.getDataConsumer().getReportingHost()); Assert.assertEquals(100000, thePipe.getDataConsumer().getMaxNumberOfLines()); }