Base class for tests introduced
This commit is contained in:
@@ -16,49 +16,20 @@
|
||||
|
||||
package org.jetbrains.jet.asJava;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import org.jetbrains.jet.JetLiteFixture;
|
||||
import org.jetbrains.jet.JetTestUtils;
|
||||
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
||||
import org.jetbrains.jet.config.CommonConfigurationKeys;
|
||||
import org.jetbrains.jet.config.CompilerConfiguration;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.LazyResolveTestUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class JavaElementFinderTest extends JetLiteFixture {
|
||||
private JavaElementFinder finder;
|
||||
|
||||
public JavaElementFinderTest() {
|
||||
super("asJava/findClasses");
|
||||
}
|
||||
public class JavaElementFinderTest extends KotlinAsJavaTestBase {
|
||||
|
||||
@Override
|
||||
protected JetCoreEnvironment createEnvironment() {
|
||||
CompilerConfiguration configuration = new CompilerConfiguration();
|
||||
|
||||
configuration.add(CommonConfigurationKeys.SOURCE_ROOTS_KEY, getTestDataPath() + "/asJava/findClasses/" + getTestName(false) + ".kt");
|
||||
|
||||
return new JetCoreEnvironment(getTestRootDisposable(), configuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
// We need to resolve all the files in order too fill in the trace that sits inside LightClassGenerationSupport
|
||||
List<String> paths = getEnvironment().getConfiguration().get(CommonConfigurationKeys.SOURCE_ROOTS_KEY);
|
||||
assert paths != null;
|
||||
List<JetFile> jetFiles = Lists.newArrayList();
|
||||
for (String path : paths) {
|
||||
jetFiles.add(JetTestUtils.loadJetFile(getProject(), new File(path)));
|
||||
}
|
||||
LazyResolveTestUtil.resolveEagerly(jetFiles, getEnvironment());
|
||||
finder = new JavaElementFinder(getProject(), LightClassGenerationSupport.getInstance(getProject()));
|
||||
protected List<File> getKotlinSourceRoots() {
|
||||
return Collections.singletonList(
|
||||
new File("compiler/testData/asJava/findClasses/" + getTestName(false) + ".kt")
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user