@Test
public void testBuilder() throws IOException, FlumeSpecException {

  File tmpdir = FileUtil.mktempdir();
  String src = "tailDir(\""
      + StringEscapeUtils.escapeJava(tmpdir.getAbsolutePath())
      + "\", \"foo.*\"";
  Context ctx = LogicalNodeContext.testingContext();
  FlumeBuilder.buildSource(ctx, src + ")"); // without startFromEnd param
  FlumeBuilder.buildSource(ctx, src + ", true)"); // with startFromEnd = true
  FlumeBuilder.buildSource(ctx, src + ", false)"); // with startFromEnd =
  // false
  FlumeBuilder.buildSource(ctx, src + ", true,2)"); // recursively w/
  // max-depth 2
  FileUtil.rmr(tmpdir);
}