fix test expectations

This commit is contained in:
Eugene Zhuravlev
2012-11-25 19:27:33 +01:00
parent e19ad35e5b
commit 0cf0ad50dc
2 changed files with 8 additions and 9 deletions
@@ -152,10 +152,8 @@ public class BuildOperations {
try {
final Map<T, Set<File>> cleanedSources = new java.util.HashMap<T, Set<File>>();
ProjectBuilderLogger logger = context.getLoggingManager().getProjectBuilderLogger();
final Collection<String> outputsToLog = logger.isEnabled() ? new LinkedList<String>() : null;
final THashSet<File> dirsToDelete = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
final THashSet<String> deletedPaths = new THashSet<String>();
final Collection<String> deletedPaths = new ArrayList<String>();
dirtyFilesHolder.processDirtyFiles(new FileProcessor<R, T>() {
private final Map<T, SourceToOutputMapping> mappingsCache = new java.util.HashMap<T, SourceToOutputMapping>(); // cache the mapping locally
@@ -172,9 +170,6 @@ public class BuildOperations {
if (outputs != null) {
final boolean shouldPruneOutputDirs = target instanceof ModuleBasedTarget;
for (String output : outputs) {
if (outputsToLog != null) {
outputsToLog.add(output);
}
final File outFile = new File(output);
final boolean deleted = outFile.delete();
if (deleted) {
@@ -198,9 +193,13 @@ public class BuildOperations {
}
});
if (outputsToLog != null && context.isMake()) {
logger.logDeletedFiles(outputsToLog);
if (context.isMake()) {
final ProjectBuilderLogger logger = context.getLoggingManager().getProjectBuilderLogger();
if (logger.isEnabled()) {
logger.logDeletedFiles(deletedPaths);
}
}
if (!deletedPaths.isEmpty()) {
context.processMessage(new FileDeletedEvent(deletedPaths));
}
@@ -23,7 +23,7 @@ public class RebuildArtifactOnConfigurationChangeTest extends ArtifactBuilderTes
a.getRootElement().addChild(JpsPackagingElementFactory.getInstance().createDirectoryCopy(dir2));
buildAll();
assertOutput(a, fs().file("a.txt", "a").file("b.txt", "b"));
assertCopied("dir1/a.txt", "dir2/b.txt");
assertDeletedAndCopied("out/artifacts/a/a.txt", "dir1/a.txt", "dir2/b.txt");
buildAllAndAssertUpToDate();
}