processor.assertResource("the_resource");
}
// For now we don't support this until we figure the feature fully
public void _testChange() throws Exception {
RAMFileSystem ramFS = new RAMFileSystem();
String[] root = ramFS.getRoot();
String[] foo = ramFS.makePath(root, "foo");
String[] a = ramFS.makePath(foo, "A.java");
ramFS.updateResource(a, new Resource("package foo; public class A {}"));
String[] b = ramFS.makePath(foo, "B.java");
ramFS.updateResource(b, new Resource("package foo; public class B {}"));
//
RAMFileSystem output = new RAMFileSystem();
Compiler compiler = Compiler.builder().sourcePath(ramFS).output(output).build();
compiler.compile();
assertEquals(2, output.size(ReadFileSystem.FILE));
Timestamped<Resource> aClass = output.getResource(new String[]{"foo", "A"});
assertNotNull(aClass);
Timestamped<Resource> bClass = output.getResource(new String[]{"foo", "B"});
assertNotNull(bClass);
//
while (true) {
ramFS.updateResource(b, new Resource("package foo; public class B extends A {}"));
if (bClass.getTime() < ramFS.getLastModified(b)) {
break;
}
else {
Thread.sleep(1);
}
}
//
compiler.compile();
assertEquals(1, output.size(ReadFileSystem.FILE));
bClass = output.getResource(new String[]{"foo", "B"});
assertNotNull(bClass);
}