public void testIntegrityFileHasNoMemory() throws IOException, MisconfigurationException {
File file = new File(TestDependent.TEST_PYSRC_LOC + "extendable/initially_not_existant.py");
file.createNewFile();
try {
IntegrityInfo info = AdditionalInfoIntegrityChecker.checkIntegrity(nature, monitor, false);
assertFalse(info.allOk);
if (info.modulesNotInMemory.size() != 1) {
StringBuffer notInMemo = new StringBuffer(
"Modules not in memory (expected only: extendable/initially_not_existant.py)\n");
for (ModulesKey key : info.modulesNotInMemory) {
notInMemo.append(key);
notInMemo.append("\n");
}
fail(notInMemo.toString());
}
assertEquals(info.modulesNotInMemory.get(0), new ModulesKey(MOD_NAME, file));
fixAndCheckAllOk(info);
} finally {
file.delete();
}
IntegrityInfo info = AdditionalInfoIntegrityChecker.checkIntegrity(nature, monitor, false);
assertFalse(info.allOk);
assertEquals(1, info.modulesNotInDisk.size());
assertEquals(info.modulesNotInDisk.get(0), new ModulesKey(MOD_NAME, null));
fixAndCheckAllOk(info);