mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
jasper validation tests: fixes and cleanup
This commit is contained in:
@@ -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<String> ourDeletedPaths;
|
||||
private static List<String> ourRecompiledPaths;
|
||||
private static List<String> ourCompiledPaths;
|
||||
|
||||
public static void testSetup() {
|
||||
ourDeletedPaths = new ArrayList<String>();
|
||||
ourRecompiledPaths = new ArrayList<String>();
|
||||
ourCompiledPaths = new ArrayList<String>();
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -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<String> myRecompiledPaths;
|
||||
private final Set<String> myDeletedPaths;
|
||||
private final Set<String> myGeneratedPaths;
|
||||
private final boolean myExternalBuildUpToDate;
|
||||
private final CompilerMessage[] myErrors;
|
||||
private final CompilerMessage[] myWarnings;
|
||||
|
||||
public CompilationLog(boolean externalBuildUpToDate, String[] recompiledPaths, String[] deletedPaths, List<String> generatedFilePaths,
|
||||
CompilerMessage[] errors, CompilerMessage[] warnings) {
|
||||
public CompilationLog(boolean externalBuildUpToDate, List<String> generatedFilePaths, CompilerMessage[] errors,
|
||||
CompilerMessage[] warnings) {
|
||||
myExternalBuildUpToDate = externalBuildUpToDate;
|
||||
myErrors = errors;
|
||||
myWarnings = warnings;
|
||||
myRecompiledPaths = getRelativePaths(recompiledPaths);
|
||||
myDeletedPaths = getRelativePaths(deletedPaths);
|
||||
myGeneratedPaths = new THashSet<String>(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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
-2
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user