ChukwaConfiguration cc = new ChukwaConfiguration();
cc.setInt("chukwaAgent.fileTailingAdaptor.maxReadSize", 18); // small in order to have hasMoreData=true
// (with 26 letters we should have 2 chunks)
agent = new ChukwaAgent(cc);
ChunkCatcherConnector chunks = new ChunkCatcherConnector();
chunks.start();
File baseDir = new File(System.getProperty("test.build.data", "/tmp"));
testFile = makeTestFile("testDontSleepIfHasMoreData", 1, baseDir); // insert 26 letters on file
long startTime = System.currentTimeMillis();
adaptorId = agent.processAddCommand("add adaptor_test ="
+ "filetailer.FileTailingAdaptor testDontSleepIfHasMoreData "
+ testFile.getCanonicalPath() + " 0");
chunks.waitForAChunk();
chunks.waitForAChunk();
long endTime = System.currentTimeMillis();
assertTrue( endTime - startTime < 300 ); // ensure that everything finishes very fast
// faster than SAMPLE_PERIOD_MS (ie: we don't sleep)
}