*
* @throws IOException
*/
@Test
public void testLogDirsCorrect() throws IOException {
FlumeConfiguration cfg = FlumeConfiguration.createTestableConfiguration();
Clock.resetDefault();
// Set directory of webapps to build-specific dir
cfg.set(FlumeConfiguration.WEBAPPS_PATH, "build/webapps");
// Doesn't matter whether or not we use ZK - use memory for speed
cfg.set(FlumeConfiguration.MASTER_STORE, "memory");
File tmpdir = FileUtil.mktempdir();
cfg.set(FlumeConfiguration.AGENT_LOG_DIR_NEW, tmpdir.getAbsolutePath());
FlumeMaster master = FlumeMaster.getInstance();
FlumeNode node = new FlumeNode(cfg, "foo", new DirectMasterRPC(master),
false, false);
node.getAddDFOManager("foo").open();
node.getAddWALManager("foo").open();
File defaultDir = new File(new File(cfg.getAgentLogsDir()), node
.getPhysicalNodeName());
File walDir = new File(defaultDir, NaiveFileWALManager.WRITINGDIR);
assertTrue(walDir.isDirectory());
File dfoDir = new File(defaultDir, NaiveFileFailoverManager.WRITINGDIR);