Drop lazy tests: test data is used in ResolveTestGenerated.Imports
This commit is contained in:
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.lang.resolve.lazy;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.ConfigurationKind;
|
||||
import org.jetbrains.jet.JetLiteFixture;
|
||||
import org.jetbrains.jet.JetTestUtils;
|
||||
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
||||
import org.jetbrains.jet.lang.descriptors.PackageViewDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.resolve.ExpectedResolveData;
|
||||
import org.jetbrains.jet.resolve.JetExpectedResolveDataUtil;
|
||||
import org.junit.Assert;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class AbstractLazyResolveTest extends JetLiteFixture {
|
||||
@Override
|
||||
protected JetCoreEnvironment createEnvironment() {
|
||||
return createEnvironmentWithMockJdk(ConfigurationKind.JDK_AND_ANNOTATIONS);
|
||||
}
|
||||
|
||||
protected ExpectedResolveData getExpectedResolveData() {
|
||||
Project project = getProject();
|
||||
|
||||
return new ExpectedResolveData(
|
||||
JetExpectedResolveDataUtil.prepareDefaultNameToDescriptors(project),
|
||||
JetExpectedResolveDataUtil.prepareDefaultNameToDeclaration(project)
|
||||
) {
|
||||
@Override
|
||||
protected JetFile createJetFile(String fileName, String text) {
|
||||
return createCheckAndReturnPsiFile(fileName, null, text);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected void doTest(@NonNls String testFile) throws Exception {
|
||||
String text = FileUtil.loadFile(new File(testFile), true);
|
||||
|
||||
final ExpectedResolveData expectedResolveData = getExpectedResolveData();
|
||||
|
||||
List<JetFile> files = JetTestUtils.createTestFiles("file.kt", text, new JetTestUtils.TestFileFactoryNoModules<JetFile>() {
|
||||
@NotNull
|
||||
@Override
|
||||
public JetFile create(@NotNull String fileName, @NotNull String text, @NotNull Map<String, String> directives) {
|
||||
return expectedResolveData.createFileFromMarkedUpText(fileName, text);
|
||||
}
|
||||
});
|
||||
|
||||
KotlinCodeAnalyzer resolveSession = LazyResolveTestUtil.resolveLazilyWithSession(files, getEnvironment(), true);
|
||||
|
||||
PackageViewDescriptor actual = resolveSession.getModuleDescriptor().getPackage(new FqName("test"));
|
||||
Assert.assertNotNull("Package 'test' was not found", actual);
|
||||
|
||||
resolveSession.forceResolveAll();
|
||||
|
||||
expectedResolveData.checkResult(resolveSession.getBindingContext());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.lang.resolve.lazy;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.jet.JUnit3RunnerWithInners;
|
||||
import org.jetbrains.jet.JetTestUtils;
|
||||
import org.jetbrains.jet.test.InnerTestClasses;
|
||||
import org.jetbrains.jet.test.TestMetadata;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("compiler/testData/resolve/imports")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class LazyResolveTestGenerated extends AbstractLazyResolveTest {
|
||||
public void testAllFilesPresentInImports() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/resolve/imports"), Pattern.compile("^(.+)\\.resolve$"), false);
|
||||
}
|
||||
|
||||
@TestMetadata("ImportConflictAllPackage.resolve")
|
||||
public void testImportConflictAllPackage() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/resolve/imports/ImportConflictAllPackage.resolve");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ImportConflictBetweenImportedAndRootPackage.resolve")
|
||||
public void testImportConflictBetweenImportedAndRootPackage() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/resolve/imports/ImportConflictBetweenImportedAndRootPackage.resolve");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ImportConflictBetweenImportedAndSamePackage.resolve")
|
||||
public void testImportConflictBetweenImportedAndSamePackage() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/resolve/imports/ImportConflictBetweenImportedAndSamePackage.resolve");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ImportConflictForFunctions.resolve")
|
||||
public void testImportConflictForFunctions() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/resolve/imports/ImportConflictForFunctions.resolve");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ImportConflictPackageAndClass.resolve")
|
||||
public void testImportConflictPackageAndClass() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/resolve/imports/ImportConflictPackageAndClass.resolve");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ImportConflictSameNameClass.resolve")
|
||||
public void testImportConflictSameNameClass() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/resolve/imports/ImportConflictSameNameClass.resolve");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ImportConflictWithClassObject.resolve")
|
||||
public void testImportConflictWithClassObject() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/resolve/imports/ImportConflictWithClassObject.resolve");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ImportConflictWithInFileClass.resolve")
|
||||
public void testImportConflictWithInFileClass() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/resolve/imports/ImportConflictWithInFileClass.resolve");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ImportConflictWithInnerClass.resolve")
|
||||
public void testImportConflictWithInnerClass() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/resolve/imports/ImportConflictWithInnerClass.resolve");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ImportConflictsWithMappedToJava.resolve")
|
||||
public void testImportConflictsWithMappedToJava() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/resolve/imports/ImportConflictsWithMappedToJava.resolve");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ImportNonBlockingAnalysis.resolve")
|
||||
public void testImportNonBlockingAnalysis() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/resolve/imports/ImportNonBlockingAnalysis.resolve");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ImportResolveOrderStable.resolve")
|
||||
public void testImportResolveOrderStable() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/resolve/imports/ImportResolveOrderStable.resolve");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,6 @@ import org.jetbrains.jet.jvm.compiler.AbstractLoadJavaTest
|
||||
import org.jetbrains.jet.jvm.compiler.AbstractCompileJavaAgainstKotlinTest
|
||||
import org.jetbrains.jet.jvm.compiler.AbstractCompileKotlinAgainstKotlinTest
|
||||
import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveDescriptorRendererTest
|
||||
import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveTest
|
||||
import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveRecursiveComparingTest
|
||||
import org.jetbrains.jet.modules.xml.AbstractModuleXmlParserTest
|
||||
import org.jetbrains.jet.jvm.compiler.AbstractWriteSignatureTest
|
||||
@@ -250,10 +249,6 @@ fun main(args: Array<String>) {
|
||||
model("renderer")
|
||||
}
|
||||
|
||||
testClass(javaClass<AbstractLazyResolveTest>()) {
|
||||
model("resolve/imports", recursive = false, extension = "resolve")
|
||||
}
|
||||
|
||||
testClass(javaClass<AbstractLazyResolveRecursiveComparingTest>()) {
|
||||
model("loadJava/compiledKotlin")
|
||||
model("lazyResolve/recursiveComparator")
|
||||
|
||||
Reference in New Issue
Block a user