From fbb0f3913970e8c3b82b038fee2e2563fbda7334 Mon Sep 17 00:00:00 2001 From: nik Date: Fri, 30 May 2014 09:15:22 +0400 Subject: [PATCH] jasper validation tests: fixes and cleanup --- .../compiler/CompilerManagerImpl.java | 43 ------------------- .../compiler/BaseCompilerTestCase.java | 31 +------------ .../testFramework/CompilerTester.java | 2 - .../compiler/MavenCompilingTestCase.java | 2 - 4 files changed, 2 insertions(+), 76 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java b/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java index 14158f178d35..5cb7a2477315 100644 --- a/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java +++ b/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java @@ -30,7 +30,6 @@ import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.util.ArrayUtil; import com.intellij.util.messages.MessageBus; import com.intellij.util.messages.MessageBusConnection; import org.jetbrains.annotations.NotNull; @@ -246,48 +245,6 @@ public class CompilerManagerImpl extends CompilerManager { } } - // Compiler tests support - - private static List ourDeletedPaths; - private static List ourRecompiledPaths; - private static List ourCompiledPaths; - - public static void testSetup() { - ourDeletedPaths = new ArrayList(); - ourRecompiledPaths = new ArrayList(); - ourCompiledPaths = new ArrayList(); - } - - public static void addDeletedPath(String path) { - ourDeletedPaths.add(path); - } - - public static void addRecompiledPath(String path) { - ourRecompiledPaths.add(path); - } - - public static void addCompiledPath(String path) { - ourCompiledPaths.add(path); - } - - public static String[] getPathsToDelete() { - return ArrayUtil.toStringArray(ourDeletedPaths); - } - - public static String[] getPathsToRecompile() { - return ArrayUtil.toStringArray(ourRecompiledPaths); - } - - public static String[] getPathsToCompile() { - return ArrayUtil.toStringArray(ourCompiledPaths); - } - - public static void clearPathsToCompile() { - if (ourCompiledPaths != null) { - ourCompiledPaths.clear(); - } - } - public boolean isExcludedFromCompilation(@NotNull VirtualFile file) { return CompilerConfiguration.getInstance(myProject).isExcludedFromCompilation(file); } diff --git a/java/compiler/impl/testSrc/com/intellij/compiler/BaseCompilerTestCase.java b/java/compiler/impl/testSrc/com/intellij/compiler/BaseCompilerTestCase.java index 5822e9433bed..5793832b8cd7 100644 --- a/java/compiler/impl/testSrc/com/intellij/compiler/BaseCompilerTestCase.java +++ b/java/compiler/impl/testSrc/com/intellij/compiler/BaseCompilerTestCase.java @@ -246,7 +246,6 @@ public abstract class BaseCompilerTestCase extends ModuleTestCase { @Override public void run() { - CompilerManagerImpl.testSetup(); final CompileStatusNotification callback = new CompileStatusNotification() { @Override public void finished(boolean aborted, int errors, int warnings, CompileContext compileContext) { @@ -256,7 +255,6 @@ public abstract class BaseCompilerTestCase extends ModuleTestCase { } ExitStatus status = CompileDriver.getExternalBuildExitStatus(compileContext); result.set(new CompilationLog(status == ExitStatus.UP_TO_DATE, - CompilerManagerImpl.getPathsToRecompile(), CompilerManagerImpl.getPathsToDelete(), generatedFilePaths, compileContext.getMessages(CompilerMessageCategory.ERROR), compileContext.getMessages(CompilerMessageCategory.WARNING))); @@ -413,20 +411,16 @@ public abstract class BaseCompilerTestCase extends ModuleTestCase { } protected class CompilationLog { - private final Set myRecompiledPaths; - private final Set myDeletedPaths; private final Set myGeneratedPaths; private final boolean myExternalBuildUpToDate; private final CompilerMessage[] myErrors; private final CompilerMessage[] myWarnings; - public CompilationLog(boolean externalBuildUpToDate, String[] recompiledPaths, String[] deletedPaths, List generatedFilePaths, - CompilerMessage[] errors, CompilerMessage[] warnings) { + public CompilationLog(boolean externalBuildUpToDate, List generatedFilePaths, CompilerMessage[] errors, + CompilerMessage[] warnings) { myExternalBuildUpToDate = externalBuildUpToDate; myErrors = errors; myWarnings = warnings; - myRecompiledPaths = getRelativePaths(recompiledPaths); - myDeletedPaths = getRelativePaths(deletedPaths); myGeneratedPaths = new THashSet(generatedFilePaths, FileUtil.PATH_HASHING_STRATEGY); } @@ -434,31 +428,10 @@ public abstract class BaseCompilerTestCase extends ModuleTestCase { assertTrue(myExternalBuildUpToDate); } - public void assertRecompiled(String... expected) { - checkRecompiled(expected); - checkDeleted(); - } - public void assertGenerated(String... expected) { assertSet("generated", myGeneratedPaths, expected); } - public void assertDeleted(String... expected) { - checkRecompiled(); - checkDeleted(expected); - } - - public void assertRecompiledAndDeleted(String[] recompiled, String... deleted) { - checkRecompiled(recompiled); - checkDeleted(deleted); - } - - private void checkRecompiled(String... expected) { - } - - private void checkDeleted(String... expected) { - } - public CompilerMessage[] getErrors() { return myErrors; } diff --git a/java/testFramework/src/com/intellij/testFramework/CompilerTester.java b/java/testFramework/src/com/intellij/testFramework/CompilerTester.java index c7ecfac84daf..414541fa23bb 100644 --- a/java/testFramework/src/com/intellij/testFramework/CompilerTester.java +++ b/java/testFramework/src/com/intellij/testFramework/CompilerTester.java @@ -15,7 +15,6 @@ */ package com.intellij.testFramework; -import com.intellij.compiler.CompilerManagerImpl; import com.intellij.compiler.CompilerTestUtil; import com.intellij.openapi.application.AccessToken; import com.intellij.openapi.application.Result; @@ -62,7 +61,6 @@ public class CompilerTester { myMainOutput = new TempDirTestFixtureImpl(); myMainOutput.setUp(); - CompilerManagerImpl.testSetup(); new WriteCommandAction(getProject()) { @Override protected void run(Result result) throws Throwable { diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/compiler/MavenCompilingTestCase.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/compiler/MavenCompilingTestCase.java index f947f00f1d0c..2ca35d40fca5 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/compiler/MavenCompilingTestCase.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/compiler/MavenCompilingTestCase.java @@ -15,7 +15,6 @@ */ package org.jetbrains.idea.maven.compiler; -import com.intellij.compiler.CompilerManagerImpl; import com.intellij.compiler.CompilerTestUtil; import com.intellij.compiler.CompilerWorkspaceConfiguration; import com.intellij.compiler.artifacts.ArtifactsTestUtil; @@ -76,7 +75,6 @@ public abstract class MavenCompilingTestCase extends MavenImportingTestCase { }); CompilerWorkspaceConfiguration.getInstance(myProject).CLEAR_OUTPUT_DIRECTORY = true; - CompilerManagerImpl.testSetup(); final Semaphore semaphore = new Semaphore(); semaphore.down();