try {
tmpdir = FileUtil.mktempdir();
} catch (Exception e) {
Assert.fail("mk temp dir failed");
}
FlumeConfiguration conf = FlumeConfiguration.get();
conf.set(FlumeConfiguration.AGENT_LOG_DIR_NEW, tmpdir.getAbsolutePath());
mock = new MockMasterRPC();
nodesMan = (nodesMan != null) ? nodesMan : new LogicalNodeManager(NetUtils
.localhost());
walMan = (walMan != null) ? walMan : new NaiveFileWALManager(new File(conf
.getAgentLogsDir()));
dfMan = (dfMan != null) ? dfMan : new NaiveFileFailoverManager(new File(
conf.getAgentLogsDir()));
colAck = (colAck != null) ? colAck : new CollectorAckListener(mock);
liveman = (liveman != null) ? liveman : new LivenessManager(nodesMan, mock,
walMan);
node = new FlumeNode(NetUtils.localhost(), mock, nodesMan, walMan, dfMan,