@Test
public void testBadCompile() throws Exception {

    final File thriftFile = new File(testRootDir, "missing.thrift");
    builder.addThriftPathElement(testRootDir);
    // Hacking around checks in addThrift file.
    assertTrue(thriftFile.createNewFile());
    builder.addThriftFile(thriftFile);
    assertTrue(thriftFile.delete());
    final Thrift thrift = builder.build();
    assertTrue(!thriftFile.exists());
    assertFalse("gen-java directory should not exist", genJavaDir.exists());
    // execute the compile
    final int result = thrift.compile();
    assertEquals(1, result);
}