Source:
<code>public void testDependency001() throws Exception { IncrementalTestHelper iteLib = new IncrementalTestHelper(AbstractTestTools.createTempDir()); iteLib.setIsApiTest(); File f = iteLib.addJavaFile("jack.incremental", "A.java", "package jack.incremental; \n" + "public abstract class A { \n" + "public abstract void m(); }"); iteLib.incrementalBuildFromFolder(); iteLib.snapshotJackFilesModificationDate(); Assert.assertEquals(1, iteLib.getJayceCount()); IncrementalTestHelper iteProg = new IncrementalTestHelper(AbstractTestTools.createTempDir()); iteProg.setIsApiTest(); iteProg.addJavaFile("jack.incremental", "B.java", "package jack.incremental; \n" + "public class B extends A { \n" + " @Override public void m(){} }"); iteProg.incrementalBuildFromFolder(new File[]{iteLib.getCompilerStateFolder()}); iteProg.snapshotJackFilesModificationDate(); Assert.assertEquals(1, iteProg.getJayceCount()); iteLib.deleteJavaFile(f); iteLib.addJavaFile("jack.incremental", "A.java", "package jack.incremental; \n" + "public abstract class A { \n" + "public abstract int m(); }"); iteLib.incrementalBuildFromFolder(); iteLib.snapshotJackFilesModificationDate(); Assert.assertEquals(1, iteLib.getJayceCount()); <START> File testOut <END> = AbstractTestTools.createTempFile("DependenciesTest015-", "-001"); iteProg.setReporterOutputFile(testOut); try { iteProg.incrementalBuildFromFolder(new File[] {iteLib.getCompilerStateFolder()}); Assert.fail(); } catch (FrontendCompilationException e) { Assert.assertTrue( AbstractTestTools.getFileContent(testOut) .contains("The return type is incompatible with A.m()")); } }</code><technical_language>changing a File if load fully anyway</technical_language>

Target:
public void testDependency001() throws Exception { IncrementalTestHelper iteLib = new IncrementalTestHelper(AbstractTestTools.createTempDir()); iteLib.setIsApiTest(); File f = iteLib.addJavaFile("jack.incremental", "A.java", "package jack.incremental; \n" + "public abstract class A { \n" + "public abstract void m(); }"); iteLib.incrementalBuildFromFolder(); iteLib.snapshotJackFilesModificationDate(); Assert.assertEquals(1, iteLib.getJayceCount()); IncrementalTestHelper iteProg = new IncrementalTestHelper(AbstractTestTools.createTempDir()); iteProg.setIsApiTest(); iteProg.addJavaFile("jack.incremental", "B.java", "package jack.incremental; \n" + "public class B extends A { \n" + " @Override public void m(){} }"); iteProg.incrementalBuildFromFolder(new File[]{iteLib.getCompilerStateFolder()}); iteProg.snapshotJackFilesModificationDate(); Assert.assertEquals(1, iteProg.getJayceCount()); iteLib.deleteJavaFile(f); iteLib.addJavaFile("jack.incremental", "A.java", "package jack.incremental; \n" + "public abstract class A { \n" + "public abstract int m(); }"); iteLib.incrementalBuildFromFolder(); iteLib.snapshotJackFilesModificationDate(); Assert.assertEquals(1, iteLib.getJayceCount()); ByteArrayOutputStream errOut = new ByteArrayOutputStream(); iteProg.setReporterOutputStream(errOut); try { iteProg.incrementalBuildFromFolder(new File[] {iteLib.getCompilerStateFolder()}); Assert.fail(); } catch (FrontendCompilationException e) { Assert.assertTrue(errOut.toString().contains("The return type is incompatible with A.m()")); } }