since JetTestCase is no longer a base class for any tests, remove code which is now redundant and rename it to JetTestCaseBuilder

This commit is contained in:
Dmitry Jemerov
2011-10-27 19:27:18 +02:00
parent 0b821ff5bf
commit 0b0aacc9e4
12 changed files with 37 additions and 61 deletions
@@ -5,7 +5,7 @@ import com.intellij.openapi.projectRoots.Sdk;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.JetTestCaseBase;
import org.jetbrains.jet.JetTestCaseBuilder;
import org.jetbrains.jet.plugin.quickfix.PluginTestCaseBase;
import java.io.File;
@@ -55,21 +55,21 @@ public class JetPsiCheckerTest extends LightDaemonAnalyzerTestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(JetTestCaseBase.suiteForDirectory(PluginTestCaseBase.getTestDataPathBase(), "/checker/", false, new JetTestCaseBase.NamedTestFactory() {
suite.addTest(JetTestCaseBuilder.suiteForDirectory(PluginTestCaseBase.getTestDataPathBase(), "/checker/", false, new JetTestCaseBuilder.NamedTestFactory() {
@NotNull
@Override
public Test createTest(@NotNull String dataPath, @NotNull String name) {
return new JetPsiCheckerTest(dataPath, name);
}
}));
suite.addTest(JetTestCaseBase.suiteForDirectory(PluginTestCaseBase.getTestDataPathBase(), "/checker/regression/", false, new JetTestCaseBase.NamedTestFactory() {
suite.addTest(JetTestCaseBuilder.suiteForDirectory(PluginTestCaseBase.getTestDataPathBase(), "/checker/regression/", false, new JetTestCaseBuilder.NamedTestFactory() {
@NotNull
@Override
public Test createTest(@NotNull String dataPath, @NotNull String name) {
return new JetPsiCheckerTest(dataPath, name);
}
}));
suite.addTest(JetTestCaseBase.suiteForDirectory(PluginTestCaseBase.getTestDataPathBase(), "/checker/infos/", false, new JetTestCaseBase.NamedTestFactory() {
suite.addTest(JetTestCaseBuilder.suiteForDirectory(PluginTestCaseBase.getTestDataPathBase(), "/checker/infos/", false, new JetTestCaseBuilder.NamedTestFactory() {
@NotNull
@Override
public Test createTest(@NotNull String dataPath, @NotNull String name) {
@@ -6,7 +6,7 @@ import com.intellij.openapi.projectRoots.Sdk;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.JetTestCaseBase;
import org.jetbrains.jet.JetTestCaseBuilder;
import java.io.File;
import java.io.FilenameFilter;
@@ -49,7 +49,7 @@ public class JetQuickFixTest extends LightQuickFixTestCase {
return false;
}
};
JetTestCaseBase.NamedTestFactory namedTestFactory = new JetTestCaseBase.NamedTestFactory() {
JetTestCaseBuilder.NamedTestFactory namedTestFactory = new JetTestCaseBuilder.NamedTestFactory() {
@NotNull
@Override
public Test createTest(@NotNull String dataPath, @NotNull String name) {
@@ -60,14 +60,14 @@ public class JetQuickFixTest extends LightQuickFixTestCase {
List<String> subDirs = Arrays.asList(quickFixTestsFilter != null ? dir.list(quickFixTestsFilter) : dir.list());
Collections.sort(subDirs);
for (String subDirName : subDirs) {
suite.addTest(JetTestCaseBase.suiteForDirectory(getTestDataPathBase(), subDirName, false, fileNameFilter, namedTestFactory));
suite.addTest(JetTestCaseBuilder.suiteForDirectory(getTestDataPathBase(), subDirName, false, fileNameFilter, namedTestFactory));
}
return suite;
}
public static String getTestDataPathBase() {
return JetTestCaseBase.getHomeDirectory() + "/idea/testData/quickfix/";
return JetTestCaseBuilder.getHomeDirectory() + "/idea/testData/quickfix/";
}
public String getName() {
@@ -2,14 +2,14 @@ package org.jetbrains.jet.plugin.quickfix;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.projectRoots.impl.JavaSdkImpl;
import org.jetbrains.jet.JetTestCaseBase;
import org.jetbrains.jet.JetTestCaseBuilder;
/**
* @author yole
*/
public class PluginTestCaseBase {
public static String getTestDataPathBase() {
return JetTestCaseBase.getHomeDirectory() + "/idea/testData";
return JetTestCaseBuilder.getHomeDirectory() + "/idea/testData";
}
public static Sdk jdkFromIdeaHome() {